> ## Content Index
> Fetch the complete content index at: https://exindel.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Turning Agent-Generated Code Into Trusted Code at Scale
- URL: https://exindel.com/turning-agent-generated-code-into-trusted-code-at-scale/
- Published: 2026-11-16T05:03:48.000Z
- Updated: 2026-11-16T05:03:48.000Z
- Author: Exindel
- Tags: #daily-brief, #pick, AI Agents

Lauren Tan, who works on Grokbot at SpaceX, argues that the job of a software engineer now is to maintain or improve code quality while massively increasing output. She reports shipping 3,000 pull requests to production in a month. The talk comes down to trust: not blind trust in agents, but investing in the agent's environment so you can trust that agents do the right thing. It took her six months to reach the point of shipping thousands of pull requests, many of them in her sleep, and she says it will take a listener less time.

## Where to spend effort: the inverse pyramid

Tan describes an inverse pyramid of where to invest in an agent's environment. The first two layers are deterministic and live in the code itself: good API design, architecture, refactoring, lint rules, type systems, compilers, and various kinds of testing. Used together, these constrain what agents can do and force them to do the right thing by default. Layered on top is verification, both runtime and formal, which finds bugs, checks properties and invariants, and shows whether the agent understood the goal and intent. The final, smallest layer is prose: rules, skills, agents.md, and other things that require judgment.

## The codebase is the biggest input

Agents generate output from their inputs, and the codebase is one of the largest inputs, so its quality matters a lot. Tan's advice: when correcting an agent, turn the correction into a deterministic check rather than adding another line to rules or agents.md, since code is far more reproducible and therefore more trustworthy.

She uses a garden analogy. Code used to arrive a few pull requests at a time; she recalls reviewing the three pull requests her colleagues wrote in 2024, and says the number today is closer to 300\. Every engineer is now a team of hundreds or thousands of agents, and code arrives as an almost continuous stream, almost like a living thing. In this picture, the constraints and guardrails you impose are the concrete foundations that new agent-written code grows around. The job becomes something like gardening: because code is the biggest input, any workaround, anti-pattern, deprecated code, or tech debt is likely to be copied by the next agent because it looks like the established pattern, the way weeds or pests spread through a garden. The codebase should be as pristine as possible so agents copy the good stuff.

## Dune and the lessons encoded as lint rules

Dune is a client framework the team built for Grokbot to implement what Tan calls organic architecture. She says it is not technically interesting, roughly Next.js for Electron apps; the interesting part is the constraints and lint rules encoding lessons from building desktop applications. Her stated principle: anything that requires nuance to use well often leads to slop.

- **Banning useEffect.** React's useEffect has valid uses but is often misused; Tan notes the joke that you need a PhD to use it well. Agents are not good at it, so it is banned in product code and allowed only in some places inside Dune's APIs. The problem is categorically eliminated and never needs catching in review again.
- **Context through directory structure.** In Cursor, an Electron app, agents often imported main-thread code into the renderer thread, causing long tasks and jank. In Grokbot and Dune apps, two top-level directories are literally named Electron renderer and Electron main, and imports between them are banned by a dependency graph analyzer and lint rules. The rules are simple to set up and remove one more thing to think about in review.
- **Markdown as an escape hatch.** Tan has seen agents use documentation, code comments, rules, and skills to write down justifications for not doing the right thing, or to over-rotate on a small correction and treat it as a hard rule that can never be broken again.
- **Imperative timers in Cursor.** Agents loved setTimeout, requestAnimationFrame, and requestIdleCallback as quick fixes patching over an architecture clash between VS Code's imperative style and React's declarative style. Tan says the architecture choice made both client and agent performance worse; rapidly created and destroyed timers cause major garbage collection, lag, and jank. Worse, agents wrote many comments explaining why the quick fix was justified, and timers spread everywhere.
- **Banning 99% of comments in Grokbot.** Comments go stale, humans don't bother reading them, and they give agents an escape hatch to justify not doing the right thing. Above all they are not enforceable: a note telling the next agent not to do something is not something you can trust.

Grokbot and Dune now have lint rules that emit helpful error messages telling the agent to fix the root cause rather than patch around it. The general principle: every correction becomes a deterministic check, or a redesign of API or architecture that categorically eliminates the problem. Do this enough and there is less to watch for in review, until eventually there is nothing left to review and agents can merge most of their own pull requests.

## Verification as the new code review

Verification is a major part of making agents more autonomous and increasing confidence in their work. Code review has shrunk into reviewing verification artifacts: videos, screenshots, diagrams, formal verification.

- **Runtime verification** means giving the agent a way to run the code itself and use the debugging tools human developers use, such as the Chrome DevTools protocol.
- **Feature map.** Inside the runtime verification skills is a map of all features available in the application from the user's point of view, a kind of site map. It gives agents and humans shared vocabulary so agents don't have to guess what "the thingy in the left sidebar" means.
- **Custom CLIs** inside the skills let agents reuse the same CLI and driver each time, cutting token usage and making the process testable.
- **Formal verification.** The team uses TLA+ to model-check major user flows such as notifications across multiple devices and platforms, and Lean to prove properties of certain algorithms, for example their custom virtualization library, checking for flickering or jittering. Tan says this is still experimental, has already found quite a few bugs, and is promising but not a silver bullet, just another layer.
- **Property-based testing for UIs** with a library called Bombadil, which has also caught a few UI bugs.

Tan cites a tweet from Cindy six months earlier about not being able to trust agents because subtle bugs were being merged, with verification the missing piece; Cindy now says 70% of her daily tokens go into verification, which Tan says matches her own experience. Tan argues none of these techniques are new, just good software engineering tools that were previously prohibitively expensive to understand, write, or maintain, and that agents drastically cut that cost. In her view this is a golden age of software testing and verification, and formal verification also helps reason about how the product should work and whether agents understand intent. She also built a skill called state chart in her plugin, "potato stack," which visualizes state machines from the user's point of view and is easier to review alongside videos and screenshots.

## What the investment returns

On the Grokbot team, velocity is accelerating: 11,000 pull requests shipped to production last month, a new stable client release about once a day, more shipping from the core team, and many casual or drive-by contributors without much context, with about 227 people contributing at least one pull request in October. Tan addresses the worry about chaos: the share of pull requests that get reverted has gone down on a relative basis and holds steady at about half a percent. Performance has stayed stable and improved on multiple dimensions since launch, including startup, typing, opening new chats, and switching chats. She notes Grokbot is still an Electron app, so there is a ceiling, but calls it already faster than many other agent UIs.

## Advice before building a factory

Tan's closing guidance: before automating everything, correct agents by improving the codebase first, starting with a lint rule that prevents new occurrences of an anti-pattern and then cleaning up the old ones. Make the verification story strong, because much of this work is a prerequisite to automation: if the inner coding loop produces slop, automating it produces more slop and requires throwing more and more tokens at the problem, which is expensive. Once the foundations of code, static analysis, runtime and formal verification are in place, building a factory on top becomes easy. She promotes Grokbot as a way to build that outer loop, with connectors, routines that kick off Cursor cloud agents, and projects that orchestrate hundreds or thousands of agents. As an example, on each new release Grokbot spins up a Cursor project that fuzzes the entire application and build, finds bugs by using the app like a real user, opens a fix pull request for each bug, and auto-merges it, because the codebase is good enough that pull requests tend to be good by default and most product code no longer needs deep human review.

[Source: AI Engineer on YouTube](https://www.youtube.com/watch?v=O%5Fzcc6Xl12g&ref=exindel.com)