# AI agents

Run AI coding agents inside a Buddy Sandbox, let agents operate Sandboxes over MCP, and host Claude Managed Agents on Buddy infrastructure.

Sandboxes and AI agents fit together in two directions: an agent can **run inside** a Sandbox, and an agent can **operate** Sandboxes from outside. Both are covered in depth in the [AI agents](/docs/ai-agents.md) section - this page is the map.

## Running an agent inside a Sandbox

A Sandbox is a clean, isolated machine with your repository already fetched, full `sudo`, and popular coding agents preinstalled. The agent gets a real environment to install, build, run, and break things in - and none of it touches your laptop.

Start here: [Run agents in a sandbox](/docs/ai-agents/sandboxes.md).

What to set up on the Sandbox side:

- [Git and Artifacts](/docs/sandboxes/git-and-artifacts.md) - get the repository in, and grant write access if the agent should push
- [Snapshots](/docs/sandboxes/snapshots.md) - prepare the toolchain once, start every agent from it
- [Terminal and SSH](/docs/sandboxes/terminal-and-ssh.md) - give each agent its own system user when several work in parallel
- [Files](/docs/sandboxes/files.md) - collect whatever the agent produced

## The agent changing its own Sandbox

An agent inside a Sandbox can reconfigure the machine it is on - expose a port, define an app, snapshot a good state - using the `this` command, with no identifier and no credentials. See [Self-management](/docs/sandboxes/self-management.md).

## Agents operating Sandboxes over MCP

Through the Model Context Protocol, an agent can create Sandboxes, run commands in them, manage apps and snapshots, and tear them down - as tools, from any MCP-capable client. See [MCP](/docs/ai-agents/mcp.md).

## Agent Skill

Buddy ships a skill that teaches agents the patterns of our API, CLI, and SDKs, so an agent orchestrating Sandboxes does not have to guess. See [Skills](/docs/ai-agents/skills.md).

## Claude Managed Agents

Anthropic runs the agent loop; Buddy runs the execution layer - an orchestrator Sandbox plus one isolated worker Sandbox per session, created from a prebuilt snapshot. A reference implementation is available. See [Claude Managed Agents](/docs/ai-agents/claude-managed-agents.md).

## Driving it from code

For your own orchestration, the [SDK](/docs/sandboxes/sdk.md) and the [REST API](/docs/api/sandboxes.md) expose the full Sandbox lifecycle.


---
Original source: https://buddy.works/docs/sandboxes/ai-agents