← Back to Library

Policy-as-Prompt: Turning AI Governance Rules into Guardrails for AI Agents

Authors: Gauri Kholkar, Ratinder Ahuja

Published: 2025-09-28

arXiv ID: 2509.23994v2

Added to Library: 2025-12-08 18:01 UTC

📄 Abstract

As autonomous AI agents are used in regulated and safety-critical settings, organizations need effective ways to turn policy into enforceable controls. We introduce a regulatory machine learning framework that converts unstructured design artifacts (like PRDs, TDDs, and code) into verifiable runtime guardrails. Our Policy as Prompt method reads these documents and risk controls to build a source-linked policy tree. This tree is then compiled into lightweight, prompt-based classifiers for real-time runtime monitoring. The system is built to enforce least privilege and data minimization. For conformity assessment, it provides complete provenance, traceability, and audit logging, all integrated with a human-in-the-loop review process. Evaluations show our system reduces prompt-injection risk, blocks out-of-scope requests, and limits toxic outputs. It also generates auditable rationales aligned with AI governance frameworks. By treating policies as executable prompts (a policy-as-code for agents), this approach enables secure-by-design deployment, continuous compliance, and scalable AI safety and AI security assurance for regulatable ML.

🔍 Key Points

  • FocusAgent introduces an innovative method for observation pruning in web agents, utilizing a lightweight Large Language Model (LLM) retriever to selectively extract relevant lines from accessibility tree (AxTree) observations, thereby significantly reducing computational costs and improving efficiency in processing extensive web page data.
  • The proposed method allows for more effective reasoning by removing irrelevant context, which also decreases the risk of security vulnerabilities, such as prompt injection attacks, by filtering out potentially harmful content before processing.
  • Experimental results demonstrate that FocusAgent maintains performance levels comparable to traditional approaches while achieving over 50% reduction in observation size, indicating its practical applicability in real-world scenarios.
  • FocusAgent's capability to effectively mitigate the success rates of prompt-injection attacks shows its dual role in enhancing both operational performance and security, paving the way for safer web agent deployment.
  • The release of open-source code for FocusAgent provides a tool for further research and development in observation pruning techniques for web agents and enhances community engagement in improving agent performance and safety.

💡 Why This Paper Matters

This paper is significant as it addresses critical challenges in web agent development, specifically the need for efficient and secure processing of large amounts of contextual data. By introducing FocusAgent, it presents a novel pruning mechanism that not only improves performance but also bolsters security against emerging threats such as prompt injections. These dual benefits are crucial for advancing the robustness of AI agents in both research and real-world applications.

🎯 Why It's Interesting for AI Security Researchers

For AI security researchers, this paper is of particular interest as it tackles the pressing issue of security vulnerabilities in web agents, especially those arising from prompt injection attacks. The focus on integrating security measures within the agent's operational framework—rather than as an afterthought—demonstrates a proactive approach to building resilient AI systems. Additionally, the insights gained from the FocusAgent method could inspire further exploration of LLMs in enhancing the safety and reliability of AI applications across various domains.

📚 Read the Full Paper