jcard.toml

The jcard.toml tells mb which mixtape to boot and which agents to run.

Minimal example

mixtape = "opencode-mixtape:latest"

[[agents]]
harness = "opencode"
prompt = "Hello world!"

Top-level fields

FieldTypeRequiredDescription
mixtapestringyesMixtape image and tag to boot.

[[agents]] section

Multiple agents can run concurrently inside a single sandbox. Each [[agents]] entry defines an independent agent managed by agentd.

FieldTypeDefaultDescription
namestringauto-generatedUnique identifier for this agent. If omitted, auto-generated from harness (e.g. "claude-code", "claude-code-1").
harnessstringAgent runner: "claude-code", "opencode", "gemini-cli", or "custom". Required.
typestring"sandboxed"Execution mode: "sandboxed" (gVisor container) or "native" (tmux session).
promptstring""Prompt passed to the agent at startup. Empty starts interactive mode.
prompt_filestringPath to a prompt file inside the VM. Overrides prompt if set.
workdirstring"/workspace"Working directory for the agent process.
restartstring"no"Restart policy: "no", "on-failure", or "always".
max_restartsint0Max restart attempts. 0 = unlimited.
timeoutstringMax run duration ("30m", "1h", "2h"). Unset = no limit.
grace_periodstring"30s"Time between SIGTERM and SIGKILL on shutdown.
sessionstringagent nametmux session name.
extra_packagesstring[][]Additional Nix packages to install. Only valid for type = "sandboxed".
replicasint1Number of identical agents to launch. See Replicas.

[[shared]] section

Mount host directories into the sandbox. Each [[shared]] entry maps a host path to a guest mount point using virtio-fs. Paths are relative to the jcard.toml location.

FieldTypeDefaultDescription
hoststringDirectory on the host machine. Required.
gueststringMount point inside the VM. Required.
readonlyboolfalsePrevent the agent from modifying host files.
[[shared]]
host = "./"
guest = "/workspace"
readonly = false

Multiple shared directories are supported:

[[shared]]
host = "./"
guest = "/workspace"

[[shared]]
host = "/tmp/data"
guest = "/data"
readonly = true

The agent’s workdir typically points to a shared mount so that agents can read and write files on the host.

[agents.env]

Extra environment variables for the agent process.

[[agents]]
harness = "opencode"

[agents.env]
ANTHROPIC_API_KEY = "${ANTHROPIC_API_KEY}"

Restart policies

PolicyBehavior
noRun once, never restart.
on-failureRestart only on non-zero exit.
alwaysRestart on any exit, up to max_restarts.

Replicas

The replicas field launches multiple identical agents from a single spec. Each replica gets a unique name suffixed with its index.

[[agents]]
name = "reviewer"
harness = "claude-code"
prompt = "Review the code for bugs."
replicas = 5

This creates 5 agents: reviewer-0, reviewer-1, reviewer-2, reviewer-3, reviewer-4.

If replicas = 1 (the default), no suffix is added — the agent keeps its original name.

Replicas share the same configuration but run independently. Useful for launching swarms of agents performing the same task.

Examples

Shared workspace with an agent:

mixtape = "opencode-mixtape:latest"

[[shared]]
host = "./"
guest = "/workspace"

[[agents]]
harness = "claude-code"
prompt = "Fix the failing tests."
workdir = "/workspace"

Single agent with restart and timeout:

mixtape = "opencode-mixtape:latest"

[[agents]]
harness = "opencode"
prompt = "Fix the failing tests."
workdir = "/workspace"
restart = "on-failure"
max_restarts = 3
timeout = "1h"

[agents.env]
ANTHROPIC_API_KEY = "${ANTHROPIC_API_KEY}"

Multiple agents in one sandbox:

mixtape = "opencode-mixtape:latest"

[[agents]]
name = "reviewer"
harness = "claude-code"
prompt = "Review the PR for security issues."

[[agents]]
name = "coder"
harness = "opencode"
prompt = "Implement the feature described in TASK.md."

Agent swarm with replicas:

mixtape = "opencode-mixtape:latest"

[[agents]]
name = "worker"
harness = "claude-code"
prompt = "Process items from the work queue."
replicas = 10

Interactive session (no prompt):

mixtape = "opencode-mixtape:latest"

[[agents]]
harness = "opencode"
workdir = "/workspace"

Sandboxed agent with extra packages:

mixtape = "opencode-mixtape:latest"

[[agents]]
harness = "claude-code"
type = "sandboxed"
extra_packages = ["ripgrep", "fd", "python311"]