> For the complete documentation index, see [llms.txt](https://docs.computesdk.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.computesdk.com/providers/brezel.md).

# Brezel

Brezel provider for ComputeSDK — self-hosted Firecracker sandboxes backed by operator-qualified immutable environments.

[Brezel](https://github.com/infercrane/brezel) is an open-source, self-hosted Firecracker sandbox runtime for autonomous agents.

## Installation

```bash
npm install computesdk @computesdk/brezel
```

Configure a project-scoped service token, the public HTTPS endpoint, and a prequalified immutable environment revision:

```bash
BREZEL_API_KEY=your_project_scoped_token
BREZEL_API_URL=https://brezel.example.com
BREZEL_PROJECT_ID=agents
BREZEL_ENVIRONMENT_REVISION=envr_qualified
BREZEL_ALLOW_INTERNET=false
```

## Usage

```typescript
import { brezel } from '@computesdk/brezel';

const compute = brezel({
  apiKey: process.env.BREZEL_API_KEY,
  baseUrl: process.env.BREZEL_API_URL,
  project: process.env.BREZEL_PROJECT_ID,
  environmentRevision: process.env.BREZEL_ENVIRONMENT_REVISION,
  allowInternet: false,
});

const sandbox = await compute.instances.create();
const result = await sandbox.runCommand('node --version');
console.log(result.stdout);
await sandbox.destroy();
```

## Configuration options

| Option                | Environment variable          | Description                                                               |
| --------------------- | ----------------------------- | ------------------------------------------------------------------------- |
| `apiKey`              | `BREZEL_API_KEY`              | Project-scoped Brezel service token.                                      |
| `baseUrl`             | `BREZEL_API_URL`              | Public HTTPS endpoint for the Brezel deployment.                          |
| `project`             | `BREZEL_PROJECT_ID`           | Project boundary used for sandbox operations.                             |
| `environmentRevision` | `BREZEL_ENVIRONMENT_REVISION` | Prequalified immutable environment revision used by default.              |
| `allowInternet`       | `BREZEL_ALLOW_INTERNET`       | Allows outbound internet access when exactly `true`; defaults to `false`. |
| `apiTimeoutMs`        | —                             | Timeout for Brezel management API operations, in milliseconds.            |

## Supported operations

| Method       | Supported | Notes                                                              |
| ------------ | --------- | ------------------------------------------------------------------ |
| `create`     | ✅         | Uses a prequalified immutable environment revision.                |
| `getById`    | ✅         | Returns `null` for absent or terminal sandboxes.                   |
| `list`       | ✅         | Lists active sandboxes in the configured project.                  |
| `destroy`    | ✅         | Waits for a confirmed terminal state or resource absence.          |
| `runCommand` | ✅         | Supports `env`, `cwd`, background execution, and output callbacks. |
| `getInfo`    | ✅         | Includes the environment revision and Brezel resource revision.    |
| `getUrl`     | ✅         | Creates a time-limited preview lease for a guest port.             |
| `filesystem` | ✅         | Native file reads/writes plus directory operations.                |
| `snapshot`   | ❌         | Not exposed through ComputeSDK yet.                                |

`templateId` may override the configured immutable environment revision for a single create call. Arbitrary image builds are intentionally outside the request path.

Create-time environment variables are not exposed because Brezel cannot yet restore them durably after reconnection. Pass environment variables to `runCommand` instead.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.computesdk.com/providers/brezel.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
