Sapien generates a task-specific policy from the trusted user prompt and tool documentation, then checks every agent tool call against that policy. Unlike static allowlists, its policies can restrict call order, bind later arguments to earlier results, defer permissions until designated data is fetched, and apply scoped semantic checks.
Across four models, Sapien remained within a few percent of an unconstrained agent's task success rate. Under the assumption of a fully hijacked agent, its policies ruled out 93-95% of attacks on AgentDojo and 62-85% on Toolathlon, with twice the defense rate of tool allowlists on the latter's long-horizon tasks.