Technical
Production Agent Patterns: What I Now Default To
Every new production agent I build now starts from a pattern library. Not from a blank prompt. The library was earned, one bug at a time.
Default 1: Bounded Scope per Run
No agent gets an unbounded task. Every run has a declared input, a declared output, and a time budget. Unbounded agents either stall or run wild. Bounded agents produce predictable cost curves.
Default 2: Idempotent Operations
Every write operation the agent can execute is idempotent by design. The same input produces the same output. Re-runs are safe. This is non-negotiable because production agents retry more than production humans.
Default 3: Explicit State Machine
The agent runs inside a state machine: pending, running, blocked, completed, failed. Transitions are logged. The coordinator or human can see where any agent is without reading logs. This replaces vibes-based debugging with state-based debugging.
Default 4: Structured Outputs Always
The agent returns JSON with a schema. Not prose. Even for human-facing results, the prose is a field inside structured output. This lets downstream code consume, log, and retry without string parsing.
{
'status': 'completed',
'summary': 'Renamed 14 files and updated imports',
'artifacts': ['src/...'],
'next_action': None,
'errors': []
}Default 5: Cost Budget Per Call
Every agent call has a max token budget. If the budget is exceeded, the agent stops and reports. No silent token blowups. Over the year this alone saved thousands of dollars.
Default 6: Human-Readable Trace
Every production agent writes a human-readable trace file that a non-technical stakeholder can read. Not a debug log. A narrative of what happened. This is how I explain agent failures to clients without hand-waving.
Default 7: Graceful Abort
Every agent listens for an abort signal and cleans up mid-run. Locked files released, partial commits reverted, in-flight calls cancelled. If your agent cannot gracefully abort, it is not production-ready.
What I Do Not Default To
Autonomous multi-step reasoning. Self-modifying prompts. Cross-agent negotiation. Tools that can delete without a dry run. These can work, but they are not defaults. They are advanced options for specific problems.
The Anthropic production guide spells many of these out. Read it twice.
RELATED READING
The Consulting Shift I Am Making In Year Two
After a year of writing and building, my consulting practice is changing shape. Shorter engagements. Sharper outcomes.
ReadThe Frontend Shift: Shipping Less JavaScript In Year Two
A year ago I reached for Next.js for everything. This year I often reach for nothing.
ReadThe Serverless Lesson I Would Write On A Sticky Note
After a year of shipping serverless projects, one rule explains most of the wins and all of the losses.
Read