Lauren Tan is challenging the current meta of AI-assisted development by arguing that we are wasting time writing documentation for agents that don't read it. In a recent talk, she outlined a strategy for managing "slop"βthe low-quality, hallucinated code generated by AI agentsβthat prioritizes structural enforcement over textual instruction. Her core thesis is simple: if you want to stop AI from making mistakes, you must remove the ability to make them entirely through codebase design, not by adding more lines to your AGENTS.md file.
The Trust Pyramid: Code Over Prose
Tan proposes a hierarchy of trust that inverts how most teams currently approach AI integration. She places written rules and documentation, such as AGENTS.md, at the top as the weakest form of constraint because agents frequently ignore or misinterpret natural language. The middle layer consists of verification tools like tests and runtime checks that provide evidence of behavior. The base layer, which she considers the strongest, involves codebase design, static analysis, strict types, and lint rules. These technical constraints physically prevent an agent from generating invalid code, making prose instructions largely unnecessary for mechanical tasks.
Designing Out Errors via Restrictive APIs
The most practical application of this philosophy is what Tan calls "eliminating mistakes via architecture." Using her team's Dune framework as an example, she noted that instead of instructing agents to use React's useEffect hook correctly, they restricted its usage entirely to framework internals. This forced agents to use safer, supported paths for side effects. Similarly, by using directory structures like electron-main versus electron-renderer combined with dependency analysis, the team mechanically rejects imports that cross architectural boundaries. This approach removes entire classes of structural errors from the human review queue, allowing engineers to focus on logic rather than style violations.
Comments as Permission Slips
A counter-intuitive but critical part of Tan's strategy is the restriction of explanatory comments. She identifies a specific failure mode where agents write workarounds for bad patterns and add comments explaining why the hack was necessary. To the next AI agent, these comments look like intentional, approved patterns, causing the slop to spread through the codebase. Tan advocates for a restrictive policy toward comments that document known-bad patterns. If a workaround is required, it should be fixed via a better API or a helpful lint error that points to the real fix, rather than being documented as a permanent exception that future agents will mimic.
Scaling Verification for 11,000 PRs
Tanβs team ships approximately 11,000 pull requests per month, a volume that makes traditional code review impossible. To handle this, she moves verification beyond reading text diffs. Agents are required to run the application and use debugging tools to provide runtime evidence. Reviewers examine artifacts like videos, screenshots, and statecharts rather than just code. She also emphasizes naming features from the user's perspective to prevent agents from guessing which UI element is being discussed. For deeper checks, her team is experimenting with model checking and property-based testing to catch issues that a single successful screenshot might miss.
The Bottom Line
You cannot fix AI slop by adding more warnings; you fix it by making the "wrong" choice impossible to make through API design, linting, and architecture. Stop treating AI agents like junior devs who need guidance, and start treating them like unsafe inputs that need strict schema validation.
Key Takeaways
- Move constraints from prose (AGENTS.md) to code (linters, types, restrictive APIs).
- Restrict
useEffectand similar powerful hooks to framework internals to prevent agent misuse. - Treat explanatory comments for workarounds as "permission slips" that spread bad patterns.
- Verify behavior through runtime artifacts (videos, screenshots) rather than just text diffs.
- Only automate the outer loop (auto-merge) after fixing the inner loop (codebase quality).