# The Inspector

> The bundled UI — every operation the API and CLI offer, served same-origin at /inspector, keys kept in sessionStorage only, mutating actions behind a two-step confirm.

Source: https://docs.durable-runner.404human.dev/inspector/

The Inspector is the single-page UI `durable-server` serves at `/inspector` when it's started with
`--ui-dir`. In v1.0.0 it covers **every operation the API and CLI offer**: submit, the newest-first
run list, run detail, spec read-back, cancel, diagnostics, compact and backup — no separate
dashboard needed.

```sh not-
durable-server --journal journal --listen 127.0.0.1:58300 --ui-dir apps/inspector/build \
  --handler step=http://127.0.0.1:58320/step
```

Then open `http://127.0.0.1:58300/inspector` — a local page, on a local server.

The two screens most visits start on. First, the key field — the only thing standing between the
page and the run list:

![The Inspector's key field, before a key is entered](https://docs.durable-runner.404human.dev/shots/inspector-key-1440.png)

Then, once a key is in, the newest-first list — done runs, one still queued, a cancel button on
anything live:

![The Inspector's run list: two finished runs and one queued](https://docs.durable-runner.404human.dev/shots/inspector-runs-1440.png)

## Which key does what

Paste a key into the field at the top and the list loads. The two keys have honest boundaries, and
the UI enforces them the same way the API does:

- **`DURABLE_READ_KEY` views.** Listing runs and opening a run's detail are reads; the read key is
  all they need. Day-to-day browsing should carry this one.
- **The API key mutates.** Submit, cancel, spec read-back (the input may be customer content), and
  the admin operations — diagnostics, compact, backup — all need `DURABLE_API_KEY`. Mutating
  actions sit behind a two-step confirm so a stray click can't cancel a run.
- **Or no key at all** on an `--open-reads` server — which, being loopback-only, means your own
  machine anyway.

Where the key lives is the security-relevant part, so it's precise: **`sessionStorage`, and
nothing else.** Not `localStorage`, not a cookie, never the URL — the key dies with the tab, a
closed tab leaks nothing, and *Forget keys* clears it on demand. The key is never baked into the
build and never sent anywhere but the same-origin API.

## Same-origin by design

The Inspector is served by `durable-server` itself, so its API calls are relative — no CORS, no
configuration, no second origin to trust. Light and dark themes use semantic tokens rather than a
baked palette, and the two-row phone layout keeps run ids, keys and the cancel action unclipped at
390 px. What it never does: send your key anywhere but the origin that served it, or persist
anything beyond that one `sessionStorage` slot.
