Friction Forces Judgment in AI Agent Coding
AI coding agents create addictive speed but produce slop code and debt; reintroduce friction via agent-legible codebases and human gates on high-stakes changes to steer quality.
AI's Psychological Trap Amplifies Code Production Over Review
AI agents hook engineers with effortless output, tricking them into feeling more efficient despite skipping design and reviews. This addiction stems from the thrill of the 'next prompt' potentially solving issues, but it floods teams with PRs—often 5,000-line monsters—that overwhelm reviewers. Production outpaces review capacity, leading teams to rubber-stamp changes or expand to non-engineers (e.g., marketers, ex-CEOs) shipping code without full responsibility. Result: larger PRs optimized for 'runs now' via reinforcement learning, creating brittle systems with hidden failure modes like default configs overwriting data or services hobbling on local recoveries. Humans intuitively avoid such 'slop' due to emotional discomfort; agents don't, rapidly building entropy where they can't even parse their own messes.
Agents excel in libraries with tight APIs but falter in products tangled with UI, permissions, billing, and flags—too much for context windows, yielding locally sane but globally demented code.
Design Agent-Legible Codebases as Infrastructure
Treat codebases like infrastructure: modularize components and flows (e.g., user message → agent loop → output handling) to confine agent 'fuzz' like unwanted state or type parsing. Follow RL-trained patterns, push complexity to abstraction layers, and eliminate hidden magic via linting:
- No bare catch-alls (agents exploit them).
- Single SQL query interface (prevents missed spots).
- One primitives UI library (no raw inputs).
- No dynamic imports.
- Unique function names (boosts token efficiency for agent grips).
- Erasable syntax-only TypeScript (JS + annotations, no transpiling confusion).
These enforce legibility, making agents produce better code while surfacing pain points for humans.
Reinsert Friction for Human Steering
Speed is devious in architecture and reliability; agents generate weeks of debt in days, eroding codebase understanding. Use tools like a custom PI extension to split reviews: auto-fix mechanical bugs (lint violations), but flag human-judgment zones like database migrations (consider locks/data size), permission changes (underdocumented risks), or dependency adds (vet maintainers). Commit to slowing on system design—e.g., reproduce bugs or explore directions with agent code, but architect manually.
Friction isn't waste; like SLOs, it prompts critical questions (reliability needs? staffing?). Without it, no steering—embrace it to leverage experience, as agents amplify creation but humans hold responsibility.