Beyond evals: Why AI agents need behavorial guardrails, not just output checks

Nikita BokilNikita Bokil
13 juli 2026

TL;DR

  1. Bad execution hides behind good outputs, and it's usually the first sign something's shifted.
  2. No single layer catches everything, so evals, guardrails, and behavioral monitoring need to work together.
  3. The real bar isn't stopping a failing agent, it's rescuing the run before it fails.

Introduction

Trust in fully autonomous AI agents has dropped from 43% to 27% according to a 2026 Capgemini Research Institute survey of 1,500 senior executives. Adoption is accelerating, but trust is not. We're deploying agents faster than we're building the systems to catch them when they go wrong. 

To build trust, the AI industry has been deep in the evals conversation, and rightfully so. Did the model hallucinate? Was the output grounded? Did the agent achieve its goal? 

But evals are retrospective. They tell you how an execution went after it's over. They don't tell you something is going wrong while it's happening. 

What if a system could monitor agents in real time, detect anomalies as they happen, and actively rescue the run before it fails? That's the missing layer we set out to test and build.

Why autonomous agents raise the stakes

I'm a product lead for Optimizely Opal, an AI platform where marketers can create agents that run autonomously, triggered by schedules, emails, and webhooks.

Our customers have built agents that run at any hour, across time zones, with no one watching: 

An ABM agent that continuously generates personalized landing pages for every new prospect in Salesforce. 

content refresh agent that optimizes pages for SEO and GEO on a monthly cadence. 

brand compliance agent that reviews content before it's published to the CMS. 

translation agent that spins up localized versions automatically when one language is published. 

These aren't headline-grabbing use cases. But when they run unsupervised, the stakes change. When an agent goes off the rails at 2am, it doesn't just produce bad output. It burns through tokens, racks up API calls, and consumes compute until something stops it. We've invested heavily in evals and they're a critical part of our reliability story. But we knew they weren’t the whole answer. 

Why it’s hard to define “normal” for agents 

Andrej Karpathy (a founding member of OpenAI and former Director of AI at Tesla) has described agents as "spiky entities": stochastic, sometimes unreliable, but extremely capable when directed well. He's right, and that tension is the whole point. 

LLMs are non-deterministic, and that's why they're useful. The same prompt can produce different outputs every time. Non-determinism is what gives agents their creativity, their ability to adapt to novel inputs, their capacity to handle edge cases no rule book could anticipate. You wouldn't want a deterministic content agent because it would produce the same stale output on every run. 

But non-determinism means you can't write a static rule for what an agent ‘should’ do. You can't hardcode the expected sequence of tool calls, because a good agent might take a different path each time and still get it right. The variability is the value. 

Managing a non-deterministic system is a lot like managing a creative team. You don't want to script every decision; that's what makes them valuable. But you need to know when someone's gone off-brief. You can't define "good" as one exact sequence of steps. You have to learn what the range of normal looks like, and flag when something falls outside it. 

That's the core challenge we wanted to solve. Not just "is the output safe?" (that's what content guardrails are for). Not just "did the output look good?" (that's what evals are for). But: is this agent behaving within its normal range, right now, in real time – and can we rescue it if it isn't? 

Why evals only tell half the story

Most AI guardrails work like inspecting products as they leave the factory. You check every item at the door. If it looks right, it ships. But you never watch the assembly line. 

A machine drifting out of calibration produces parts that look fine today but will fail next week. Suppose an agent calls the right tools in the wrong order, or usually searches three sources but suddenly searches twelve, or skips a step it has never skipped before. The output may pass inspection, but the behavior is wrong, and by the time the output starts looking wrong too, you've shipped thousands. 

This is where the distinction between output quality and execution quality becomes critical. They are fundamentally different things. Evals focus entirely on output quality: Did we get the right answer? But they completely ignore execution quality: How did the agent get there, and what happened along the way? 

We needed something that could watch the assembly line, not just inspect what comes off it. 

Why behavioral monitoring is the missing layer 

Before we built anything new, we needed to know what was already out there. We found that the landscape falls into three categories: 

Input/output guardrails: Screen what goes into and comes out of a model. NVIDIA NeMo Guardrails, Amazon Bedrock Guardrails, and Google's Model Armor provide strong frameworks for content filtering, prompt injection detection, and PII redaction.

Quality validation and evals: Check output correctness and groundedness. Guardrails AI offers runtime validation and hallucination detection. LangSmith provides tracing, evals, and production monitoring. Galileo (now part of Cisco) does post-hoc observability with hallucination metrics and evaluation suites.

Behavioral monitoring: Watch what an agent is doing during execution, not just what it produces. This category barely exists. There's promising academic work from a January 2026 paper called 'Trajectory Guard', which proposes a model for detecting anomalous agent runs by analyzing tool-call sequences.

 

The first two categories are well-served. The third is not. Very few systems learn what 'normal' looks like for each individual agent, detect deviations from that learned baseline as the execution unfolds, and intervene to attempt recovery. That's the gap we set out to fill. 

 

How behavioral guardrails work for agents 

 

We built an anomaly detection and recovery system that monitors agent executions, learns what normal behavior looks like, and intervenes when something drifts. We call the approach the Learn-Observe-Enforce-Rescue framework, a progressive model that builds confidence before it takes action, and actively restores order when things go wrong.

The key design decision was that the system doesn't start enforcing or intervening from day one. It operates in four progressive modes: 

1

Learn mode: The system watches and collects baseline data from successful executions. No intervention, just observation.

2

Observe mode: The system starts detecting anomalies but doesn't stop anything. It flags, it logs, it builds confidence.

3

Enforce mode: The system actively stops executions that deviate too far from learned patterns.

4

Rescue mode: Instead of simply killing a drifting execution, the system dynamically generates corrective instructions to nudge the agent back on track.

This progression matters. A system that enforces rules it hasn't learned yet is just guessing. The Learn-Observe-Enforce-Rescue cycle means interventions are grounded in observed reality, not assumptions. Every new agent gets behavioral monitoring and rescue capabilities automatically with zero configuration. The system starts learning the moment an agent runs its first execution. 

 

Why good outputs can hide bad behavior 

 

The system combines two independent methods to catch different kinds of problems.

Statistical modeling tracks the measurable dimensions of every execution: how many tools were called, which tools were used, and how long the run took. An agent that usually uses the Web Search tool three times and suddenly uses it twelve times gets flagged. An agent that always uses the Web Search tool and suddenly skips it also gets flagged. Both spikes and absences carry signal.

Structural sequence analysis looks at the ordering of steps, not just the counts. If an agent starts repeating the same action in a loop, calling tools in an order it has never used before, or skipping steps that always appeared in previous runs, those patterns get flagged. The sequence of actions tells a story that counts alone cannot.

These two methods combine into a single anomaly score. The goal isn't to prevent every deviation. It's to distinguish a meaningful behavioral shift from normal variation.

This is where the distinction between output quality and execution quality plays out in practice. We found agents that produced perfectly fine outputs but were taking wildly inefficient paths to get there: an agent that normally completes a task in 8 steps but starts consistently taking 20. Same output, very different execution behavior. Those bad patterns are usually early signals of a deeper problem, whether that's a prompt drift, a tool misconfiguration, or a model update that shifted behavior. Catching them early saves both quality and cost. 

 

Why stopping an agent isn’t the same as saving the run 

 

Detection alone is only half the battle. In an enterprise environment, halting a critical ABM or translation workflow at 2 AM is still a failure, even if it saves token budget.

This is why we built an automated companion recovery system specifically for Rescue mode.

When the behavioral monitor flags an anomaly, it doesn't immediately abort. It pauses the run and asks: can this be saved? If yes, it generates a targeted corrective nudge, for example, "You have searched three times. Do not search again. Proceed directly to generating the email template." The agent adjusts course and completes the task.

Managing autonomous agents is a lot like managing human teams: you don't fire a creative marketer the second they take a wrong step on a project. You give them a course correction.

And when rescue isn’t possible, circuit breakers step in as a hard ceiling to stop unrecoverable loops before they burn through token budgets. Halting a run 15 steps in, instead of letting it spiral to 200, isn't just a quality decision. At enterprise scale, that’s real financial protection.

As a Harness Engineering guide published by Agentway puts it: "A system is judged reliable not by how smoothly it speaks, but by how it restores order when execution goes wrong." 

 

Why no single approach is enough 

 

True agent reliability requires multiple approaches working together. Input/output guardrails ensure agents don't say anything harmful. Quality validation and evals ensure agents produce correct, grounded outputs. Behavioral monitoring and rescue ensure agents don't do anything abnormal while getting there.

Stopping a failing run is the minimum bar. A system that can decide when to intervene and have the intelligence to recover is resilient. That's the standard we should be building toward. 

Want to see more? See Optimizely, the AI platform for marketers in action.