Which Repository Boundaries Does Your Agent Actually Respect?

Test four boundaries separately: repository reads, workspace writes, outbound connections, and what reaches the model. Compare isolated execution with self-hosted execution using harmless markers and recorded decisions.

Measure what crosses the model boundary

Draw two boundaries before selecting a runtime: where tool calls execute and where tool results are processed. Claude Managed Agents can run tools on a worker you operate, while tool results still reach the Managed Agents service. That setup can satisfy a rule about checkout location while failing a rule about source snippets leaving your network. To test the distinction, place a unique synthetic marker in an allowed fixture file and another in a file your model should never see. Ask the agent to summarize the allowed fixture and inspect a redacted trace captured at the tool-result boundary. The first marker confirms that the observation path works. A second marker in the trace is a failure even if the model's final reply omits it. Record a missing trace as untested.

Choosing an agent environment - Claude Platform Docs

Test whether writes survive the intended lifetime

Pick the workspace based on who needs to see edits after the run. Claude Code's deployment guide describes temporary memory-backed mounts, overlays with a separately inspectable write layer, and dedicated volumes for persistent output. Give each option the same harmless task: write a unique marker to a designated output path and read it back during the run. After shutdown, inspect the underlying fixture and, where applicable, the retained output. A temporary mount should lose the marker. An overlay should preserve the original fixture and make the change visible at the review stage before disposal. A volume should retain the designated output for the next authorized reader. A write that succeeds during the run but disappears before review is a handoff failure even when the isolation works.

Securely deploying AI agents - Claude Code Docs

Start from the commit under review

Stage a clean checkout at a recorded commit in a dedicated workspace. Give the agent the task, the relevant project instructions, and the test entry point. Let it follow references from the affected files into neighboring modules. Review the staged file inventory and keep personal home directories, production configuration, and credential stores outside the workspace. Include only the test fixtures the task needs.

Anthropic’s Claude Code deployment guide describes an overlay that can hold edits separately for inspection. If your runtime offers that arrangement, verify that the agent can write to the overlay and that the original files remain intact. Export the diff with its base commit, then confirm it applies to a clean copy before handing it to a maintainer.

Securely deploying AI agents - Claude Code Docs

Keep fetch and publish credentials separate

If the runner must fetch directly from GitHub, start with one selected repository and the minimum permissions needed to read its contents. GitHub documents that a personal access token acts within the owner’s capabilities and can be further constrained by the permissions granted to it. A short-lived fetch for an individual task and a shared integration have different owners. For an organization-level or long-lived integration, follow GitHub’s guidance to use a GitHub App.

Before exposing the credential to a real job, use two test repositories. The runner should read the intended repository, receive an authorization failure on the second private repository, and be unable to push to the first. If a test fails, check which credential Git actually used, including any cached sign-in or inherited environment setting.

Managing your personal access tokens - GitHub Docs

Run a patch handoff with harmless fixtures

In an illustrative test, the agent receives one checkout of a private repository at a known commit and a task to correct an invoice rounding rule. Add two fixtures for the boundary case and an ordinary invoice. Cloudflare’s OpenCode sandbox example shows the relevant handoff pattern. OpenCode edits a GitHub repository in a Linux sandbox and the caller reads the resulting diff.

Ask the runner for the changed paths, the diff, and the results of both fixture tests. The expected output is a patch that fixes rounding, preserves ordinary behavior, and applies cleanly to the recorded commit. Put a harmless marker file in a sibling directory outside the workspace. Verify that the marker is inaccessible and that the remote branch tip stays unchanged throughout the run.

Run OpenCode in a sandbox · Cloudflare Sandboxes docs

Choose where the checkout can live

Cursor’s managed Cloud Agents run in Cursor-hosted VMs. Cursor Self-Hosted Machines run tool calls on hardware you control through My Machines or Team Pools, while the agent loop stays in Cursor’s cloud. If your requirement concerns where the checkout and tools run, test the applicable runtime on a disposable repository. If your requirement also covers what reaches the model, verify permitted transfers and retention separately before using real source code.

For a managed versus self-hosted comparison, ask each runtime to make the same small edit and record where the checkout, test execution, and resulting diff appear. Inspect the worker’s mounts and credential sources before the self-hosted run. A self-hosted worker gives you control over those settings and makes their upkeep your team’s responsibility.

Choose where Cloud Agents run | Cursor Docs

Sources