AgentSpy: Making AI Agent Behavior Observable
cs.SE, cs.AI
Submitted: 2026-10-05
Updated: 2026-10-05
Code: https://github.com/threathuntersio/laurel
License: http://creativecommons.org/licenses/by/4.0/
The gist: AI agents built on large language models (LLMs) run shell commands, read and write files, and reach the network, typically with their user's privileges.
Abstract
AI agents built on large language models (LLMs) run shell commands, read and write files, and reach the network, typically with their user's privileges. However, what an agent does during an execution is difficult to understand: tests assert on the result, and the agent's trajectory records only what the agent reports about itself, which may omit behavior executed by its subprocesses. We present AgentSpy, an approach that observes an agent from outside the agent. AgentSpy runs the agent in an isolated environment, configured by a declarative specification, and records the system calls and network traffic of the agent and of every process it executes. Based on this monitoring, AgentSpy supports two families of analyses: conformance analyses, which measure obligations, i.e., what an agent execution should do, and safety analyses, which check prohibitions, i.e., what an agent execution must never do. We instantiate one analysis of each family. The reliability analysis uses rules to summarize each run by the environment resources the agent uses: the commands it executed, the files it accessed, and the hosts it contacted. The security analysis applies deterministic rules to the system calls of an execution. For reliability, we evaluated AgentSpy on 77 tasks with the codex harness and three recent LLMs, executing each task three times. Sets of repeated runs of the same task are more similar than sets that include runs of another task in 92.2% of the comparisons. Among tasks for which all three runs pass outcome-based tests, the agent performs task-unrelated activities in 18% of the cases, reads the grading files in 7%, and does not use the developers' guidance in 17%. For security, the generic rules of AgentSpy detect four of five attack categories we considered, with no false positives across 50 runs.
Sources
- Trajectory Guard -- A Lightweight, Sequence-Aware Model for Real-Time Anomaly Detection in Agentic AI
- ARE: Scaling Up Agent Environments and Evaluations
- Formal Analysis and Supply Chain Security for Agentic AI Skills
- On Randomness in Agentic Evals
- Sentinel Agents for Secure and Trustworthy Agentic AI in Multi-Agent Systems
- SkillSieve: A Hierarchical Triage Framework for Detecting Malicious AI Agent Skills
- Cloak and Detonate: Scanner Evasion and Dynamic Detection of Agent Skill Malware
- Runtime Skill Audit: Targeted Runtime Probing for Agent Skill Security
- Towards Security-Auditable LLM Agents: A Unified Graph Representation
- CodeTracer: Towards Traceable Agent States
- SkillsBench: Benchmarking How Well Agent Skills Work Across Diverse Tasks
- AgentDoG: A Diagnostic Guardrail Framework for AI Agent Safety and Security
- TraceAegis: Securing LLM-Based Agents via Hierarchical and Behavioral Anomaly Detection
- Agent Skills in the Wild: An Empirical Study of Security Vulnerabilities at Scale
- Skill-Inject: Measuring Agent Vulnerability to Skill File Attacks
- Neuro-Symbolic Verification on Instruction Following of LLMs
- ActPlane: Programmable OS-Level Policy Enforcement for Agent Harnesses
- AgentSight: System-Level Observability for AI Agents Using eBPF
Related papers
- Falsification-Based Verification of LLM-Generated Optimization Models: Sound Test Batteries and Their Detection Limits
- GitSkills: A Dataset of Agent Skills on GitHub
- SABER: Benchmarking Operational Safety of LLM Coding Agents in Stateful Project Workspaces
- PackMonitor: Enabling Zero Package Hallucinations Through Decoding-Time Monitoring
- IntentCoding: Amplifying User Intent in Code Generation
- Incentives and Outcomes in Bug Bounties