# Sandbox & File Access

> Foundry isolates work per project under a sandbox directory. Each project is fully isolated: no cross-project file access, no shared state.

Source: https://bifrost5.com/foundry/docs/sandbox/

# Sandbox and File Access

Information

Open a secure preview of your web, backend or mobile work before anything reaches your main branch, with Production-Grade.

[See editions](/foundry/docs/editions)

Foundry isolates work per project under a **sandbox** directory. Each project is fully isolated: no cross-project file access, no shared state.

## Isolation Rules

- Each task has a `project_id`; its working directory is `sandbox/

/`.

- The supervisor **only** reads/writes under the sandbox. No access outside unless explicitly configured.

- Multiple projects can exist: `sandbox/project-a/`, `sandbox/project-b/`.

- Each project has its own state key and task queue: no shared state between projects.

- Goals are per project; the supervisor completes when all goals in state are completed.

## Sandbox Paths

- **Default root**: `./sandbox` (relative to supervisor project root)

- **Project directory**: `//`

- **Task-level override**: set `working_directory` in the task to use `/`

The agent process is spawned with `cwd` set to the project sandbox directory. `sandbox_root` is also injected into the state snapshot context so the agent is always aware of its boundaries.

## Boilerplates

Place starter code in `sandbox/<project-id>/` before enqueueing tasks. The agent will **build on** existing files. Tasks can say "Extend the existing `App.tsx`" or "Add an endpoint following `routes/users.ts`".

## What to Include in Boilerplates

- Project structure (directories, config files)

- Initial dependencies (`package.json`, `requirements.txt`, etc.)

- Starter templates (React components, API routes, etc.)

## Parallel Mode and File Locking

When using parallel execution, each task declares `affects_files`. The supervisor uses file-level locking so no two tasks edit the same file at once. `depends_on` enforces task order: tasks are auto-promoted when dependencies are met.
