Efficient Auditing of Adversarial AI Agent Behavior from Agent Traces
cs.CR
Submitted: 2026-10-05
Updated: 2026-10-05
Code: https://github.com/invariantlabs-ai/invariant
License: http://creativecommons.org/licenses/by/4.0/
The gist: AI agents powered by large language models (LLMs) can perform complex tasks but may harm the systems they operate in, either intentionally or unintentionally.
Terminology
Abstract
AI agents powered by large language models (LLMs) can perform complex tasks but may harm the systems they operate in, either intentionally or unintentionally. Existing agent monitoring approaches rely on rule-based guardrails or LLM-based trace auditing. However, rule-based guardrails can be bypassed through obfuscation and may miss harmful actions beyond their predefined rules, whereas applying an LLM to audit every action is costly. We present a two-stage agent trace auditing framework. The first stage uses single-event and trace-sequence rules to select pending actions for inspection; the second uses an LLM audit agent to examine each selected action in the context of the agent's preceding trace before execution. We jointly refine the gate rules and audit instructions using training data, allowing the framework to adapt to complex agent behaviors rather than relying solely on predefined rules. On the public benchmark OpenAgentSafety, our framework reduces the average number of LLM audits from 8.15 to 2.33 per run and token usage from 47.8k to 14.6k, with a detection rate of 72.8% compared with 81.5% when every action is audited. In two simulated multi-agent case studies, the framework flags all malicious traces while reducing audit token usage by more than 80%.
Sources
- A 2E: An End-to-End Agent Auditing Engine
- AgentTrace: A Structured Logging Framework for Agent System Observability
- From Agent Traces to Trust: A Survey of Evidence Tracing and Execution Provenance in LLM Agents
- Don't Trust Your Upstream: Exploiting LLM Multi-Agent System via Topology-Guided Adversarial Propagation
- AutoMonitor-Bench: Evaluating the Reliability of LLM-Based Misbehavior Monitor
- Detecting Safety Violations Across Many Agent Traces
- AgentSentinel: An End-to-End and Real-Time Security Defense Framework for Computer-Use Agents
- How does information access affect LLM monitors' ability to detect sabotage?
- Reliable Weak-to-Strong Monitoring of LLM Agents
- Hodoscope: Unsupervised Monitoring for AI Misbehaviors
- LLM-based event log analysis techniques: A survey
- KRONE: Scalable LLM-Augmented Log Anomaly Detection via Hierarchical Abstraction
- LLM-Enhanced Log Anomaly Detection: A Comprehensive Benchmark of Large Language Models for Automated System Diagnostics
- Audit-LLM: Multi-Agent Collaboration for Log-based Insider Threat Detection
- Large Language Models for Security Operations Centers: A Comprehensive Survey
- ShieldAgent: Shielding Agents via Verifiable Safety Policy Reasoning
- AGrail: A Lifelong Agent Guardrail with Effective and Adaptive Safety Detection
- Progent: Securing AI Agents with Privilege Control
- ExCyTIn-Bench: Evaluating LLM agents on Cyber Threat Investigation
- Cyber Defense Benchmark: Agentic Threat Hunting Evaluation for LLMs in SecOps
Related papers
- SoK: AI-Augmented Binary Reversing
- Relaxed Sender Anonymity for CBDC Interbank Settlement: A Zero-Knowledge Approach on Permissioned EVM
- Calibration-Family Overfit: Why Trusted Sabotage Monitors Don't Transfer Across Lineages
- Efficient Fuzzy PSI under One-Sided Assumptions
- Sealing the Audit-Runtime Gap for LLM Skills
- Token Composition: A Graph Based on EVM Logs