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

# LangSmith sandboxes

> Run CostGraph workflows and CI jobs in LangSmith sandboxes: the key to create, its permissions, and its limits

LangSmith Sandboxes are LangChain-managed isolated environments for executing code and working with a filesystem, managed from LangSmith workspaces via SDK, CLI or API.

The following table shows what CostGraph runs on this provider.

| Workflows | CI runners | Connect with |
| - | - | - |
| Yes | Yes | Integrations or your own dispatcher |

## Connect

Connect LangSmith on Integrations, and CostGraph starts sandboxes in your LangSmith account. You don't run anything yourself.

1. In CostGraph, go to **Integrations > Sandbox > LangSmith**.

2. Enter these fields:

   * **API key** (`LANGSMITH_API_KEY`, required): A LangSmith service key from Settings > API Keys.
   * **Sandbox endpoint** (`LANGSMITH_SANDBOX_ENDPOINT`, optional): A different LangSmith sandbox address, if you do not use the default.

3. Click **Connect**.

### Your own dispatcher

To keep the key out of CostGraph or reach a private network, run your own dispatcher instead.
Set `provider` to `langsmith` and the preceding fields as environment variables, as described in [Run your own dispatcher](https://docs.costgraph.ai/costgraph/workflows/managed-sandboxes.md#run-your-own-dispatcher).

To see what LangSmith costs, connect the [LangSmith integration](https://docs.costgraph.ai/costgraph/integrations/langsmith.md).

## Key and permissions

LANGSMITH\_API\_KEY is a LangSmith API key, created in Settings > API Keys: a service key (scoped to specific workspaces or the full organization, recommended for services) or a personal access token (inherits its creator's permissions).

Workspace permissions sandboxes:create, sandboxes:read, sandboxes:delete (lifecycle) are needed; exec and file ops are allowed for the sandbox's creator by default, so a single key that creates and execs needs no sandboxes:exec (other identities need sandboxes:exec). Use a service key scoped to the one workspace; Enterprise can assign a specific workspace role to a service key. Which built-in roles include these permissions is not documented.

Sources: [docs.langchain.com: sandbox permissions](https://docs.langchain.com/langsmith/sandbox-permissions.md), [docs.langchain.com: create account api key](https://docs.langchain.com/langsmith/create-account-api-key.md), [docs.langchain.com: sandboxes](https://docs.langchain.com/langsmith/sandboxes.md), [docs.langchain.com: sandbox sdk](https://docs.langchain.com/langsmith/sandbox-sdk.md).

## Limits

* CPU 0.05 to 16 vCPU; memory up to 64 GiB within 50% of 4 GiB per vCPU; disk up to 16 GiB per vCPU for non-persistent sandboxes. ([source](https://docs.langchain.com/langsmith/sandbox-sdk.md))
* idle\_ttl\_seconds default 600 (10 minutes) stops the sandbox after inactivity (any command or file I/O resets it; 0 disables); stop discards filesystem writes on non-persistent sandboxes. delete\_after\_stop\_seconds max 30 days. ([source](https://docs.langchain.com/langsmith/sandbox-sdk.md))
* Generally available on GCP US/EU/APAC, AWS US and BYOC; non-Enterprise orgs get restricted egress (allowlist) by default. ([source](https://docs.langchain.com/langsmith/sandboxes.md))

## Related

* [Supported sandbox providers](https://docs.costgraph.ai/costgraph/workflows/sandbox-providers.md)
* [Run workflows on a managed sandbox provider](https://docs.costgraph.ai/costgraph/workflows/managed-sandboxes.md)
* [Run CI jobs in sandboxes](https://docs.costgraph.ai/costgraph/autopilot/ci-sandboxes.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.