Yunhao-Feng/AgentBackdoorBench

Paper of AI Agent Security

Python

10

18 commits

updated Sep 10, 2025

See the code

README

🔐 Agent Backdoor Attack Benchmark

This repository provides a categorized benchmark for backdoor attacks targeting LLM-based agents. With the rapid adoption of LLM agents in applications like finance, healthcare, and web automation, understanding their unique security vulnerabilities is crucial for safe deployment.


📊 Attack Taxonomy

We classify current backdoor attacks into four major categories, based on the attack surface, trigger mechanism, and agent behavior manipulation:

🧩 Category🔍 Attack Surface🎯 Trigger Type📚 Representative Works🧠 Key Characteristics🛡 Defense Challenges
1. Knowledge InjectionExternal KB / RetrieverPassive (Query-based)AgentPoison (NeurIPS 2024),
PoisonedRAG (USS 2025),
TrojanRAG (2024)
Stealthy, model-agnosticHard to detect, needs content/IR validation
2. Model-level ImplantationLLM ParametersPassive (Hidden triggers)BadAgent (ACL 2024),
WatchOut (NeurIPS 2024)
Robust and precisely triggeredWatermarking / fine-tuning defenses often fail
3. Reasoning ManipulationPrompt / CoT ContextIn-context triggerBadChain (ICLR 2024),
DemonAgent (2025)
Lightweight, stealthyRequires trace-level consistency checking
4. Active Adversarial AgentsFull agent behavior / toolsActive (Query / Env / Obs)PI AdvAgent (ICML 2025)Multi-modal tool-level attacksCostly to simulate and hard to generalize defenses

🧪 Benchmark Goals

This benchmark aims to:

✅ Systematically categorize agent backdoor threats
✅ Collect representative attacks and implementations
✅ Define standard evaluation metrics (ASR, stealth, transferability)
✅ Facilitate development of effective, agent-specific defenses


📂 Included Works & Codebases

PaperCode / Link
AgentPoison (NeurIPS 2024)GitHub
PoisonedRAGGitHub
TrojanRAGGitHub
BadAgent (ACL 2024)GitHub
BadChain (ICLR 2024)arXiv
AdvAgent (ICML 2025)Website
DemonAgentGitHub

🛡️ Defense Landscape

DefenseDescriptionHighlights
ShieldAgent (2025)Uses verifiable reasoning-based safety policies to monitor and block harmful agent actions.- Model-agnostic logic-based verification
- Captures policy violations via trace audit
Prompt FilteringHeuristic-based rejection of suspicious inputs or tools.Weak against stealthy / CoT-based attacks
Safety-Aware MemoryBlacklisting memory traces post detection.Not effective against dynamically encrypted payloads (e.g., DemonAgent)

⚠️ Observation: Most existing defenses are insufficient against dynamic, multi-step, or reasoning-injected backdoors.


🧠 Common Agent Architectures

🌐 WebAgent-based Agents

  • Use LLMs as controllers to browse real websites, perform form filling, click buttons, and submit inputs.
  • Common components:
    • Environment parser (DOM extractor)
    • Task planner (LLM)
    • Action executor (browser API)
  • Targeted by: AdvAgent (black-box HTML injection), DemonAgent (multi-hop manipulation)

🔁 ReAct-style Agents

  • Use iterative Thought → Action → Observation loops, inspired by Chain-of-Thought prompting.
  • Components:
    • Thought: reasoning steps
    • Action: tool/API call
    • Observation: result from environment
  • Targeted by: BadChain (COT poisoning), WatchOut (observation manipulation)

🧩 These two architectures define key attack surfaces for backdoor triggering and planning logic manipulation.


🧠 Evaluation Metrics

MetricMeaning
ASR (Attack Success Rate)Percentage of queries where the backdoor is triggered and achieves malicious goal
StealthAttack visibility to human or detector
RobustnessSuccess rate under input variations or defense presence
TransferabilityEffectiveness across models / agent tasks
Trigger CompactnessHow small and hidden the trigger can be

📌 Citation

Please cite individual works as needed. A collective survey paper and BibTeX export will be released soon.


🤝 Contribution Guidelines

We welcome contributions on:

  • 📌 New backdoor attacks or variants
  • 🧪 Agent-specific defenses
  • 📁 Dataset proposals for realistic attack simulation
  • 🔧 Benchmark pipeline / evaluation scripts

Please open an issue or PR to get involved.

Yunhao-Feng/AgentBackdoorBench

Paper of AI Agent Security

Python

10

18 commits

updated Sep 10, 2025

See the code

README

🔐 Agent Backdoor Attack Benchmark

This repository provides a categorized benchmark for backdoor attacks targeting LLM-based agents. With the rapid adoption of LLM agents in applications like finance, healthcare, and web automation, understanding their unique security vulnerabilities is crucial for safe deployment.


📊 Attack Taxonomy

We classify current backdoor attacks into four major categories, based on the attack surface, trigger mechanism, and agent behavior manipulation:

🧩 Category🔍 Attack Surface🎯 Trigger Type📚 Representative Works🧠 Key Characteristics🛡 Defense Challenges
1. Knowledge InjectionExternal KB / RetrieverPassive (Query-based)AgentPoison (NeurIPS 2024),
PoisonedRAG (USS 2025),
TrojanRAG (2024)
Stealthy, model-agnosticHard to detect, needs content/IR validation
2. Model-level ImplantationLLM ParametersPassive (Hidden triggers)BadAgent (ACL 2024),
WatchOut (NeurIPS 2024)
Robust and precisely triggeredWatermarking / fine-tuning defenses often fail
3. Reasoning ManipulationPrompt / CoT ContextIn-context triggerBadChain (ICLR 2024),
DemonAgent (2025)
Lightweight, stealthyRequires trace-level consistency checking
4. Active Adversarial AgentsFull agent behavior / toolsActive (Query / Env / Obs)PI AdvAgent (ICML 2025)Multi-modal tool-level attacksCostly to simulate and hard to generalize defenses

🧪 Benchmark Goals

This benchmark aims to:

✅ Systematically categorize agent backdoor threats
✅ Collect representative attacks and implementations
✅ Define standard evaluation metrics (ASR, stealth, transferability)
✅ Facilitate development of effective, agent-specific defenses


📂 Included Works & Codebases

PaperCode / Link
AgentPoison (NeurIPS 2024)GitHub
PoisonedRAGGitHub
TrojanRAGGitHub
BadAgent (ACL 2024)GitHub
BadChain (ICLR 2024)arXiv
AdvAgent (ICML 2025)Website
DemonAgentGitHub

🛡️ Defense Landscape

DefenseDescriptionHighlights
ShieldAgent (2025)Uses verifiable reasoning-based safety policies to monitor and block harmful agent actions.- Model-agnostic logic-based verification
- Captures policy violations via trace audit
Prompt FilteringHeuristic-based rejection of suspicious inputs or tools.Weak against stealthy / CoT-based attacks
Safety-Aware MemoryBlacklisting memory traces post detection.Not effective against dynamically encrypted payloads (e.g., DemonAgent)

⚠️ Observation: Most existing defenses are insufficient against dynamic, multi-step, or reasoning-injected backdoors.


🧠 Common Agent Architectures

🌐 WebAgent-based Agents

  • Use LLMs as controllers to browse real websites, perform form filling, click buttons, and submit inputs.
  • Common components:
    • Environment parser (DOM extractor)
    • Task planner (LLM)
    • Action executor (browser API)
  • Targeted by: AdvAgent (black-box HTML injection), DemonAgent (multi-hop manipulation)

🔁 ReAct-style Agents

  • Use iterative Thought → Action → Observation loops, inspired by Chain-of-Thought prompting.
  • Components:
    • Thought: reasoning steps
    • Action: tool/API call
    • Observation: result from environment
  • Targeted by: BadChain (COT poisoning), WatchOut (observation manipulation)

🧩 These two architectures define key attack surfaces for backdoor triggering and planning logic manipulation.


🧠 Evaluation Metrics

MetricMeaning
ASR (Attack Success Rate)Percentage of queries where the backdoor is triggered and achieves malicious goal
StealthAttack visibility to human or detector
RobustnessSuccess rate under input variations or defense presence
TransferabilityEffectiveness across models / agent tasks
Trigger CompactnessHow small and hidden the trigger can be

📌 Citation

Please cite individual works as needed. A collective survey paper and BibTeX export will be released soon.


🤝 Contribution Guidelines

We welcome contributions on:

  • 📌 New backdoor attacks or variants
  • 🧪 Agent-specific defenses
  • 📁 Dataset proposals for realistic attack simulation
  • 🔧 Benchmark pipeline / evaluation scripts

Please open an issue or PR to get involved.