Skip to main content
Architecture Patterns

These are target-state architecture patterns for agent observability and evaluation at enterprise scale, not required prerequisites for a first prototype. AgentCore Observability and Evaluations are native services; CloudWatch alarms and CI/CD integrations are adjacent AWS services you wire together.

Observability & Evaluations

Who this is for

Teams instrumenting observability and evaluation pipelines for production agents — the observe-evaluate-optimize loop, built-in evaluator IDs, evaluation modes, and how to close the feedback loop with CI/CD and alerting.

Agents are non-deterministic. The same input can produce different outputs, take different reasoning paths, and invoke different tools. Traditional monitoring (CPU, memory, error rates) is necessary but insufficient. Agent platforms need an observe → evaluate → optimize loop that continuously measures quality, safety, and performance. This page covers what AgentCore Observability and Evaluations provide natively, how to close the loop with adjacent AWS services, and which actions (such as rollback) remain customer-built patterns.


The Observe → Evaluate → Optimize Loop​

Observe→ Evaluate→ Alert & Optimize→ Repeat

Observe​

Collect comprehensive telemetry from every agent interaction. The observation layer captures what happened, when, and how long it took.

Services: AgentCore Observability, CloudWatch, X-Ray

SignalWhat's CapturedPurpose
TracesEnd-to-end request flow, tool calls, model invocations, latency per stepDebug failures, understand reasoning paths
MetricsToken usage, latency percentiles, success/error rates, cost per invocationSLA monitoring, capacity planning
LogsAgent reasoning, tool inputs/outputs, memory operationsRoot cause analysis, audit
User FeedbackThumbs up/down, corrections, escalationsGround truth signal for evaluation
Guardrail EventsPolicy violations, blocked content, PII detectionsSafety monitoring, policy tuning

Evaluate​

Automatically assess agent behavior against defined quality, safety, and performance criteria. Evaluations turn raw telemetry into actionable quality signals.

Service: AgentCore Evaluations

DimensionWhat's MeasuredExample Metrics
QualityResponse accuracy, relevance, completeness, groundednessBuiltin.Faithfulness, Builtin.ResponseRelevance, Builtin.Correctness, Builtin.GoalSuccessRate
SafetyGuardrail compliance, content policy adherenceBuiltin.Harmfulness, PII leak rate, topic violation count
PerformanceLatency, throughput, token efficiencyP95 latency, tokens per task, Builtin.ToolSelectionAccuracy, tool call efficiency
CostToken consumption, compute cost, tool invocation costCost per conversation, cost per task completion
DriftBehavior change over time, model degradationQuality score trend, response distribution shift

Alert & Optimize​

Close the loop by triggering automated actions when evaluations detect issues.

Services: CI/CD pipelines, CloudWatch Alarms

ActionTriggerResult
AlertsQuality score drops below thresholdPagerDuty/Slack notification to agent owner
RollbackSafety evaluation fails in productionRepoint the PROD endpoint to a previous Runtime version (customer-built pattern using Runtime endpoint versioning + Observability metrics)
ThrottleCost exceeds budget thresholdReduce rate limits or switch to cheaper model
Update EvalsNew failure patterns detectedAdd new evaluation criteria to catch edge cases
OptimizeOngoing quality metricsModel tuning, prompt refinement, data augmentation

Evaluation Framework​

Evaluations run in three modes, each serving a different point in the agent lifecycle.

Evaluation Modes​

ModeWhenTriggerPurpose
BatchEvery deploymentCI/CD pipeline gatePrevent regressions from reaching production
On-DemandEvent-driven or human-triggeredManual request, incident response, experimentDeep-dive analysis, A/B comparison
OnlineContinuous in productionSampling (e.g., 10% of traffic)Detect drift, measure real-world quality

Batch - CI/CD Gate

Runs on every deployment. Evaluates against a curated test dataset. Blocks promotion if quality, safety, or performance thresholds aren't met.

Every Deploy

On-Demand

Triggered by humans or events. Used for incident investigation, experiment analysis, or deep-dive into specific agent behaviors.

Event Triggered

Online - Production Sampling

Continuously samples live traffic. Detects quality drift, new failure modes, and model degradation before users report issues.

Continuous

Evaluation Dimensions​

A full evaluation framework measures agents across five dimensions:

DimensionBatchOn-DemandOnlineExample Evaluators
Quality✅ Regression test✅ A/B comparison✅ SamplingBuiltin.Faithfulness, Builtin.ResponseRelevance, Builtin.Correctness
Safety✅ Adversarial inputs✅ Red team results✅ Guardrail eventsBuiltin.Harmfulness, PII detection, topic violations
Performance✅ Latency benchmarks✅ Load testing✅ P95/P99 trackingEnd-to-end latency, token efficiency
Cost✅ Cost projection✅ Budget analysis✅ Spend trackingCost per task, cost vs. quality tradeoff
Operational✅ Error rate baselines✅ Incident postmortem✅ AvailabilitySuccess rate, retry rate, timeout rate
info

Start with Quality and Safety evaluations. Add Performance, Cost, and Operational dimensions as your agent fleet matures and you need optimization signals.


Further Reading​