File System Access Patterns for Computer-Use Agents
Agents need filesystem-level safety controls, not just prompt-based guardrails.

Computer-use agents do not interact with file systems the way ordinary software does, because an agent can execute hundreds of file operations and shell commands in a single session with the user's full privileges, with no human choosing each one. This single fact, not any particular bug, is why file system access for agents needs its own set of patterns.
How computer-use agents interact with file systems
Traditional software touches files on explicit user instruction: a person clicks save, drags a folder, grants a permission dialog. Agents work differently. An LLM planner decides what to read, write, or delete, and it does so without per-action human approval, often across a long chain of autonomous steps. Research presented at SOSP '26 documents what happens when that delegation goes wrong: agents that wiped entire drives, destroyed irreplaceable documents, and silently leaked credentials. None of these outcomes came from a bug in the agent framework. None of this is a matter of better prompting. It is an architectural problem, and the fix belongs at the infrastructure and filesystem layer, not inside the model's instructions.
The five file operations agents perform
Agent file system behavior breaks down into five distinct operation types, and each one has a failure surface that doesn't exist when a human is at the keyboard. The first is read and ingest: an agent parses PDFs, DOCX files, and JSON from remote sources, and because the agent itself decides what to open and how to interpret it, a malicious or malformed file can shape every decision the agent makes afterward. The fifth is share and transfer, where the agent generates secure links or changes permissions to deliver its work, and those permission changes can quietly outlive the session that created them.
These five operations are the vocabulary the rest of this piece works from.
The two gaps that make agent file access unsafe by default: information and control
Agent file access fails along two independent axes, and if you understand them separately, the rest of this article's patterns make sense. The first is an information gap. Neither the user nor the agent has adequate visibility into what a given operation will actually do to the filesystem. The SOSP '26 study, which analyzed 290 public reports, treats this as a systematic feature of how agents operate, not a rare edge case.
The second axis is a control gap. Agents may simply ignore a natural-language instruction such as "do not read my SSH key," and prompt injection can override such instructions. Once harm has occurred, an agent operating on a traditional filesystem has no recovery path. It can only apologize.
These two gaps compound each other. The conclusion this points to is architectural: safety cannot be enforced only inside the agent's harness. It has to be enforced at the filesystem or environment layer, below where the model itself operates. The architectural mismatch between agent autonomy and filesystem assumptions designed for humans is exactly where infrastructure enters the picture: platforms like Maritime that run agents in isolated, persistent micro-VMs can enforce filesystem-level safety and observability below the agent layer, so the infrastructure itself becomes the boundary against unintended file operations.
Read patterns: how agents should scope and gate file ingestion
Reads are the most frequent operation an agent performs, and they are the entry point for one of the most dangerous attack vectors available to a malicious actor: prompt injection delivered through file content. A safe read pattern scopes what the agent is permitted to see before execution starts, rather than trying to filter what it tries to read after the fact. The underlying primitive is access gating: the filesystem, not the agent, determines which paths are visible for a given session, so the agent simply cannot read what it cannot enumerate. Traversal needs the same discipline. List and traverse operations should stay confined to a designated working directory, because unrestricted ls access from root exposes credential files, configuration files, and other assets the user never intended to put on the table.
File content itself has to be treated as untrusted. A file the agent reads can contain instructions embedded in its text that redirect the agent's subsequent behavior, and this isn't a model failure so much as a consequence of agents trusting file content by default. Read operations need the same adversarial posture a web application takes toward HTTP input: assume hostility until proven otherwise. The SOSP '26 paper names "gate accesses" as one of three core primitives an agent-native filesystem must provide, and progressive permission is the mechanism that makes it workable in practice: start with a narrow scope, expand only when the agent explicitly asks to go beyond it, and surface that request to the user as a real decision. If you implement this gating purely inside the agent harness, as software sitting above the filesystem, it is structurally weaker than when isolation is enforced at the VM or filesystem layer itself, and that distinction becomes central once isolated environments enter the picture later in this piece.
Write and mutation patterns: staging changes instead of applying them immediately
Writes and mutations are the more destructive half of agent file activity, and the safe pattern for handling them is staging: changes accumulate in an intermediate state and only become permanent once the agent or the user confirms the intended effect. Applying mutations immediately, with no intervening checkpoint, is the root cause behind most of the irreversible harm documented in the SOSP '26 research. Under a staging model, mutations do not land on the live filesystem directly. They sit in a staging area where the agent can inspect them, diff them against the prior state, or correct course before anything becomes permanent.
The clearest evidence for this pattern comes from YoloFS, the agent-native filesystem built as part of the SOSP '26 research. YoloFS stages mutations until the user commits them. On 112 routine tasks, it cut the amount of user interaction you need while matching the baseline success rate of systems without staging. That combination, fewer interruptions and stronger safety guarantees, is the paper's central empirical result, and it distinguishes staging from a simple approval prompt. Approval prompts interrupt the agent after every action, but staging accumulates a set of changes and presents them for batch review, so it reduces interaction load without sacrificing oversight. Staging also neutralizes a specific risk around path construction: since agents generate destination paths programmatically, a bug in that logic would otherwise write to the wrong location immediately and silently. Staging surfaces the actual destination before commit, so you get a chance to catch it. Not all mutations deserve equal scrutiny, either. Irreversible actions, overwrites, deletions, permission changes, warrant a higher commit threshold than simple additive writes, and the access-rule system governing an agent should draw that distinction explicitly.
Why permission and approval systems fail
The obvious response to all of this is to add more approval prompts, and that response doesn't hold up. Frequent prompts produce approval fatigue: users either start approving everything without reading it or disable the prompts altogether, which means the safety mechanism ends up producing precisely the unsafe outcome it was built to prevent. This is sometimes called the "YOLO mode" dynamic, and it is a predictable consequence of asking humans to make careful decisions at a pace no human can sustain.
A University of Washington survey looked at 21 agent permissions proposals and found that most enforcement mechanisms rely on the LLM itself to honor permission constraints. The same University of Washington research found that commercial agents' permissions handling lags substantially behind what the academic literature has already worked out, so the proposals for fixing this exist, but production systems mostly haven't built them. What a harness layer can legitimately do is surface information, present staged changes for review, and let users set access rules ahead of execution. Enforcing those rules has to happen below the harness, at the environment layer, where the agent cannot talk its way around them. You have to close the control gap at the filesystem or environment layer, below the model's reach, and enforcement works best when each agent runs inside its own isolated compute environment with full visibility into its own filesystem state, instead of sharing infrastructure where one agent's recovery becomes another agent's collision.
Persistence patterns: what agents need from a file system across sessions
An agent that stages its mutations carefully still needs somewhere durable to stage them, and that requirement points toward the second half of this article's argument: statefulness. When a session ends on a conventional setup, generated files, intermediate state, downloaded assets, and task context typically vanish with it, an "amnesia" failure mode that prevents an agent from resuming a task, handing it to another agent, or building incrementally on work it already did. Correct persistence requires a few concrete things: a designated working directory that survives process termination, a credential and configuration store available the moment the agent wakes, and a record of what was staged or committed in earlier sessions.
One pattern that bridges storage and interface is the virtual filesystem, exemplified by systems like LangSmith's Agent Builder, which stores data in a database but exposes it to the agent through a filesystem interface. Persistence is also what makes collaboration between agents, or between an agent and a human, workable. A durable filesystem is the handoff mechanism; without one, multi-agent workflows have to pass context through the model's context window instead, which is expensive in tokens and loses information in the process. File storage and vector storage serve different purposes here too, since vector databases are built for semantic recall and cannot hold binaries, renders, or compiled artifacts. File storage makes an agent's output usable by the rest of a technology stack without forcing a format conversion first.
How isolated VM environments resolve read, write, and persistence failures
Staging, access gating, and permission systems reduce harm at the harness layer, but they cannot eliminate every failure mode on their own. Running each agent inside its own isolated environment with a persistent disk closes the remaining gap, because isolation enforces the boundary structurally and persistence makes the workspace durable across every session. When an agent runs inside its own micro-VM with its own kernel, a filesystem operation that tries to escape the agent's working directory simply cannot reach the host or another agent's workspace. That boundary is enforced by hardware, not by a policy an LLM might be talked out of honoring.
There is a meaningful difference between container isolation and kernel-level isolation here. Snapshot-restore then functions as the undo primitive at environment scale, since the same mechanism that enables fast wake also enables rollback to a known-good state, mapping cleanly onto the "undo mutations" primitive the SOSP '26 researchers identified as a core requirement.
Maritime's infrastructure model puts this into practice directly: each agent runs in its own Firecracker micro-VM on bare metal, with a persistent disk and snapshot-restore scheduling, so agents wake in about a second, pay for storage rather than idle compute, and carry their file state across sessions without a custom storage backend behind them. Because each of these five operations can persist across sessions, agents need infrastructure that preserves filesystem state reliably between wake and sleep cycles, so that writes commit durably, moves stay reversible, and permission changes remain auditable even once the agent has gone idle. When each user gets a dedicated agent VM, cross-tenant filesystem exposure is ruled out by the architecture itself, because the VM boundary is the permission boundary rather than a policy someone has to remember to enforce.
Practical decisions developers face when choosing a file system access architecture for their agent
The right file system architecture for an agent follows directly from the failure modes it is exposed to. These patterns aren't decorative choices; each one answers a specific risk, and matching the pattern to the risk is the actual design work.
Start with whether the agent needs persistence across sessions. If it doesn't, session-scoped preprocessing, materializing remote data as a local filesystem at runtime and discarding it on exit, is sufficient and avoids the overhead of managing durable storage. If it does, the agent needs a real workspace: either a designated persistent directory on a long-lived host, or a VM with an attached persistent disk that survives sleep and redeploy.
Next, consider whether the agent executes shell commands or runs build tools. Container isolation gets you partway there, but kernel-level micro-VM isolation closes the gap completely.
Mutation review should scale with stakes. Mutations touching credentials, configuration, or shared files call for progressive permission, explicit requests to expand access, and a snapshot taken before any irreversible change.
Read scope deserves the same discipline. Begin with the narrowest working directory that lets the agent do its job, and treat any request to expand that scope as a decision for the user to make, not the agent. Every piece of file content the agent ingests should be treated as untrusted input, the same posture a web application takes toward data arriving over HTTP.
Finally, for multi-tenant or per-user deployments, one VM per user is the cleanest architecture available: isolation is structural, permission boundaries are implicit, and cross-tenant filesystem exposure is eliminated by construction. Snapshot-restore scheduling lets idle agents sleep and pay for storage instead of standing compute, which is what makes that economics work at scale.
Safety for agent file access is achieved not by constraining what the agent is allowed to do, but by building an environment where the consequences of its errors are bounded, reversible, and visible before they ever become permanent.


