---
title: "Sandboxing"
description: "Configure sandboxed tool execution in Cody CLI"
canonical: "https://docs.ainative.studio/docs/cody-cli/sandboxing"
last-updated: "2026-10-22T17:48:46.689Z"
---

# Sandboxing

Source: https://docs.ainative.studio/docs/cody-cli/sandboxing

> Configure sandboxed tool execution in Cody CLI

# Sandboxing

Cody CLI can run tool calls (bash commands, file writes) in a sandboxed environment to limit the blast radius of unintended actions.

## Enabling Sandboxing

Set in `settings.json`:

```json
{
  "sandboxing": {
    "enabled": true,
    "allowedPaths": ["./src", "./tests"],
    "allowNetwork": false
  }
}
```

## Sandbox Modes

- **Path restrictions** — Limit file read/write to specific directories.
- **Network isolation** — Block outbound network calls from bash tools.
- **Read-only mode** — Allow reads but block all writes.

## Per-Tool Configuration

Configure sandbox rules per tool type:

```json
{
  "sandboxing": {
    "tools": {
      "Bash": { "allowNetwork": false },
      "FileWrite": { "allowedPaths": ["./src"] }
    }
  }
}
```

<Callout type="warning" title="Sandboxing is not a security boundary">
Sandboxing is a best-effort safety layer. For untrusted code execution, use a proper container or VM.
</Callout>
