@Scale
Production agent misbehavior stems from a controls deficit rather than flawed prompts, making deterministic in-loop steering and out-of-loop policy engines necessary to stop unintended executions.
AI-assisted summary of Bridging the Intent Gap in Agentic Systems | Anoop Deoras from AWS (Live) — original source. Check the original for full context.
Source published:
Key ideas
- Production agent misbehavior stems fundamentally from a controls problem rather than a prompting issue, meaning natural language system prompts fail to enforce runtime invariants. (0:00)
- AWS structures agent governance across two axes: control location (in-loop vs. out-of-loop) and corrective action (guiding/nudging with retries vs. hard deterministic blocking). (3:45)
- In-loop steering hooks inspect execution ledgers to enforce deterministic sequencing rules in standard Python code, enabling local unit testing of agent constraints. (6:30)
- Hard authorization and security boundaries require external policy engines like Cedar at the gateway to prevent adversarial users from negotiating around in-loop reasoning defenses. (10:00)
Detailed notes
## Background Published on YouTube by @Scale on June 23, 2026, this presentation features Anoop Deoras, Director of AWS Agentic AI, delivering a talk titled "Bridging the Intent Gap in Agentic Systems." The session explores why autonomous AI agents fail when moving from local development to production, presenting architectural strategies to enforce reliable agent behavior.
## TL;DR Anoop Deoras argues that production agent misbehavior is fundamentally an architectural controls issue rather than a prompting problem. He breaks down the disconnect into two challenges: the operator specification gap between builder intent and execution, and the user understanding gap caused by ambiguous natural language. To resolve these issues, Deoras presents a two-axis control framework combining in-loop steering hooks that inspect execution ledgers to nudge the agent with out-of-loop policy engines like Cedar that deterministically block unauthorized actions. He concludes that creating trustworthy agentic systems requires moving away from the "prompting treadmill" toward a layered defense calibrated by reversibility, blast radius, and explicit user-in-the-loop validation.
## Atmosphere & style The presentation carries a crisp, pragmatic tone tailored directly to the lived frustrations of AI practitioners and systems engineers. Deoras speaks with calm, authoritative clarity from the podium, puncturing generative AI hype by acknowledging the exhausting reality of prompt engineering whack-a-mole. The delivery feels methodically structured and reassuringly grounded, replacing probabilistic uncertainty with disciplined software engineering patterns and structured architectural diagrams.
## Bulletin - [00:00](https://www.youtube.com/watch?v=Vvhe5qG8IpQ&t=0s) Production agent misbehavior stems fundamentally from a controls problem rather than a prompting issue, meaning natural language system prompts fail to enforce runtime invariants. - [03:45](https://www.youtube.com/watch?v=Vvhe5qG8IpQ&t=225s) AWS structures agent governance across two axes: control location (in-loop vs. out-of-loop) and corrective action (guiding/nudging with retries vs. hard deterministic blocking). - [06:30](https://www.youtube.com/watch?v=Vvhe5qG8IpQ&t=390s) In-loop steering hooks inspect execution ledgers to enforce deterministic sequencing rules in standard Python code, enabling local unit testing of agent constraints. - [10:00](https://www.youtube.com/watch?v=Vvhe5qG8IpQ&t=600s) Hard authorization and security boundaries require external policy engines like Cedar at the gateway to prevent adversarial users from negotiating around in-loop reasoning defenses.
## Key takeaways - [00:00](https://www.youtube.com/watch?v=Vvhe5qG8IpQ&t=0s) Agent failures in production represent an intent gap that cannot be solved by prompt engineering alone; it is fundamentally a systems controls problem. - [01:04](https://www.youtube.com/watch?v=Vvhe5qG8IpQ&t=64s) The intent gap splits into two distinct challenges: the specification gap (builder intent vs. execution) and the user understanding gap (what the user said vs. what they meant). - [01:04](https://www.youtube.com/watch?v=Vvhe5qG8IpQ&t=64s) Codifying business rules purely in system prompts fails because natural language instructions cannot guarantee runtime execution logic or prerequisite tool verification. - [03:45](https://www.youtube.com/watch?v=Vvhe5qG8IpQ&t=225s) Agent behavioral controls map along two main axes: whether the control is inside or outside the execution loop, and whether the response is to nudge or hard block. - [03:45](https://www.youtube.com/watch?v=Vvhe5qG8IpQ&t=225s) Prompts and standard operating procedures (SOPs) are static build-time levers, whereas steering hooks and policy engines operate dynamically at runtime. - [06:30](https://www.youtube.com/watch?v=Vvhe5qG8IpQ&t=390s) In-loop steering hooks intercept execution before tool calls and after response generation to evaluate state transitions deterministically. - [06:30](https://www.youtube.com/watch?v=Vvhe5qG8IpQ&t=390s) Execution ledgers track all prior tool calls and I/O payloads, allowing deterministic Python handlers to verify preconditions and inject targeted corrective nudges. - [06:30](https://www.youtube.com/watch?v=Vvhe5qG8IpQ&t=390s) In-loop steering introduces hot-path latency and token overhead, while subjective constraints like tone require probabilistic LLM-as-a-judge evaluators. - [10:00](https://www.youtube.com/watch?v=Vvhe5qG8IpQ&t=600s) Security enforcement and access boundaries must sit outside the agent's reasoning loop because any logic inside the loop can be debated, negotiated, and bypassed by users. - [10:00](https://www.youtube.com/watch?v=Vvhe5qG8IpQ&t=600s) High-level natural language builder intent can be compiled into deterministic authorization policies using Cedar, structuring rules into principals, actions, resources, and constraints. - [12:35](https://www.youtube.com/watch?v=Vvhe5qG8IpQ&t=755s) The choice between guiding (nudging) and blocking depends on three critical factors: action reversibility, adversarial threat level, and blast radius. - [12:35](https://www.youtube.com/watch?v=Vvhe5qG8IpQ&t=755s) A layered architecture routes constraints dynamically: policy engines block hard security risks, while steering handlers guide tool sequencing and parameter corrections. - [16:09](https://www.youtube.com/watch?v=Vvhe5qG8IpQ&t=969s) The user understanding gap cannot be fully eliminated by technology, requiring interaction patterns like plan reflection, proactive fork clarification, and explicit confirmation for high-stakes actions. - [16:09](https://www.youtube.com/watch?v=Vvhe5qG8IpQ&t=969s) Hyper-personalization across interaction sessions helps bridge human ambiguity by incrementally retaining user preferences over time.
## Detailed walkthrough ### [00:00](https://www.youtube.com/watch?v=Vvhe5qG8IpQ&t=0s) The Production Intent Gap: A Controls Problem
Opening his presentation at the @Scale podium, Anoop Deoras reflects on the inspiring history of talks at the conference, highlighting a session earlier that morning by Boris on coding agents. Addressing the audience of practitioners and AI builders, he touches upon a shared, frustratingly common experience: an engineer designs an agent locally on a laptop, thoroughly tests its behavior, deploys it to production, and suddenly watches it execute actions that were never intended or planned.
The central mission of the talk is to dissect why this divergence occurs and lay out the architectural tools required to solve it. Deoras emphasizes a foundational premise that challenges conventional agent engineering wisdom: this breakdown is fundamentally not a prompting problem, but a controls problem.
```mermaid flowchart TD accTitle: The Intent Gap in Agent Deployment accDescr: Diagram showing the breakdown between local testing and production deployment where an intent gap emerges. subgraph Local["Local Development"] A["Agent Built on Laptop"] --> B["Local Behavior Testing"] B --> C["Deployment to Production"] end subgraph Prod["Production Reality"] C --> D["Unplanned Actions & Misbehavior"] D --> E["The Intent Gap: Controls vs. Prompting Issue"] end ```
[01:04](https://www.youtube.com/watch?v=Vvhe5qG8IpQ&t=64s) The Library Agent Failure: Specification vs. Understanding Gaps
To illustrate this failure mode concretely, Deoras walks through a case study of building a library management agent. The agent is designed to manage user profiles, understand preferences, and issue reminders when books are due. The builder establishes a critical business rule: *if a book has been recalled, it must not be renewed*. Under standard development practices, the builder embeds this constraint as a natural language instruction directly into the agent's system prompt. Local testing appears successful, but once deployed to production, the agent routinely renews recalled books anyway.
The breakdown occurs because a rule codified merely in natural language does not guarantee execution logic; the agent never invoked a tool to verify the book's status prior to issuing the renewal. This disconnect highlights what Deoras clarifies are actually two distinct intent gaps:
1. **The Operator Gap (Specification Gap):** The distance between what the agent builder intends for the agent to do and what the agent actually executes in production. 2. **The Understanding Gap (User Understanding Gap):** The distance between what the human user explicitly says and what they actually mean.
While the user understanding gap is significantly more challenging to solve, Deoras focuses the core of his talk on systematically closing the specification gap through deterministic controls, while later addressing mitigation strategies for user ambiguity.
- **Failure Cause:** Natural language system prompts fail to force runtime tool validation (e.g., executing a status check before taking a mutating action). - **Primary Focus:** Closing the specification gap using deterministic, unit-testable runtime controls rather than relying purely on probabilistic prompt adherence.
[03:45](https://www.youtube.com/watch?v=Vvhe5qG8IpQ&t=225s) The Spectrum of Agent Behavior: Two Key Axes of Control
Guiding agent behavior at scale spans an entire spectrum of mechanisms, ranging from natural language prompts, standard operating procedures (SOPs), and steering hooks, to rigid workflows and external policy engines. Deoras collapses these various levers onto two defining structural axes:
1. **Location of Control:** Does the control mechanism live *inside* the agent execution loop, or does it sit *outside* the loop? 2. **Action on Misbehavior:** Upon detecting an impending misbehavior, does the system *course-correct and nudge* the model to give it another opportunity to do the right thing, or does it issue a *hard block*?
```mermaid flowchart LR accTitle: Two Axes of Agent Behavioral Control accDescr: Two by two grid comparing inside versus outside loop controls against nudging versus blocking actions. subgraph Inside["Inside Agent Loop"] A["Steering Hooks<br/>(Nudge / Retry / Guide)"] end subgraph Outside["Outside Agent Loop"] B["External Policy Engine<br/>(Hard Block / No Retry)"] end subgraph BuildTime["Build-Time Levers (Excluded)"] C["System Prompts"] D["Standard Operating Procedures (SOPs)"] end ```
Deoras distinguishes runtime controls from build-time configurations. Prompts and SOPs are build-time artifacts that define intended behavior upfront, whereas runtime governance requires active mechanisms: in-loop steering and out-of-loop external policies. In-loop steering operates via guidance and retries, giving the model a chance to recover upon misbehavior. Conversely, external policy engines sitting outside the loop offer no negotiation or retry mechanism; they enforce strict, non-negotiable boundaries and block non-compliant actions entirely.
| Control Dimension | In-Loop Steering | Out-of-Loop Policy Engine | |:--- |:--- |:--- | | **Control Location** | Inside the agent execution loop | Outside the agent loop (e.g., at the API gateway) | | **Corrective Action** | Nudge, guide, and retry | Strict hard block (zero negotiation) | | **Lifecycle Phase** | Runtime execution | Runtime execution | | **Primary Philosophy** | "Guide" the model to recover | "Enforce" non-negotiable organizational rules |
[06:30](https://www.youtube.com/watch?v=Vvhe5qG8IpQ&t=390s) Implementing In-Loop Steering Hooks
Diving into concrete implementation, Deoras details how runtime steering hooks operate within the execution cycle. In their architecture, steering hooks trigger at two critical junctures: directly before a tool invocation, and directly after the model generates a response.
Returning to the library agent bug—where recalled books were being renewed without a status check—Deoras contrasts traditional prompt patching with steering hooks. In a naive setup, an engineer attempts to fix the bug by updating the system prompt with emphatic phrasing (such as adding instructions in ALL CAPS, "hoping that your agent is going to listen to you"). In contrast, a pre-tool steering hook executes a deterministic handler that inspects the complete execution ledger. This ledger contains every tool executed up to that point, alongside all inputs and outputs.
```mermaid flowchart TD accTitle: Steering Hook Execution Flow accDescr: Workflow showing a steering hook inspecting the ledger before a tool call and nudging the agent if prerequisites are missing. A["Model Proposes Tool Call: RenewBook"] --> B{"Pre-Tool Steering Hook:<br/>Inspect Execution Ledger"} B -->|"getStatus() in Ledger"| C["Allow Tool Execution"] B -->|"getStatus() NOT in Ledger"| D["Inject Steering Nudge:<br/>'Check book status first'"] D --> E["Model Re-evaluates & Executes getStatus()"] ```
When the model attempts to invoke `RenewBook`, the steering handler checks whether `getStatus` exists in the execution history: - If `getStatus` has not been called, the handler intercepts the call and injects a targeted nudge guiding the model to check the book's status before proceeding. - The defining philosophy of this mechanism is captured by the verb **"guide"**, giving the model an opportunity to self-correct dynamically.
Deoras acknowledges that steering is not without trade-offs. Injecting corrective loops introduces additional tokens and latency directly onto the production hot path. Furthermore, non-codifiable requirements (such as adjusting tone or subjective formatting) rely on LLM-as-a-judge evaluators, which cannot provide 100% deterministic guarantees. However, for codifiable rules, steering handlers are written as standard, deterministic Python code. This allows engineers to unit-test agent constraints locally with absolute certainty that the rules will hold identically in production without surprises.
- **Hook Interception Points:** Pre-tool call (inspecting parameters and prerequisite tool calls) and post-response generation. - **Ledger Inspection:** Handlers inspect historical tool traces and input/output payloads to evaluate state transitions deterministically. - **Trade-offs:** Introduces inference latency and token overhead on the hot path; subjective constraints require heuristic LLM judges, whereas logical constraints benefit from deterministic unit testing.
[10:00](https://www.youtube.com/watch?v=Vvhe5qG8IpQ&t=600s) Out-of-Loop Policy Enforcement and Cedar
To execute a tool call safely, an agent request must pass through an external gateway. Unlike soft steering mechanisms, the gateway acts deterministically: it either allows the execution or denies it outright. There is no conversational feedback loop, no negotiation, and no retry granted to the model. While developers might question why an external, hard blocker is necessary when elegant in-loop reasoning logic exists, the rationale comes down to security boundaries. Because in-loop steering operates entirely through the model's reasoning loop, anything within that loop can inherently be reasoned with. When enforcement logic is placed inside a conversational layer where it can be debated, an adversarial user will inevitably debate and persuade it. For critical security boundaries and authorization checks, having an unyielding component outside the reasoning loop is non-negotiable.
```mermaid flowchart TD accTitle: Agent Control Boundaries Architecture accDescr: Diagram contrasting out-of-loop deterministic policy enforcement with in-loop reasoning and steering.
subgraph ExternalBoundary["Deterministic Gateway (Out-of-Loop)"] GW["Security Gateway"] Cedar["Cedar Policy Engine\n(Allow / Deny)"] GW --> Cedar end
subgraph AgentLoop["Agentic Reasoning Loop (In-Loop)"] LLM["Agent / LLM"] Handler["Steering Handler"] Ledger["Execution Ledger"] LLM <--> Handler Handler <--> Ledger end
TargetTool["External Tool / Action"]
LLM -->|"Tool Request"| GW Cedar -->|"Allow"| TargetTool Cedar -.->|"Deny (No Feedback)"| LLM ```
To translate high-level operator intent into deterministic, verifiable enforcement, systems require structured authorization languages. At AWS, this is implemented using Cedar, an open-source authorization policy language, although other policy engines can serve the same purpose. The core challenge lies in mapping an operator's intent—such as requiring that an agent only schedule appointment slots between 9:00 AM and 9:00 PM—into an unambiguous, mathematically verifiable policy. Although natural language is inherently noisy and ambiguous, using it as an authoring interface works here because this is a one-time setup specifically designed for the agent builder persona. Expressing the initial rule in natural language keeps the authoring process approachable; the system then compiles that natural language into Cedar's formal primitives:
- **Principals**: The actors initiating the operation. - **Actions**: The specific tool or operational call being requested. - **Resources**: The targeted entities or slots being modified. - **Constraints**: Logical guards such as `when` clauses that enforce explicit conditions (e.g., temporal windows).
Because compiled Cedar policies are deterministic, builders can inspect and verify the exact constraints to guarantee their intent was preserved before deploying the policy into production.
---
[12:35](https://www.youtube.com/watch?v=Vvhe5qG8IpQ&t=755s) Guiding vs. Blocking: The Dilemma of Verbs and Layered Controls
Enforcing agent constraints involves choosing between two very different operational verbs: guiding or blocking. Applying the wrong verb constitutes a major failure mode in production agent design. If a system blocks an agent for a trivial, reversible formatting slip, it terminates and wastes an entire multi-step reasoning run. Conversely, if a system merely attempts to gently guide an agent during an irreversible delete operation or a financial transaction, it risks committing a catastrophic, permanent mistake. Selecting the correct verb depends on three key criteria: how reversible the target action is, how adversarial the operational environment is, and how large the potential blast radius could be.
Because modern enterprise agent workflows are intricate and multi-staged, developers do not need to choose exclusively between guiding or blocking. Instead, systems can implement a layered defense that routes constraints dynamically depending on the scenario:
| Constraint Category | Mechanism | Enforcement Mode | Rationale & Context | |:--- |:--- |:--- |:--- | | **Hard Security & Authorization** | Policy Engine (Cedar) | **Block** | Hard boundaries; cannot be left open to model negotiation or prompt injection. | | **Deterministic Parameter Checks** | Gateway or Steering | **Block or Guide** | Chosen based on blast radius: block for high-risk inputs, steer for low-risk corrections. | | **Tool Ordering & Sequencing** | Steering Handler | **Guide** | The handler provides ledger state context so the agent can course-correct if it calls tools out of sequence. | | **Tone, Formatting & Judgment** | In-Loop LLM-as-a-Judge | **Guide** | Highly subjective; cannot be verified deterministically, offering heuristic guidance rather than 100% guarantees. |
---
[16:09](https://www.youtube.com/watch?v=Vvhe5qG8IpQ&t=969s) Closing the User Intent Gap and Building Trustworthy Agents
While the operator specification gap can be bridged with formal policies and structured steering, the user intent gap—the understanding distance between what an end user literally says and what they actually mean—remains inherently harder to solve. Because human language is intrinsically incomplete and ambiguous, this gap cannot be eliminated entirely through technology alone. Instead, production systems must adopt operational best practices to manage it:
- **Reading the plan back**: Having the agent reflect its interpretation and execution plan back to the user for explicit confirmation before beginning execution. - **Requiring confirmation for high-stakes actions**: Pausing to solicit explicit approval whenever the agent is about to execute a costly, high-blast-radius, or irreversible action. - **Clarifying at forks**: Forcing the agent to proactively query the user for clarification whenever it hits ambiguity or branching decision points rather than guessing. - **Hyper-personalization**: Incrementally capturing implicit and explicit user preferences across sessions so the agent understands recurring habits without needing repeated elicitation.
Reliability and predictability in agentic systems cannot be achieved by extending prompt lengths or engaging in endless "whack-a-mole on a prompting treadmill." Prompt engineering alone will not solve alignment; robust agent architectures require a structured, layered control strategy. Builders must carefully choose their enforcement verbs based on reversibility, adversarial threat, and blast radius, while remaining clear-eyed and honest about how to manage the user understanding gaps that cannot be completely closed. By mastering when to steer an agent within its reasoning loop and when to block it with hard external policies, teams can transition agentic AI from merely "impressive" experiments into predictable, trustworthy engines of enterprise productivity.
## Notable quotes > [00:00](https://www.youtube.com/watch?v=Vvhe5qG8IpQ&t=0s) this breakdown is fundamentally not a prompting problem, but a controls problem. — Anoop Deoras
> [01:04](https://www.youtube.com/watch?v=Vvhe5qG8IpQ&t=64s) if a book has been recalled, it must not be renewed — Anoop Deoras
> [06:30](https://www.youtube.com/watch?v=Vvhe5qG8IpQ&t=390s) hoping that your agent is going to listen to you — Anoop Deoras
> [06:30](https://www.youtube.com/watch?v=Vvhe5qG8IpQ&t=390s) guide — Anoop Deoras
> [10:00](https://www.youtube.com/watch?v=Vvhe5qG8IpQ&t=600s) Because in-loop steering operates entirely through the model's reasoning loop, anything within that loop can inherently be reasoned with. When enforcement logic is placed inside a conversational layer where it can be debated, an adversarial user will inevitably debate and persuade it. — Anoop Deoras
> [16:09](https://www.youtube.com/watch?v=Vvhe5qG8IpQ&t=969s) whack-a-mole on a prompting treadmill — Anoop Deoras
> [16:09](https://www.youtube.com/watch?v=Vvhe5qG8IpQ&t=969s) Reading the plan back — Anoop Deoras
> [16:09](https://www.youtube.com/watch?v=Vvhe5qG8IpQ&t=969s) Clarifying at forks — Anoop Deoras
## Mentioned Anoop Deoras, AWS, @Scale, Boris, Cedar, Python
## Video description Join the Director of AWS Agentic AI, Anoop Deoras, for his presentation of "Bridging the Intent Gap in Agentic Systems".
Want to learn more about the @Scale conferences? Visit our website: atscaleconference.com
[Source](https://www.youtube.com/watch?v=Vvhe5qG8IpQ)