SafeAgent: A Runtime Protection Architecture for Agentic Systems
Abstract
Large language model (LLM) agents are vulnerable to prompt-injection attacks that propagate through multi-step workflows, tool interactions, and persistent context, making input-output filtering alone insufficient for reliable protection. This paper presents SafeAgent, a runtime security architecture that treats agent safety as a stateful decision problem over evolving interaction trajectories. The proposed design separates execution governance from semantic risk reasoning through two coordinated components: a runtime controller that mediates actions around the agent loop and a context-aware decision core that operates over persistent session state. The core is formalized as a context-aware advanced machine intelligence and instantiated through operators for risk encoding, utility-cost evaluation, consequence modeling, policy arbitration, and state synchronization. Experiments on Agent Security Bench (ASB) and InjecAgent show that SafeAgent consistently improves robustness over baseline and text-level guardrail methods while maintaining competitive benign-task performance. Ablation studies further show that recovery confidence and policy weighting determine distinct safety-utility operating points.
Community
Official implementation and reproducibility resources:
• SafeAgent Core:
https://github.com/SafeAgent-Development/safeagent_core
• Archived Core release v0.2.0:
https://github.com/SafeAgent-Development/safeagent_core/releases/tag/v0.2.0
• Runtime Controller reference integration and coding-agent demonstration:
https://github.com/lhl4971/safeagent_coder
SafeAgent Core contains the stateful runtime decision pipeline, risk encoders,
policy arbitration, persistent risk state, and analysis utilities. The
safeagent_coder repository demonstrates one execution-side Controller
integration and provides the coding-agent application used in the study.
The revised artifact includes statistical-analysis and runtime latency
analysis utilities. Additional experimental artifacts will accompany the
revised paper.
Get this paper in your agent:
hf papers read 2604.17562 Don't have the latest CLI?
curl -LsSf https://hf.co/cli/install.sh | bash Models citing this paper 0
No model linking this paper
Datasets citing this paper 0
No dataset linking this paper
Spaces citing this paper 0
No Space linking this paper
Collections including this paper 0
No Collection including this paper