Skip to content

How to monitor AI agents in production

To monitor an AI agent, record every run (steps, tool calls, cost, timing), score whether the outcome met the user's goal, group repeated failures, and alert on those scores. A request can return a 200 and the task can still fail, so status codes alone won't tell you.

By Arun Prasad · Published · Last updated

On this page

Why agent monitoring matters

Uptime and error-rate dashboards show that a request went through. They don't show that the agent did what the user wanted, so wrong answers, wrong tool choices and drift can reach customers without any alert. Traditional application monitoring misses these failures because it tracks span status, not outcomes. The point to start from is the outcome rather than the span status.

Here is a hypothetical example. A support agent is asked to cancel an order. It calls the order lookup tool and gets a 200. It calls the cancellation tool and gets a 200. It replies, "Your order has been canceled." Every step succeeded. But the lookup returned the wrong order, so the user's order is still active. Latency is normal and the error rate is zero. The task failed anyway.

PRISM by Block Convey tracks the outcome against the user's goal, not only span status. The steps below show how to set that up.

Step 1: Record every run, not just the request

Send each run with its steps, tool calls, model, cost and timing, so you can replay what happened. A request log alone can't show you why an agent chose the wrong tool.

In PRISM, Agent Observability has four connected views: Traces (per-run request, response, model, cost, timing, scores), Sessions (multi-turn journey and drift), Agent Runs (steps, tool calls, retries, handoffs, state) and Scores & Alerts. Agent steps appear when your integration sends them, so what you see depends on what you send.

Four common ways to send data:

  • Python SDK. Install it with pip install "prismtrace-sdk>=0.5.1" and import prismtrace. The SDK is Python only.
  • Zero-code proxy. Change your base URL to /proxy/anthropic, /proxy/openai/v1 or /proxy/gemini, and send your PRISM key in the X-PRISMtrace-Key header from the same client config.
  • OpenTelemetry. Export to /api/otlp over http/protobuf or http/json, with the key header. gRPC isn't served.
  • HTTP API. Post one request per exchange to POST /api/traces.

If you work in TypeScript, Go or Java, use the HTTP endpoint or OpenTelemetry, since there's no npm package. Every supported connector is available on every plan, including Free. See the integrations page for the full list.

Step 2: Group turns into sessions

Grouping turns into sessions lets you see drift and goals left unresolved across multiple exchanges. Without a session ID, each turn looks independent.

In PRISM, traces that share a session_id form one conversation. Sessions can't be backfilled, so add the ID before launch rather than after. With OpenTelemetry, turns are grouped only from declared attributes (gen_ai.conversation.id, session.id or prismtrace.session_id). PRISM does not infer sessions.

If you use LangGraph or Google ADK, PRISM can read the framework's own conversation ID (LangGraph thread_id, ADK session_id). That needs SDK version 0.5.0 or later.

Step 3: Score outcomes against the user's goal

A tool can return success and the task can still fail. Score the outcome against what the user wanted, using rules and an LLM judge together: rules are cheap and cover every session, the judge catches quality problems rules can't express.

PRISM's evaluators come in these two kinds:

  • Deterministic rules give the same verdict for the same input, use no model, and run on 100% of sessions.
  • LLM-as-judge rules have a model read the exchange. The judge scores every incoming trace until your plan's daily allowance runs out. On the Free plan, that allowance is 100 traces a day.

Each verdict links to the rule, the span, the source checked and the reason, so you can check why a trace scored the way it did. Core scores are included on Free. Custom evaluators and the Evaluators Hub need Builder or above.

Step 4: Group failures into patterns and set alerts

One bad run is noise. The same failure across many sessions is a defect. Group repeated failures into patterns so you can alert on the ones that matter.

PRISM groups repeated failures into patterns and shows how many sessions share each one. Agent Intelligence looks for patterns across runs: user intent, how conversations feel, repeated failures and missing knowledge. Scores & Alerts is one of the four Agent Observability views.

One limit to plan for: automatic evaluation tasks run about hourly. They are not real time, so don't rely on them to catch a failure the minute it happens.

Step 5: Watch cost and latency per step

Cost builds up across steps, so a run that looks fine as a whole can hide one expensive step. PRISM records the model, cost and timing of every step in every run, so you can spot expensive or slow steps.

How this looks in production

In PRISM, one run becomes a trace with its request, response, model, cost, timing and scores. The steps and tool calls appear in Agent Runs if your integration sends them. The trace belongs to a session if you sent a session ID. Each score links to the rule that produced it, the span it checked, the source it checked against and the reason. When a score looks wrong, you can open the rule and the span instead of trusting a bare number.

Example: sending a trace over HTTP

Example · text
# Example
POST https://api.prism.blockconvey.com/api/traces
X-PRISMtrace-Key: pt-sk-…

{
  "project_id": "proj_abc123",
  "model": "gpt-4o",
  "input_messages": [{"role": "user", "content": "Cancel my order #8821"}],
  "output_message": "Your order has been canceled.",
  "latency_ms": 820,
  "session_id": "sess_xyz",
  "agent_id": "support-agent"
}

# Response (200)
# {
#   "id": "tr_…",
#   "cost_usd": 0.0012,
#   "session_id": "sess_xyz"
# }

Authenticate with the X-PRISMtrace-Key header. Authorization: Bearer is rejected for API keys. Keys look like pt-sk-… and are shown once, so store yours when you create it. The response returns the stored trace's id, cost_usd and session_id, so you can confirm the trace was received and link it to the session.

A note on content-free ingest. You can drop prompt text, response text and error messages from storage. The deterministic guardrail rules still run, but the text isn't stored. Those traces get no LLM-judge scores and aren't billed for scoring.

Connect your agent to see traces and scores from your own runs at prism.blockconvey.com/signup.

Common mistakes

Four mistakes come up often when teams monitor agents.

  • Relying on HTTP status and error rate. A tool can return a 200 while the task fails. Fix: score the outcome against the user's goal, as in Step 3.
  • Reviewing only a sample of sessions. Some failures are rare and only surface when you check every session. Fix: run deterministic rules, which cover every session with no sampling.
  • Forgetting session IDs. Without them, multi-turn drift can't be seen, and sessions can't be backfilled. Fix: declare the ID before launch.
  • Trusting an LLM-judge score without checking it. A score is only as good as the rule behind it. Fix: open the verdict. It links to the rule, the span, the source checked and the reason.

What is LLM observability, and how is it different from monitoring?

Observability is the data (traces showing what happened); monitoring is the alerts (telling you when something matters). PRISM provides both.

In PRISM, the Traces view shows the request, response, model, cost, timing and scores for each run. Sessions shows the multi-turn journey and drift. Agent Runs shows steps, tool calls, retries, handoffs and state.

How do you evaluate AI agent quality at scale?

Run cheap deterministic rules on every session, run an LLM judge on traces within your plan's daily allowance, and add human review for the cases that matter.

In PRISM, deterministic rules cover 100% of sessions. The LLM judge scores every incoming trace until your plan's daily allowance runs out. On the Free plan, that allowance is 100 traces a day. A human review queue is available on Builder and above.

How do you turn production traces into tests?

Find a failure pattern in your traces, write a check that catches it, and run it again after the fix.

In PRISM, the loop runs like this: create a scenario, run the app, PRISM finds the issue, you inspect it in Observability (traces and sessions) and Agent Intelligence, Evaluators (checks that re-run) track it, and AI Remediation suggests a fix. Then you run it again. Remediation traces a failure to a likely cause and produces a backlog where each item has severity, suggested fix, owner, expected impact and status. After a fix is merged, PRISM compares pass rates for the 7 days before and the 7 days after the merge.

Nothing ships without human sign-off. For code changes, PRISM opens a draft pull request only when your team has turned remediation on and granted write access, and only if at least 80% of replays pass. A person reviews and merges it.

Synthetic Scenarios generates simulated users from your app description and Knowledge Base, not from production sessions. A failing scenario becomes a regression test.

See what your agent is really doing

Connect your agent and check traces and scores on your own runs.

Free to start, 100 credits each month.