---
title: "Hermes Agent integration"
description: "Run Hermes Agent in an E2B sandbox from the prebuilt hermes template, with its sessions, memory and self-made skills kept in the sandbox."
url: "https://e2b.dev/integrations/hermes"
---

# Hermes Agent

> Run Hermes Agent in a sandbox from the prebuilt hermes template. Its terminal and file tools work on the sandbox, and its memory, sessions and skills stay there between turns.

Coding agents · [All integrations](https://e2b.dev/integrations.md)

## About this integration

- **Maintained by:** E2B
- **How it works:** Prebuilt hermes sandbox template
- **Package:** e2b
- **Language:** TypeScript, Python
- **Upstream:** [NousResearch/hermes-agent · ★ 265k](https://github.com/NousResearch/hermes-agent)
- **Example:** [e2b-cookbook/hermes-incident-playbook-python](https://github.com/e2b-dev/e2b-cookbook/tree/main/examples/hermes-incident-playbook-python)

## Get started

Paste the prompt into your coding agent, or follow the steps yourself.

### Paste this into your coding agent

```text
Run Hermes Agent in an E2B sandbox from this project.

1. Install the e2b SDK using the project's package manager.
2. The SDK needs the E2B_API_KEY environment variable, and Hermes needs a model provider key such as OPENROUTER_API_KEY. If E2B_API_KEY isn't set, ask me for my API key from https://console.e2b.dev/?tab=keys. Never hardcode either key.
3. Follow the Hermes Agent guide at https://docs.e2b.dev/agents/hermes: create a sandbox from the hermes template, pass the provider key in envs, and run hermes chat -Q --yolo -q for a single headless turn. Kill the sandbox when it's done.
4. Run one task and show me the output that came from the sandbox.
```

## Or set it up yourself

### 1. Install the E2B SDK

```bash
pip install e2b
```

### 2. Set your API keys

```bash
export E2B_API_KEY="e2b_..."
export OPENROUTER_API_KEY="..."
```

### 3. Run a headless turn

```python
import os
from e2b import Sandbox

sandbox = Sandbox.create("hermes", envs={
    "OPENROUTER_API_KEY": os.environ["OPENROUTER_API_KEY"],
}, timeout=600)

result = sandbox.commands.run(
    'hermes chat -Q --yolo --provider openrouter '
    '--model anthropic/claude-sonnet-4.6 '
    '-q "Inspect this workspace and summarize its purpose"',
)

print(result.stdout)
sandbox.kill()
```

### 4. Continue the session

```bash
hermes chat -Q --yolo -c -q "Continue the investigation and implement the first fix"
```

## What runs in the sandbox

Hermes runs inside the sandbox, so its terminal and file tools act on the sandbox, not your machine.

- **Tools:** Terminal, file, browser, memory and skill tools, auto-approved with --yolo and contained by the sandbox.
- **State:** Skills under ~/.hermes/skills and memory under ~/.hermes/memories last as long as the sandbox does.
- **Sessions:** Conversations are saved in the sandbox. -c continues the latest one, --resume picks one by ID or title.
- **Secrets:** Your host files and credentials stay out unless you copy or pass them into the sandbox.

## More coding agents

Other coding agents that run in E2B sandboxes.

- [OpenClaw](https://e2b.dev/integrations/openclaw.md): Host an always-on OpenClaw agent in a sandbox and chat with it from its web UI or Telegram.
- [Pi](https://e2b.dev/integrations/pi.md): Run the Pi coding agent in a sandbox, or keep Pi local and send its tool calls to E2B with @e2b/pi.
- [OpenCode](https://e2b.dev/integrations/opencode.md): Run OpenCode in a sandbox, or keep it local and point its workspaces at E2B with the @e2b/opencode plugin.

## Links

- [Get API key](https://console.e2b.dev/?tab=keys)
- [Read the docs](https://docs.e2b.dev/agents/hermes)
- [E2B documentation](https://docs.e2b.dev)
