Skip to main content
Use AFK incrementally. Start with one narrow agent, add tools only when the task needs action, and add production controls before real users depend on the system.

Phase 1: narrow agent

Build one agent that solves one task without tools.
Move on when the agent is reliable on real examples for the narrow task.

Phase 2: tools and safety

Add typed tools and hard limits.
Move on when all tools have Pydantic argument models, cost limits are set, and mutating operations are gated or absent.

Phase 3: production controls

Before shipping, add the controls that make failures diagnosable:
  • evals for expected behavior;
  • telemetry for latency, usage, errors, and tool calls;
  • persistent memory or queues if runs must survive process restarts;
  • security controls for sandboxing, secret scope, and tool output limits;
  • troubleshooting docs for on-call and operators.
Useful pages:

Evals

Test agent behavior and enforce budgets.

Observability

Export metrics, traces, and run records.

Security Model

Understand policy gates, sandboxing, and secret isolation.

Task Queues

Run agents through distributed workers.

Phase 4: release discipline

Once the agent is in production:
  • run evals in CI before prompt, tool, or model changes;
  • compare behavior across releases with golden traces where appropriate;
  • monitor cost per run and failure rate;
  • version system prompts in files;
  • document operator actions for approval, resume, and rollback flows.

Common mistakes

Next steps

Read Building with AI for production design patterns, then Troubleshooting for common operational failures.