AgentPolicyForge: From Executable Environments to Policy Benchmarks and Adaptive Guards

Chao Shang, Wanyu Du, Yi Zhang, Sandesh Swamy
10/20/2026
cs.AIcs.CRcs.LG

No confident code implementation found for this paper.

Abstract

Customized agent deployments define policies over tools, resources, and execution conditions. Providing these policies in the task agent's prompt does not reliably prevent violations.

Show full abstract

Training a guard requires examples of tool calls that comply with or violate those policies. We introduce AgentPolicyForge, a framework that uses executable environments to construct policy benchmarks and iteratively train policy guards. With this framework, we construct PolicyGym, a dataset across ten policy families using 698 scenarios for training data generation and 254 separate held-out scenarios for human-reviewed test sets. Tool calls are executed and their outcomes recorded to help determine whether they comply with the policy. Every violating case uses a permitted tool, requiring checks of arguments, resources, and context rather than tool identity alone. The case construction process supports iterative guard training: an attacker generates requests using retrieved strategies, and the guard is fine-tuned on balanced, environment-verified examples. Training improves policy enforcement even with a fixed archive. Updating the archive further reduces in-domain attack success compared with keeping it fixed. We compare policy-aware task agent self-regulation with a trained policy guard. On PolicyGym, the final guard-based configuration achieves a 40-44% relative reduction in attack success rate and fewer benign rejections than policy prompting alone.

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{shang2026agentpolicyforge,
  title  = {AgentPolicyForge: From Executable Environments to Policy Benchmarks and Adaptive Guards},
  author = {Chao Shang and Wanyu Du and Yi Zhang and Sandesh Swamy},
  year   = {2026},
  eprint = {2610.28989},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2610.28989v1}
}

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.28989.svg)](https://codeofpaper.com/paper/2610.28989)

Discussion