> ## Documentation Index
> Fetch the complete documentation index at: https://www.klavis.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Sandbox

> Scalable, isolated training and RL environments for real-world tool use

## The Problem

For LLM researchers, setting up LLM training or reinforcement learning environment for real-world tool use is complex and painful:

* Managing different environment or test accounts
* Implementing MCP Servers and handling various authentication issues
* Initializing realistic data
* Resetting states between multiple runs
* Ensuring isolation across concurrent sessions

## The Solution

Klavis MCP Sandbox as a Service solves these challenges. In addition to letting your model interact with our comprehensive MCP server ecosystem, you can use our sandbox infrastructure to easily **verify and reset data** on any concurrent run.

<Info>
  Our sandbox infrastructure is **horizontally scalable**, so it can handle any number of concurrent sessions as you need.
</Info>

## Lifecycle

<Steps>
  <Step title="Create">
    Request a sandbox based on the external services you need (Snowflake, GitHub, Notion, Woocommerce, etc.) and get an MCP server URL for that isolated instance.
  </Step>

  <Step title="Initialize">
    Load a deterministic "world state" in JSON format or via API. We handle everything—creating databases, setting up data, and more.
  </Step>

  <Step title="Interact via MCP">
    Let your LLM / AI agent use MCP tools against the sandbox as if it were the real app. You can use multiple MCP servers with many tools simultaneously.
  </Step>

  <Step title="Verify">
    Access the full sandbox state to programmatically compare against your ground truth—whether your LLM completed the task correctly or not.
  </Step>

  <Step title="Reset / Delete">
    Wipe the sandbox back to a clean state and kick off the next run.
  </Step>
</Steps>

## Video

<iframe
  style={{
width: '100%',
aspectRatio: '16/9',
border: 'none'
}}
  src="https://www.youtube.com/embed/10C18rpCYcA"
  title="Klavis Sandbox"
  allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
  allowfullscreen
/>

## Resources

<CardGroup cols={2}>
  <Card title="Example Notebook" icon="book-open" href="https://github.com/Klavis-AI/klavis/blob/main/examples/klavis-sandbox/klavis_sandbox.ipynb">
    Create sandboxes, seed data, run an agent, then verify and clean up.
  </Card>

  <Card title="Sandbox API" icon="box" href="/api-reference/sandbox/create">
    Manage isolated sandbox environments for training/eval: pooling, init, export, teardown.
  </Card>

  <Card title="Fireworks + Klavis" icon="fire" href="https://evalprotocol.io/integrations/klavis-mcp">
    Use Klavis MCP Sandbox with Eval Protocol for model training and RL at scale.
  </Card>
</CardGroup>
