> ## Documentation Index
> Fetch the complete documentation index at: https://opensandbox-oc-s-762ac928075c46d2828bcb22.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Tools

> Configure what tools an agent can use

By default, the agent has access to bash, file read/write, and Python — the same tools available in [Claude Code](https://docs.anthropic.com/en/docs/agents/claude-code-sdk-overview). You can restrict these and add custom tools via MCP servers.

## Default Tools

The agent runs with all Claude Code tools enabled. To restrict which tools the agent can use, pass `allowedTools`:

<CodeGroup>
  ```typescript TypeScript theme={null}
  const session = await sandbox.agent.start({
    prompt: "Analyze the CSV files in /data",
    allowedTools: ["Read", "Bash"],
  });
  ```

  ```python Python theme={null}
  session = await sandbox.agent.start(
      prompt="Analyze the CSV files in /data",
      allowed_tools=["Read", "Bash"],
  )
  ```
</CodeGroup>

## MCP Servers

[Model Context Protocol](https://modelcontextprotocol.io/) servers give the agent access to custom tools. MCP servers run inside the sandbox — the agent discovers available tools via the protocol.

Pass MCP server configuration when starting the agent:

<CodeGroup>
  ```typescript TypeScript theme={null}
  const session = await sandbox.agent.start({
    prompt: "Query the users table and summarize the results",
    mcpServers: {
      sqlite: {
        command: "npx",
        args: ["-y", "@modelcontextprotocol/server-sqlite", "/data/app.db"],
      },
    },
  });
  ```

  ```python Python theme={null}
  session = await sandbox.agent.start(
      prompt="Query the users table and summarize the results",
      mcp_servers={
          "sqlite": {
              "command": "npx",
              "args": ["-y", "@modelcontextprotocol/server-sqlite", "/data/app.db"],
          },
      },
  )
  ```
</CodeGroup>

### McpServerConfig

| Field     | Type      | Required | Description                                  |
| --------- | --------- | -------- | -------------------------------------------- |
| `command` | string    | Yes      | Command to start the MCP server              |
| `args`    | string\[] | No       | Command arguments                            |
| `env`     | object    | No       | Environment variables for the server process |

### Example: Custom API Tool

```typescript theme={null}
const session = await sandbox.agent.start({
  prompt: "Fetch the latest deployment status",
  mcpServers: {
    deploy: {
      command: "node",
      args: ["/tools/deploy-server.js"],
      env: { DEPLOY_API_KEY: process.env.DEPLOY_API_KEY },
    },
  },
});
```

## System Prompt

Steer agent behavior with a custom system prompt:

<CodeGroup>
  ```typescript TypeScript theme={null}
  const session = await sandbox.agent.start({
    prompt: "Review the codebase for security issues",
    systemPrompt: "You are a security auditor. Focus on OWASP Top 10 vulnerabilities. Output findings as a markdown checklist.",
  });
  ```

  ```python Python theme={null}
  session = await sandbox.agent.start(
      prompt="Review the codebase for security issues",
      system_prompt="You are a security auditor. Focus on OWASP Top 10 vulnerabilities. Output findings as a markdown checklist.",
  )
  ```
</CodeGroup>

## Permission Mode

Controls how the agent handles tool permissions:

<CodeGroup>
  ```typescript TypeScript theme={null}
  const session = await sandbox.agent.start({
    prompt: "Set up the project",
    permissionMode: "bypassPermissions", // default — agent runs freely
  });
  ```

  ```python Python theme={null}
  session = await sandbox.agent.start(
      prompt="Set up the project",
      permission_mode="bypassPermissions",
  )
  ```
</CodeGroup>

The default is `bypassPermissions` — the agent can use any available tool without confirmation. This is safe because the agent runs inside an isolated sandbox VM.

## Max Turns

Limit how many think → act → observe iterations the agent can perform:

<CodeGroup>
  ```typescript TypeScript theme={null}
  const session = await sandbox.agent.start({
    prompt: "Fix the failing test",
    maxTurns: 10, // default: 50
  });
  ```

  ```python Python theme={null}
  session = await sandbox.agent.start(
      prompt="Fix the failing test",
      max_turns=10,
  )
  ```
</CodeGroup>

Lower `maxTurns` to prevent runaway agents on simple tasks. The default is 50.

<Tip>
  Back to [Agents overview](/agents/overview). See also: [Events](/agents/events) · [Multi-turn](/agents/multi-turn).
</Tip>
