Dev.to AI 🤖 Ai 👁 0 📖 2 min read

How Lauren Tan says to manage slop

Based on the text provided, Lauren Tan’s approach to managing AI-generated code (referred to as "slop") focuses on structural enforcement over textual instruction. Instead of trying to guide AI agents with more written r

Based on the text provided, Lauren Tan’s approach to managing AI-generated code (referred to as "slop") focuses on structural enforcement over textual instruction. Instead of trying to guide AI agents with more written rules in files like AGENTS.md, she advocates for embedding constraints directly into the codebase and tooling.

Here is a summary of her core strategies:

1. The "Trust Pyramid": Code Over Prose

Tan argues that prose instructions are weak because they are easy for agents to ignore or misinterpret. She proposes a hierarchy of trust where the strongest constraints live at the bottom:

  • Top Layer (Weakest): Written rules and documentation (e.g., AGENTS.md). These should only be used for judgment calls that cannot be encoded technically.
  • Middle Layer: Verification tools (tests, runtime checks) that provide evidence of behavior.
  • Base Layer (Strongest): Codebase design, static analysis, types, lint rules, and good APIs. These physically prevent an agent from generating invalid code.

2. Eliminate Mistakes via Architecture & Linting

Rather than reviewing bad patterns repeatedly, Tan suggests designing them out of existence so agents cannot produce them:

  • Restrictive APIs: In her Dune framework example, instead of asking agents to use React's useEffect perfectly, her team restricted its usage entirely to framework internals, forcing agents to use safer, supported paths.
  • Enforced Boundaries: Using directory structures (e.g., electron-main vs. electron-renderer) combined with dependency analysis and lint rules to mechanically reject imports that cross architectural boundaries.
  • Result: This removes entire classes of errors from human review queues, allowing reviewers to focus on logic rather than style or structural violations.

3. Treat Comments as Potential "Permission Slips"

A counter-intuitive part of her approach is restricting comments:

  • The Problem: When agents write workarounds, they often add comments explaining why the hack was necessary. To the next AI agent, this looks like an intentional, approved pattern, causing the "slop" to spread.
  • The Solution: A restrictive policy toward explanatory comments for known-bad patterns. If a workaround is needed, it should be fixed via a better API or a helpful lint error pointing to the real fix, not documented as a permanent exception.

4. Verify Behavior, Not Just Diffs

To handle the volume of changes (her team shipped ~11,000 PRs/month), she moves verification beyond reading code:

  • Runtime Evidence: Agents must run the application and use debugging tools.
  • Artifacts: Reviewing videos, screenshots, and statecharts rather than just text diffs.
  • Feature Maps: Naming features from the user's perspective so agents don't guess which UI element is being discussed.
  • Deeper Checks: Experimenting with model checking and property-based testing to catch issues that a single successful screenshot might miss.

5. Automate the Outer Loop Only After Fixing the Inner One

Tan emphasizes a strict order of operations for scaling AI development:

  1. Improve the inputs: Clean up the codebase so agents learn from good examples, not legacy workarounds.
  2. Make constraints executable: Move warnings from text to linters/types.
  3. Strengthen verification: Give agents robust ways to test their own work.
  4. Automate: Only then introduce outer loops (like auto-fuzzing and auto-merging).

Key Takeaway: 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, thereby reducing the need for human intervention.

Source: ai.engineer/code/2026/talks/lauren-tan

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.