---
name: bijection-e2b
description: "Evaluate and integrate the E2B Sandboxes component with Bijection."
---

# E2B Sandboxes

E2B sandboxes for Bijection agent applications

- Package: @bijectionhq/e2b
- Category: Sandboxes
- Status: Preview
- License: MIT
- Bijection source (repository access required): https://github.com/bijectionhq/e2b/tree/2024f8d7d5fdb7eeb855eb92d57829b05f39a6b2
- Upstream: https://github.com/e2b-dev/e2b-convex/tree/1ed44191acdcd0f9b024e7fd91dd614544bc6821
- Documentation: https://docs.bijection.com/components/using
- Directory: https://bijection.com/components/e2b

## Get the source

Bijection repository access is required. Request access at https://bijection.com/contact.

```sh
git clone https://github.com/bijectionhq/e2b.git
cd e2b
git checkout 2024f8d7d5fdb7eeb855eb92d57829b05f39a6b2
```

## Before using this component

Read the package README at the recorded revision for setup, dependencies, and API examples. Upstream documentation describes the original package and may differ from the Bijection adaptation. This is a source candidate for evaluation. Catalog inclusion does not establish npm availability or runtime qualification. Check compatibility with your SDK and deployment before adoption. External providers run their own compute.

## Integration workflow

1. Read the source README and package manifest at the recorded revision.
2. Confirm the required SDK, dependency availability, and runtime compatibility.
3. Follow the component's documented setup and configuration. Never invent an npm install command from a catalog package name.
4. Keep credentials in the project's existing secret store.
5. Follow the project's execution rules for verification and report what was actually checked.

## Original upstream skill

The following guidance describes @e2b/convex. Its installation commands and APIs refer to the upstream package. Evaluate compatibility with the Bijection source separately.


> Agents: read this skill fully before writing code that uses E2B Sandboxes. Follow the installation and configuration steps exactly.

# E2B Sandboxes

## Instructions

Use E2B Sandboxes to run persistent e2b cloud sandboxes from convex actions with a v8-compatible client for shell commands, files, preview hosts, and ai agent tools. This Convex component integrates directly with your backend.

### Installation

```bash
npm install @e2b/convex
```

Current npm version: `@e2b/convex@0.1.1`

### Capabilities

- Reuse running or paused sandboxes across Convex actions via scope/key identity without managing sandbox IDs manually
- Integrate sandboxes directly into Convex Agent or AI SDK tool chains using purpose-built adapters with no full E2B Node SDK in the runtime
- Execute shell commands and bounded file operations inside isolated cloud environments from within Convex action handlers
- Control sandbox lifecycle, timeout behavior, and resume-on-access semantics without custom orchestration code

## Examples

### how to run shell commands in a Convex action

The @e2b/convex component exposes a runCommand method on the E2B client that executes shell commands inside a persistent cloud sandbox from a Convex action. You identify the sandbox with a scope and key pair, and calls with the same pair reuse the existing sandbox automatically. Command output is bounded to 32 KiB per stream and capped at 1 MiB total.

### persistent sandbox for AI agent in Convex

The @e2b/convex component integrates with the Convex Agent framework via createAgentTools from @e2b/convex/agent, which creates thread-aware sandbox tools with optional approval rules. Sandboxes pause on timeout and resume automatically when any operation targets them, so agent sessions can persist across multiple turns without manual lifecycle management.

### how to give an AI agent code execution capabilities in Convex

Using @e2b/convex, you can expose E2B sandbox operations as AI SDK tools inside any Convex action via createAiSdkTools from @e2b/convex/ai. This gives the agent access to shell commands and file operations inside an isolated cloud environment. File tool access is restricted to /home/user and /tmp by default, and the getHost preview capability is opt-in.

### run E2B sandbox from Convex without Node.js SDK

The @e2b/convex package ships a V8-compatible E2B client that includes only the Process and Filesystem protocol descriptors needed by the component, avoiding Node built-ins and the full E2B SDK. This makes it compatible with the Convex JavaScript runtime, which does not support Node-only packages.

## When NOT to use

- When a simpler built-in solution exists for your specific use case
- If you are not using Convex as your backend
- When the functionality provided by E2B Sandboxes is not needed

## Troubleshooting

**Does @e2b/convex require the full E2B Node.js SDK?**

No. @e2b/convex ships its own V8-compatible E2B client that includes only the Process and Filesystem protocol descriptors the component needs. The full Node-oriented E2B SDK is not imported into the Convex runtime. The pinned e2b package is a development-only dependency used as a protocol source.

**How does sandbox persistence work across multiple Convex action invocations?**

Sandboxes in @e2b/convex are identified by a scope and key pair you provide. If a sandbox with that identity is already running or paused, getOrCreate returns it instead of creating a new one. Paused sandboxes resume automatically when any operation targets them, which also restarts E2B billing for that session.

**What are the file operation limits in @e2b/convex?**

File reads in @e2b/convex default to 64 KiB and are capped at 1 MiB. File writes are capped at 4 MiB. File tools are restricted to /home/user and /tmp unless the configuration is explicitly changed. These limits apply to both direct action usage and agent tool integrations.

**Can I use @e2b/convex with Convex Agent and the Vercel AI SDK?**

Yes. @e2b/convex provides separate integration entry points: createAgentTools from @e2b/convex/agent for Convex Agent, and createAiSdkTools from @e2b/convex/ai for standard AI SDK usage inside any Convex action. Each integration requires its own peer dependency (ai, and optionally @convex-dev/agent), but the core package has no runtime dependency on either.

**Is @e2b/convex ready for production use?**

The package is pre-1.0 and the authors recommend validating it against your E2B template and network policy before deploying to production. The component uses E2B's public APIs and CI rejects Node built-ins or full-SDK imports in the emitted Convex runtime. A scheduled real-service test monitors for protocol drift.

## Resources

- [npm package](https://www.npmjs.com/package/%40e2b%2Fconvex)
- [GitHub repository](https://github.com/e2b-dev/e2b-convex)
- [Live demo](https://github.com/e2b-dev/e2b-convex/tree/main/example)
- [Convex Components Directory](https://www.convex.dev/components/e2b/convex)
- [Convex documentation](https://docs.convex.dev)