Skip to content
All patterns
Agents

Production agent

An agent system wrapped in the production machinery required to ship safely: gateway, policy, observability, evaluation, caching and security.

How a production agent stops an unsafe action before it runs

Step 1 of 5

Gateway

The request arrives at the gateway, which authenticates the user, applies rate limits and checks the cache for an identical earlier answer. A cache hit never reaches the agent.

The agent can propose anything; the policy layer decides what is allowed to execute.

User
Gateway
Agent
Caching
Policy layer
Tools
Observability
Evaluation
APIs
clientservicemodeldatabaseagentexternal
Explanation

Every agent action passes through a policy layer that enforces authorisation, rate limits and safety. The gateway handles auth, caching and routing. Every step is traced for observability and scored for evaluation.

Components
API gatewayAuth + RBACPolicy engine (OPA/Cedar)Agent orchestratorTool registryObservability (OpenTelemetry/LangSmith)Evaluation pipelineCaching layer
When to use
  • Any agent shipped to external users
  • Agents that take actions on user data
  • Regulated industries (finance, healthcare)
When NOT to use
  • Early prototyping
  • Internal-only trusted tools
Failure modes
  • Policy too strict — agent unable to act
  • Policy too lax — unsafe actions execute
  • Observability sampling misses the failing trace
  • Cache poisoning returns stale/wrong results
Production checklist
  • AuthN + AuthZ on every request
  • Policy enforcement on every tool call
  • Full trace of agent trajectory
  • Online evaluation scores in dashboards
  • Cost and token budgets per run
  • Cache invalidation strategy
  • Audit log of every action
  • Incident response runbook