> For the complete documentation index, see [llms.txt](https://docs.cloud.olakrutrim.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cloud.olakrutrim.com/basics/core-infrastructure/sandbox.md).

# Sandbox

Krutrim Cloud Sandbox provides isolated, ephemeral cloud environments for running code, testing applications, executing workloads, and supporting AI agentic workflows.

Sandboxes can be created and managed through the Krutrim Cloud Console, SDK, API, and MCP.

## What you can do

* Isolated compute
* A dedicated workspace
* Command execution
* File management
* Environment configuration
* Sandbox lifecycle management

## Create a Sandbox

The currently available region is `In-Bangalore-1`.

### Using the Console

You can create a Sandbox from the Krutrim Cloud Console by providing the required configuration.

<table><thead><tr><th width="289.8984375">Setting</th><th>What to configure</th></tr></thead><tbody><tr><td><strong>Sandbox Name</strong></td><td>Specify a unique name for your Sandbox.</td></tr><tr><td><strong>Region</strong></td><td>Select the region where you want to deploy the Sandbox.</td></tr><tr><td><strong>Compute</strong></td><td>Select the CPU and memory configuration based on your workload.</td></tr><tr><td><strong>Expiry (TTL)</strong></td><td>Specify how long the sandbox should remain active. If no TTL is specified, the sandbox will remain active for the default duration of <strong>one hour.</strong></td></tr><tr><td><strong>Environment Variables</strong></td><td>Configure environment variables required by your workload.</td></tr></tbody></table>

### Create a Sandbox with MCP

Prefer an AI client? See [Create a Sandbox with MCP](/basics/core-infrastructure/sandbox/create-a-sandbox-with-mcp.md) for API-key prerequisites, configuration discovery, reviewed creation inputs, and readiness checks.

### Compute Configuration

Choose a Sandbox flavor based on the compute requirements of your workload.

| Flavor          | vCPU |     RAM |
| --------------- | ---: | ------: |
| sandbox-nano    | 0.25 | 0.5 GiB |
| sandbox-small   | 0.50 |   1 GiB |
| sandbox-medium  |    1 |   2 GiB |
| sandbox-large   |    2 |   4 GiB |
| sandbox-x-large |    4 |   8 GiB |

Each Sandbox provides 20 GB of ephemeral storage.

## Work in your Sandbox

### Workspace

Each Sandbox provides a workspace at:

`/app`

Use `/app` to store application code, scripts, configuration files, generated files, and other workload data.

### Run Commands

You can execute commands within an active Sandbox.

Commands can be used to:

* Run application code and scripts
* Install dependencies
* Build applications
* Run tests
* Process data
* Execute other supported workloads

### Manage Files

You can manage files within a Sandbox.

Supported file operations include:

* Upload files from your local environment to the Sandbox
* Download files from the Sandbox to your local environment
* List files and directories within the Sandbox

Files used by your workload are stored within the Sandbox and are subject to its lifecycle.

### Environment Variables

Environment variables can be configured when creating a Sandbox.

They can be used to provide runtime configuration to applications and commands running within the Sandbox.

### Storage

{% hint style="warning" %}
Sandbox storage is ephemeral.

Use the Sandbox for temporary execution and workload storage. If data or artifacts need to persist beyond the Sandbox lifecycle, store them in an appropriate external storage or database service.
{% endhint %}

## Sandbox Lifecycle

A Sandbox progresses through the following states:

| State           | What it means                                      |
| --------------- | -------------------------------------------------- |
| `deploying`     | The Sandbox is being provisioned.                  |
| `active`        | The Sandbox is ready for use.                      |
| `deleting`      | The Sandbox is being removed.                      |
| `failed_deploy` | The Sandbox could not be successfully provisioned. |

You can explicitly delete a Sandbox when it is no longer required.

### TTL (Sandbox Lifetime)

TTL determines how long a Sandbox remains active.

The TTL is an **absolute lifetime from the time the Sandbox is activated**.

{% hint style="warning" %}
It is **not an idle timeout**. Using the Sandbox or making API requests does not reset the TTL.
{% endhint %}

#### TTL Limits

If no TTL is specified, the sandbox will remain active for the default duration of **one hour.**

#### Extend Sandbox Lifetime

You can explicitly extend the Sandbox lifetime using the TTL update operation.

Extending the TTL requires an explicit action. Normal activity within the Sandbox does not extend its lifetime.

### Sandbox Management

From the Krutrim Cloud Console, you can view and manage your Sandboxes, including:

* View Sandbox status
* View Sandbox configuration
* Create a Sandbox
* Delete a Sandbox
* Manage Sandbox lifetime

## Agentic Harness Integration

### Current Integration

Native execution-backend integration with an agentic harness is not currently available. A connected MCP client can provision and manage Sandboxes through explicit tool calls.

Follow [Create a Sandbox with MCP](/basics/core-infrastructure/sandbox/create-a-sandbox-with-mcp.md) to discover configurations, review the request, approve creation, and check readiness.

#### Prerequisites

* A Krutrim Cloud account with the required permissions
* A Krutrim Cloud API key configured privately
* A connected MCP client, or an explicitly configured SDK/API workflow

#### Workflow

1. Review and approve creation of the Sandbox, then check that it is active.
2. Explicitly configure the workflow to target the created Sandbox for remote execution.
3. Approve the required workload separately before running it in the Sandbox.

{% hint style="warning" %}
Creating a Sandbox does not automatically redirect the agent session or its local terminal into that Sandbox. Remote execution requires an explicit workflow targeting the Sandbox.
{% endhint %}

#### Example request

```
Use Krutrim Cloud MCP to prepare a Sandbox in In-Bangalore-1.
Show the available flavors and templates, ask me to choose them,
explain the expiry, and wait for my approval before creating anything.
Do not run commands or transfer files yet.
```

### Planned Integration

Native plug-in integration with agentic harnesses is planned for a future phase and will provide a more seamless Sandbox experience.

## Best Practices

* Select a compute flavor based on the requirements of your workload.
* Use `/app` as the Sandbox workspace.
* Use TTL when you want the Sandbox to have a defined lifetime.
* Delete Sandboxes when they are no longer required.
* Do not use ephemeral Sandbox storage as a persistent data store.
* For agentic workflows, explicitly configure the agent to use the Krutrim Cloud Sandbox until native plug-in integration is available.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.cloud.olakrutrim.com/basics/core-infrastructure/sandbox.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
