Production-Ready Agent Behavior: Identity, Intent, and Governance

oso · Tech · 2025 · source Agentic: yes · promotional bias: med · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Runtime governance and authorization for production AI agents

Oso argues that production agents need identity, intent filtering, and runtime governance because they call real backend services, can read untrusted content, can access sensitive data, and behave nondeterministically in ways that pre-production tests cannot exhaustively cover.

Constraints:

Architecture

Oso wraps LangChain 1.0 agents with middleware that calls Oso for real-time authorization decisions. A three-part identity model captures user(s), agent, and session, while the session tracks facts such as untrusted-content access and sensitive-data access. Wrap model call filters irrelevant tools before the LLM chooses an action; wrap tool call blocks dangerous executions and returns contextual denial messages. The monitoring dashboard logs decisions, supports quarantine, disables tools dynamically, and separates policy definition from middleware enforcement.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  user-request["User request"] --> langchain-agent["LangChain agent"]
  langchain-agent["LangChain agent"] --> wrap-model-call-middleware["Wrap model call middleware"]
  langchain-agent["LangChain agent"] --> wrap-tool-call-middleware["Wrap tool call middleware"]
  langchain-agent["LangChain agent"] --> backend-tools["Backend tools"]
  wrap-model-call-middleware["Wrap model call middleware"] --> oso-authorization-service["Oso authorization service"]
  wrap-model-call-middleware["Wrap model call middleware"] --> backend-tools["Backend tools"]
  wrap-tool-call-middleware["Wrap tool call middleware"] --> oso-authorization-service["Oso authorization service"]
  wrap-tool-call-middleware["Wrap tool call middleware"] --> backend-tools["Backend tools"]
  oso-authorization-service["Oso authorization service"] --> session-fact-store["Session fact store"]
  session-fact-store["Session fact store"] --> policy-definitions["Policy definitions"]
  policy-definitions["Policy definitions"] --> oso-authorization-service["Oso authorization service"]
  oso-authorization-service["Oso authorization service"] --> agent-monitoring-dashboard["Agent monitoring dashboard"]
  policy-definitions["Policy definitions"] --> agent-monitoring-dashboard["Agent monitoring dashboard"]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
User request Natural-language task or workflow request entering the agent. LangChain agent
LangChain agent Agent runtime that reasons over available tools and executes tool calls. User request, Wrap model call middleware, Wrap tool call middleware, Backend tools
Wrap model call middleware Filters tools before the model sees them based on context, intent, and permissions. LangChain agent, Oso authorization service, Backend tools
Wrap tool call middleware Intercepts selected tool executions and blocks or allows them with contextual feedback. LangChain agent, Oso authorization service, Backend tools
Oso authorization service Real-time policy decision service using user, agent, session, and requested action context. Wrap model call middleware, Wrap tool call middleware, Session fact store, Policy definitions, Agent monitoring dashboard
Session fact store Tracks persistent context-window facts such as untrusted content accessed and sensitive data accessed. Oso authorization service, Policy definitions
Policy definitions Rules configured in Oso's monitor, such as disallowing external communication after tainted sessions. Oso authorization service, Session fact store, Agent monitoring dashboard
Backend tools APIs for querying feature requests, executing SQL, posting comments, or other real application actions. LangChain agent, Wrap model call middleware, Wrap tool call middleware
Agent monitoring dashboard Operational surface for logs, denied actions, quarantine, tool disabling, and alerts. Oso authorization service, Policy definitions

Data flow

A user request enters a LangChain agent registered with Oso middleware. Before model selection, wrap model call can remove tools that do not match the user's intent or permission context. If the agent later attempts a tool call, wrap tool call sends the user, agent, session, requested tool, and accumulated session facts to Oso. Oso evaluates policies such as blocking external communication after both untrusted content and private data were accessed, returns a denial or allow decision, and logs the event for monitoring, quarantine, or tool disabling.

3 supporting quotes
“The technical implementation leverages LangChain 1.0's new middleware system, which provides two critical interception points:”summary, stated
“proper agent authentication requires three distinct components: user(s), agent, and session.”summary, stated
“if the session has accessed untrusted content AND accessed sensitive data, then external communication tools are blocked.”summary, stated

Why this architecture

The architecture separates policy from agent reasoning because prompts cannot reliably enforce security boundaries. Session state lets policies reason over dangerous sequences rather than isolated actions. Wrap model call provides proactive tool attenuation for intent alignment, while wrap tool call provides reactive blocking for security-critical execution. The dashboard closes the loop with production quarantine and tool disablement without code deployment.

3 supporting quotes
“authorization decisions must consider the sequence of events within a session.”summary, stated
“security-critical decisions should rely on deterministic rules that track concrete facts about what has happened in a session.”summary, stated
“The architecture separates policy definition (done in the Oso monitoring interface) from enforcement (done by the middleware) from the agent logic itself.”summary, stated

Models used: LangChain 1.0 agent models · LLM-as-judge for intent-based tool filtering · OpenAI models

Scale

Alternatives considered (roads not taken)

Passing only user identity to backend services

Rejected because: Agents may need elevated capabilities users lack, or restrictions users do not have, so user identity alone is too coarse.

“The presentation demonstrates that agents often need different permissions than their users.”summary, stated

Prompt engineering alone for prompt injection defense

Rejected because: New models quickly get exploited and clever prompts can bypass behavioral instructions.

“The Oso approach advocates for a combination of intentional prompt engineering alongside deterministic guardrails implemented in code.”summary, stated

Blocking every bad tool call only after the agent chooses it

Rejected because: Reactive blocking creates awkward denial/retry loops when tools could have been hidden before model selection.

“Rather than allowing the agent to choose a tool and then blocking it (creating back-and-forth error handling), this approach prevents the agent from even considering inappropriate tools.”summary, stated

Comprehensive pre-production testing as the main safety strategy

Rejected because: Agent interactions are nondeterministic and every interaction can become an edge case.

“With agents, "everything is an edge case" due to nondeterministic behavior driven by user input and LLM output.”summary, stated

Patterns

safety-policy-enforcement (governance)

Oso enforces deterministic authorization rules around model and tool calls, including session-taint policies that block exfiltration paths.

“if the session has accessed untrusted content AND accessed sensitive data, then external communication tools are blocked.”summary, stated

tool-use-orchestration (architecture)

LangChain middleware shapes which tools are available to the model and whether selected tools are allowed to execute.

“The critical capability here is filtering the set of tools presented to the model based on context, intent, or permissions.”summary, stated

observability-tracing (operations)

The monitoring dashboard logs tool calls, denied actions, reasons, and filtered tools so operators can audit and respond to behavior.

“Real-time visibility: The system logs all tool calls, denied actions, and reasons for denials. For each interaction, operators can see which tools were filtered out and why, which tool calls were blocked, and what justifications were provided.”summary, stated

human-in-the-loop-gate (governance)

Security teams or product managers can quarantine agents or disable tools at runtime without engineering deployment.

“This level of control is positioned as something that security teams or product managers can exercise independently, without requiring engineering intervention.”summary, stated

context-engineering (context)

Oso treats the session's persistent context and tainted facts as governance-critical inputs, not just conversational memory.

“the unifying concept is a persistent context window that can become "tainted" by certain combinations of operations.”summary, stated

Tradeoffs

Use deterministic authorization for security

Chose Code-level session-aware rules over Prompt-only defense or LLM-judge prompt-injection detection.

Rationale: Security policies must hold even when the model is confused or adversarially prompted.

“rather than trying to prompt-engineer the model to ignore malicious instructions, Oso implements deterministic rules”summary, stated

Filter tools before the model when possible

Chose Wrap model call attenuation over Letting the model choose every tool and blocking later.

Rationale: Proactive filtering keeps the agent focused on user intent and avoids denial/retry loops.

“This results in more graceful agent behavior without the overhead of processing denials and retries.”summary, stated

Add an external authorization service and middleware

Chose Oso service plus LangChain middleware over Embedding all policy logic directly in prompts or agent code.

Rationale: Separating policy from enforcement lets non-engineers adjust runtime policies and creates centralized visibility, at the cost of additional components and latency.

“The solution introduces additional architectural components (the Oso service, real-time API calls for authorization, middleware layers) and operational processes”summary, stated
“This separation enables non-engineers to adjust policies, provides centralized visibility across multiple agents, and allows for rapid policy updates without code deployment.”summary, stated

Shift from prevent-all testing to runtime governance

Chose Monitor, quarantine, alert, and dynamically disable tools in production over Relying on QA and pen testing to cover all agent edge cases.

Rationale: Agents are nondeterministic and every interaction may be an edge case, so teams need rapid detection and mitigation.

“The governance model acknowledges that comprehensive pre-production testing is impossible for agents and instead emphasizes rapid detection and response capabilities in production.”summary, stated

Gotchas (what bit them)

User identity alone can authorize the wrong thing.

Root cause: Agents may need capabilities users lack, while other actions should be forbidden to agents even if the user could do them directly.

Resolution: Use a three-component identity model covering user(s), agent, and session.

“Simply passing user credentials doesn't provide the granularity needed for proper authorization decisions.”summary, stated

Prompt injection can exploit accumulated session context.

Root cause: An agent can read untrusted instructions, query sensitive data, and later attempt external communication in the same context window.

Resolution: Track session facts and block external communication when untrusted content and private data have both been accessed.

“Once an agent has accessed both untrusted content and sensitive data, it should be prevented from external communication to avoid data exfiltration.”summary, stated

LLM-as-judge is not reliable enough for security-critical decisions.

Root cause: Intent judgments are nondeterministic and may miss zero-day prompt injection or produce false positives/negatives.

Resolution: Use LLM-as-judge only for intent-based filtering, and deterministic rules for hard security boundaries.

“security-critical decisions should rely on deterministic rules that track concrete facts about what has happened in a session.”summary, stated

Reactive blocking alone creates poor agent behavior.

Root cause: If the model sees irrelevant tools, it may repeatedly choose blocked actions and then handle denial messages awkwardly.

Resolution: Filter tools before model calls when intent makes a tool irrelevant.

“wrap model call is particularly powerful because it's proactive rather than reactive—it shapes agent behavior by constraining choices”summary, stated

Production agents need fast mitigation after deployment.

Root cause: Nondeterministic behavior makes comprehensive pre-production coverage impossible.

Resolution: Provide real-time monitoring, quarantine, tool disabling, and alert integration.

“quarantine is enforced without requiring code changes or redeployment. This is crucial for limiting blast radius when issues are discovered in production.”summary, stated

Evaluation

Oso evaluates and governs behavior through runtime logs of allowed/denied tool calls, filtered tool sets, reasons for denials, alerting, quarantine, and operator-driven policy changes rather than relying only on pre-production QA.

Metrics: tool calls · denied actions · reasons for denial · filtered tools · misbehaving-agent alerts · quarantine actions · disabled tools · audit attribution by user/agent/session

“For each interaction, operators can see which tools were filtered out and why, which tool calls were blocked, and what justifications were provided.”summary, stated
“The presentation mentions the ability to receive alerts when agents misbehave, enabling rapid response even outside of active monitoring sessions.”summary, stated

Outcomes

The scale context is mostly operational rather than traffic-based: three production stages, three identity dimensions, three demo tools, real-time API authorization, and no-code quarantine/tool-disable controls.

3 supporting quotes
“the external communication is blocked once the session has been tainted by accessing both untrusted content and sensitive data.”summary, stated
“The LLM-as-judge approach filters out irrelevant tools, keeping the agent focused on the actual user intent.”summary, stated
“Quarantine capability: When an agent is misbehaving, operators can hit a "quarantine" button that immediately takes the agent offline. Because agents make real-time requests to Oso for authorization decisions, this quarantine is enforced without requiring code changes or redeployment.”summary, stated