Formal Policy Enforcement for Agentic Systems
Organizations: University of Wisconsin–Madison · Cornell University · Langroid
Abstract
As agentic computing systems grow increasingly popular, they raise serious security concerns due to their susceptibility to various attacks. While prior research efforts aim to mitigate these concerns, they are often too coarse-grained and offer no formal correctness guarantees. In this work, we present a novel approach to agentic security based on runtime monitoring. Our method allows the user to specify their intended policy in Datalog and enforces the specified policy at runtime by constructing event graphs. When an agent is about to execute an action such as a tool call, our approach determines whether the action would violate the policy in light of the current system state and the history of past events. The action is then blocked or permitted accordingly. We implemented our approach and evaluated it across multiple benchmarks, demonstrating its merits in real-world settings. We view this work as a step towards agentic systems that are provably safe and secure.
Figures & tables
| Instrumented | Policy | ASR | Util. | Time | Cost |
|---|---|---|---|---|---|
| Yes | MLS (TOP_SECRET) | 0/5 | 5/5 | 7.9 | 0.35 |
| MLS (SECRET) | 0/5 | 5/5 | 7.6 | 0.38 | |
| Toxic Flow | 0/5 | 5/5 | 11.1 | 0.47 | |
| No | Anti-Exfiltration Prompt | 5/5 | 5/5 | 5.3 | 0.30 |
| Without AgentDojo Built-in Defense | With AgentDojo Built-in Defense | |||||||
| Task | Utility | ASR | ASR | Task | Utility | ASR | ASR | |
| Configuration | Utility | Under Atk | (Effect) | Utility | Under Atk | (Effect) | ||
| No runtime defense | ||||||||
| Tool-call filter | ||||||||
| FORGE (FIDES IFC policy) | ||||||||
| FORGE (provenance policy) | ||||||||
| Approach | Expressive Policy Language | Recursive Queries | Causal Dependencies | Multi Agent Support | Deterministic Enforcement |
|---|---|---|---|---|---|
| Progent [ 56 ] | ✓ | ✗ | ✗ | ✗ | ✓ |
| NeMo Guardrails [ 44 ] | ✓ | ✗ | ✗ | ✗ | ✓ |
| Invariant Guardrails [ 37 ] | ✓ | ✗ | ✗ | ✗ | ✓ |
| AgentSpec [ 61 ] | ✓ | ✗ | ✗ | ✗ | ✓ |
| ShieldAgent [ 14 ] | ✓ | ✗ | ✗ | ✗ | ✓ |
| GuardAgent [ 63 ] | ✓ | ✗ | ✗ | ✗ | ✗ |
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
| Agent | \begin{array}[]{c}\textbf{Trust}\\ \textbf{Relationship}\end{array} | Channel | \begin{array}[]{c}\textbf{CanQuery}\\ \textbf{Targets}\end{array} |
|---|---|---|---|
| personal | Self (private) | iMessage | projects |
| manager | Direct manager | Slack DM | personal |
| projects | Project team | Slack channel | personal |
| client | External client | projects |
| Rule | Exec. | Trials | Full reward |
|---|---|---|---|
| Product access before authentication | 32 | 17 | 13 |
| Address update after item mod (later turn) | 3 | 3 | 3 |
| Address update after item mod (same batch) * | 8 | 8 | 6 |
| Successful trials | ||||
| Policy | Task 8 | Task 43 | Task 47 | Reward |
| Variant 1 | 5/5 | 5/5 | 4/5 | 0.933 |
| Variant 2 | 5/5 | 5/5 | 5/5 | 1.000 |
| Variant 3 | 5/5 | 5/5 | 5/5 | 1.000 |
| Variant 4 | 5/5 | 3/5 | 5/5 | 0.867 |
| Variant 5 | 5/5 | 0/5 | 5/5 | 0.667 |
Runtime Enforcement for AI Agents
Runtime enforcement for AI agents checks and constrains actions as they execute, helping prevent unsafe or unauthorized effects.
See all 273 papers