Computer

Declare a named Linux guest. Shell nodes and agents bind it.

A computer is a named hand: a Linux guest with a promised set of commands, optional pinned packages, a scratch directory, and optional disk mounts. Binders use a computer. They are not one. A computer has no model.

Two binders name a computer. type: shell runs one bash command on a fresh guest, then throws the guest away. An agent may set computer and run its workspace tools on one guest of that computer, reused across the agent's sessions.

disk kb {}

computer pr_bot {
  label: "PR bot"
  software: { gh: "2.63.2", git: "2.47.0" }
  disks: [kb]
  resources: { cpus: 2, memoryMiB: 1024 }
}

node lint_pr {
  type: shell
  computer: pr_bot
  command: "gh repo clone \"$REPO\" /srv/workspace/repo"
}

What every computer promises

With or without software: pins, these commands are on PATH: bash, ls, cat, mkdir, cp, mv, rm, grep, sed, awk, find, tar, gzip, and the rest of the usual file and text tools. command: always runs under bash.

curl, git, gh, jq, node, bun, and python are not included. Declare them as quoted pins. There is no apt.

Fields

FieldRequiredNotes
label, descriptionnoDisplay strings. label defaults to the block name
softwareno{ package: "pin" }. Pins are quoted. A bad pin fails the deploy
disksnoNames of disk blocks. Mounted at /mnt/disks/<name> when a guest starts
resourcesnocpus, memoryMiB, diskGiB. Defaults are 2 CPUs and 1024 MiB, or 4096 MiB on a computer with a harness. Disk size may be omitted
harnessno{ type: coding, provider: <name> }, with claude, codex, pi, or hermes as the provider. See Coding harnesses

Scratch files live at /srv/workspace. On a shell node they disappear with that guest. Persist through disks. An agent guest keeps scratch for the life of that guest and shares it across the agent's sessions. A changed computer recipe starts a fresh agent guest and does not carry scratch over. /mnt/agent and mounted disks persist. See Run workspace tools on a computer.

Secrets stay out of the snapshot. A shell node allowlists vault vars (secrets: { block: [VAR] }) and the guest shell expands "$VAR". An agent's secrets block, including the provider key, is not injected into a computer guest.

Deploy

The first deploy of a recipe waits until the guest image is ready. A later deploy with the same recipe does not rebuild. A failed bake fails that deploy and leaves the previous deployment live.

Binding an agent to a computer that has no disks adds mount tooling and re-bakes that computer. A computer that already lists disks already has that tooling.

Cloud lists computers read-only under Build: name, pins, disks, resources, harness, snapshot state, the shell nodes that bind each one, and the agents that bind each one. An unbound computer shows none in both lists. The editor warns Computer "<name>" is not bound by any shell node or agent. swirls doctor does not.

Coding harnesses

A computer can run a coding harness: Claude Code, Codex, Pi, or Hermes. Name the provider in a harness block and Swirls supplies the harness itself, kept at its current release, so there is no package to pin and no version to update. A shell node bound to that computer calls the harness by name in its command:, with your API key passed in through secrets:. Only shell nodes bind a harness computer for now, so an agent whose computer: names one fails validation.

secret openai {
  vars: [CODEX_API_KEY]
}

computer codex_box {
  harness: {
    type: coding
    provider: codex
  }
  software: { gh: "2.63.2" }
}

workflow fix_tests {
  label: "Fix failing tests"

  root {
    type: shell
    computer: codex_box
    secrets: { openai: [CODEX_API_KEY] }
    command: "codex exec --dangerously-bypass-approvals-and-sandbox --ephemeral \"Fix the failing tests\""
  }

  node check {
    type: code
    code: @ts {
      const run = context.nodes.root.output
      if (run.exitCode !== 0) {
        throw new Error("codex exited " + run.exitCode + ": " + run.stderr.slice(0, 500))
      }
      return { ok: true }
    }
  }

  flow {
    root -> check
  }
}

The guest is the sandbox, so each harness runs headless with its own approval prompts and inner sandbox turned off:

ProviderHarnessCommand
claudeClaude Codeclaude -p "…" --dangerously-skip-permissions --no-session-persistence
codexCodexcodex exec --dangerously-bypass-approvals-and-sandbox --ephemeral "…"
piPipi --print --no-session "…"
hermesHermesHERMES_YOLO_MODE=1 hermes -z "…"

A harness computer always has git, ripgrep, curl, and ps on PATH, and defaults to 2 CPUs and 4096 MiB because that is what the vendors ask for. swirls doctor warns below that size. Leave the harness's own package out of software:, since Swirls owns its version. Pins for other packages work as usual, and a package name with a hyphen goes in quotes, such as "claude-code".

Keys and billing

Each harness signs in with your own credential, read from the shell node's secrets:. Claude Code takes ANTHROPIC_API_KEY or a full Amazon Bedrock or Google Vertex AI set, Codex takes CODEX_API_KEY or OPENAI_API_KEY, and Pi and Hermes take a key for any model provider they support. A run with no accepted key fails with harness_credentials_missing before a guest starts, and the error lists the variables that would have worked.

Usage bills to whoever owns the key. Swirls credits never cover harness usage.

A key inside a guest is readable by whatever runs there: your command, the harness, and anything that can steer the harness, such as a prompt that arrives through a webhook or instructions in a repository it clones. Give each harness computer a key scoped to one project with a spend limit, so a leaked key reaches as little as possible.

Signing in with a Claude or ChatGPT subscription is not supported yet. Harness computers run on API keys and inference provider credentials.

Results

A harness that fails usually exits non-zero, and a non-zero exit is returned as data: the shell node still succeeds and carries the exit code in its output. Check exitCode in the next node, as the example does, so a failed run does not pass as a good one.

stdout and stderr are each capped at 128 KiB, keeping the beginning, so a result the harness prints on its last line can be cut off. When the result matters, have the harness write it somewhere that outlives the guest, such as a pull request or a disk.

Run detail shows which harness version each shell node ran.

Availability

Providers become available one at a time, as each one passes Swirls' release checks. Until a provider is available, a deploy that names it is refused with a message naming the computer and the provider, so nothing deploys that would fail on every run. After that, new harness releases reach your runs on their own, with no redeploy.

On this page