# 12-factor-agents

> What are the principles we can use to build LLM-powered software that is actually good enough to put in the hands of production customers?

- Type: skill
- Field: Learning & Education
- Repository: https://github.com/humanlayer/12-factor-agents
- GitHub stars: 27408
- Licence: NOASSERTION
- Language: TypeScript
- Last push: 2025-09-21
- Page: https://imutechz.in/agents/12-factor-agents

## What it is
12-Factor Agents is a set of engineering principles for building reliable, production-ready LLM-powered software. Created by Dex at HumanLayer, it adapts the 12-factor app methodology to AI agents, covering prompt ownership, context window management, tool design, state unification, human-in-the-loop patterns, and stateless reducer architectures. The guide emphasizes that effective agents are mostly deterministic software with targeted LLM steps, not open-ended tool-use loops.

## Features
- 12 concrete architectural factors for LLM applications
- Prompt and context window ownership patterns
- Tools as structured outputs with unified state
- Launch/pause/resume APIs and human escalation
- Small focused agents over monolithic designs
- Stateless reducer model for agent execution

## Best for
- Designing production LLM agent architectures
- Evaluating agent framework trade-offs
- Establishing team standards for AI software
- Refactoring prototype agents for reliability

## Pros
- Framework-agnostic principles applicable to any stack
- Based on real production experience across companies
- Clear factor-by-factor documentation with examples
- Open content (CC BY-SA 4.0) and code (Apache 2.0)

## Cons
- No runnable code or framework — principles only
- Requires engineering effort to implement patterns
- Assumes familiarity with LLM application concepts

Tags: llm-agents, agent-architecture, production-ai, 12-factor, prompt-engineering, context-engineering, human-in-the-loop, agent-patterns
