Every sandbox pod exposes a /tty WebSocket endpoint that the lap CLI and browser terminal attach to. Access is gated by a shared secret — HARNESS_AUTH_TOKEN.
Why it exists
AWS ALB (and most corporate proxies) strip Authorization headers from WebSocket upgrade requests. A header-only auth scheme would silently fail behind a load balancer. The harness accepts the token as a ?token= query parameter instead, which survives the upgrade.
How it flows
If HARNESS_AUTH_TOKEN is absent from the platform env, tty_token in the session response is null — the CLI connects with no token and the harness returns 401.
Bootstrap
The deploy pipeline seeds HARNESS_AUTH_TOKEN automatically on first deploy. For existing clusters, set it once:
Existing warm-pool pods were created without the token and will still return 401. Delete them after the restart so new pods pick up the value.
Rotating the token
- Generate a new value:
openssl rand -hex 32
- Update the secret and restart web + worker (same commands as bootstrap above).
- All new sessions pick up the new token immediately.
- Any active session (already
ready) holds the old token in its tty_token field — those sessions will stop accepting TTY connections after the rotation until restarted.