# Connect a Rivet harness

> Let your agent do it: Make Hermitbox the sandbox provider of my Rivet agent harness. Install `hermitbox` in the Rivet runner project, and set `HERMITBOX_API_URL` and `HERMITBOX_API_KEY` in its private environment, never in code or this chat. Replace the harness's sandbox factory with the page's `hermitboxProvider()` export, and keep the returned sandbox ID in actor state. Follow the exact steps in https://docs.hermitbox.dev/v0.3.2/integrations/rivet-harness.md.

Give an agent harness in a Rivet runner its sandboxes from Hermitbox. One export replaces the
harness's sandbox factory, and the provider then creates, connects, suspends and deletes Hermitbox
sandboxes for it.

1. Install `hermitbox` in your Rivet runner project.
2. Set `HERMITBOX_API_URL` and `HERMITBOX_API_KEY` in its private environment.
3. Replace the harness's sandbox factory with this export; keep the returned ID in actor state.

```ts
import { hermitboxProvider } from 'hermitbox/provider'

export const sandboxProvider = hermitboxProvider()
```

The provider reads the host's default tier and uses an image only for containers. File paths
resolve inside the sandbox's reported `cwd`.

Know what the default tier separates. Processes that share a UID must trust each other, and
processes with internet access share the host's network. Wasm has a virtual kernel and a shared
sidecar, and takes HTTP-only ingress. A named tier the host lacks keeps its admission refusal, and
this API version refuses a named guarantee it can't prove.

[The full integration guide](https://docs.hermitbox.dev/v0.3.2/integrations/rivet.md) covers what each hook does and which methods are partial.
OpenOrange 1.0.2 needs the prepared upstream patch, because its releases don't include that
provider hook; follow the guide before you try its registration or preview callback.
