Skip to main content
Tardie, the Tardigrade mascot, inside the boxd card. Tardigrade is a TypeScript framework for building durable, event-driven actors, built on Effect. Its agent template gives an agent bash, read, write, and edit tools, and a workspace decides where those tools run. The boxd workspace runs them on an isolated boxd machine. The actor, its event log, and its model calls stay on your Bun host, and so does your API key. It ships in tardie 0.56.0 and later.

Set up

1

Create an agent project

@boxd-sh/sdk is an optional peer dependency of tardie, so add it yourself. In an existing project, run bun add tardie @boxd-sh/sdk.
2

Create an API key

Put it in the project’s .dev.vars, which bun run dev loads:
Machines are created and billed in the key’s organization.
3

Mount the boxd workspace

In server.ts, replace localWorkspace with boxdWorkspace:
server.ts
boxdWorkspaceName(coordinate) names a machine after the actor, instance, and thread, so each thread gets its own machine. The name is tardie- followed by 16 hex digits. Start the host with bun run dev.

Check the workspace without a model

This script gives the workspace a name, runs commands on the machine, and writes a file, with no model or host involved:
check.ts
The first run creates the machine and hibernates it at the end. The second run adopts the same machine and finds the note the first one wrote, and the allowlist lets the npm registry through and blocks everything else:
org is only needed when the key can reach more than one organization.

Lifecycle

The first command creates the machine, or adopts the machine that already has the name. A restarted host adopts the same machine with its files. Without region, adoption looks in every region, and it fails when two regions hold the name or when a region doesn’t answer. A hibernated or suspended machine wakes on the next command, and a stopped machine is started first. release decides what happens to the machine when the workspace layer is released: Release covers a machine from the moment it is created, so a first command interrupted during startup leaves nothing behind under destroy. A command that runs past policy.commandTimeoutMs, 30 seconds by default, is cancelled, and its process on the machine is stopped.

Network

network becomes the machine’s egress allowlist when the machine is created. It defaults to none. The policy is fixed at creation. Adopting a machine whose allowlist differs from the requested policy fails, with both lists in the error.

Options

What each machine gets

  • Isolation: every machine is created isolated, and the workspace refuses to adopt one that isn’t. Code the agent runs holds no boxd credentials and can’t reach your other machines.
  • Commands as the boxd user in /home/boxd/workspace, through boxd’s exec and file APIs.
  • The default image: Ubuntu 24.04. For your own tools, start from a snapshot with snapshot.
  • A machine per thread: with boxdWorkspaceName(coordinate), two threads never share files or processes.
Tardigrade’s agent guide covers services, tools, and its other workspaces.