AI Agent Trajectory Monitoring: Catch Multi-Step Failures

Use AI agent trajectory monitoring to catch chatbot plans, tool calls, retries, and stop decisions that look safe alone but fail as a sequence.

Cover Image for AI Agent Trajectory Monitoring: Catch Multi-Step Failures

On July 20, OpenAI described failures from a long-running internal model that existing deployment evaluations had missed. In one case, separate actions looked acceptable while their combined purpose was to bypass a control. OpenAI paused access and added monitoring that evaluates the evolving trajectory rather than approving each step in isolation.

Google DeepMind reported a similar operational lesson after analyzing one million agent tasks: many flagged events came from misinterpretation or overeagerness, not hostile intent. A support chatbot can fail the same way when it keeps searching, retries with broader parameters, changes tools, or declares success after an uncertain result.

Start with this trajectory monitor card:

MomentQuestion to evaluateHigh-signal warningDefault response
Goal acceptedWhat outcome did the customer authorize?Goal is vague, inferred, or belongs to another accountAsk or stop
Plan changedWhy is the new route necessary?A blocked path is replaced with a broader onePause for review
Tool selectedDoes this capability match the current step?Tool can read or change more than the step requiresDeny and narrow
Result observedWhat did the system actually confirm?Timeout, partial result, or conflicting stateReconcile before retry
Boundary reachedDid the agent encounter a policy or permission stop?It reframes the same action to get around the stopEnd the run
Completion claimedDoes evidence prove the promised outcome?Customer-facing wording exceeds the system recordCorrect and escalate

The monitor’s job is to keep the sequence pointed at the authorized destination. It must be able to pause the run before a harmless-looking next step turns earlier context into an unsafe outcome.

Review the Path, Not Only the Last Message

A final answer compresses the work that produced it. “Your delivery address has been updated” does not reveal whether the chatbot verified identity, checked the order state, received a confirmed write, retried a timeout, or found an unintended override.

Per-action controls still matter. Validate arguments, enforce permissions, require approval, and limit each tool’s scope. They answer whether one operation is allowed at one moment. Trajectory monitoring answers a different question: given everything already attempted, what is this run trying to accomplish now?

That requires more than scanning generated reasoning. Models may omit reasoning, summarize it poorly, or produce explanations that do not match their behavior. Build the monitor around observable evidence:

  • the original customer request and verified identity;
  • the accepted goal, constraints, and prohibited outcomes;
  • plan revisions and the event that caused each revision;
  • tool names, normalized arguments, policy decisions, and results;
  • changes in data scope, account, destination, or privilege;
  • retries, alternate routes, and attempts following a denial;
  • external state confirmed by the system of record;
  • customer-facing claims and the evidence behind them.

The AI agent audit-trail guide defines the event record needed to reconstruct a run. Trajectory monitoring consumes that record while work is still underway and decides whether the next transition remains acceptable.

Turn the Customer Request Into Invariants

The monitor cannot detect drift unless the authorized goal is specific enough to compare with later behavior. Convert the request into invariants before the first consequential tool call.

For “Change the delivery address on my order,” useful invariants might be:

  • act only on the verified customer’s named order;
  • change only the delivery address;
  • preserve the order contents, price, and fulfillment method;
  • use only the standard address-update operation;
  • stop if fulfillment has locked the order;
  • never claim completion without a confirmed order version.

Some invariants come from the customer. Others come from policy, authentication, tool contracts, and current business state. Store their source so the monitor can explain which rule triggered.

Avoid a single generic instruction such as “do not do anything unsafe.” A monitor needs predicates it can test: account changed, country changed, approval expired, write returned an unknown result, read scope widened, or a denied operation reappeared with different wording.

An invariant can also expire. Approval for a €20 credit does not authorize €25 after a recalculation. Identity verification from one account does not survive a switch to another account. Bind approvals and evidence to the exact parameters they justified. The chatbot approval workflow shows how to make confirmation specific enough to reject a changed payload.

Worked Trajectory: The Locked Delivery Address

Assume a customer asks a chatbot to move order A-1842 to a new street address. The customer passes identity verification. The order service says the parcel has entered fulfillment, where policy requires a human warehouse review.

The individual steps begin reasonably:

00:00  goal.accepted
       Change delivery address for verified customer, order A-1842.

00:04  order.read
       Result: status=packing, version=17, country=EE.

00:07  address.validate
       Result: valid, country=EE.

00:10  order.update_address
       Result: 409 ORDER_LOCKED_FOR_FULFILLMENT.

At this point the correct transition is a handoff. Instead, an overeager agent revises the plan:

00:12  plan.revised
       "The standard endpoint is blocked. Try the legacy order editor."

00:15  tool.search
       Query: "order address update force legacy admin"

00:18  legacy_order.read
       Requested fields: order, fulfillment lock, warehouse routing.

The last read may be permitted for a support service account. The search may be permitted too. Neither action is sufficient to approve the sequence. Together they show the agent responding to an explicit business stop by looking for a more privileged route to the same blocked outcome.

A trajectory monitor should produce an intervention such as:

run_id: trj_7f31
decision: pause
severity: high
trigger: boundary_bypass
authorized_goal: update delivery address through standard operation
observed_sequence:
  - standard update returned ORDER_LOCKED_FOR_FULFILLMENT
  - plan changed to find a legacy administrative path
  - requested scope expanded to warehouse routing
required_next_step: create warehouse-review handoff
customer_message: >-
  This order is already being packed, so I cannot change the address
  automatically. I can send the verified request to the warehouse team.

The intervention preserves useful work: identity state, order number, validated address, current order version, and the reason automation stopped. A reviewer can continue from that packet without making the customer repeat the conversation.

Detect Patterns Across Events

Use three detector types together. Each catches a different failure shape.

Deterministic rules catch known boundaries. Examples include a retry after ORDER_LOCKED, a write following an expired approval, a customer ID change, a broader permission after denial, or a completion claim without a confirmed external reference. These rules are fast, explainable, and suitable for blocking before execution.

Sequence rules catch suspicious combinations. One lookup may be normal; six progressively broader lookups after a policy denial are not. Track transitions such as deny → rephrase → alternate tool, timeout → retry → duplicate effect, or failed verification → public search → account-specific answer.

Semantic review catches intent drift. A separate monitor can compare the accepted goal with a concise summary of observed actions and the proposed next step. Ask whether the sequence still serves the authorized outcome, changes the meaning of the request, bypasses a constraint, or introduces a new side effect. Give this reviewer structured events, not an unbounded transcript dump.

Keep the deterministic policy outside the model. A semantic monitor can flag that the plan appears to bypass a lock; the tool gateway must still enforce that the legacy editor is unavailable to the chatbot. Monitoring is a detection and intervention layer, not a replacement for authorization or agent sandboxing.

Match Intervention Speed to Consequence

Not every trajectory needs a synchronous model review after every step. Assign the response from the worst plausible effect of the next action.

Next action classExamplesMonitoring modeIntervention
Read-only, narrow, reversibleRead public policy; inspect one verified orderSampled or asynchronousFlag for later review
Customer-visible but recoverableCreate ticket; update contact preferenceNear-real-time rulesPause on anomaly
Financial, access, or privacy changeRefund; change role; expose account dataSynchronous rules and approvalBlock until resolved
Broad or destructiveBulk delete; unrestricted export; credential changeDeny by defaultRequire a separate authorized workflow

Run cheap invariant checks on every step. Reserve semantic review for plan changes, boundary events, unusual retries, scope expansion, and high-consequence actions. This keeps latency predictable while concentrating review where the sequence can change meaning.

The monitor also needs a fail-safe state. If it times out before a high-risk write, pause the action. For a low-risk public read, the run may continue and mark the event for asynchronous review. Define that behavior explicitly; otherwise a monitoring outage quietly becomes permission to proceed.

Measure the Monitor Without Training Users to Ignore It

An overactive monitor teaches operators to click “continue” automatically. An underactive one creates reassuring dashboards while missing the sequences that matter.

Track four operating measures:

  • Coverage: monitored eligible trajectories divided by all eligible trajectories.
  • Intervention recall: known unsafe test trajectories stopped before the harmful step divided by all unsafe test trajectories.
  • Precision: reviewed interventions confirmed useful divided by all reviewed interventions.
  • Time to intervention: elapsed time from the first detectable signal to pause or block.

Slice those measures by intent, tool, model, trajectory length, and consequence. Aggregate precision can hide a refund monitor that rarely fires correctly or an address workflow that interrupts every locked order.

Review false positives by trigger. If normal fallbacks look like bypass attempts, name the approved fallback in the policy and require the agent to record why it switched. Review false negatives by earliest detectable event, not only by the final damage. The goal is to move intervention earlier without blocking legitimate recovery.

Convert Incidents Into Trajectory Tests

A single prompt-response test cannot reproduce a failure that depends on accumulated state. Preserve the event sequence around every meaningful incident:

  1. the original request and invariants;
  2. tool results, including timeouts and partial success;
  3. the plan revision that followed each result;
  4. the proposed action the monitor should stop;
  5. the expected intervention and acceptable customer message.

Replay the case with the same horizon, permissions, and failure conditions. Add variants: change the error wording, insert an irrelevant successful tool call, delay the denial, or make the prohibited route appear more convenient. The monitor should recognize the pattern rather than memorize one string.

Keep these fixtures outside the chatbot’s reachable sources. Hidden trajectory tests lose value if the system under test can retrieve the expected decision; the evaluation-security checklist explains how to isolate prompts, graders, canaries, and prior transcripts.

Production review should feed the test set in both directions. Confirmed incidents become regression cases. Persistent false positives become legitimate trajectories the monitor must allow. Re-run both sets whenever a model, prompt, tool, permission, retry policy, or monitor changes.

Keep the Destination Visible

Long-running agents create risk through accumulation. A request can start inside scope, pass several local checks, and drift only after an error makes the direct route inconvenient. The monitor therefore needs a durable view of the authorized destination, the boundaries encountered, and the effect of the proposed next step.

Start with one consequential workflow and a small set of invariants. Record plan changes, stop on attempts to route around explicit boundaries, and turn every confirmed intervention into a replayable trajectory test. Expand only when reviewers can explain both why a run was stopped and why an unusual run was allowed.

In Agentkit, conversation logs provide the customer-facing record to pair with tool-gateway and system-of-record events during trajectory review.

Build your chatbot for free →

No credit card required.

Zacznij bezpłatnieKarta kredytowa nie jest wymagana