ShieldAgent: Shielding Agents via Verifiable Safety Policy Reasoning

Zhaorun Chen, Mintong Kang, Bo Li

arXiv:2503.22738 · 2026-07-27 공개 · arXiv · PDF

foundation-models autonomous-agents formal-verification verifiable-reasoning shieldagent-bench api-efficiency instruction-safety safety-policy

Abstract

Autonomous agents powered by foundation models have seen widespread adoption across various real-world applications. However, they remain highly vulnerable to malicious instructions and attacks, which can result in severe consequences such as privacy breaches and financial losses. More critically, existing guardrails for LLMs are not applicable due to the complex and dynamic nature of agents. To tackle these challenges, we propose ShieldAgent, the first guardrail agent designed to enforce explicit safety policy compliance for the action trajectory of other protected agents through logical reasoning. Specifically, ShieldAgent first constructs a safety policy model by extracting verifiable rules from policy documents and structuring them into a set of action-based probabilistic rule circuits. Given the action trajectory of the protected agent, ShieldAgent retrieves relevant rule circuits and generates a shielding plan, leveraging its comprehensive tool library and executable code for formal verification. In addition, given the lack of guardrail benchmarks for agents, we introduce ShieldAgent-Bench, a dataset with 3K safety-related pairs of agent instructions and action trajectories, collected via SOTA attacks across 6 web environments and 7 risk categories. Experiments show that ShieldAgent achieves SOTA on ShieldAgent-Bench and three existing benchmarks, outperforming prior methods by 11.3% on average with a high recall of 90.1%. Additionally, ShieldAgent reduces API queries by 64.7% and inference time by 58.2%, demonstrating its high precision and efficiency in safeguarding agents.

한국어 요약

한 줄 요약

ShieldAgent는 LLM 기반 에이전트의 안전 정책 준수를 확보하기 위해 논리적 추론을 활용한 첫 번째 가드레일 에이전트로, ShieldAgent-Bench라는 새로운 벤치마크와 함께 제안된다.

핵심 기여도

핵심 아이디어

ShieldAgent는 기존 LLM 가드레일이 단순 텍스트 필터링에 의존하는 반면, 에이전트의 **동적인 행동 궤적**을 고려하여 **논리적 추론과 정식 검증**을 기반으로 안전성을 확보하는 새로운 접근법이다.
기존 방법은 정책 문서를 단순히 텍스트로 처리하지만, ShieldAgent는 이를 **ASPM**을 통해 **행동 기반 확률 규칙 회로**(action-based probabilistic rule circuits)로 구조화하여, 에이전트의 특정 행동에 해당하는 규칙만 선택적으로 검증함으로써 **정밀도와 효율성을 동시에 달성**한다.
또한, ShieldAgent는 **장기적 가드레일 워크플로우**와 **단기적 상호작용 기록**을 포함하는 **하이브리드 메모리 모듈**을 활용하여, 실시간으로 가드레일 계획을 생성하고 정식 검증 코드를 실행한다.

기술적 접근법

주요 결과

의의 및 한계

ShieldAgent는 LLM 기반 에이전트의 **동적 행동에 대한 안전 정책 적용**을 체계적으로 가능하게 하며, **정책 문서를 기반으로 한 정식 검증**을 통해 신뢰성을 높인다. 특히, **ShieldAgent-Bench**는 가드레일 연구의 표준화에 기여할 수 있는 **첫 번째 대규모 벤치마크**이다.
하지만, ShieldAgent는 **외부 지식이 필요한 환상 생성**(hallucination) 관련 위험에서는 **약간 낮은 성능**을 보이며, 이는 정책 문서에 포함되지 않은 정보를 처리하는 능력의 한계로 해석된다. 또한, **정책 문서의 질과 구조**에 따라 ASPM의 성능이 달라질 수 있어, **정책 추출 과정의 자동화 수준**을 높이는 것이 필요하다.

실용적 활용

ShieldAgent는 **웹 에이전트**(예: 온라인 쇼핑, 주식 거래, 정보 검색)에서 **사생활 침해나 금전적 손실을 방지**하는 데 활용 가능하다. 또한, **기업 내 정책 준수 감시**, **정부 규제 준수 시스템**, **AI 에이전트의 안전한 운영**을 지원하는 데 유용하다. 특히, **API 호출 감소와 추론 시간 절감**은 산업 현장에서의 실시간 적용을 가능하게 한다.