Irida docs
Irida runs code in a sealed sandbox, billed per second, with one way out: a gate that opens only to the hosts you name and adds your API keys outside the sandbox. Every request that tries to leave ends up in a signed receipt.
First run
Node 18.17 or newer. No signup: the CLI makes an ed25519 key on first use, and that key is your account. A new account gets 0.02 USDG of cloud time on its first request, once.
$ npx irida run --cloud -- echo hello
✓ session opened 0x8c41…a20e https://api.irida.run
rate 0.0004 USDG/s · budget 0.24 USDG · worker shell (sh) · node 0x4a5b…4be5
gate closed · no network
hello
✓ receipt signed ~/.irida/receipts/0x8c41….json
✓ settled 0.0004 · refund 0.2396 (ledger)
Install it if you use it often: npm i -g irida, then the command is irida. Without --cloud the command runs on your own machine and is metered and signed locally, with no money moving.
| FLAG | WHAT IT DOES |
|---|---|
--worker | shell, python (3.12 with numpy and matplotlib) or node (24) |
--budget | Most USDG the session may hold. It stops when the budget runs out; the rest is refunded. |
--allow | Hosts the gate opens to, comma separated |
--secret | Names of stored keys the code may use through the broker |
--quiet | Hide the live gate lines |
Account and money
irida account --cloud prints your account id, balance, trial and recent sessions. Sessions hold their budget when they open and pay for the seconds used when they close, per started second at 0.0004 USDG. Fund an account by depositing USDG to the vault on Robinhood Chain from the fund page with your account id.
Opening the gate
A sandbox has no network device. Pass --allow and the node starts a gate for the session; inside the sandbox, HTTP_PROXY and HTTPS_PROXY point at it, so curl, pip, npm, Python's urllib and requests, and Node's fetch all go through it without changes.
$ irida run --cloud --worker python --allow pypi.org,files.pythonhosted.org \
-- pip install --target . requests
⇄ gate https pypi.org tunnel open
⇄ gate https files.pythonhosted.org tunnel open
Successfully installed …
✓ gate on receipt 2 requests · 0 refused · 3.1 KB up · 612.4 KB down
Use *.example.com for every subdomain of example.com (not example.com itself). Anything not on the list gets a 403 from the gate, which is logged:
$ irida run --cloud --allow pypi.org -- curl -s https://collect.example
⊘ gate refused collect.example (not allowed)
Keys through the broker
Store a key once. It stays in ~/.irida/secrets.json (mode 600) on your machine, pinned to one https origin:
$ echo "$OPENAI_API_KEY" | irida secret add openai https://api.openai.com
✓ openai stored · goes only to https://api.openai.com as authorization
$ irida secret ls
A bare token for the authorization header is sent as Bearer <token>. For other APIs pick the header, for example --header x-api-key for Anthropic.
Run with --secret openai. Inside the sandbox, call $IRIDA_GATE/openai/<path>. The gate drops any authorization the code sends, adds the stored header and forwards the request to the pinned origin:
# ask.py
import os, requests
r = requests.post(os.environ["IRIDA_GATE"] + "/openai/v1/responses",
json={"model": "gpt-5", "input": "Say hi"})
print(r.json()["output_text"])
$ irida run --cloud --worker python --secret openai -- python ask.py
⇄ gate POST openai/v1/responses → 200 1.2 KB up · 2.4 KB down · key added at the gate
Say what a key may do
An agent that reads a poisoned page can still ask the gate to use your key. Give each key the calls it is for, and a ceiling per session. The gate checks both before the key is added:
$ echo "$GITHUB_TOKEN" | irida secret add github https://api.github.com --only "GET /repos/*/*,GET /repos/*/*/issues" --max 50
✓ github stored · goes only to https://api.github.com as authorization · only GET /repos/*/*, GET /repos/*/*/issues · up to 50 requests per session
$ curl -X DELETE $IRIDA_GATE/github/repos/you/app
irida gate: key "github" may not be used for DELETE /repos/you/app (allowed: GET /repos/*/*, GET /repos/*/*/issues)
A rule is a method (or *) and a path. * matches one path segment, ** any number of them. Encoded slashes in broker paths are refused, so a path means the same thing to the gate and to the API.
Replies are checked for the key
Some APIs echo request headers back. The gate asks the origin for uncompressed replies and replaces the key, and the bare token inside it, with [irida:redacted] in every header and body that comes back, even when it is split across chunks. The receipt line for that request carries "scrubbed": true.
Take access back mid-run
The owner can remove hosts or keys from a running session. Open tunnels to a removed host are cut at once and the change is logged in the receipt:
await s.revoke({ hosts: ["api.github.com"], secrets: ["openai"] });
Rules and limits
| RULE | VALUE |
|---|---|
| Ports | HTTPS on 443 through the tunnel; plain http on 80 to listed hosts |
| Names | Host names only. Connecting by IP address is refused. |
| Addresses | Names that resolve to private, loopback, link-local, carrier-grade NAT or metadata addresses are refused |
| Hosts per session | 32 allowlist entries, 8 keys |
| Traffic per session | 500 requests, 64 MB both ways |
| Raw sockets | No route: the sandbox has only its own loopback |
| Key rules | Up to 32 method and path rules per key, and an optional request ceiling per session |
| Processes | A per-session process cap inside the sandbox; a fork flood stops there |
The receipt
When a session closes the node signs one receipt (ed25519 over canonical JSON) with the commands and exit codes, seconds, money, a sha256 of all output, and the gate:
"net": {
"allow": ["api.github.com"],
"secrets": [{ "name": "openai", "origin": "https://api.openai.com", "header": "authorization", "rules": ["POST /v1/responses"], "key": "hmac:3f9a0c1e77b2d415" }],
"requests": 2, "denied": 1, "up": 1612, "down": 14720,
"log": [
{ "t": 391, "k": "deny", "host": "collect.example", "port": 443, "why": "not allowed" },
{ "t": 560, "k": "tls", "host": "api.github.com", "port": 443, "up": 429, "down": 4196, "ms": 164 },
{ "t": 905, "k": "broker", "secret": "openai", "host": "api.openai.com", "method": "POST",
"path": "/v1/responses", "status": 200, "up": 1183, "down": 10524, "body": "sha256:9be1…" }
]
}
t is milliseconds since the session opened. tls lines are tunnels: the gate sees the host and byte counts, not the content. broker lines carry the method, path, status and a sha256 of the response body. A session without a gate has "net": null.
Anchors
A signature proves which node wrote a receipt. An anchor proves it has not been changed or back-dated since. Every hour the node seals the receipts closed since the last batch:
- Each receipt's leaf is
sha256(0x00 ‖ canonical JSON), signature included. - The leaves form a merkle tree whose inner nodes are
sha256(0x01 ‖ left ‖ right), so a leaf can never stand in for an inner node. An odd node at the end of a level moves up unchanged. - The batch head is
sha256(previous head ‖ root), so every batch commits to all the batches before it. - The node posts the head to the IridaAnchor contract on Robinhood Chain as soon as the batch is sealed, and retries until it lands. The contract accepts batches in order only, and recomputes the chaining itself: a head that is not
sha256(last head ‖ root)is refused.
Each receipt names the contract and chain it will be anchored to ("anchor": { "chain": 4663, "contract": "0x…" }), inside the signed body.
Proof for any receipt: GET /v1/receipts/<session>/proof returns the leaf, its path, the root, the previous head, the head and the chain transaction.
Verifying
$ irida verify 0x5c810677d479…253e3 --log
✓ valid · session 0x5c81…53e3 · 1s · paid 0.000400 USDG · signed by node 0x4a5b…4be5
✓ gate · 1 requests · 2 refused · allow api.github.com
391ms deny collect.example not allowed
560ms tls api.github.com 429/4196
✓ in batch #1 of 2 · merkle path checked · head a9b4…1178
✓ on chain · read from rpc.mainnet.chain.robinhood.com: contract 0x3e1d…90aa holds this head in block 128402117 · tx 0x91c2…7e0a
It accepts a receipt file, a session id or a receipt URL. The last line comes from the chain, not from the node: verify fetches the transaction from an RPC and checks that the contract named in the receipt emitted this batch's head. Use --rpc <url> to pick the RPC. A receipt that should have been sealed more than two batch periods ago but is in no batch fails verification. --offline checks the signature only. Irida Scan does the same checks in the browser, including the merkle path and the chain read.
Proving a node
Verifying checks one receipt. irida prove checks the whole node, from your machine, with no key and no wallet:
$ npx irida prove
- Who it is. The node answers, and its manifest (site, docs, repo, package, X account, anchor contract) is signed by the same key that signs receipts.
- A real run. It sends a probe through
POST /v1/try. Inside a real sandbox the probe opens a raw socket to 1.1.1.1, asks the gate for example.com and for the cloud metadata address 169.254.169.254, and fetches one allowlisted host. - Judged by the receipt. The signature, that the output you received hashes to the output that was signed, that the bill is seconds times rate with the rest refunded, that both refusals and the allowed request are in the signed gate log, and that the raw socket failed.
- The public copy. The same receipt is served at
/v1/receipts/<session>, byte for byte. - Its own record. The node runs the same probe on itself every 30 minutes and publishes every result at
/v1/canary; prove checks the latest is recent and passing. - On chain. One anchored receipt from the feed is walked from its merkle leaf to the batch head, and the head is read from a chain RPC, not from the node.
Agents can do the same with the irida_prove MCP tool. Irida Scan shows the latest self-check and the public feed.
MCP for agents
$ claude mcp add irida -- npx -y irida mcp --allow pypi.org,files.pythonhosted.org,api.github.com
--allow on the server is the ceiling: an agent may open the gate to those hosts, or fewer, never others. Without it the ceiling is the package registries (PyPI, npm) and GitHub. Keys the agent may use are the ones stored on the machine; the agent passes names, never values. --max-budget caps what one tool call may hold (default 0.10 USDG).
| TOOL | USE |
|---|---|
irida_run | One job: code or command, input files, output files, net: { allow, secrets }, receipt |
irida_session_open | A sandbox that stays up across calls, gate set when it opens |
irida_exec | Run in an open session; /work persists |
irida_session_close | Pay, refund, return the verified receipt |
irida_account | Balance, permitted hosts, stored key names |
irida_quote, irida_verify, irida_receipts | Price, check and list receipts |
irida_prove | Check the node end to end before trusting it with keys or funds |
SDK
import { cloud } from "irida";
const node = cloud("https://api.irida.run");
const s = await node.open({ worker: "python", budget: "0.05",
net: { allow: ["api.github.com"] } });
const out = await s.exec("python3 -c \"import urllib.request as u; print(u.urlopen('https://api.github.com/zen').read())\"",
{ onGate: (e) => console.log("gate", e.k, e.host) });
const receipt = await s.stop(); // verified before it is returned
console.log(receipt.net.log);
HTTP API
Requests that touch an account are signed with its ed25519 key (headers x-irida-key, x-irida-ts, x-irida-nonce, x-irida-sig over method, path, time, nonce and the body's sha256). The CLI and SDK do this for you.
| ROUTE | WHAT |
|---|---|
GET /v1/node | Rate, workers, gate support and limits, anchor settings |
POST /v1/sessions | { worker, budget, net?: { allow: [], secrets: [{ name, origin, header, value, rules?, max? }] } } |
POST /v1/sessions/:id/exec | { cmd }; NDJSON stream of stdout, stderr, gate and exit lines |
POST /v1/sessions/:id/net | { revoke: { hosts: [], secrets: [] } }; narrows the gate of a running session |
POST /v1/sessions/:id/stop | Close, settle, return the receipt |
GET /v1/receipts/:id | A closed session's receipt (public) |
GET /v1/receipts/:id/proof | Its merkle proof and anchor (public) |
GET /v1/anchors | Sealed batches, newest first (public) |
GET /v1/stats | Totals and recent sessions (public) |
POST /v1/try | { worker, cmd }; a short run with no key, behind the gate with the node's demo allowlist, paid by the node; returns stdout, stderr and the signed receipt (public, rate limited) |
GET /v1/feed | Recent closed sessions: kind, seconds, paid, gate tallies, batch and anchor tx; accounts are never shown (public) |
GET /v1/canary | The node's self-checks: last result, streak and history (public) |
GET /v1/manifest | Who runs the node, signed by the node key (public) |