One project.
Two sandboxes.

Give Codex and Claude Code a project folder to edit. Their commands run in separate environments, with limits on the files and network destinations they can reach.

Apple silicon macOS 15 or later

Two isolated sandboxes share one project folder Codex and Claude Code can both edit the shared project. A request reaches its tile and turns it green. Requests for other Mac folders stop at the edge of the sharing plane, on the left for Codex and on the right for Claude Code. CodexClaude Code
Supported agents
CodexClaude Code
Isolation runtime
Brig microVMs
Native terminal
libghostty

Why sandbox a coding agent?

Ask an agent to run tests, and it may first install a dependency. In your Mac terminal, a faulty setup script could overwrite files in another project.

Brig runs each agent in its own microVM, a small virtual machine on your Mac. Each guest has its own Linux kernel and home directory. Both guests can edit the project folder you share.

Files and tools
A setup script can replace a tool inside the guest without replacing the one on your Mac. Mac folders outside the sharing plan stay out of reach.
Network access
You choose which hosts guest commands can contact. The policy denies other destinations by default. A permitted host can still receive project data.
Account access
The guest gets an access token so the agent can make requests. The credential that renews your provider sign-in stays on your Mac.

How it works

Follow one Codex task inside a Brig microVM. The terminal and project in this walkthrough are simulated.

Allowed guest hosts
  • auth.openai.com
  • chatgpt.com
  • api.openai.com
  1. Start Codex

    Brig verifies the image and boots a private Linux kernel with four vCPUs and 4 GiB of memory. In the guest shell, you start codex and type Implement prd-79.

  2. Check the destination

    Codex looks up a test fixture. The gateway on your Mac checks the hostname against the project’s allowlist. The lookup is denied, so Codex continues with the local fixture.

  3. Write to the project

    Codex edits a file in the mounted project. The edit appears in the same folder on your Mac. Other Mac folders stay outside the guest’s filesystem.

  4. Call the provider

    The gateway allows the connection to ChatGPT. Codex uses its guest access token. Tugboat keeps the refresh token on your Mac.

  5. Use a brokered credential

    The guest policy blocks a direct fetch from GitHub. In a second run, a Git route permits fetching team/northstar. The guest contacts brig.internal, where the broker checks the repository and uses the Mac’s credential to fetch it.

  6. Open a local preview

    If you publish a port in Brig, a browser on your Mac can reach the guest’s dev server through localhost. Other guest ports stay closed to incoming connections.

  7. Run tests offline

    After the chat ends, you restart the guest in offline mode. A guest shell can run the project’s local tests while outbound connections are blocked.

  8. Resume the session

    The private home survives a stop. Restart the guest with its network policy to resume the saved chat. Removing the sandbox leaves your project edits on your Mac.

Inside the workspace.

Select a view to explore a sample project.

Choose a workspace view
The Northstar project shows four saved Codex and Claude Code sessions.
Project sessions / Sample dataFull size
Session usage shows token counts and estimated API cost for two requests.
Session usage / Sample dataFull size
Network settings show separate lists of allowed guest hosts for new Codex and Claude Code policies.
Network settings / Sample dataFull size

From folder to first chat.

  1. Connect your account.

    Sign in with ChatGPT or Claude under Settings → Providers. Use that account across your projects.

  2. Choose a folder.

    Select Add new project, then choose your agent. Tugboat prepares a separate environment for that agent.

  3. Start the conversation.

    Select New Chat to work in the terminal. Review Git changes and run project tests in the same environment.

Frequently asked questions

Why does Tugboat use Brig instead of Docker Sandboxes?

Brig puts the network rules outside the agent’s control. A gateway on your Mac filters outgoing packets from the agent and any install script it runs. Tugboat requires a policy that denies connections by default. Brig can allow specific hosts or IP address ranges. If the runtime cannot enforce the policy, Brig refuses to start the sandbox.

Brig’s optional credential broker can keep a key on the host and use it only for an allowed request, down to the HTTP method, path or Git repository. For ChatGPT and Claude sign-in, Tugboat gives the guest an access token and keeps the refresh token on your Mac.

Docker Sandboxes (sbx) also uses microVMs. It enforces network rules through host-side proxies and can add credentials to outgoing requests. Brig lets us inspect the gateway code and the tests that show which connections it allows or blocks.

Brig network policiesBrig credential brokerBrig security testsDocker Sandboxes architecture

Which parts of a chat run on my Mac?

The agent edits files and runs commands inside its sandbox on your Mac. It sends requests to its model provider for responses. Those requests can include code and command output from your project.

What happens to my work when I stop a sandbox?

Your edits are already in the project folder on your Mac. Stopping the sandbox ends that agent’s running processes. Tugboat keeps its guest home and saved chats, so you can resume a conversation later.

Get Tugboat for Mac.

You need an Apple silicon Mac with macOS 15 or later, an account for your agent, and internet access for the first environment download.