Deployment security model¶
What operators must know before exposing Anvil Serving beyond one machine. To report a vulnerability, see SECURITY.md.
Transport: no TLS¶
The first-party HTTP services (router, controller, Anvil Workbench (dashboard serve) telemetry server, voice
Realtime server, model-swap multiplexer) speak plain HTTP and do not terminate TLS. Traffic that
crosses a host boundary must ride a private mesh such as Tailscale or a TLS-terminating
proxy. Prefer publishing a loopback listener with Tailscale Serve over binding every
interface; see Private networking with Tailscale. Network identity is
defense in depth on top of tokens, not a replacement.
Default binds¶
| Service | Default bind | Authentication |
|---|---|---|
| Router | 127.0.0.1:8000 |
Optional [server].auth_env |
| Controller | 127.0.0.1:8765 |
Token required unless --allow-unauthenticated-loopback |
Anvil Workbench (dashboard serve) |
127.0.0.1:8766 |
Optional --auth-env |
| Voice Realtime | 127.0.0.1:8765 (voice.realtime_host/realtime_port) |
Optional realtime_token_env |
| Model-swap multiplexer | 127.0.0.1:8000 |
None |
Listeners with no token must stay on loopback. The Host checks below stop DNS rebinding
from a browser; they do not stop a direct peer on the network. The multiplexer has no token at
all and only prints a warning when bound to a non-loopback address, so any reachable peer can
load and evict GPU models.
Router¶
- With
[server].auth_envset, every route exceptGET /healthzneeds the token as a bearer token orx-api-key. router runrefuses a non-loopback bind withoutauth_env(exit 2) unless--allow-unauthenticated-public-bindis passed. Use that flag only on an isolated network.- Without a token, the router answers 403
forbidden_hostunless theHostheader names127.0.0.1,[::1]or the exact--hostvalue. This blocks DNS rebinding. The dashboard telemetry server (no token, no web console), the multiplexer, and the voice Realtime server (novoice.realtime_token_env) apply the same rule. - With a wildcard bind (
--host 0.0.0.0), only loopbackHostnames pass, so remote clients that use a hostname or address get 403 even with--allow-unauthenticated-public-bind. Bind a specific address, or setauth_env. - See Running without a token.
Voice WebSocket origins¶
The Realtime server rejects a request carrying a browser Origin that is not in
voice.realtime_allowed_origins (empty by default), with or without a token. Requests with no
Origin header, such as native clients, are accepted. The introspection routes /pool and /usage require the token when one is configured.
GET /healthz needs no token and returns a constant {"ok": true} for readiness probes; the
Host rule still applies to it. See
Browser origins and Host checks.
Controller and MCP¶
- The controller token is host-level authority. The reference compose file
(
examples/primary-node/docker-compose.controller.yml) mounts/var/run/docker.sockinto the controller container, so anyone holding the token can drive Docker and should be treated as root on that host. Keep the controller on loopback or a private mesh and protect the token. confirm=trueand dry-run are operator safety gates, not access control. They stop accidental mutation and keep a preview step; any caller authorized to call the tool can supply the confirmation.- The legacy controller token is unscoped. It authenticates a "legacy" principal that may
call every tool that declares no scope (and the media scopes) without a scoped-policy entry.
Scoped credentials from the authorization policy are limited to their declared scopes
(for example
workloads:read). Hand scoped credentials to clients that need less, and keep the legacy token to operators. - Unauthenticated controller mode. With
--allow-unauthenticated-loopbackevery caller is the full-authority legacy principal. The controller applies a Host guard in that mode: a foreignHostgets 403 on every route, and aPOSTcarrying a non-loopback browserOrigin(or duplicateOriginheaders) gets 403. This stops DNS rebinding from a browser, not a direct local process or network peer. Configure the token anyway and avoid the flag on shared hosts. - Bind safety: a public address or wildcard (
0.0.0.0) needs--allow-public-bindeven with a token. Non-loopback binds always require the token.--allow-operation(repeatable) restricts the controller to declared operations. The reference compose file binds0.0.0.0inside the container and publishes127.0.0.1:8765on the host (ANVIL_CONTROLLER_PUBLISHoverrides).
Environment files¶
The router and the controller resolve token references from the process environment, then
$ANVIL_SERVING_HOME/.env, then ~/.env. ~/.env is read by default; set
ANVIL_SERVING_NO_HOME_ENV=1 to exclude it. The Workbench --auth-env and voice
realtime_token_env read the process environment only. Keep these files out of Git and mode 0600.
Anvil Connect sessions¶
- The Connect browser session lasts 8 hours by default and is configurable from 60 seconds to
24 hours (
gateway.browser_session_lifetime_seconds). It is independent of the identity provider's login lifetime; changes at the IdP do not shorten an existing Connect session. - Connect logout invalidates that human's Connect sessions and cancels admitted streams. It does not end the Authelia session, and a later sign-in can reuse it. End the Authelia session separately when a full sign-out matters.
- See Anvil Connect and identity.