The Strategy: Fighting Slop with Slop

Vaibhav Gupta argues that modern engineering teams are losing the war against "slop"—code that no one reads, which accumulates as AI agents generate more output. His counter-intuitive solution is to embrace "slop" by building automated, agentic tools that monitor, validate, and test the codebase constantly. Instead of relying on manual code reviews, which do not scale, teams should build systems that treat AI-generated code as a raw material to be refined by automated pipelines.

Building Invariants and Automated Governance

To maintain stability without manual oversight, teams must implement hard invariants that agents cannot breach:

  • Architecture as Code: Use simple, version-controlled markdown files and CLI scripts to define architectural boundaries. These files act as the "source of truth" that agents must consult.
  • Design Doc Automation: Treat design documentation as a first-class citizen. By integrating design docs with Slack notifications and CLI checks, teams ensure that documentation is actually read and updated, preventing the "psychosis" of shipping unreviewed design changes.
  • Agentic Auditing: Build agents that constantly monitor the transcripts of other agents. These meta-agents flag hallucinations, identify inefficient tool calls, and perform A/B testing on different code approaches to determine which produces the fewest errors.

Attacking the Foundational Layer

The ultimate defense against slop is to make entire classes of errors impossible through language design. Gupta advocates for moving away from languages like JavaScript/TypeScript, which bake in "slop" (like unpredictable sorting or weak error handling), toward systems that prioritize first-principles correctness:

  • Inferred Error Handling: Use type systems that force exhaustive error handling. If a function can throw an error, the compiler should prove it is handled, or the code should fail to build.
  • Agent-First Tooling: Build tools that provide execution traces and semantic navigation. Instead of searching code with grep, agents should be able to query the codebase for function descriptions, usage patterns, and documentation directly.
  • BAML (Boundary AI Markup Language): Gupta’s project, BAML, allows developers to define type-safe boundaries across languages (Python, TypeScript, Rust). It enables agents to move fast within strict, type-safe walls, ensuring that even if the agent is "sloppy," the system remains deterministic and type-safe.

The Future of Engineering

Engineering processes must evolve to match the speed of AI. By building tools that provide deep visibility into execution traces and enforcing strict type boundaries, teams can move from "reading every line of code" to "understanding the system's behavior." The goal is to build a new generation of foundational tools—compilers, databases, and languages—that are designed for an era where AI agents, not just humans, are the primary authors of software.