Note: Use a shallow, single-branch clone to reduce the clone time. This clone omits the commit history and other branches:
Quick start
Generate an authenticated Git URL and use it inside any sandbox: SetPIERRE_ORG and PIERRE_PRIVATE_KEY as shown in the
Quick Start.
Confine a sandbox to one session branch
Give the agent two short-lived URLs. Use a read-only normal URL for fetches. Use an ephemeral URL for pushes. Useref_policies to confine it to one branch.
BASE_SHA. Pass sessionBranch as SESSION_BRANCH.
origin with separate URLs for fetches and pushes. A stray
git push origin main goes to the ephemeral namespace. The sandbox has no credential that can write
to a normal branch. The policy permits fast-forward pushes to this session branch only. It rejects
all other pushes.
See Capture Agent State for the branch layout, and
Ref Policies for the ref_policies rules.
Modal
Modal provides serverless cloud functions with persistent volumes. Clone repositories into volumes, run code, and push changes back.E2B
E2B provides cloud sandboxes for AI agents. Clone repositories, execute code, and push results back to Code Storage.Daytona
Daytona provides secure sandboxes for AI agents. Use Daytona’s built-in Git API to clone repositories. Run commands and push changes back.Provider resilience
Many teams use multiple sandbox providers to improve resilience. Git keeps your code portable across providers. If one provider has an outage or no capacity, start a sandbox elsewhere. Then clone the same repository:Security considerations
- Short TTLs: Use the shortest TTL practical for your use case. Sandbox sessions are typically short-lived. The token of a remote URL lives 15 minutes by default and 1 hour at most.
- Minimal permissions: Grant
git:readonly unless the sandbox needs to push changes. - Agent state: Store experimental or untrusted work on ephemeral branches. See Capture Agent State.
- Audit commits: Review sandbox changes before you merge them into protected branches.