Manuscript Offprint

arXiv:2610.33753

Ring-0 by Default: Agents as Operating Systems (AaOS)

Xiang Li, Aichun Huang, Zuyao Xu, Fasheng Miao, Zheli Liu

Abstract

LLM agents now read and write files, start processes and sub-agents, fetch network content, load third-party extensions, and save and resume state, which are the responsibilities of an operating system. They gained these functions within about three years, but not the protections that operating systems built over five decades: whatever the model outputs, whether it follows the user, a tool result, or a downloaded skill, runs with the full authority of the host user, in effect at ring 0. Prior work builds an operating system for agents (OS4A); we argue that a deployed agent already is like an operating system (AaOS) and analyze it as one. Taking the mechanisms of standard OS textbooks as a checklist, we map 116 mechanisms in 19 subsystems to their agent counterparts, from product documentation, source code, and the literature, and label each as isomorphic, degraded (function present, protection dependent on the model), missing, mutated, or novel. Only 11 are isomorphic and 65 are missing, most of them protections: privilege separation, resource quotas, transactions, and tamper-proof audit. Existing defenses confine the whole agent or review its extensions and leave this interior unprotected, and by Anderson's reference-monitor criteria (non-bypassable, tamper-proof, verifiable), rules written in the prompt satisfy none.

We test the map with thirteen experiments on Claude Code, Codex CLI, and Gemini CLI, covering 25 mechanisms whose enforcement documentation cannot settle: 16 match the analysis, 7 gain a more precise description, and 2 change verdict. Access checks sit in individual tools, not in the process, so a file write that the file tool refuses goes through the shell. The agent's own records are trusted: all three CLIs load a forged transcript record as a user message on resume and accept a time returned by a tool. Control is weak: a task id names a wrapper rather than the process, sub-agents inherit their parent's permissions, and a model-based permission monitor receives text that the agent controls. We identify five problems for which no OS defense transfers and derive a prioritized list of open problems from the gaps of the map.

1 Introduction

A coding agent such as Claude Code, Codex CLI, or Gemini CLI [7, 49, 101] reads and writes files on the developer's machine, runs shell commands, and starts sub-agents that work in parallel [12]. It fetches web pages and calls remote services through tool servers [6], installs third-party skills and plugins [10, 99], keeps notes in a memory that outlives the session, and resumes a session from a checkpoint [8]. Each of these is a textbook responsibility of an operating system [13, 133]: file and process management, the network stack, dynamic loading of drivers and packages, persistent storage, and suspension and resumption. Agents gained all of them within about three years (Figure 2).

The resemblance is one of function, and it can be stated as three criteria (Section 3). An agent multiplexes the host's processes, files, network connections, and memory across the main task, sub-agents, and background jobs. It mediates every access to these resources through a fixed interface, the tool call, which works as a system-call boundary. And it keeps persistent state that shapes later sessions. A system that does all three holds the position of an operating system, and five widely used agents do all three (Table 1).

Our observations. An operating system draws its security from protection mechanisms built over five decades: a privilege boundary enforced in hardware [122]; isolated address spaces; a reference monitor that is non-bypassable, tamper-proof, and verifiable [4]; capabilities and access-control lists [37, 75, 118]; resource quotas [90]; transactional recovery [54, 93]; and an audit trail that the audited program cannot change [121]. The agent has almost none of these inside it. Its system prompt, the user's request, a tool's output, and the contents of a file all reach one model, which cannot tell them apart, and whatever the model outputs runs with the full authority of the host user. There is no ring 3 for untrusted data: by default, the agent runs at ring 0 (Figure 1). Approval prompts and host sandboxes narrow this authority at the agent's edge, but they add no second privilege level inside it.

Seen this way, several well-known agent attacks are classi-

Corresponding author: Xiang Li (lixiang(at)nankai.edu.cn).

functions with protections

Ring 0 by default: an agent is an OS without the protections

functions without protections

Figure

Figure 1: A classical OS (a) and an agent viewed as an OS (b), compared layer by layer. The OS isolates programs, separates them from a small kernel by a privilege boundary, and mediates every access through a reference monitor; the agent feeds all inputs into one model, checks only at the tool edge, and acts with the user's full authority. The core tiles are the 19 subsystems of our map, filled by their AaOS status in Table 5. The center column lists the experiments and findings behind each layer.

cal attacks on a mechanism that the agent leaves unprotected (Section 5). Indirect prompt injection [55] is control-flow hijacking by untrusted input, memory poisoning [26, 32] is tampering with a store that has no integrity protection, and token exhaustion [38, 86] is denial of service on a system with no rlimit. Five other problems have no OS counterpart, because the property that the OS defense needs is gone: the agent writes its own audit log, resume trusts what it loads, no clock is trusted, errors arrive as text, and one resource, tokens, is also money.

Previous works. Earlier work uses the operating-system metaphor in the opposite direction. OS-for-agents systems (OS4A), such as MemGPT [106], AIOS [89], and AOS [125], treat the agent as an application and build a new OS beneath it. Agent-security surveys [28, 126] organize the field by threat, and sandboxing [18, 151], the most common defense, confines the whole agent but adds no protection inside it. Two recent papers apply an OS lens to agent security [112, 161]; they map the components of an agent ecosystem to OS roles and transfer defenses, and the one with a case study evaluates four OpenClaw-style assistants and excludes coding agents. We take the position opposite to OS4A, agent as OS (AaOS): the agent deployed on developer machines today is itself an operating system. Instead of mapping agent components to OS roles, we start from the complete list of OS mechanisms and ask which of them the agent has (Section 2).

Our paper. We take the mechanisms of standard OS textbooks as a checklist, 116 mechanisms in 19 subsystems, and find the agent counterpart of each in product documentation, source code, and the agent literature of 2022–2026 (Section 4). Each mechanism receives one of five verdicts: isomorphic, degraded (the function exists, but its protection depends on the model or on a check that another path bypasses), missing, mutated, or novel. Anderson's reference-monitor criteria [4] separate isomorphic from degraded. Only 11 mechanisms are isomorphic, and 65 (56 %) are missing, most of them protections. We then place the attack and defense literature on the map: existing defenses concentrate on isolation and the supply chain, at the agent’s boundary (Section 5), and rules written in the prompt meet none of Anderson’s criteria that protects the system (Section 6).

Because each verdict states where a boundary is enforced, it can be tested. We run thirteen experiments on Claude Code, Codex CLI, and Gemini CLI that test 25 mechanisms, chosen where documentation cannot show whether a boundary is enforced by code or by prompt text (Section 7). Of these, 16 match the analysis, 7 gain a more precise description, and 2 change from missing to degraded. The experiments show that access checks sit in individual tools, so a file write that the file tool refuses goes through the shell; that all three CLIs load a forged transcript record as a user message on resume; that a task id names a wrapper, so a reported stop can leave the process running; that sub-agents inherit their parent's permissions; and that a model-based permission monitor receives text that the agent controls. Finally, we turn the gaps of the map into a prioritized list of open problems (Section 8). The model and its context are the agent's processor and are not mapped, and our experiments test whether a boundary holds, not how often an attack succeeds.

References (100)

Couldn't load all references. Reload the page to try again.