AgentSpec: Customizable Runtime Enforcement for Safe and Reliable LLM Agents

要約

LLMS上に構築されたエージェントは、多様なドメイン全体にますます展開され、複雑な意思決定とタスクの実行を自動化します。
ただし、彼らの自治は、セキュリティの脆弱性、法的違反、意図しない有害な行動など、安全リスクをもたらします。
モデルベースのセーフガードや早期執行戦略などの既存の緩和方法は、堅牢性、解釈可能性、適応性が不足しています。
これらの課題に対処するために、LLMエージェントのランタイム制約を指定および実施するための軽量ドメイン固有の言語であるAgentsPecを提案します。
AgentSPECを使用すると、ユーザーはトリガー、述語、および施行メカニズムを組み込んだ構造化されたルールを定義し、事前定義された安全境界内でエージェントが動作するようにします。
コード実行、具体化されたエージェント、自律運転など、複数のドメインにエージェントピックを実装し、適応性と有効性を実証しています。
私たちの評価は、AgentSPECがコードエージェントのケースの90%以上で危険な実行を成功裏に防止し、具体化されたエージェントタスクのすべての危険なアクションを排除し、自律車両(AVS)による100%のコンプライアンスを施行することを示しています。
その強力な安全保証にもかかわらず、AgentsPecは数ミリ秒単位でオーバーヘッドを伴う計算的に軽量のままです。
解釈可能性、モジュール性、効率を組み合わせることにより、AgentsPecは、多様なアプリケーション全体でLLMエージェントの安全性を実施するための実用的でスケーラブルなソリューションを提供します。
また、LLMSを使用してルールの生成を自動化し、それらの有効性を評価します。
私たちの評価は、OpenAI O1によって生成されたルールが95.56%の精度を達成し、具体化されたエージェントの70.96%のリコールを達成し、リスクコードの87.26%を正常に識別し、AVSが8つのシナリオのうち5つで法律を破るのを防ぐことを示しています。

要約(オリジナル)

Agents built on LLMs are increasingly deployed across diverse domains, automating complex decision-making and task execution. However, their autonomy introduces safety risks, including security vulnerabilities, legal violations, and unintended harmful actions. Existing mitigation methods, such as model-based safeguards and early enforcement strategies, fall short in robustness, interpretability, and adaptability. To address these challenges, we propose AgentSpec, a lightweight domain-specific language for specifying and enforcing runtime constraints on LLM agents. With AgentSpec, users define structured rules that incorporate triggers, predicates, and enforcement mechanisms, ensuring agents operate within predefined safety boundaries. We implement AgentSpec across multiple domains, including code execution, embodied agents, and autonomous driving, demonstrating its adaptability and effectiveness. Our evaluation shows that AgentSpec successfully prevents unsafe executions in over 90% of code agent cases, eliminates all hazardous actions in embodied agent tasks, and enforces 100% compliance by autonomous vehicles (AVs). Despite its strong safety guarantees, AgentSpec remains computationally lightweight, with overheads in milliseconds. By combining interpretability, modularity, and efficiency, AgentSpec provides a practical and scalable solution for enforcing LLM agent safety across diverse applications. We also automate the generation of rules using LLMs and assess their effectiveness. Our evaluation shows that the rules generated by OpenAI o1 achieve a precision of 95.56% and recall of 70.96% for embodied agents, successfully identifying 87.26% of the risky code, and prevent AVs from breaking laws in 5 out of 8 scenarios.

arxiv情報

著者 Haoyu Wang,Christopher M. Poskitt,Jun Sun
発行日 2025-03-24 13:31:48+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.AI, cs.CL パーマリンク