Design a coding assistant that calls tools only when confident, with human review for uncertain decisions.
Build a customer support bot that escalates to a human agent via tool call when it encounters ambiguous requests.
Create a workflow automation system that pauses and resumes agent tasks without losing state between runs.
Architect an LLM-powered feature that carefully controls what context the model sees to reduce hallucinations.
12-Factor Agents is a guide, modeled after the well-known "12 Factor App" methodology for web applications, that proposes twelve concrete engineering principles for building AI-powered software that is reliable enough to deploy to real production customers. The core argument is that most successful AI agent products are not fully autonomous loops of an LLM calling tools until something works; they are mostly conventional software with AI steps embedded at precisely the right moments. The twelve factors cover the full lifecycle of building a production-grade AI agent. Several focus on controlling how information flows into the language model: own your prompts (write and version them yourself rather than relying on framework defaults), own your context window (carefully curate what the model sees rather than feeding it everything), and compact errors back into context rather than crashing. Others address architecture: keep agents small and focused on a single task, make agents stateless so they can be paused and resumed like a pure function, and treat tool calls as structured data outputs rather than magical actions. Factor 7 specifically addresses human oversight, designing the agent to contact a human through a tool call when it encounters uncertainty, rather than guessing. A developer or founder building LLM-powered features into a product, whether a coding assistant, customer support bot, or workflow automation, would use this guide to avoid common pitfalls and architectural dead ends. The content lives in Markdown files in the repository and the code examples are in TypeScript. It is published under Apache 2.0 (code) and Creative Commons BY-SA 4.0 (content).
Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.