Graph based defense improves large language model agent security

GRAD: Graph-Structured Antibody Defense for LLM Agents

Cryptography and Security

Summary

Large language model agents can be tricked by hidden attacks spread over multiple steps, which many current defense methods miss because they only check one input at a time. The authors introduce GRAD, a way to connect all the pieces of an agent’s operations as a graph to detect these distributed attacks more reliably. GRAD also uses multiple specialized detectors that adapt over time without losing previous learning, improving accuracy on several benchmark tasks. This method runs quickly and can be added easily to existing models without slowing them down.

What this means in practice

  • For ai security teams: Detect and block attacks on AI agents that spread malicious input across multiple operations using graph-based risk evaluation.
  • For software developers: Integrate a fast, lightweight gate that identifies suspicious inputs during AI agent execution without impacting performance.

Authors

Tianqi Song, Jiawei Du, Xuemei Jia, Zheng Wang

Abstract

Memory poisoning and decomposition attacks distribute malicious evidence across the operations of large language model agents. Existing request-level defenses can miss such attacks because they assess individual inputs without connecting earlier information to later actions. Moreover, detectors must adapt as task contexts change, while updates to shared parameters can impair previously learned detection capabilities. To address these challenges, we propose GRAD, which combines graph-based evidence aggregation across operations with an extensible collection of detection experts. Its Semantic-Structural Understanding Module (SSUM) jointly encodes operation text, event attributes, and typed candidate relations in an execution graph to aggregate distributed attack evidence into a graph-level risk score. Its Continual Antibody Adaptation (CAA) adds experts on frozen encoder snapshots and routes inputs by observable graph signatures, acquiring and reusing detection capabilities as tasks arrive. Across Decomp, MCP, and MRT, GRAD achieves AUROCs of 97.19%, 77.59%, and 86.60%, respectively, outperforming Sequential Monitor and locally adapted Agent-Sentry and NeuroTaint. CAA improves final accuracy by 13.08 percentage points over Replay on the cross-dataset task stream. The gain remains 9.05 points with equal family/base-case weights within each task. Its compact drop-in gate performs local model inference in milliseconds without monitoring API calls.