Skip to main content
Trace analysis is per-run, not per-message. Send it after an agent finishes (or at a checkpoint) — the detectors here reason about the shape of the whole run, which is exactly what a message-at-a-time scan cannot see.

Overview

Scanning each prompt in isolation catches injection in that prompt. It cannot catch an agent that reads a malicious web page on step 2, picks up a private API key on step 5, and posts it to an attacker-controlled endpoint on step 9. Every individual step looks reasonable. Only the path through the run is dangerous. POST /api/v1/agent/trace takes the whole trace and runs two detectors over it: The endpoint returns one aggregate allow / warn / block decision plus per-finding detail, and persists a security_event you can review in the dashboard.
The endpoint itself fails open by design: a detector error or database hiccup returns a decision rather than a 500, so trace analysis can never take down your agent. The goal-alignment auditor fails closed within that — it is opt-in for exactly that reason.

The four capability labels

Taint analysis needs to know what your tools can do. You describe each tool along the four axes of the “lethal trifecta” (plus destructiveness), and the analyzer follows values between them: All four default to false. A tool with no labels is treated as inert — so an unlabeled dangerous tool is invisible to this detector. Labeling is the one step worth being thorough about.

Submitting a trace

The trace above is the canonical failure: untrusted content from read_tickets flows into send_email, a public sink. FLOW001 reports the path rather than just flagging the final message, so the finding tells you which step introduced the taint.

Reading the response

Match on code, never on reason. The reason string is human-facing and may be reworded; the code is a contract.

Event shape

Each entry in events describes one step. Send only the fields that apply:

Where to call it

1

After the run completes

Simplest and safest. You get a full audit trail and a security_event per run, with no added latency in the agent’s own loop.
2

At a checkpoint, before a destructive step

Submit the trace so far and branch on decision before calling anything labeled destructive. Costs one round trip, but can stop the irreversible action rather than just recording it.

Best practices

  • Label every tool, especially the boring ones. An unlabeled tool is invisible to taint analysis; a single missing public_sink is enough to hide a real exfiltration path.
  • Always send user_objective. The goal-alignment auditor has nothing to compare against without it, and silently contributes no findings.
  • Include thought when your framework exposes it. Stated reasoning is often where drift shows up first.
  • Start in warn. Review real findings on your own traffic before you branch on block.

Next Steps

MCP Server Security

Validate individual tool calls as they happen

Extended Threat Coverage

The full catalogue of agentic threat types

Agent Security API

Sessions, registration, and credential rotation

Security Overview

All 16 detectors and how they fit together