Introduction
The evolution of Large Language Models (LLMs) has led to the emergence of "computer-use" agents—autonomous systems capable of controlling a user's mouse, keyboard, and terminal to perform complex tasks. While models like Claude 3.5 Sonnet and OpenAI Operator offer unprecedented productivity, they also introduce significant security risks. These agents can inadvertently execute dangerous commands, fall victim to prompt injection, or be manipulated by malicious third-party tool outputs.
The Visibility Gap in Agent Security
Traditional security measures, such as input prompt filtering or isolated sandboxing, are often insufficient for computer-use agents. Prompt filters cannot predict the actual "side effects" of a tool's execution at the operating system level, and strict sandboxing can break the functionality of agents that require legitimate system access. This creates a "visibility gap": a disconnect between the high-level user intent (the chat) and the low-level system actions (the execution trace).
AgentSentinel: A Safe AI Agent Loop
To bridge this gap, AgentSentinel provides an end-to-end, real-time defense framework. It operates via a client-server architecture that intercepts sensitive system operations before they can cause harm.
Core Architecture
The framework is divided into three primary functional stages:
- Context-Aware Monitoring: The agent is instrumented to transmit its current task context—including chat history and tool metadata—to a dedicated monitoring server.
- System-Level Tracing & Enforcement: Utilizing eBPF (Extended Berkeley Packet Filter) and LSM (Linux Security Modules), AgentSentinel monitors 16 critical system probes. These probes cover process creation, file system modifications, and network activity. When a sensitive operation is detected, the framework immediately suspends the process.
- Adaptive Hybrid Auditing: A two-tier system determines the fate of the suspended process. A Rule-Based Auditor handles known patterns, while an LLM-Based Auditor performs a deep semantic analysis. It evaluates whether the low-level system trace aligns with the high-level user request.
To maintain real-time performance and avoid agent timeouts, AgentSentinel incorporates a Multi-Level Security Query Cache and a QPS Optimizer. These components ensure that redundant or safe operations are cleared quickly without requiring a full LLM audit every time.
Evaluating Security: The BadComputerUse Benchmark
To rigorously test AgentSentinel, the authors developed BadComputerUse, the first benchmark dedicated to computer-use security. It comprises 60 attack scenarios across seven categories, including backdoor attacks, hallucination exploitation, and malicious execution environments. Without defense, state-of-the-art LLMs showed a staggering 87% average Attack Success Rate (ASR) on this benchmark.
Key Results and Insights
AgentSentinel demonstrated a high degree of effectiveness and efficiency in empirical tests:
- Defense Success Rate (DSR): The framework achieved a 79.6% DSR, vastly outperforming existing baselines like Llama Guard.
- Minimal Utility Impact: The "Failed Task" rate was restricted to 4.2%, ensuring that security does not come at the cost of usability.
- Robustness against Adaptive Attacks: Even when attackers specifically attempted to bypass the defender, AgentSentinel maintained an 85% success rate.
A critical insight from this research is that LLMs, while prone to errors as agents, are remarkably effective as auditors. When provided with structured system traces, they can accurately identify discrepancies between intent and action. Furthermore, the framework's unidirectional trust model ensures that a compromised agent cannot disable its own monitoring, preventing "defender killing" attacks.
Limitations and Future Directions
While highly effective, AgentSentinel faces challenges with deep process tree monitoring and occasional over-sensitivity to administrative tasks (e.g., apt install). Future work will focus on expanding trace coverage and developing post-hoc log auditing tools to detect subtle, long-term threats that might evade real-time detection budgets.
Summary updated