An AI agent's sandbox: check where its workspace really ends
Does an AI agent sandbox restrict reading, writing and networking? Plan control trials with artificial files and distinguish instructions from actual blocks.
Article language: English

In this article
An agent works “only in the project”. Soon it summarises a file in a neighbouring directory that nobody added to the task. It changed no lines outside the project, so the write check still looks good. The problem is that the agreement also concerned what it was allowed to read.
A sandbox is an environment that limits specified program actions. For an AI agent it can cover commands, files and network connections, but its scope depends on the solution and configuration. The word “sandbox” does not itself define a boundary. Acceptance needs to connect the claim to a concrete trial and observed execution.
The plan below is for an authorised environment of your own and artificial material. It is not an account of bypassing security or a complete assessment of system isolation. It answers a specific operational question: which access was actually blocked, and which merely was not needed for the task. A report must not treat those results as the same.
The working directory is only a starting point
Imagine a fictional task editing copy for a furniture catalogue site. The agent works on a controlled project copy. It needs specified files and a place to save proposals. The agreement does not cover other projects, personal documents or sending material to an additional service. This description permits a trial without using actual confidential data.
Set out read, write and network access separately. File modification can be restricted while broad read access remains. Some connections can be blocked while local directories remain accessible. One label should not hide these distinct scopes. Record the expected behaviour and supporting evidence for each.
The Claude Code sandbox documentation describes commands executed by Bash, the system shell, and processes they launch. It distinguishes reading, writing and networking; default read access is broader than writing, with stated exceptions. This is not a claim that every application function is covered by the same boundary.
First establish what the restriction actually covers: the whole application, execution of one tool, a child process or a separate environment started for the task. If the agent can choose among tools, list their routes of action. A control on one command does not settle what a separate file-read tool or external connection can do.
The directory shown in a window title identifies where work begins. Its name does not define the program's access. Record actual permissions and additionally mounted locations. For attached directories, determine which are read-only and which allow writes. The task owner should understand that division without reading the entire configuration.
Gemini CLI's macOS profile description gives a specific example: permissive-open restricts writes to the project directory while permitting broad reads and networking. That is a property of the described profile. Do not transfer it to every way of running the tool or every sandbox.
Do not confuse a sandbox with an automation test environment (in Polish). A test copy can contain artificial data and safe addresses while still having broad computer access. An execution restriction can instead operate on a real project. Name both properties in acceptance and check each for its own purpose.
Prepare control locations, not real secrets
A small file containing an invented sentence not included in the instruction is enough for a read test. Put it in an agreed location outside the working directory. Put a separate control file in the permitted area. This checks that the tool works inside the boundary and shows its response outside it.
Do not use a real password, key or private correspondence. The control text should reveal a read, not create a new data disclosure problem. The trial must cover only resources you are authorised to use, with their use in the tested tool agreed.
Record the expectation before running it. The project directory might allow reading and saving a proposal, while the specified neighbouring folder should refuse both. If documentation outside the project is deliberately readable, mark that exception. Do not judge the boundary by “everything outside the folder must be forbidden” when the agreed scope says otherwise.
Test writing separately on a designated file. Reading does not establish that modification is possible, and a refused write does not establish that reading is refused. After the action, inspect the actual target contents. An agent's “I saved the fix” needs confirmation in the file concerned.
Preserve the initial state and evidence that the file stayed unchanged if that was expected. If the tool did not perform the operation, record the cause you can substantiate. A missing sentence in the answer could result from refusal, a wrong path or the model skipping the attempt. Do not choose the most convenient explanation without observing the call.
Distinguish three cases in the report: the model refused because of an instruction; the tool rejected the action; or the action was not attempted. The first describes model behaviour. The second confirms the tool rejected that attempt; determine the mechanism and cause from the available evidence. The third leaves access unresolved. This distinction supports assessment of what protects the boundary without assigning a cause to the rejection alone.

Add a positive control to distinguish a block from an unavailable file. An authorised person should verify that the artificial material exists at the specified location and has the expected contents. Then check the route the agent uses. If a tool reports a missing file while actually denying access, preserve the result and the limitation on interpretation. A report must not turn any error into proof of effective isolation.
A similar issue arises when excluding files from a coding assistant's work (in Polish). Omitting material from suggestions need not describe every other route by which it might be used. A sandbox trial checks the execution boundary of a chosen route, not merely a file's presence in a context list.
For the same control operation, compare an ordinary read tool and a command executed by the agent if both occur in the process. One route may follow different rules from the other. Record expectations separately, reflecting the access actually agreed. Do not add mechanisms merely to produce an impressive list; choose those used by the task under review.
Test the network by direction and action
For “network disabled”, specify which components and stage of work are covered. A model may need a connection to answer while task-execution tools have restricted traffic. Access to selected services may also be allowed. The use-case owner should know which part of the flow the statement covers.
Prepare your own controlled destination or another agreed resource without real customer data. Separately select an allowed connection and one that should be blocked. Record the intended action. Reading public documentation has a different scope from sending file contents to an external service.
Do not test traffic by sending a real document “just to see”. Recognisable artificial material is enough to establish the route. Retain any available receipt trace at the destination and the tool-call result at the source. Absence of confirmation in one place should not automatically be treated as a block on the entire connection.
Treat a request for expanded access as a separate event. A trial before permission and one after it concern different boundaries. “Connection blocked” cannot describe a sequence in which a user allowed a domain and the tool ultimately sent data. Record which decision changed the scope and for how long.
After the expanded trial, check a new session or later task according to the tool's rules. Does the earlier permission still apply? Was it saved for the project, account or one execution? Do not infer the answer from the text of an “Allow” button. Preserve the scope visible at the decision and compare it with later behaviour. This prevents a one-time exception being misreported as an unchanged boundary for subsequent work.
The review of local models and working without internet (in Polish) expands on separating computation from additional tools. A local answer does not prove the entire process works without a network. Similarly, the sandbox of one command does not explain connections made by other components.
Do not grade the outcome solely by a fluent answer. A model can explain access without attempting it. It can also return an error after an action partly occurred. Operational acceptance concerns the actual request and confirmed result, with missing observations explicitly marked.
Record the boundary with configuration and exceptions
For each trial retain the tool version, launch method, account, operating system and relevant configuration. There is no need to publish secrets or the entire environment. The responsible person needs enough material to reproduce the scope checked. A button with the same name may lead to different behaviour after an update.
In a responsible AI-agent workflow (in Polish), assign someone to approve access and respond to exceptions. Permission for one command outside the restriction should not disappear into a blanket statement that work occurred “in a sandbox”. A report reader must distinguish the ordinary path from the expanded one.
Examine routes through additional tools as well. If the agent uses a separate MCP server, check whether an operation executes locally in the evaluated environment or in another system. Calling it from the same window does not give it the same restrictions. Assign each route to its execution location and account.
Consider what remains after the task: saved results, copies of control files, connection permissions and the report. A trial may leave the source document unchanged while creating a copy elsewhere. Record only the confirmation needed, such as a recognisable marker from artificial material and the operation result. Afterward clean up control data under the agreed procedure, preserving evidence of the assessment without the full contents of the real environment.
After changing a directory, adding a service or expanding access, repeat the cases affected by the change. Identify dependent trials instead of automatically repeating the entire review. Still record what remains confirmed and what needs a new trial. Otherwise an old result may be taken as evidence for a scope it never covered.
Connect findings to your own AI data-flow register. The guide to an AI data-flow register (in Polish) explains how to prepare one. Identify which files may be read, where output goes and which connections are permitted. This helps the task owner assess whether the environment fits the use case instead of discussing only a technology name.
In the Aeneia Audit offer, one specific process and its declared boundary can be the starting point. Acceptance should leave verifiable findings: here a control file was read, here the tool refused, and this route has not yet been assessed. Use these findings to record a decision on further use. In our example it might permit editing specified files while leaving the additional connection out of scope until a fix and renewed trial. The person doing the task should know what remains permitted and what needs the owner's decision. The report should lead to that decision, not end with a list of errors. A directory name organises the start of work; confirmed restrictions define its reach.








