Skip to content

ADR-0008: A one-click demo that runs only on a developer's machine

  • Status: Accepted
  • Date: 2026-11-28

Context

Seeing Keelgate Cloud work meant creating an API key, copying it into a terminal and running a script. The step that most often failed was silent: the demo's large trade needs EXPLICIT_SIGNOFF, which nobody has by default, and the instructions did not say so. A button in the dashboard would let someone understand the product, or show it, without a terminal.

A browser cannot run the agent, and ADR-0006 keeps agents outside the control plane: the gate runs where the agent runs, and the control plane records and routes approvals.

Decision

A separate demo runner container, added to the local Compose stack by an overlay file. The Demo page calls the dashboard's server, which mints a temporary API key and hands it to the runner. The runner runs the shipped example, examples/cloud_governed_agent.py, unchanged in what it proposes.

browser --(no key)--> dashboard server --(runner token + temporary key)--> demo runner
                           |                                                   |
                           +------ session: mint / revoke --> control plane <--+ agent API

Off unless someone adds it

The dashboard shows the page only when KEELGATE_DEMO_RUNNER_URL and a token of at least 32 characters are set. Only deploy/docker/compose.demo.yml sets them. A test asserts that the base Compose file, the Helm chart and the Terraform never mention the runner.

What a caller can influence

  • The browser sends nothing the runner sees. The dashboard route never reads the request body.
  • The runner accepts exactly org_id, key_id and api_key. The program, the control-plane address, the trades and the limits are fixed in its image and environment.
  • Starting needs a same-origin POST from a signed-in owner.
  • The runner publishes no port, checks its own token in constant time, runs as a non-root user with a read-only filesystem and no capabilities, and runs one demo at a time. The time it waits for a person is capped.

The temporary key

The user does not paste a key. Pasting would add steps and one more place that handles a secret.

  • It is never sent to the browser, written to disk or logged; the runner holds it in memory.
  • The runner makes it revoke itself when the run ends, whether it succeeded or failed, and on SIGTERM. This needed one new endpoint, POST /v1/keys/self/revoke. It can only remove access, only from the calling key, and it deliberately skips plan, billing and rate-limit checks. Revoking from the dashboard instead would have left the key live whenever the tab was closed.
  • If the runner is killed outright, the key survives until the next run, when the dashboard revokes unrevoked keys with the demo's name that are more than a minute old. It also expires after a day.

Approval stays with a person

The page does not grant clearance and does not approve. It explains that the owner must grant EXPLICIT_SIGNOFF on the Team page, and sends them to the normal Approvals page. A shortcut would have taught the wrong thing about the product. The sign-off code is not passed through the runner.

Rejected

  • Run the agent inside the control plane. Fewer parts, but it breaks the ADR-0006 boundary and puts agent execution beside every tenant's data.
  • Simulate events in the dashboard. Nothing would be gated, so the demo would prove nothing.
  • Let users upload or edit the agent. That is running customers' code on our servers: a different product with a far larger attack surface, and it needs a real sandbox.

Consequences and limits

  • This helps someone understand Keelgate. Customers' agents still run on their own machines and connect with an API key.
  • The runner shares the local stack's Docker network, so it can reach Postgres at the network level. It has no database credentials.
  • Run state is in memory: restarting the runner forgets the last run. The audit log keeps it.
  • A leftover approval request from a run nobody decided stays pending until it expires.
  • An owner who gives their own key the reserved name demo-runner (temporary) will have it revoked by the next demo run.
  • A demo run counts towards the organisation's usage, like any agent.