Sapien: A Stateful Policy Engine for Autonomous AI Agents

Corinn Tiffany, Wen Zhang, Eugene Bagdasarian, Lillian Tsai
9/30/2026
cs.AIcs.CLcs.CR

No confident code implementation found for this paper.

Abstract

Contextual security defenses prevent AI agents from taking rogue actions by synthesizing a task-specific policy and enforcing it on the agent's tool calls. In multi-step tasks, however, which actions are valid often depends on what the agent has already done and learned.

Show full abstract

We present Sapien, a policy engine for enforcing stateful contextual policies. A Sapien policy specifies permitted tool-call sequences using a regular expression extended with stateful predicates, deferred policy generation, and scoped semantic checks. We show that Sapien stays within a few percent of an unconstrained agent's utility. Even if the agent is fully hijacked, Sapien's policies rule out 93-95% of attacks on AgentDojo and 62-85% on Toolathlon (twice as many as tool allowlists on long-horizon tasks).

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{tiffany2026sapien,
  title  = {Sapien: A Stateful Policy Engine for Autonomous AI Agents},
  author = {Corinn Tiffany and Wen Zhang and Eugene Bagdasarian and Lillian Tsai},
  year   = {2026},
  eprint = {2610.00797},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2610.00797v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2610.00797.svg)](https://codeofpaper.com/paper/2610.00797)

Discussion