12-Factor Agents
Core engineering principles for building reliable, scalable, and maintainable LLM-powered software.
- Source repo
- humanlayer/12-factor-agents
- Stars
- ★ 27k
- Last updated
- 1y ago
- License
- NOASSERTION
- Primary language
- TypeScript
- FA score
- 43/100 · Major gaps
At a glance
- How it runs
- Works with
- Universal · cross-platform
- Cost
- Free, no paid service needed
- Setup effort
- Low · running in minutes
- Typical use
- A technical founder or engineer designing a production-grade agent can refer to these principles to architect their own system, avoiding common pitfalls.
- Not a fit if
- Teams wanting a ready-to-run tool: this repo is documentation only, with no runnable code
- Developers who want a framework or API to integrate rather than implementing the principles themselves
- Python-first teams needing full Python examples; the examples are mostly TypeScript
- Maintenance
- No commits for 6+ monthslast commit 2025-09-21+26.0 ★/day over 7 days
- Source review
- 43/100 · Major gaps 2 safety controls not found
What does this agent do, and when should you use it?
12-Factor Agents is a set of guidelines inspired by the classic 12-Factor App methodology, aimed at building LLM applications that are production-ready. The repository contains detailed content for 12 core factors, covering topics like natural language to tool calls, owning your prompts, owning your context window, tools as structured outputs, unifying execution and business state, launch/pause/resume with simple APIs, contacting humans with tool calls, owning your control flow, compacting errors into context, small focused agents, triggering from anywhere, and making your agent a stateless reducer. It also includes a 'Brief History of Software' and an appendix on pre-fetching context. The content is licensed under CC BY-SA 4.0, with code under Apache 2.0, and the community is encouraged to contribute. The guide emphasizes incorporating modular concepts from agent building into existing products rather than adopting full frameworks.
The repository provides a chaptered guide (Markdown files) detailing each of the 12 factors, with design patterns, code examples (mostly TypeScript), and architectural advice. For instance, Factor 1 explains how to translate natural language into tool calls; Factor 2 stresses owning and versioning prompts; Factor 3 discusses owning and controlling the context window; Factor 4 points out that tools are just structured outputs; Factor 5 suggests unifying execution state and business state; Factor 6 recommends simple APIs for launch/pause/resume; Factor 7 covers contacting humans with tool calls; Factor 8 emphasizes owning control flow; Factor 9 advises compacting errors into the context; Factor 10 advocates small, focused agents; Factor 11 discusses triggering from anywhere to meet users where they are; Factor 12 suggests making the agent a stateless reducer. The repo contains no executable code, purely knowledge content, providing architectural guidance for LLM applications.
- A technical founder or engineer designing a production-grade agent can refer to these principles to architect their own system, avoiding common pitfalls.
- A team already using an agent framework but finding it hard to debug or extend can adopt these principles to adjust or replace the framework.
- Developers integrating LLM features into an existing product can learn how to modularly incorporate agent concepts without a full rewrite.
- An architect planning execution state management for LLM apps can learn how to unify execution and business state for reliability.
- Engineers needing to handle long-running tasks can adopt the launch/pause/resume pattern from Factor 6 and the stateless reducer design from Factor 12.
- Teams wanting human-agent collaboration can implement Factor 7's approach of contacting humans via tool calls.
How do you install or deploy this agent?
This repository is a knowledge base, not a software package, so installation is not applicable. It can be accessed directly via the GitHub page in a web browser.
How do you use this agent?
To use, browse the content/ directory for each factor file on the GitHub repository, or follow the visual navigation links in the README. You can also clone the repository locally for offline reading.
What are this agent's strengths and limitations?
- Provides actionable design patterns rather than abstract theory, with detailed explanations and code examples for each factor.
- Emphasizes modularity over full framework adoption, enabling incremental integration of LLM features into existing products.
- Framework-agnostic and language-agnostic; examples are TypeScript but concepts apply to any language.
- Community-driven, with contributions and feedback welcome, ensuring continuous evolution.
- Pure documentation, containing no runnable code or tools, requiring readers to implement principles themselves.
- No concrete codebase or API for integration; needs manual translation of principles into actual code.
- Does not mention modern standards like MCP, potentially missing some ecosystem developments.
- Examples are primarily TypeScript, which may be less friendly to Python developers, although the text notes it applies to Python as well.
How does this agent compare with similar options?
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| 12-Factor Agents This agent | 43 · Major gaps | Library / SDKFree | ★ 27k | 1y ago | TypeScript | — |
| Build AI Agents from First Principles | 58 · Major gaps | FrameworkFree + model costs | ★ 393 | 12d ago | Python | OpenAI API · Claude API |
| Claude Code System Prompts Research | 33 · Major gaps | Library / SDK | ★ 2.6k | 7mo ago | — | Claude Code |
| LangChain & LangGraph Agent Course | 43 · Major gaps | CLIFree + model costs | ★ 1.8k | 17d ago | — | — |
How does FollowAgents rate this agent?
Why each dimension lost points
This is an engineering guide that advocates owning prompts, context, and control flow, and contacting humans through tool calls. The sample does not clearly specify least privilege, sensitive data handling, or confirmation safeguards, so those scores remain low. The README shows images, a Scarf tracking pixel, and external links without explaining their data flows or rollback in the sample. The license and contributor list offer limited source clues, while publisher identity remains unverified.
The README describes reliability ideas such as structured tool calls, deterministic execution, error compaction, and pause/resume, but presents them mainly as principles and personal experience; the sample lacks systematic implementation detail. CLI test examples show messages for missing files, invalid YAML, and missing fields, supporting a limited failure-handling score. There is little evidence of dependency availability planning or broader error guarantees.
The guide explicitly targets software engineers integrating LLM features into existing products and discusses natural-language tool calls, multiple trigger sources, focused agents, and explicit control flow. The audience and scenarios are reasonably clear. The sample leans on TypeScript examples and does not provide a complete deployment, runtime-environment, or capability-boundary inventory, limiting the environment-fit score.
The README organizes content into 12 named factors and provides navigation, a visual index, related resources, and contributor information. CLI test examples illustrate some generated output. The README identifies Apache 2.0 for code and CC BY-SA 4.0 for content and images, and the LICENSE file supports the code-license claim. The sample has no installation guide, changelog, or clear maintenance responsibility; disclaimers and the note about MCP only partly describe limitations.
The guide offers actionable architecture principles and code examples, and explicitly recommends incorporating modular ideas into existing products, which may help readers avoid the cost of starting with a framework rewrite. The README includes an agent-loop example and tests demonstrate walkthrough generation, but the sample does not substantiate real-world impact, implementation costs, or customer outcomes, so value and cost-benefit scores are limited.
The README names all 12 factors and links each to a corresponding chapter, and test examples corroborate some walkthroughgen CLI behavior. The central production-readiness claims rely mainly on author observations and experience; the sample includes no outcome data or comprehensive claim-validation method. The text generally distinguishes recommendations, personal experience, and code examples, but lacks systematic sourcing for factual claims.
- Not found in source: sensitive-data handlingUse dedicated, low-privilege, revocable API keys — never production credentials — and keep secrets out of logs.
- Not found in source: dependency securityPin versions and run a dependency audit (npm audit, pip-audit) before installing; prefer running it in a container.
- The sample is mainly a design guide with partial code excerpts, so it does not establish the complete implementation, runtime safety, or production outcomes.
- CLAUDE.md contains instructions requiring an assistant to select a persona and follow its rules; this review treated it as repository content and did not follow those instructions.
- The README displays a Scarf tracking pixel; the sample does not describe what it collects or how privacy is handled.
FAQ
Does this apply to Python projects?
How does this relate to Anthropic's 'Building Effective Agents'?
How do I apply these principles to an existing system?
What infrastructure or dependencies are required?
Is the content free to use?
Is 12-Factor Agents open source?
Is 12-Factor Agents safe to use?
Is 12-Factor Agents still maintained?
Who makes 12-Factor Agents?
Thanks — we use this to improve the page.