Production lifecycle
How to Build Production-Ready AI Agents: A Guide to Pre-Deployment Evaluation
A production-ready agent is not a demo with hosting. It is a system with defined operating boundaries, repeatable evaluation, observable decisions, controlled releases, and a response plan when behavior changes.
The pre-deployment evaluation process applies the system methods in the multi-agent evaluation guide before users and downstream systems carry the risk.
Why pre-deployment evaluation catches failures before production
Prototype testing optimizes for visible success. Production evaluation searches for the conditions under which the workflow becomes unsafe, inconsistent, too expensive, or impossible to explain. The unit under test includes agents, tools, handoffs, memory, rules, and the final outcome.
Begin with an operating contract. Define the users, decisions, allowed actions, prohibited actions, data boundaries, human authority, service levels, and consequences of error. A team cannot evaluate production readiness without agreeing what production behavior should be.
Convert that contract into scenarios. Cover normal workflow branches, boundary values, missing information, conflicting sources, delayed tools, long sessions, and high-impact cases. Rank coverage by frequency, consequence, reversibility, and detectability.
Encode hard constraints independently from prompts. Verify permissions, spending, timing, required approvals, schemas, and authoritative sources with deterministic checks where possible. The four-pillar reliability framework connects this enforcement to scenarios, traces, and monitoring.
Capture decision-level evidence from the first test run. Record roles, state versions, tool inputs and outputs, handoffs, constraint verdicts, cost, and timing. Retrofitting traceability after launch leaves the most important early decisions unexplained.
Use a readiness matrix, not one score. Track correctness, hard-constraint compliance, trace completeness, escalation behavior, latency, cost, and stability across repeated runs. A strong average cannot cancel a critical policy violation.
The role of CI/CD integration
Evaluation must run where changes enter the system. Trigger targeted suites when prompts, models, tools, retrieval sources, schemas, policies, or orchestration code change. Map each changed component to the scenarios and contracts it can affect.
Use a layered pipeline. Fast schema, unit, permission, and deterministic constraint checks run first. Representative system scenarios run next. Expensive semantic judging, repeated stochastic trials, and broad regression suites run when risk or change scope justifies them.
Create immutable evaluation artifacts. Store the commit, prompt versions, model identifiers, scenario versions, constraint versions, tool fixtures, and verdicts. A release decision must be reproducible after the branch and hosted model have moved on.
Treat contracts as first-class gates. A producer change should prove compatibility with every affected consumer before full workflow evaluation. This catches boundary defects close to their source.
The CI/CD implementation guide provides pipeline structure, polling behavior, threshold logic, and working SDK patterns.
Keep human approval for changes that alter authority, data use, regulatory interpretation, or escalation policy. Automation supplies evidence and blocks known violations. It does not grant new business authority.
Setting quality thresholds and gates
Define thresholds per dimension and risk tier. Hard constraints use pass or block. Semantic quality can use minimum scores and confidence bands. Cost and latency can use warning and blocking budgets. Escalation metrics need both missed-escalation and unnecessary-escalation limits.
Set thresholds from a reviewed baseline, not aspiration alone. Run known-good examples repeatedly to measure natural variation. A threshold inside ordinary variance creates noisy gates. A threshold below unacceptable behavior creates false confidence.
Use absolute and relative gates together. Absolute gates enforce minimum safety and quality. Relative gates detect regression from the current baseline even when the result remains above the minimum.
Require sample sufficiency. One favorable run does not prove a stochastic system is stable. Repeat high-risk scenarios and report distributions, worst cases, and confidence. Make the required repetition count proportional to consequence.
Define override policy before the first blocked release. Record who can override, for which gate, with what evidence, for how long, and what follow-up is required. An undocumented override turns a control into a suggestion.
Version thresholds with the scenarios they govern. When a workflow or policy changes, review the threshold rather than carrying forward a number whose meaning has changed.
Cost of catching regressions early vs. late
A pre-merge defect is bounded. The changed component, fixtures, and responsible team are known. A production defect can affect users, stored state, external actions, audit records, support queues, and downstream systems before anyone identifies the source.
Late discovery increases diagnostic cost. Hosted models and data may have changed since the original decision. Traces may be incomplete. Engineers must reconstruct both the behavior and the environment that produced it.
Late discovery also increases remediation scope. The team may need to reverse actions, notify users, review similar decisions, preserve evidence, and satisfy incident obligations. The code change can be smaller than the operational response.
Track escaped defects and time to detection as lifecycle metrics. If the same fault category repeatedly reaches production, add coverage or an earlier gate at the boundary where evidence first existed.
Pre-deployment evaluation does not eliminate production monitoring. Real distributions, silent provider changes, and new user behavior create conditions no fixed suite can fully predict. The regression monitoring guide extends the same evidence model after release.
A mature release decision produces an assurance record: what changed, what was tested, which constraints passed, which risks remain, who approved, and what monitoring will watch. That record is the bridge from engineering confidence to operational accountability.
Use production-like environments without copying uncontrolled production data. Preserve tool behavior, permissions, rate limits, and failure semantics through synthetic fixtures or approved snapshots. Mask or generate personal data according to the same policy that governs the live workflow.
Test rollback as a workflow. Know which model, prompt, policy, tool adapter, and scenario baseline the system returns to. Confirm that rollback does not strand in-flight tasks or leave state written under a newer schema.
Conduct load and concurrency evaluation where agents compete for shared tools, budgets, queues, or locks. A workflow that is correct in isolation can violate timing or capacity constraints under simultaneous demand.
Define launch stages with increasing exposure. Internal users, shadow mode, limited cohorts, and bounded action scopes provide evidence before full autonomy. Each stage has entry criteria, observation time, and rollback triggers.
Review residual risks explicitly. Some semantic uncertainty, rare states, and external dependencies will remain. Record the owner, mitigation, monitoring signal, and review date rather than hiding uncertainty behind a pass label.
Final signoff should include engineering, domain, security, and operational owners where their authority applies. Production readiness is a shared claim supported by one evidence package, not four unrelated approvals.
Add security testing at the agent boundary. Review prompt injection, tool authorization, credential handling, data exfiltration, and unsafe side effects with the same seriousness as ordinary application threats.
Document service-level objectives for evaluation and operation. Include maximum decision latency, escalation deadlines, evidence availability, recovery time, and tolerated evaluator downtime. These targets shape architecture before launch.
Run a launch review using evidence, not presentations. Reviewers should be able to open the exact scenarios, constraints, traces, baseline comparisons, overrides, and monitoring configuration that support the readiness claim.
Schedule a post-launch review before launch day. Compare actual traffic, escalations, costs, and fault patterns with the readiness assumptions, then update scenarios and thresholds while the release evidence is still fresh.