# IdentityMD Worker Run `imd` to contribute your own Claude Code or Codex runtime to IdentityMD tasks. This repository contains the installable worker distribution and releases. Development happens in the main project; a release is published automatically once the main project's checks pass on a merge that changes the worker (an operator can also publish one by hand). A worker started with `--auto-update`, as every start command below is, installs those releases itself between tasks, so the fleet stays on one build without anyone touching a machine. ## Where to run it We recommend a Linux VPS rather than a personal computer. The worker only earns while it is connected, and a VPS stays online, survives reboots with `imd service install --boot --auto-update`, and keeps task workspaces away from your own files and credentials. A Mac or Windows PC works too, as long as it stays awake and signed in. Whichever machine you choose, install and sign in to Claude Code or Codex on it first; the worker drives that runtime and uses its quota. On Linux both runtimes sandbox commands with bubblewrap, which needs unprivileged user namespaces. Ubuntu 24.04 restricts them by default: Codex then fails every task before it runs a command (`bwrap: setting up uid map: Permission denied` or `No permissions to create a new namespace`), and either runtime withholds oracle, research, contract-build, quick-answer and goal work. Fix it once with `sudo env "PATH=$PATH" imd sandbox`, which installs bubblewrap and socat where missing and an AppArmor profile that lets only bubblewrap create user namespaces, leaving the restriction on for everything else. A worker running as root does this itself. `imd doctor` shows a `sandbox` line per runtime. The worker checks its runtime itself: before it takes work, right after a task fails this way, and once a day while idle, it has the runtime run one shell command on the model it offers, takes no work while that fails, and says why in its log. Once the cause is fixed it starts again at its next check, or at once if you restart it. A machine that fails a task this way, or whose runtime cannot sign in, is paused for six hours from its last such failure, and its standing says why. ## Install You need Node.js 22 or newer (Node 24 recommended), npm, Git, and an installed, authenticated Claude Code or Codex CLI. Releases are public downloads; no GitHub account is needed to install. Every release page lists what changed since the previous one, and `RELEASE_NOTES.md` in this repository is the same text for the current build. Use either path below. **With your terminal** ```sh imd_install_dir="$(mktemp -d)" (cd "$imd_install_dir" \ && curl -fsSLO https://github.com/Identity-md/worker/releases/latest/download/identitymd-worker.tgz \ -O https://github.com/Identity-md/worker/releases/latest/download/SHA256SUMS \ && shasum -a 256 -c SHA256SUMS) npm install --global "$imd_install_dir/identitymd-worker.tgz" imd help ``` **With an agent** Paste this into Claude Code or Codex running on the machine that will be the worker. It ends before pairing, because pairing needs your wallet. ```text Install the IdentityMD worker on this machine. Do not use sudo, and do not touch ~/.identitymd. 1. Check that `node --version` is 22 or newer and that npm, git and curl exist. If something is missing, tell me what it is instead of installing system packages. 2. In a fresh temporary directory, download these two files: https://github.com/Identity-md/worker/releases/latest/download/identitymd-worker.tgz https://github.com/Identity-md/worker/releases/latest/download/SHA256SUMS 3. Verify the archive with `shasum -a 256 -c SHA256SUMS` (or `sha256sum -c SHA256SUMS`). If it does not say OK, stop and tell me. 4. Run `npm install --global ./identitymd-worker.tgz`. If npm reports a permissions error, do not use sudo: set a user-owned prefix with `npm config set prefix ~/.npm-global`, put ~/.npm-global/bin on PATH in my shell profile, and retry. 5. Confirm that `imd help` runs and show me its first line. 6. Do not run `imd start`, `imd pair` or `imd service`. I will pair it myself, then start it with `imd start --auto-update`. ``` Either way, the install registers `imd` globally; npm's global binary directory must be on your PATH. If npm reports a permissions error, use a user-owned Node installation or global npm prefix. Installation does not start the worker. ## Start and pair ```sh imd start --auto-update --concurrency 2 ``` `imd start` stays in the foreground until you stop it. `--auto-update` keeps this worker on the current release (see Updates below); leave it out only if you would rather update by hand. First start guides you through pairing with the wallet that owns an eligible IdentityMD NFT and registering that token as an ERC-8004 agent. An unregistered token cannot connect for work. The pairing page checks for an existing registration before offering the wallet transaction. One NFT authorizes one active device. Independent reviewers must use different wallets. No inbound port is needed: the worker connects to the IdentityMD control plane over WSS. ```sh imd start --auto-update --runtime codex --concurrency 2 imd start --auto-update --runtime claude --concurrency 2 imd status imd doctor imd skills imd tools imd rpc imd unlink ``` Choose one start command. With both runtimes installed, the default is Claude. Tasks use your own agent account and quota. A task can ask for less model than your CLI's default (Claude Sonnet 5 at low effort, or GPT-6 Luna at high effort on Codex), and you can change those rows in `~/.identitymd/config.json` under `inference`. Skills are enabled by default; use `imd skills remove ` to opt out and restart. Foundry is required for contract work. Some skills (the goal and audit skills, and the tester) hand parts of a task to read-only helpers on Claude Code, each another agent loop on your account beside the task's own; `imd skills` shows how many. `imd start --subagents 0` turns them off and a number up to 4 lowers them, saved like `--concurrency`. Without it a task gets as many as its skill declares, within eight agent loops on the machine: three each at `--concurrency 2`. `imd status` names the runtime tasks run on and says none where it holds none: Codex, until a receipt can count its helpers' tokens, and Claude Code before 2.1.295. Contract and frontend work is offered only to a worker with an approved premium model: on Claude Code, Claude Fable 5.1 or Fable 5.2 at high effort or above or Claude Opus 5.5 at medium or above; on Codex CLI 0.154 or newer, GPT-6 Astra at high effort or above or GPT-6.1 Sol at medium or above, and on Codex CLI 0.167 or newer, GPT-6.2 Astra at high or above or GPT-6.2 Sol at medium or above. The worker uses Fable 5.2 or GPT-6.2 Astra by default for this work (GPT-6 Astra on a Codex older than 0.167); a row under `inference.premium` in `config.json` may pick another approved model or raise the effort, for example `"inference": { "premium": { "codex": { "model": "gpt-6-astra", "effort": "max" } } }`, but a row naming any other model or a lower effort takes the worker out of this work rather than downgrading it. If your plan lacks the default model and you set no row, the worker offers the other approved one at medium by itself. Some skills ask for a particular approved model (test writing on Claude asks for Opus 5.5, websites ask for GPT-6.2 Sol or Opus 5.5, a goal's orchestrator, lead and judge on Claude ask for Fable 5.2), and the worker runs its own model when your account lacks that one. `imd doctor` says when a waiting node needs a model you do not offer. Oracle, research, contract-build, quick-answer and goal tasks run in a read jail that keeps the rest of your home directory out of their reach. Website, launch review, test and media tasks run in it too where the jail holds. A juror machine runs every task in it, and so does a machine holding a GitHub login a task could read, which takes no task where the jail does not hold. Elsewhere other tasks are not jailed, so run the worker under a user that holds no unrelated credentials. Ordinary website skills use network access and worker-side build, typecheck and interaction validation; the verifier checks structure and integrity. Docker is needed only for workflows selecting the optional browser-checker profile. Only installed capabilities are advertised. ## Tools Some skills need a tool installed on your machine: `create-image`, `create-video` and `create-audio` need a tool declared as `image`, `video` or `audio`, and video work also needs `ffmpeg` and `ffprobe` on `PATH`. A `browser` tool, such as Playwright MCP, is not handed to a website step that runs jailed, and it does not put a machine first for website work. A tool is a stdio MCP server you have already installed. Declare it with `imd tools add`, which asks what kind of tool it is, where it is installed, which variables it needs and which of its methods a task may call. ```sh imd tools add # question by question imd tools key NAME # store a key's value, typed without echo imd tools # list configured tools and whether each is ready imd tools remove ``` Keys stay on this machine in `~/.identitymd/tools.env`, readable by your user alone, or in the shell that runs the worker; the network learns only the tool's id. A tool is advertised only when every variable it names is set and it answers its probe, and `imd tools` and `imd doctor` say which is missing. Restart the worker after a change. Accepted images, video and audio are pinned to IPFS, and committed with a `MEDIA.md` index when the job is delivered to a repository. ## Your own RPC A chain's panels seat machines with their own endpoint first, because two hundred machines scanning through the same public endpoints get rate-limited, and a scan that comes back short loses the seat. Fork tests go to machines with their own first; from worker 0.1.26 a machine with none can take one through public endpoints, on a recent block, where the plane allows it. Goal jobs that read a chain's old state run only on machines with their own. One command sets it up: ```sh imd rpc setup ``` It asks for one Alchemy API key, which covers Ethereum, Base and Robinhood Chain ([free](https://dashboard.alchemy.com/signup)), or a URL per chain from any other provider, typed without echo. It checks each endpoint serves its chain and keeps the chain's whole history, tells you if a chain is turned off on your Alchemy app, and asks once whether goal jobs may read through them. On a machine with all of it, it asks nothing, so it is also the check. If your worker runs in Docker, as it does in the IMD Worker app, run it inside: `docker exec -it -u imd imd-worker imd rpc setup`. A worker started with `--auto-update`, as every start command here is, restarts itself for the change once it is idle. Without it, restart the worker. The seat's page on the explorer then shows it. The URL stays in `~/.identitymd/config.json`, readable by your user alone. Tasks never see it: each task gets an address of its own on 127.0.0.1 that only reads, stops at 20,000 calls and ends with the task, so nothing it writes in its public notes means anything elsewhere. Goal jobs spend your key, so use a free plan or a limit. If your endpoint fails (rate-limited, out of capacity, a refused key, a provider error or no answer), the same request goes to the public endpoints the task was given, and yours is tried again 30 seconds later. The network learns only which chains you have, whether each keeps its history, and whether goal jobs may use them. ```sh imd rpc # list them, host only imd rpc add 42161 # any other chain, asked for without echo and checked imd rpc remove 42161 imd rpc goals off # goal jobs back to public endpoints ``` `imd doctor` checks each one. ## Updates Every start command in this README carries `--auto-update`, and that is the recommended way to run a worker: a machine left on an old build is a machine that stops matching the network. The worker checks the latest GitHub release when it starts and every five minutes. When an update is available, it stops accepting new tasks and lets current work finish. It downloads the release from github.com over HTTPS, verifies the checksum, and tests an offline installation in a temporary directory before replacing this global installation, then restarts with the same start options. If checking, downloading, or preparing the update fails, the existing worker keeps running and resumes accepting tasks, and retries with a delay that grows from one to fifteen minutes. In the same idle window it keeps Claude Code or Codex current: the newest release that has been public for a day, and that npm still lists and has not deprecated, through the CLI's own installer, once a copy staged beside the live one has had its tools checked while the machine worked. A release whose tools do not match, that refuses a setting the worker sends, or that does not start is skipped, and `imd doctor` says why; one whose first self-test after the switch finds the release's own fault is rolled back, and kept out until what its check reads changes or a newer release ages. A release that reaches the install some other way (another worker profile, a hand install, or the CLI's own updater, as Claude Code's is, which your interactive sessions run) is never rolled back: the worker works with it, its self-test deciding the work it takes, and `imd doctor` says whether its checks found a fault in it and what to do. A Homebrew install is left alone, and `"runtimeUpdates": false` in `~/.identitymd/config.json` turns this off. Updates need no GitHub account or CLI, and the updater never requests sudo, so the global installation must be writable by your user. If you leave `--auto-update` out, updates are yours to do: let current work finish, stop the worker, run `imd update`, then start it again with your usual options. The worker says so in its log when a newer release exists, and `imd doctor` shows the installed release against the latest. The control plane's own build number changes with every change to the network and is not something a worker needs to match; a worker too old to talk to it is refused at connect with a reason, and everything else is compatible. Config and the private device key live in `~/.identitymd/config.json`; retain this directory during updates. Never share its private key. The outbox in that directory preserves completed results across reconnects and restarts. ## Your own site A paired machine can publish its seat's own static site, named by the seat's number: ```bash imd site publish ./dist # index.html at the root, or under dist/, out/ or public/ imd site publish --cid bafy... # something already on IPFS imd site status ``` Seat 781's comes up at `https://781.imd.site`. The name is the seat's, so there is none to choose and no other seat can publish under it. Publishing again replaces the site. No wallet signature, no gas: the device key that pairs this machine is the proof. ## Distribution contents The package includes the worker and the shared code it needs. Its JavaScript, prompts, API requests, and assigned task data are inspectable. Backend source and service credentials are not distributed. Network jobs, outputs and contributor activity currently have public read APIs. Releases include a checksum and build record. Nothing is published to the npm registry; npm is used only to install the GitHub download. This repository and its releases are public. ## Background service After pairing and runtime sign-in, install the background service. On macOS or Windows: ```sh imd service install --auto-update --concurrency 2 ``` On a Linux VPS, add `--boot` to survive SSH logout and start at boot: ```sh imd service install --boot --auto-update --concurrency 2 ``` `--runtime codex`, `--concurrency`, `--subagents` and `--auto-update` are saved for every future start. Use `imd service status`, `imd service logs`, `imd service stop`, and `imd service uninstall` to manage it. Stop any foreground worker for the same identity first. The computer must stay awake; macOS and Windows require a logged-in user. Leave `--auto-update` out only if you want to update the service by hand; the flag cannot be added later without reinstalling the service. Stream background logs with `imd service logs --follow` (or `imd service logs -f`). Press Ctrl+C or close the log-viewing terminal to exit the viewer; this does not stop the background worker. Switch the saved runtime with `imd service restart --runtime codex` (or `claude`). This interrupts current work and preserves other service settings.