Skip to content

Vol. II · Production Doctrine · II.1

The Twelve Factors

Twelve engineering constraints that make LLM-powered software reliable enough for paying customers. Not a framework — a checklist you can apply to any stack.

10 min read

Doctrine

  • 1 NL → tool calls. 2 Own prompts. 3 Own context. 4 Tools are structured outputs. 5 Unify state. 6 Pause/resume APIs. 7 Humans as tools. 8 Own control flow. 9 Compact errors. 10 Small agents. 11 Trigger from anywhere. 12 Stateless reducer.
  • Even if models get smarter, these constraints remain: they are software constraints, not model constraints.

Why factors, not a framework

The 12-factor agents project (humanlayer, 2025) is explicit: most strong founders roll the stack themselves. Frameworks accelerate the first 80%. Factors are what you keep when you throw the framework away.

They map cleanly onto LangGraph (checkpoints = factor 6, graph = factor 8), OpenAI Agents (handoffs = small agents + control flow), and Claude Code (skills = context ownership + small agents). Use them as a review rubric on any design.

How to apply them in a review

For each agent surface ask: can I see the prompt? Can I see the context builder? Can I pause mid-tool? Can a human be called as a tool? Is there a step budget? Is state one blob I can serialize? If any answer is no, that is the next ticket — not a new multi-agent topology.

Anti-patterns

  • Delegating prompts to a black-box framework.
  • A separate 'agent state' that drifts from business state.
  • Giant general-purpose agents with thirty tools.

Related