Security
Console's trust boundary is the OS account it runs as. What Console protects, what it cannot, and how to deploy it safely.
The trust boundary is the OS user
Anything running as the OS account Console runs as can read Console's home and act as Console. That includes its identity key, which daemons trust as a controller, and its tokens. If an agent runs as that same account with shell access, a prompt injection can make it connect to your daemons as Console and approve its own tool calls. Console cannot fix that from inside the same account. What it does:
- For the default home (
~/.viewport/console), the identity and review keys go to the OS keychain when one is available. Any other--home, and the default home without a keychain, keeps them in files inside the home (0600), sealed whenVIEWPORT_CONSOLE_ENCRYPTION_KEYis set. - The CLI's own token has no
approvescope, but it can mint a sign-in link, which signs in as the local admin. Treat it as approve-equivalent: anything that can read<home>/cli-tokencan answer approvals. Only the default home is hidden by every daemon on the machine, so only there are its links full. In any other home (a--home,$VIEWPORT_CONSOLE_HOME, or a home this machine's daemon verified) an agent of a daemon started elsewhere could read the token, so over the network the token itself can only read, and its links sign in read only. The linkserveprints to its terminal is never written to disk and keeps every permission. - Secrets at rest (the review key, relay tokens, HITL secrets, store DSNs) are sealed when
VIEWPORT_CONSOLE_ENCRYPTION_KEYis set, and plaintext left from before is sealed on the next start.doctorlists every secret still stored in plaintext. viewport-console doctorsays which protections are active and warns for every daemon that reports no child isolation.- Console refuses a home inside the current directory or any temp directory the daemon lets agents write
(
$TMPDIR,/tmpand/private/tmp, macOS's per-user temp dir). Agents can write to all of them.
Child isolation. What the daemon reports in hello decides what Console shows:
| The daemon reports | What it means | What Console shows |
|---|---|---|
child_isolation: "home" (the 0.32.0 default) | Every agent process runs in an OS sandbox (sandbox-exec on macOS, bubblewrap on Linux) that cannot read ~/.viewport, Console's default home included | No isolation warning |
"home" on a machine with no working sandbox | The daemon fails closed: every runner is unavailable with a reason that names the fix, and no session starts | The runner as unavailable with the daemon's reason; starting a session returns the daemon's daemon.runner_unavailable (422) |
child_isolation: "none" (isolation turned off, or an older daemon) | Agents running as the same OS user can read the daemon's home and Console's key | A warning in viewport-console doctor, on the Daemons screen, and when Console pairs the daemon on this machine |
For a daemon that reports "none", or agents you do not trust at all, use a separate OS user or a container, or
run Console on another machine.
Console's home must be one the daemon hides. The sandbox denies Console's home at ~/.viewport/console, or
wherever the daemon's environment sets VIEWPORT_CONSOLE_HOME. For any other home, agents can read Console's keys
and CLI token, so use export VIEWPORT_CONSOLE_HOME=<dir> for the daemon and Console both instead of --home.
Console checks: for a home that is neither, it does not pair this machine's daemon on start
(console.home_unprotected; --unprotected-home overrides), doctor and serve warn with the export line, and
the CLI token's sign-in links leave out approve and admin. Console also sends its home's real path in the local
pairing offer (console_home); a daemon that supports it adds the home to its deny roots and lists them in
hello.isolation, and Console then checks its home against that list instead of assuming.
Every daemon on the machine counts, not just the paired one. A daemon knows only its own environment and the
homes a Console named to it. Another daemon on the same machine, started without the export, hides only
~/.viewport/console, so its agents can read a home anywhere else. hello.isolation verifies the home for the daemon
that sent it, never for the others. So Console treats a home from $VIEWPORT_CONSOLE_HOME as unverified, and one
verified by this machine's daemon as verified for that daemon only: in both, doctor, serve and the web UI's
Doctor say so, and the CLI token and its sign-in links can only read. Console's keys in such a home stay
readable by those agents (sealed only with VIEWPORT_CONSOLE_ENCRYPTION_KEY). Use the default home when more than
one daemon runs as your user.
Threats and mitigations
| Threat | Mitigation |
|---|---|
| Script in Console's origin through agent output | The web UI renders untrusted text as text. Strict CSP (default-src 'self', script-src 'self', frame-ancestors 'none', require-trusted-types-for 'script'). Results files are served as JSON with nosniff, never as HTML |
| Approvals crafted to look benign | Full args are always reachable. Large actions are fetched in full and checked against their digest before they can be answered. Policy reasons are shown apart from agent text |
| Stale or mismatched answers | The answer carries the digest of what was shown; Console and the source both check it. The outbox keeps one message id per answer |
| Cookie leakage to other loopback ports, CSRF | No cookies in local mode: a bearer token in localStorage. Origin and Sec-Fetch-Site are checked. Bodies are JSON only. The live WebSocket needs a single-use ticket |
| DNS rebinding | Host must be 127.0.0.1:<port>, localhost:<port> or the configured public_url |
| Spoofed identity behind a proxy | Proof required: Tailscale whois of the connection's ip:port, a Cloudflare Access JWT, or a proxy secret from a trusted address. 401 without it. In Tailscale mode a connection from this machine itself gets no identity; Tailscale Serve's identity header counts only on loopback with trust_serve_headers, which any local process can forge |
| Forged or replayed HITL messages | Signatures over the raw body, a 5 minute window, message id dedupe for 24 hours, a per-source rate limit, a 1,000,000 byte cap. Reviews on the console channel are Ed25519-signed by a key the gated app never sees |
| Leaked HITL approve links | links are dropped on ingest |
| A malicious relay | It cannot read or forge messages. Its reject frames and close reasons are shown as unverified and never delete a pairing |
| Phishing or SSRF through pair links | Admin-only pairing behind a confirmation with full fingerprints. Console never dials link-local, cloud metadata (including 100.100.100.200, IPv4-mapped, IPv4-compatible, 6to4 and NAT64 forms) or 0.0.0.0/8 addresses. Residual risk: the check resolves the host, then the dialer resolves it again, so a DNS server that answers differently the second time (rebinding) can still steer the dial. Pairing is admin-only and shows the daemon's fingerprint before it completes |
| Path traversal through sources | Admin-only registration, realpath confinement, allowlisted names, no dotfiles |
| Tampering with history | Hash chains verify on every read. Anchors kept outside Console catch a full rewrite |
| Secrets in logs and receipts | Silent logs. Receipts hold digests of args (never the args) and only a byte count for session input. Obvious secrets are redacted before events are cached; a redact hook and cache.output: false go further |
Fail closed
When Console cannot deliver an answer before the approval expires, it records answer_undelivered and assumes
nothing. The source's own timeout denies.
Deploy safely
- Local mode binds loopback only; Console refuses anything else.
- For remote access, put an identity-proving proxy in front (proxy auth) and publish
the port on loopback:
127.0.0.1:7071:7071. - Set
VIEWPORT_CONSOLE_ENCRYPTION_KEY(32 random bytes,openssl rand -hex 32) wherever the home is backed up or shared.