Lauren Tan: Make AI-generated code trustworthy with enforceable checks

The Grok Bot engineer describes the architecture, verification and review changes behind her team’s high-volume agent workflow.

LTLauren TanSpeaker · Engineer
Channel
AI Engineer
Published
Nov 14, 2026
Video
17:31
Read
5 min
Slides
6
Original
English
Open on YouTube
Scroll to read and the video shrinks to the bottom-right corner. Captions follow your reading language.
Reading languageAvailable in 2 languages
You're reading the original English.
SUMMARY

In 30 seconds

Lauren Tan says the way to scale coding agents is to invest in a codebase that makes the right change easier and catches bad ones automatically. Her team encodes boundaries in lint rules, gives agents tools to run the product, and experiments with formal verification. She reports about 11,000 pull requests in one month with a roughly 0.5% revert rate, while emphasizing that these results followed months of work on the foundations.

  1. 1Agent trust comes from investment in the environmentTan says it took six months of work before she could ship thousands of pull requests, including changes made while she slept.
  2. 2An automatic check survives a correction better than another instructionBecause the codebase is a major input for agents, Tan recommends turning repeated corrections into reproducible checks and removing patterns that agents might copy.
  3. 3Dune bans error-prone patterns and enforces process boundariesHer team disallows React useEffect in product code and blocks imports between Electron’s main and renderer directories using dependency analysis and linting.
  4. 4Review increasingly centers on evidence that the software worksAgents run the application with debugging tools and produce screenshots, videos and diagrams. The team is also experimenting with formal methods and property-based tests.
  5. 5Tan reports 11,000 pull requests with a roughly 0.5% revert rateShe says the team’s client releases roughly daily, and startup, typing and chat navigation have improved despite the increase in changes.
  6. 6Automate the outer loop only after improving the inner loopTan recommends adding lint rules, cleaning up existing anti-patterns and strengthening verification before scaling a software factory.

Takeaways

  1. Turn recurring agent corrections into enforceable checks or better APIs instead of adding prose instructions.
  2. Clean up old anti-patterns as well as preventing new ones: agents copy existing code.
  3. Let agents run and inspect the application, then review evidence such as videos and screenshots.
  4. Tan’s team also experiments with TLA+, Lean and property-based UI testing; she treats formal verification as another layer, not a cure-all.
  5. Tan reports roughly 11,000 team pull requests in October and a revert rate near 0.5%.
FULL TEXT

Read the edited text by chapter

Transcript only
01

Trust is built into the agent environment

Tan argues that engineers must improve code quality as they increase agent-driven throughput. Her trust pyramid starts with architecture and deterministic checks.

I shipped 3,000 pull requests to production last month, Lauren Tan says. Agents can make many more engineers highly productive; the challenge is maintaining or improving code quality as output increases. She calls the foundation for that trust in the agent environment, not blind trust in the agent.

Tan says it took her six months of investment to reach a point where she could ship thousands of changes, including while she slept. Her trust pyramid starts with code and architecture, then static analysis and tests, followed by runtime or formal verification. Rules, skills and AGENTS.md provide a smaller layer for work that needs judgment.

A pyramid for trusting agents
SLIDE 1 / 6A pyramid for trusting agentsTan puts architecture and static analysis beneath verification, prose and human review.

The codebase is one of an agent’s largest inputs. When correcting an agent, Tan recommends asking whether the correction can become an automatic check rather than another line of instructions: an executable rule is more reproducible and can support greater trust.

She compares the repository to a garden. When a few pull requests become hundreds, code arrives like a stream; architecture and guardrails are the fixed structures around which it grows. Workarounds, deprecated code and other bad examples can spread because agents copy what appears to be the established pattern.

02

Make the codebase hard to misuse

Dune encodes conventions in APIs, directory structure and lint rules. Tan explains why her team restricts useEffect and most comments.

Dune encodes conventions for agent-written code
SLIDE 2 / 6Dune encodes conventions for agent-written codeThe framework combines per-feature organization, import restrictions and limits on comments.

Her team built Dune, a client framework for Grok Bot that she compares to Next.js for Electron applications. Its important feature, she says, is a collection of constraints and lint rules that encode lessons learned from building desktop apps.

One example is React’s useEffect: Tan says it has legitimate uses, but using it well requires nuance that agents often lack. The team bans it in product code and permits it in certain Dune APIs. That removes a recurring issue from code review rather than relying on reviewers to catch each instance.

Directory structure expresses process boundaries
SLIDE 3 / 6Directory structure expresses process boundariesSeparate Electron renderer and main directories make forbidden dependencies visible and enforceable.

Directory structure supplies another form of context. At Cursor, Tan saw agents import Electron main-thread code into the renderer, causing long tasks and jank. In Grok Bot and Dune applications, separate electron-main and electron-renderer directories make the boundary explicit; dependency analysis and lint rules forbid imports across it.

Tan has also seen agents use documentation and comments to justify shortcuts, or turn a minor correction into an inflexible rule. She describes imperative timers used as quick fixes for a mismatch between VS Code’s imperative architecture and React’s declarative style. Repeated timer creation and cleanup hurt performance, while comments explained why the workarounds seemed acceptable.

In Grok Bot, the team chose to ban about 99% of comments: Tan says comments become stale and cannot enforce their own instructions. Instead, lint errors should guide the agent toward fixing the underlying problem. Her general practice is to turn corrections into checks or eliminate the failure mode through API and architecture changes.

As those checks accumulate, Tan says there is less for a person to inspect in each review, and agents can merge many of their own changes. Her team increasingly reviews verification artifacts such as videos, screenshots, diagrams and formal checks.

03

Verify behavior rather than reading every line

Agents run applications and produce artifacts for review. The team is experimenting with model checking, proofs and property-based testing.

Runtime verification gives an agent a way to run the software and use debugging tools such as the Chrome DevTools Protocol. A feature map describes the application from a user’s perspective, giving people and agents a shared vocabulary for features. Reusable command-line tools and drivers make the skills testable and reduce repeated token use.

Two approaches to formal verification
SLIDE 4 / 6Two approaches to formal verificationThe slide contrasts modeling state machines in TLA+ with proving code properties in Lean.

The team has begun experimenting with formal verification. It uses TLA+ to model flows such as notifications across devices and Lean to check algorithms, including a custom virtualization library. Tan says these methods have already found bugs, but calls them an additional layer rather than a silver bullet.

The team is also trying property-based UI testing with Bombadil and has found UI bugs. Tan cites another engineer’s observation that 70% of daily tokens go to verification; she says most of her own token use also goes there. Agents can reduce the cost of writing and maintaining established testing techniques, she argues.

Formal models can also clarify intended behavior and whether agents understand it. Tan’s pstack plugin includes a statechart skill that visualizes state machines from the user’s perspective; she finds the result easier to review alongside screenshots and videos.

04

The output and the foundations behind it

Tan reports rapid growth in pull requests alongside a low revert rate and improved client performance. She recommends strengthening the codebase before automating the outer loop.

Reported monthly pull request growth
SLIDE 5 / 6Reported monthly pull request growthTan’s slide shows the team’s monthly merged pull request counts through October.

Tan reports that the Grok Bot team shipped about 11,000 pull requests to production in October and cuts a stable client release roughly daily. She says 227 people contributed at least one pull request that month, including occasional contributors with less context.

Reported change revert rate
SLIDE 6 / 6Reported change revert rateThe slide shows the share of commits reverted falling from 0.98% in June to 0.47% in October.

Despite the increased volume, Tan says the relative revert rate remained around 0.5%. She reports improvements in startup, typing, opening chats and switching between them since launch, while acknowledging that the Electron client has performance limits.

Before building a software factory, Tan recommends making the codebase better: add a lint rule against a repeated anti-pattern, clean up its existing occurrences and strengthen verification. If the inner coding loop produces poor work, automating it produces more of the same and consumes more tokens.

Once those foundations are in place, Tan says Grok Bot can orchestrate the outer loop through connectors, routines and projects. After a release, her team automatically launches a Cursor project to exercise the build, find bugs and open fixes; she says those fixes can then merge automatically because of the surrounding checks.

More from this channel

2 slides17:31EN
AI Engineer· Nov 12, 2026Claude Code needs less steering, but unattended work needs stronger checksLydia Hallie · AnthropicLydia Hallie describes how permissions, isolated environments and verification can take over tasks people once handled during every session.Coding agentsDeveloper workflows & testingAgent orchestration+1
3 slides14:00EN
AI Engineer· Nov 11, 2026Test what a skill teaches before cutting its instructionsNikolay Petrov · IntelNikolay Petrov compares model answers with and without a skill to find known, useful and harmful instructions—then checks changes on real tasks.Agent skillsEvalsContext engineering
4 slides18:03EN
AI Engineer· Nov 11, 2026Dmitry Buykin: How to Maintain Code When Agents Outrun ReviewDmitry Buykin · MaerskAt Maersk, weekly pruning, real-task replays and expert feedback help keep an agent-built system understandable.Coding agentsSoftware engineeringAI agents
4 slides26:49EN
AI Engineer· Nov 11, 2026Ara Khan: Choose work that improves with AI without being replaced by itAra Khan · ClineCline’s Ara Khan explains an automated evaluation loop and urges engineers to pick problems that benefit from model progress.Coding agentsEvals & observabilityCareers
3 slides12:38EN
AI Engineer· Nov 11, 2026How Duolingo uses agents to add tests without skipping human reviewKush Agrawal · DuolingoA scheduled pipeline raised iOS coverage by generating tests, repairing CI and routing pull requests to engineers for approval.Coding agentsDeveloper workflows & testingSoftware engineering
4 slides38:50EN
AI Engineer· Nov 10, 2026LinkedIn’s self-improving agent first had to fix its judgesZiwei Guo, Saloni Gandhi · LinkedInA prompt-optimization loop improved a career agent, but unreliable evaluators required human calibration first.Agent engineeringEvals & observabilityAgent orchestration+1