Apply to my task
arXiv:2610.33753 ★ 81 Oct 24, 2026

Agents as Operating Systems (AaOS): rules in an agent's prompt are a request, not a safeguard

Key result

The line "don't touch .env" in CLAUDE.md protects nothing. The authors compared coding agents (Claude Code, Codex CLI, Gemini CLI) against 116 mechanisms from operating system (OS) textbooks. Only 11 carry over fully, and 65 are missing, mostly protections. The AaOS method lets you run your agent's rules through an audit and see which ones actually hold and which rest on an honor system. The trick: a rule is reliable only if it can't be bypassed, can't be tampered with and can be verified. Rules in prompt text fail all three. The model receives the owner's order and text from someone else's page as one mush of tokens. Everything it outputs runs with the user's full permissions.

01

TL;DR

AaOS looks at a coding agent (Claude Code, Codex CLI, Gemini CLI) as an operating system. The authors took OS textbooks, listed 116 protection and operational mechanisms, and checked which of them an agent has. Nearly all the functions are there: files, processes, network, subagents, extensions, memory, session resume. But there are almost no protections inside the agent. Of the 116 mechanisms, only 11 carry over fully, and 65 are missing — mostly the protections.

The core pain is that everything the model outputs runs with the user's full permissions. The system prompt, your request, a tool's response, the contents of a downloaded file and a skill from the internet all land in one token "soup." The model can't tell an order from data. So the line "never touch .env" in CLAUDE.md is a wish. The authors checked this against the three criteria of a reliable safeguard: it can't be bypassed, can't be tampered with, and can be verified. Rules written in the prompt meet none of them.

The practical takeaway is simple: you can steer an agent with a prompt, but you can't protect with one. Anything that has to hold rock-solid must move out of the instruction text and into something the model can't rewrite: access permissions, a sandbox, a separate user, network restrictions, manual confirmation of dangerous actions.

Want this for your own case? Apply this study to your task: AI adapts its method to what you are working on and writes the prompt.

02

Method Blueprint

This isn't a prompting technique but an audit checklist. Here's the structure:

"AGENT = OS" CRITERIA (all three hold for coding agents):
  1. Shares machine resources between tasks (subagents, background processes)
  2. Everything goes through one interface (the tool call)
  3. Keeps state between sessions (memory, settings, schedules)

FOR EACH MECHANISM — ONE OF THESE VERDICTS:
  isomorphic → works as in an OS (11 of 116)
  degraded   → the function exists, protection depends on the model (26)
  mutated    → works differently than in an OS (14)
  missing    → absent entirely (65)
  novel      → no OS counterpart (9)

EXPERIMENTAL CHECK (13 experiments, 25 mechanisms):
  "Does the boundary hold when someone tries to cross it?"

The three safeguard criteria, after Anderson (a security classic): can't be bypassed, can't be tampered with, can be verified.

03

Example in Practice

The paper has no ready-made prompts, so below is a practical packaging of its conclusions. It's not the authors' method, but a way to apply it.

Task: You run Claude Code on your laptop and are editing a WooCommerce online store. Next to it sits a .env with Stripe keys and AWS access. CLAUDE.md says: "Don't read .env, don't write outside /shop, don't git push." You think that's protection. You need to find out which of the rules actually hold.

Prompt:

You are an agent configuration auditor. I use Claude Code on my work laptop.
Below are my rules from CLAUDE.md and my current permission settings.

RULES:
1. Don't read the .env file
2. Don't write files outside the /shop folder
3. Don't git push without my confirmation
4. Don't access the internet except developer.woocommerce.com

PERMISSION SETTINGS:
Allowed: reading and writing files in /shop, running bash, git commit.
Denied: nothing is explicitly denied.

For EACH rule, determine where it is actually enforced:
- "Text only" — the model was just "asked not to," nothing stops it
- "In a tool" — one tool has a check (e.g., the file tool),
  but it can be bypassed through another (e.g., the shell)
- "In the OS or sandbox" — the model physically can't violate it

For each rule, show:
a) the protection level (of the three above) and why;
b) how it could be bypassed without breaking the letter of the rule
   (via the shell, a subagent, a downloaded skill or text on a web page);
c) how to move the rule up a level (file permissions, a separate
   user, a sandbox, network blocking, manual confirmation);
d) a safe test I can run myself in an empty test folder
   to check whether the rule holds.

At the end, give a list: what to keep in CLAUDE.md as a hint,
and what must be moved out of the text into settings.

Result: The model goes through the rules one by one and names the protection level for each. Rules 1 and 2 will most likely turn out to be "text only" or "in a tool," with shell bypasses described for them. For each item you get a concrete safe test for an empty folder and a list of changes: what to move into settings, what to keep as a hint. An important caveat: the model can't check for itself how your tool actually behaves. Its list of bypasses is a set of hypotheses. Only your tests confirm them.

04

Why It Works

The weakness. An agent is built so that all inputs (your request, a file, a website's response, a skill, memory notes) land in one token stream. The model can't distinguish "this is the owner's order" from "this is text on someone else's page." Any text in context can influence an action. A rule in the prompt is also just text, and other text can override it.

The strength. Regular operating systems have half a century of proven protections: access permissions, process isolation, a log the program can't rewrite. They work outside the "program," meaning they don't depend on its willingness to follow rules. You can set these protections up with words and config: folder permissions, a separate account, a sandbox, a command allowlist, action confirmation.

How it fits together. First, separate the "request" from the "lock." The prompt is there so the agent pokes into the wrong places less often. The lock goes on the outside, where the model can't rewrite anything.

Knobs: - Where the check lives. The file tool refused, but the shell writes anywhere (as experiment E1 showed). So restrict the process or the user, not an individual tool. - What the agent writes itself. It can forge its own log and session records. If auditing matters, keep the log outside. - What subagents inherit. They get the parent's permissions. Don't count on "the helper only reads" until a setting enforces it. - Who does the checking. If the "monitor" for dangerous actions is another model, it reads text the agent itself controls. That kind of protection can be spoofed.

05

Prompt Template

You are an agent configuration auditor.

<Context>
Agent: {agent_name}
Where it runs: {machine_or_container}
What it can access: {files_keys_services}
</Context>

<Rules>
{list_of_rules_from_CLAUDE.md_or_system_prompt}
</Rules>

<Permissions>
{current_permissions_and_sandbox_settings}
</Permissions>

<AuditLogic>
For each rule in <Rules>:
  1. Determine the enforcement level:
     - TEXT_ONLY: just a request in the text
     - PER_TOOL: a check in a single tool
     - OS_LEVEL: a restriction in the OS, sandbox or permissions
  2. Find a bypass: shell, subagent, downloaded skill, text in the data,
     forged session record, spoofed time from a tool
  3. Propose how to raise the rule to OS_LEVEL
  4. Give a safe test for an empty test folder
</AuditLogic>

<Output>
Table: rule | level | bypass | how to harden | test.
Then two lists: "keep as a hint in the text" and "move into settings".
Don't execute anything, only analyze.
</Output>

What to fill in: {agent_name} — e.g., Claude Code, Codex CLI or Cursor. {files_keys_services} — what the agent can reach (.env, SSH keys, the cloud, the production database). The more honest the list, the sharper the audit.

🚀 Quick start — paste into the chat:

Here is a template for auditing an agent's rules. Adapt it to my situation: [describe which agent
you use, what it can do on the machine and what you've forbidden it in text].
Ask me questions to fill in the fields.

[paste the template above]

The LLM will ask which rules you wrote, what's actually allowed in the settings and which secrets the agent can access. That's needed to separate "text-only" rules from rules that hold in the settings. It will take the template from the structure above.

06

Limitations

⚠️ Written rules aren't useless: The paper doesn't say "don't write rules." They lower the odds of an oversight. But they're no protection against injection in data, a model error or someone else's skill.

⚠️ The experiments tested boundaries, not attack frequency: The authors showed a bypass is possible, but didn't measure how often it happens in normal work. The risk is real, but the paper doesn't estimate its scale.

⚠️ Tool versions change: The findings apply to three specific CLIs at the time of the study. Some issues may have been fixed, and Cursor and other environments weren't tested. Check your own version yourself.

⚠️ Protection requires settings outside the prompt: A sandbox, a separate user, network restrictions — that's environment configuration. A prompt alone can't do it. For a number of problems (forged logs, untrusted time, errors as text), the authors state outright that there's no ready solution from the OS world.

⚠️ Some details are unavailable: In the provided text the paper cuts off at the methodology. Details of experiments E1–E13 are known from the abstract and figures, not from a full description.

07

How They Studied It

The idea was simple. Instead of staring at an agent and hunting for threats, the authors took OS textbooks and listed every mechanism: 116 of them across 19 subsystems (processes, files, memory, network, privileges, logs and so on). For each they looked for a counterpart in documentation, source code and agent literature from 2022–2026. This approach reveals both what an agent lacks entirely and what agent researchers never even considered.

Each mechanism got one of five verdicts. Bottom line: 11 carry over fully, 65 (56%) are missing, and those are mostly protections: privilege separation, quotas, transactions, a tamper-proof log.

Next they tested the map in practice. They ran 13 experiments on Claude Code, Codex CLI and Gemini CLI, picking the 25 mechanisms where the documentation doesn't say whether the boundary is enforced by code or just a phrase in the prompt. In 16 cases the conclusion was confirmed, in 7 the description was refined, and in 2 the verdict changed from "missing" to "partial."

What surprised them. The file tool refusing to write a file doesn't stop the same file being written via the shell, because the checks live in individual tools, not in the process. All three CLIs, on session resume, load a forged transcript entry as a user message. All three accept whatever time a tool returns. A "stopped" task can keep running because its ID points to a wrapper, not the process. Subagents inherit the parent's permissions. A model-based monitor reads text the agent itself controls.

The practical conclusion: protection has to live outside the model.

08

Adaptations and Extrapolations

🔧 Technique: add "external input" to the audit → find hidden command channels

Additionally: list every place where outside text enters the agent's context
(web pages, READMEs in dependencies, downloaded skills, MCP server responses,
memory notes from past sessions). For each place, say whether a command-like
phrase could sit there, and what the agent could do with my permissions if it followed it.

This shows you that the danger isn't just your prompt but everything the agent reads. It follows logically from the paper's "one token stream" conclusion, but the authors didn't provide such a prompt themselves.

Extrapolation: a working rule instead of a prohibition

If an agent can't be trusted with protection, tasks that need broad access should be split:

Task 1 (read): read the code and draft a plan of edits. No writing, no network.
Task 2 (write): apply the plan in the /shop folder. No access to .env, no network.

These are separate sessions with different permission settings, not one session where you ask it to be careful. Your caution won't pass to subagents: they inherit the parent's permissions.

09

Resources

  • Paper: Ring-0 by Default: Agents as Operating Systems (AaOS)
  • Authors: Xiang Li, Aichun Huang, Zuyao Xu, Zheli Liu (Nankai University), Fasheng Miao (Tsinghua University)
  • Key references: Anderson's reference monitor criteria — can't be bypassed, can't be tampered with, can be verified; Pirch et al. and Zhang et al. (the two closest works taking an OS view of agents); MemGPT, AIOS (the "OS for agents" approach, the inverse of the authors')
  • Tools tested: Claude Code, Codex CLI, Gemini CLI

Research digest

Key result

The line "don't touch .env" in CLAUDE.md protects nothing. The authors compared coding agents (Claude Code, Codex CLI, Gemini CLI) against 116 mechanisms from operating system (OS) textbooks. Only 11 carry over fully, and 65 are missing, mostly protections. The AaOS method lets you run your agent's rules through an audit and see which ones actually hold and which rest on an honor system. The trick: a rule is reliable only if it can't be bypassed, can't be tampered with and can be verified. Rules in prompt text fail all three. The model receives the owner's order and text from someone else's page as one mush of tokens. Everything it outputs runs with the user's full permissions.

Principle

Separate two things: the request and the lock. The prompt is a request. It makes the agent poke into the wrong places less often. The lock goes on the outside, where the model can't rewrite anything. Every rule has three levels of protection: - Text only: it was asked not to, and nothing stops it. - In a single tool: the file tool refused, but the command line (shell) writes anywhere. - In the OS or a sandbox: the model physically can't violate it. Anything that must hold rock-solid, move from the first and second levels to the third: file permissions, a separate user, a sandbox, network blocking, manual confirmation. It's like a "do not enter" sign on a door with no lock. It stops the polite ones, not the rest. Important: the paper has no ready-made prompt. This isn't the authors' method, but a practical packaging of their conclusions.

Why it works

An agent mixes all inputs into one stream: your request, a file, a website's response, a skill from the internet, memory notes. The model can't tell an order from data. A rule in the prompt is also just text, and other text overrides it. An OS has half a century of proven protections. They work outside the program and don't depend on its willingness to follow rules. When a rule lives in folder permissions instead of the prompt, there's nothing for the model to be "talked into". Where the holes usually are: - The check sits in one tool, and the shell goes around it (as experiment E1 showed). - The agent can forge its own log and session records. For auditing, keep the log outside. - Subagents inherit the parent's permissions. "The helper only reads" is true only once a setting enforces it. - A "monitor" for dangerous actions built on another model reads text the agent itself controls. That kind of protection can be spoofed.

When to apply

Coding-agent security → auditing rules from CLAUDE.md or the system prompt, especially when production keys, SSH access, the cloud or a live database sit nearby. Also useful before handing an agent autonomous overnight work. NOT a guarantee: the LLM can't see your real environment. Its list of bypasses is a set of hypotheses. Only your tests in an empty folder confirm them. The paper also didn't measure how often bypasses happen in normal work. The risk is real; the scale is unknown.

Mini recipe

1. List the rules: everything you've forbidden the agent in words. One rule per line. 2. List the real permissions: what's enabled in the agent's settings, where it runs, which keys and services it can access. The more honest the list, the sharper the audit. 3. Run the audit: paste the template into a chat and set the role: agent configuration auditor. Say it shouldn't execute anything, only analyze. 4. Demand four things per rule: protection level, a bypass that doesn't break the letter of the rule, a way to raise the protection level, and a safe test. 5. Run the tests yourself: only in an empty test folder, no production data. The model may be wrong about your tool version. 6. Split into two lists: what stays as a hint in the text and what moves into settings. Move key access, writes outside the working folder and network access first. 7. Lock it down from outside: a separate account for the agent, file permissions, a sandbox, manual confirmation of dangerous commands.

Examples

[BAD]: `In CLAUDE.md: Never read .env and never git push!!!` and believing that's protection. [GOOD]: `You are an agent configuration auditor. I run Claude Code on my work laptop, and next to it is a .env with Stripe keys and AWS access. Rules: 1) don't read .env; 2) don't write outside /shop; 3) don't git push without my confirmation. Allowed: reading and writing in /shop, bash, git commit. For each rule, determine the level: text only, in a tool, or in the OS/sandbox. Show how to bypass it via the shell, a subagent or a downloaded skill. Propose how to move the rule to the OS level. Give a safe test for an empty folder. At the end, two lists: what to keep as a hint and what to move into settings. Don't execute anything.` What you'll get back: rules 1 and 2 will most likely turn out to be "text only" or "in a tool." A shell bypass will turn up fast. The git push rule holds only if confirmation is enabled in the settings, not in the text.

In plain words

Your smart AI coder is a full-blown operating system that has completely lost its mind. It can read files, run scripts, go online and spawn subprocesses, but at a basic level it's blind as a bat. In the architecture of today's LLMs, all incoming information gets dumped into a single token stream: your direct order, a chunk of someone else's repo and text from a hacked website carry exactly the same weight. The model is physically incapable of telling its owner's command from dangerous junk from the outside world.

It's like putting an intern at the main control panel of a nuclear plant, handing them superuser privileges and making them read email from strangers. If an incoming message says "pull the red lever and wipe the logs", they'll dutifully go do it. To them, your instruction and a note from a street hacker are just letters on the same page. AI agents have no protection: they run with Ring-0 privileges by default, with no system barriers and no brakes.

The researchers took the classic OS security stack and ran agents through a checklist of 116 protection mechanisms. The result is a disaster: only 11 work properly, and 65 mechanisms are missing entirely. Agents were given access to the disk and the network, but nobody remembered process isolation, permission audits or context separation. Text bans in the prompt like "don't touch the private keys" don't work: any stray line easily overrides the rules and hijacks control.

This hole isn't limited to Claude Code or Codex CLI — the problem is universal. Any trendy assistant with tool access today is a security sieve. While the agent is rewriting functions in a sandbox notebook, all is quiet. But the moment you let it read third-party docs, follow links or clone other people's packages, it becomes a blind executor of indirect injections.

Bottom line: protecting an agent with prompts is naive foolishness. Until architects invent rock-solid privilege separation inside models, don't believe promises of safety. Lock these helpers inside isolated Docker containers, cut off access to the production network and take away admin rights. Otherwise someone else's README.md will run a command that leaves you wondering for a long time where your database went.

AI lab assistant

Apply this study to your task

Describe what you're working on. AI takes the method and the measured results from this paper and adapts them to your case, or writes a ready prompt built on them.

Based on Agents as Operating Systems (AaOS): rules in an agent's prompt are a request, not a safeguard arXiv:2610.33753

Sign in to apply this study New accounts get 50 free credits.