Moving an AI agent from a development environment into production requires more than confirming that it can answer questions or call tools successfully.
Production agents operate with real users, real data, real permissions, and real business consequences. A system that works during a controlled demonstration can still fail when it encounters unexpected inputs, unavailable tools, model errors, authorization problems, or high request volume.
A production-ready AI agent therefore needs measurable controls around four areas:
Observability
Governance
Evaluation
Recovery
These areas should be designed together rather than added after deployment.
What Does Production Readiness Mean?
A useful definition is:
An AI agent is production-ready when its behavior can be observed, evaluated, governed, and safely recovered when something goes wrong.
The architecture can be represented as:
AI Agent
|
+---------------+---------------+
| | |
v v v
Observability Governance Evaluation
| | |
+---------------+---------------+
|
v
Recovery
|
v
Production SystemEach layer addresses a different risk.
| Area | Primary question |
|---|---|
| Observability | What happened? |
| Governance | Was the behavior allowed? |
| Evaluation | Was the result correct? |
| Recovery | What happens when it fails? |
Start With Explicit Production Criteria
Before deployment, define measurable acceptance criteria.
For example:
Agent
├── Observability
│ ├── Execution tracing
│ ├── Error logging
│ └── Latency metrics
│
├── Governance
│ ├── Authentication
│ ├── Authorization
│ └── Tool restrictions
│
├── Evaluation
│ ├── Regression tests
│ ├── Quality evaluation
│ └── Safety checks
│
└── Recovery
├── Retry
├── Timeout
├── Fallback
└── Human escalationThis converts the vague concept of "production-ready" into specific engineering requirements.
Observability
AI agents require visibility into more than HTTP requests.
A single execution may contain:
User Request
↓
Model Call
↓
Tool Call
↓
Database Query
↓
Model Call
↓
Final ResponseThe telemetry should make this execution understandable.
Useful information includes:
Execution ID
Agent name
Model
Channel
Tool name
Duration
Token usage when available
Retry count
Error category
Final status
Use Structured Logging
A structured log entry is easier to search than a plain message.
logger.LogInformation(
"Agent execution completed. " +
"ExecutionId={ExecutionId}, " +
"DurationMs={DurationMs}, " +
"Succeeded={Succeeded}",
executionId,
stopwatch.Elapsed.TotalMilliseconds,
true);Avoid logging sensitive prompts, credentials, authorization headers, or confidential customer information.
Add Distributed Tracing
For multi-step workflows, tracing provides the relationship between operations.
agent.execute
│
├── model.call
│
├── tool.search
│
├── tool.database
│
└── model.callA .NET application can use ActivitySource:
using System.Diagnostics;
public static class AgentTelemetry
{
public static readonly ActivitySource Source =
new("ProductionAgent");
}Then create an activity around execution:
using var activity =
AgentTelemetry.Source.StartActivity(
"agent.execute");
activity?.SetTag(
"agent.name",
"support-agent");
activity?.SetTag(
"agent.execution_id",
executionId.ToString());OpenTelemetry can then export traces and metrics to the observability infrastructure used by the organization.
Measure the Right Metrics
At minimum, track:
| Metric | Purpose |
|---|---|
| Request count | Understand traffic |
| Success rate | Measure reliability |
| Failure rate | Identify problems |
| P50 latency | Typical performance |
| P95 latency | Slow-request behavior |
| P99 latency | Tail performance |
| Tool failure rate | Identify dependency problems |
| Retry count | Detect transient failures |
| Token usage | Understand model consumption |
Averages alone can hide slow requests.
For example:
Average: 1.2 seconds
P95: 5.8 seconds
P99: 12.4 secondsThe average looks healthy, but a significant tail may still create a poor user experience.
Governance
Governance defines what an agent is allowed to do.
This should include:
Identity
Authentication
Authorization
Tool permissions
Data access
Auditability
Human approval requirements
A simple architecture is:
Request
↓
Authentication
↓
Authorization
↓
Agent
↓
ToolThe model should not be the final authority for permission decisions.
Keep Authorization Deterministic
Consider a refund operation.
The agent might determine that a user wants a refund, but the application should determine whether that refund is allowed.
public interface IAuthorizationService
{
Task<bool> CanRefundAsync(
string userId,
string orderId,
CancellationToken cancellationToken);
}Then:
var allowed =
await authorizationService.CanRefundAsync(
userId,
orderId,
cancellationToken);
if (!allowed)
{
return new AgentResponse(
"The requested operation is not permitted.",
false);
}This creates a deterministic security boundary around agent behavior.
Tool Governance
Every tool should have an explicit risk profile.
Read Data
↓
Lower Risk
Modify Data
↓
Higher Risk
Delete / Financial Operation
↓
High RiskA tool registry can capture this metadata:
public enum ToolRisk
{
Low,
Medium,
High,
Critical
}
public sealed record ToolDefinition(
string Name,
ToolRisk Risk,
bool RequiresApproval);For example:
var refundTool = new ToolDefinition(
"IssueRefund",
ToolRisk.Critical,
true);The agent can request the tool, but the application can require an additional approval step before execution.
Human Approval for High-Risk Actions
Not every action should execute automatically.
A useful pattern is:
Agent
↓
Requests Action
↓
Risk Check
|
+---- Low Risk → Execute
|
+---- High Risk → Human ApprovalFor example:
Search Order
→ Automatic
Update Address
→ Policy Check
Issue Refund
→ Human ApprovalThe exact policy depends on the application's business requirements.
Evaluation
Production readiness requires continuous evaluation.
A test suite should include representative scenarios:
Correct Request
Incorrect Request
Ambiguous Request
Unauthorized Request
Tool Failure
Missing Data
Prompt Injection Attempt
Model Failure
TimeoutEach test should define expected behavior rather than necessarily requiring an exact response string.
For example:
public sealed record EvaluationCase(
string Id,
string Input,
string ExpectedBehavior,
ToolRisk Risk);This allows the same test set to be executed against different agent versions.
Deterministic Evaluation
Use deterministic checks whenever possible.
For example:
Assert.False(
result.ExecutedUnauthorizedTool);Or:
Assert.Equal(
"ORDER_NOT_FOUND",
result.ErrorCode);Deterministic checks are particularly important for:
Authorization
Business rules
Tool permissions
Data validation
Required fields
Security controls
AI-Based Evaluation
Some characteristics are inherently open-ended.
For example:
Was the response relevant?
Was the explanation complete?
Was the response grounded in the retrieved information?An AI evaluator can help assess these dimensions.
Use a defined rubric:
1 = Incorrect
2 = Major issues
3 = Acceptable
4 = Good
5 = ExcellentStore the evaluation result:
public sealed record EvaluationResult(
double Score,
bool Passed,
string Reason);AI evaluation should complement deterministic testing rather than replace it.
Regression Evaluation
Every meaningful change to an agent should trigger regression evaluation.
Changes may include:
Model changes
Prompt changes
Tool changes
Retrieval changes
System-instruction changes
Business-rule changes
A simple pipeline is:
Code Change
↓
Build
↓
Unit Tests
↓
Agent Evaluation Suite
↓
Security Tests
↓
Deploy DecisionThis prevents a prompt or model change from silently degrading previously supported behavior.
Recovery
Production systems must assume that failures will happen.
Potential failures include:
Model Timeout
Tool Timeout
Database Failure
Rate Limit
Network Failure
Invalid Tool Input
Unexpected Model Output
Service UnavailableRecovery strategies should be defined for each category.
Use Timeouts
Every external dependency should have a bounded execution time.
using var timeoutCts =
CancellationTokenSource.CreateLinkedTokenSource(
cancellationToken);
timeoutCts.CancelAfter(
TimeSpan.FromSeconds(20));
var result =
await modelClient.SendAsync(
request,
timeoutCts.Token);The timeout should reflect the actual user experience requirements of the application.
Do not simply increase timeouts to hide slow dependencies.
Retry Only Transient Failures
Retries can help with temporary infrastructure failures.
A simplified pattern is:
for (var attempt = 1;
attempt <= 3;
attempt++)
{
try
{
return await ExecuteAsync(
cancellationToken);
}
catch (HttpRequestException)
when (attempt < 3)
{
await Task.Delay(
TimeSpan.FromSeconds(attempt),
cancellationToken);
}
}Production retry policies should classify failures carefully and use appropriate backoff.
Do not retry every exception.
Protect Against Retry Amplification
Agentic applications can already involve multiple calls.
Consider:
Agent
↓
Tool
↓
HTTP Service
↓
DatabaseIf every layer retries independently:
Agent Retry ×
Tool Retry ×
HTTP Retry ×
Database Retrythe total number of operations can grow rapidly.
Define ownership for each resilience policy.
For example:
Database
→ Database-level transient handling
HTTP Client
→ HTTP resilience
Agent
→ Workflow-level recoveryAvoid blindly stacking identical retry policies.
Fallback Strategies
A fallback can provide a safer result when the primary path is unavailable.
For example:
AI Agent
↓
Primary Knowledge Tool
|
X
Failure
↓
Cached Knowledge
↓
Limited ResponseA fallback should never pretend that unavailable data is current.
A safer response is:
"The knowledge service is currently unavailable.
I cannot verify the latest information."rather than generating an unverified answer.
Circuit Breaking
When an external dependency is consistently failing, repeatedly calling it can make the situation worse.
A circuit breaker conceptually works like:
Healthy
↓
Failure Threshold
↓
Open
↓
Reject Calls
↓
Recovery Window
↓
Half Open
↓
HealthyThis is particularly useful for tools that depend on unreliable external services.
Recovery Through Human Escalation
Some failures cannot be solved automatically.
For example:
Agent
↓
Payment Issue
↓
Automated Recovery Failed
↓
Human Support QueueThe handoff should include structured information:
public sealed record EscalationRequest(
string ExecutionId,
string Reason,
string? CustomerId,
string? Summary);Avoid passing unnecessary sensitive data to the human-review system.
Production Readiness Scorecard
A practical scorecard can help teams identify gaps.
| Area | Example Criteria | Status |
|---|---|---|
| Observability | Traces and structured logs | Required |
| Metrics | Latency and failure metrics | Required |
| Security | Authentication and authorization | Required |
| Tool governance | Risk classification | Required |
| Evaluation | Regression test suite | Required |
| AI evaluation | Quality rubric | Recommended |
| Recovery | Timeout and retry strategy | Required |
| Fallback | Defined degraded behavior | Recommended |
| Human escalation | High-risk workflow | Where required |
| Auditability | Important actions recorded | Required |
The status should be determined by the application's risk profile rather than by an arbitrary universal threshold.
Production Readiness Checklist
Before releasing an agent, verify:
Every execution has a correlation identifier.
Model and tool operations are observable.
Failures are categorized.
Sensitive data is excluded from unnecessary telemetry.
Authentication is implemented.
Authorization is deterministic.
Tools have defined permissions.
High-risk actions have appropriate approval controls.
Representative evaluation cases exist.
Regression tests run after meaningful changes.
External calls have timeouts.
Transient failures have controlled retry policies.
Retry amplification has been considered.
Fallback behavior is defined.
Human escalation exists where necessary.
Operational dashboards are available.
Audit requirements are satisfied.
The deployment process can safely roll back changes.
Common Mistakes
Treating a Successful Demo as Production Readiness
A demo normally exercises a small number of controlled scenarios.
Letting the Model Make Security Decisions
Authorization should be enforced by deterministic application logic.
Logging Everything
Agent traces can contain sensitive information.
Measuring Only Average Latency
Tail latency often provides more useful operational information.
Retrying Every Failure
Some failures are permanent or caused by invalid requests.
Ignoring Tool Risk
A read-only search tool and a financial transaction tool should not have identical controls.
Evaluating Only the Final Text
Tool usage and business-rule violations may be invisible in the final response.
Adding Recovery Without Testing It
A fallback that has never been exercised may fail when it is actually needed.
Best Practices
Define production-readiness criteria before deployment.
Treat observability as a core feature.
Keep authorization deterministic.
Classify tools by risk.
Separate low-risk and high-risk workflows.
Maintain a version-controlled evaluation suite.
Combine deterministic and AI-based evaluation.
Use bounded timeouts.
Retry only appropriate transient failures.
Avoid nested retry amplification.
Define explicit degraded-mode behavior.
Provide human escalation for appropriate cases.
Protect telemetry and audit data.
Monitor production behavior continuously.
Re-evaluate the agent after model, prompt, or tool changes.
Advantages and Disadvantages
Advantages
Makes agent behavior measurable
Improves production troubleshooting
Reduces uncontrolled agent actions
Supports repeatable evaluation
Provides structured recovery paths
Helps teams identify operational risks
Makes AI systems easier to govern
Disadvantages
Requires more engineering than a simple chatbot
Observability creates additional infrastructure requirements
Evaluation suites require ongoing maintenance
AI evaluators can introduce variability
Human review increases operational effort
Strong governance can reduce automation in high-risk workflows
Troubleshooting Production Failures
When an agent fails in production, investigate in this order:
Execution ID
↓
Trace
↓
Model Calls
↓
Tool Calls
↓
Authorization
↓
External Dependencies
↓
Recovery Attempts
↓
Final OutcomeFor example, if users report that an agent is slow:
Find the execution trace.
Check total duration.
Identify the slowest child operation.
Determine whether retries occurred.
Check external dependency latency.
Compare the result with normal P95 and P99 behavior.
Apply the fix at the actual bottleneck.
This is more reliable than simply increasing the global timeout.
A Production-Oriented Architecture
A mature .NET agent platform can be structured like this:
Client
|
v
API / Agent Gateway
|
Authentication
|
Authorization
|
v
Agent Runtime
|
+----------------+----------------+
| | |
v v v
Model Tool Layer Evaluation
Client | |
| v |
| External Services |
| |
+----------------+-----------------+
|
v
Observability
|
+------------+------------+
| | |
v v v
Logs Metrics Traces
Recovery Layer
|
+-------------+-------------+
| | |
v v v
Retry Fallback Human ReviewThe architecture separates execution, governance, evaluation, observability, and recovery instead of placing all responsibilities inside the model orchestration code.
Conclusion
AI agent production readiness cannot be determined by asking whether an agent works in a development environment. A production system must also answer four critical questions:
Can we see what the agent did?
Can we control what the agent is allowed to do?
Can we verify whether its behavior is correct?
Can we recover safely when something fails?
Observability provides execution visibility. Governance establishes security and operational boundaries. Evaluation verifies behavior against defined expectations. Recovery provides controlled responses to failures.
Together, these capabilities create a practical production-readiness framework:
Observability
+
Governance
+
Evaluation
+
Recovery
↓
Production-Ready AI AgentThe goal is not to eliminate every possible AI failure. That is unrealistic for non-deterministic systems. The goal is to ensure that failures are detectable, bounded, explainable, and recoverable, while critical business and security decisions remain under deterministic application control.

Join the conversation! Your thoughts help the community grow.