Reference
The riskbound command
The riskbound command runs Riskbound on your own machine: the API, the
dashboard, Postgres and Redis, and the MCP gateway if you want it, all in
Docker. It also makes agent keys, tries and pushes policies, and checks
evidence exports.
Install#
You need Docker with Compose v2 (Docker Desktop, or Docker Engine with the compose plugin on Linux).
curl -fsSL https://riskbound.ai/install.sh | shThe script checks Docker, then puts a standalone binary in ~/.local/bin,
checked against the release's SHA256SUMS. With no binary for your system
it uses npm install -g riskbound into the same place. It never uses sudo
unless you pass --sudo. Pass --dry-run to see what it would do. With
Node 22 or later you can also skip it: npx riskbound <command>.
riskbound.ai is a placeholder until the domain is bought.
Five minutes#
riskbound initriskbound upinit makes ~/.riskbound/. up pulls the images, applies the database
migrations, starts everything, waits until it is healthy, and prints:
Riskbound is running.
Dashboard http://localhost:3210
API http://localhost:8000
Admin key rb_admin_...
Saved to ~/.riskbound/credentials (mode 600). It is not shown again.Sign in to the dashboard with that key. Then give your agent a key of its own:
riskbound keys create --agent support-botAnd try a policy before it goes live. With refunds.cedar from
docs/use-case-refunds.md:
riskbound policy test refunds.cedar --tool refund --params '{"amount_minor": 48000}' refund {"amount_minor":48000}: ask_human (refund-needs-approval) [no live policy]When it does what you want, make it live:
riskbound policy push refunds.cedarCommands#
| Command | What it does |
|---|---|
init [--here] [--owner <org>] [--version <tag>] | Makes the install folder: compose file, .env with fresh secrets, config.json, the evidence public key |
up [--gateway] [--no-pull] | Pulls, migrates, starts, waits for health, prints the URLs and the admin key |
down | Stops everything. Data is kept |
status | What is running and whether it is healthy. Exits 1 if not |
logs [service] [-f] [--tail <n>] | Logs of api, dashboard, gateway, postgres or redis |
upgrade [--version <tag>] | New compose file, newer images, migrations, restart |
uninstall [--yes] | Deletes the containers, the data volumes and the install folder. Asks first |
keys create --agent <name> | Registers the agent if it is new and makes an agent key. Shown once |
keys list [--json] | Every key of the tenant: admin, agent and gateway |
policy test <file> --tool <tool> [--params <json>] [--expect <outcome>] | Tries a Cedar file with the simulator. Nothing is stored |
policy test <file> --cases <cases.json> | Tries a list of cases. Exits 1 if one does not get its expect |
policy push <file> [--note <text>] [--draft] | Stores the file as a new version and makes it live, unless --draft |
verify <export> [--public-key <pem>]... [--seal <file>]... [--require-signed] | Checks an evidence export offline: the hash chain, signatures and seals |
Every command takes --dir <path> to pick the install. Without it: the
RISKBOUND_HOME variable, then ./riskbound/ if init --here made one, then
~/.riskbound/.
keys and policy use RISKBOUND_API_URL and RISKBOUND_ADMIN_KEY when both
are set, so they also work against a Riskbound server elsewhere.
A cases file for policy test:
[
{ "name": "refund $40", "tool": "refund", "params": { "amount_minor": 4000 }, "expect": "allow" },
{ "name": "refund $480", "tool": "refund", "params": { "amount_minor": 48000 }, "expect": "ask_human" },
{ "name": "refund $900", "tool": "refund", "params": { "amount_minor": 90000 }, "expect": "block" }
]Each case may also set agent, spent_today_minor and dry_run_supported.
The install folder#
| File | What |
|---|---|
docker-compose.yml | The stack, a copy of deploy/local/docker-compose.yml. upgrade replaces it |
.env | What compose reads: settings from config.json, and the generated Postgres, Redis and dashboard secrets and evidence signing key. Mode 600 |
config.json | Images, ports, project name, whether the gateway runs |
credentials | The first admin key, as RISKBOUND_ADMIN_KEY=.... Mode 600 |
evidence-public.pem | The public half of the evidence signing key. verify uses it by default |
gateway.json, gateway.env | Yours to write if you use the gateway (see gateway/README.md) |
To change images or ports, edit config.json and run riskbound upgrade.
Images are <registry>/<imageOwner>/riskbound-{api,dashboard,gateway}:<imageTag>.
The image owner defaults to riskboundhq, the GitHub organisation that
will publish the images. init --owner <org> sets another one, for example
your own fork. The tag defaults to the CLI's own
version, so a CLI and the images of the same release match.
What it does on first start#
The compose file runs the API with RISKBOUND_MODE=self_host. On its first
start, with an empty database, the API makes one tenant and one admin key and
prints the key once to its log. up reads it from there (any rb_admin_...
token) and saves it to credentials.
On a server from before self-host mode, the log has no key and
GET /v1/setup answers 404. Then up makes the first tenant with the API
image's create-tenant command instead. A self-host server that already made
its tenant is never given a second one: if the key is lost, up says so and
stops.
A new install will not open a database volume it did not make. If a volume
with its project name is already there, up stops and names it.
Safety#
- Every port is bound to 127.0.0.1. Postgres and Redis have no host port.
- The API connects as
riskbound_app, under row-level security. The owner password and the dashboard's session secret are not in its environment. - Evidence is signed with a key made on your machine by
init. uninstallasks before deleting anything, and keeps the folder if the data volumes could not be removed.- No telemetry. The CLI talks only to Docker and to your own API. The dashboard image has Next.js telemetry off.
Develop#
npm install
npm run typecheck && npm test && npm run build
node dist/riskbound.mjs --helpnpm run build bundles everything into dist/riskbound.mjs with no runtime
dependencies. The compose file and scripts/verify-evidence.ts are built in
from the repository. The release workflow turns that file into standalone
binaries with bun build --compile.
To try the whole flow with images built from this checkout:
docker build -t ghcr.io/local/riskbound-api:dev .
docker build -f deploy/gateway.Dockerfile -t ghcr.io/local/riskbound-gateway:dev .
docker build -f dashboard/Dockerfile -t ghcr.io/local/riskbound-dashboard:dev dashboard
node cli/dist/riskbound.mjs init --owner local --version dev
node cli/dist/riskbound.mjs up --no-pull