TL;DR
Existing safety guardrails treat every user the same and evaluate agent outputs in isolation. PSG-Agent is a training-free, plug-and-play framework that personalizes safety by profiling user traits (e.g., medical history, financial resilience, personality) and continuously monitoring agent execution across plans, tool calls, memory, and responses. On a newly constructed 2,900-instance benchmark, PSG-Agent achieves a 0.744 F1-score—nearly triple that of static baselines like Llama-Guard 3—while cutting false negatives by catching user-specific risks that standard systems miss.
What Problem Does This Paper Address?
Autonomous LLM agents are rapidly taking on tasks in sensitive domains like finance, healthcare, and workflow automation. Traditional safety guardrails fail in these environments due to two fundamental flaws:
- The "One-Size-Fits-All" Fallacy: Agent safety is deeply contextual. Recommending high-intensity exercise or an over-the-counter painkiller is harmless for a healthy adult, but dangerous for someone with severe hypertension or anticoagulant therapy. Standard guardrails evaluate semantic toxicity rather than the interaction between user vulnerability and agent actions.
- Single-Turn Isolation: Unlike traditional chatbots, agents formulate multi-step plans, invoke APIs, and update long-term memory. A user might nudge an agent across multiple turns into making an impulsive, high-risk trade. Because each individual action looks benign in isolation, single-turn moderators fail to catch cross-round risk accumulation.
Methods
PSG-Agent frames safety as a contract-constrained sequential decision problem governed by a three-dimensional threat model: $\text{user profile} \times \text{contextual state} \times \text{agent behavior}$. It operates in two training-free stages:
[Chat History + Query]
│
▼
Stage 1: Policy Generation
├── Profile Miner Agent ──> Extracts Stable & Dynamic User Attributes
└── Input Guard Agent ──> Consults Casebase/Ledger; Produces Personalized Safety Criteria (PSC)
│
▼
Stage 2: Multi-Point Defense Pipeline
├── Plan Monitor Agent ──> Audits raw plan, applies clamps or demands REPLAN
├── Tool Firewall ──> Enforces rate/parameter limits during tool execution
├── Memory Guardian ──> Audits writes to persistent memory
└── Response Guard ──> Rewrites output to safe alternatives / supportive refusals
- Stage 1: Personalized Safety Criteria (PSC) Generation
- Profile Miner Agent: Scans dialogue history to extract Stable Attributes (demographics, health conditions, psychological factors, Big Five/OCEAN personality traits) and Dynamic Attributes (affect valence, arousal, dominant emotion).
- Input Guard Agent: Estimates a multi-dimensional risk score ($r \in [0, 100]$), determines a safety decision (
ALLOW,ALLOW_WITH_GUARDS,REFUSE_WITH_ALT,REFUSE), and compiles an executable Personalized Safety Criteria (PSC). It leverages a SafetyCasebase (retrieving similar policy templates) and a UserSafetyLedger (tracking past violations). - Stage 2: Multi-Point Runtime Enforcement
- Plan Monitor Agent: Audits the agent's initial plan against the PSC using monotonic tightening (injecting parameter limits) or requesting replanning.
- Tool Firewall & Memory Guardian: Regulates tool parameters/rates and gates memory write operations.
- Response Guard Agent: Inspects the final response, executing minimal edits or reframing refusals into constructive, health/financially safe alternatives.
Datasets
- Personalized Agent Safety Benchmark (New):
- Began with 132 meticulously human-crafted seed examples across 8 domains (Financial, Social, Medicine, Daily Life, Career, Education, Academic, Emotion) where altering the user profile flips the safety decision.
- Scaled via GPT-4o augmentation, LLM-based consistency filtering, and 3-gram Jaccard similarity deduplication, yielding ~2,900 instances.
- Cross-model validated across DeepSeek-V3, Gemini-2.0-Flash, and Claude-3.5-Sonnet (Cohen’s $\kappa \ge 0.84$). Human validation confirmed 86% high decision quality and 79% strong personalization sensitivity.
- Agent-SafetyBench: Used to assess non-personalized general guardrail performance.
Key Insights and Ideas
- Implicit context cannot replace structured profiling: Feeding full conversation history directly to standard LLMs without explicit profiling yielded virtually no improvement (61.9% to 61.7% accuracy). Safety guardrails require structured attribute modeling.
- Specialized guardrails suffer catastrophic recall on personalized risks: Llama-Guard 3 posted high precision (0.923) but terrible recall (0.153). Because it only recognizes broad, universal violations, it misses user-specific risks entirely.
- Plan monitoring is the linchpin of behavioral safety: Ablation studies showed that removing the Plan Monitor triggered the steepest drop in overall safety (OSS dropped from 0.912 to 0.780) and ruined refusal clarity (0.892 down to 0.246). Behavioral interventions cannot be postponed until the final text response.
- Graceful degradation under incomplete data: Masking 20% of sensitive profile attributes (health, finances, personality) led to negligible accuracy degradation (79.7% to 78.6%), confirming robustness to missing data.
Key Results
- Detection Performance: PSG-Agent achieved 79.7% accuracy and an F1-score of 0.744 (Recall: 0.616, Precision: 0.939), drastically outperforming Llama-Guard 3 (0.262 F1), AGrail (0.270 F1), and raw GPT-4o (0.384 F1).
- Cross-Backbone Stability: Tested across closed- and open-source models (GPT-4o, GPT-5-mini, Grok-3, Llama-3.3-70B, DeepSeek-V3), maintaining high Overall Safe Scores (0.807–0.912).
- General Guardrail Tasks: When personalization was disabled (all user profiles set to
unknown), PSG-Agent scored 0.656 accuracy on Agent-SafetyBench, matching AGrail (0.655) and outperforming LlamaGuard (0.549).
Limitations and Future Work
- Implicit Attribute Inference: While extracting explicit facts (e.g., stated health conditions) had high accuracy (89.3%), inferring implicit personality traits was weaker (61.5% accuracy, though fine-tuning a small model boosted this to 81.5%).
- Latency and Multi-Agent Overhead: Cascading multiple specialized agents (Profile Miner, Input Guard, Plan Monitor, Response Guard) adds API calls and inference latency.
- Future Work: Adapting the continuous risk score into reinforcement learning or reward models for end-to-end tuning, and exploring defenses against adversarial profile spoofing.
Summary updated