New internal/agentenv drops every PIPELINES_* variable naming a token,
secret, password, auth file or key (except *_PUBLIC_KEY) from the
environment of processes started for agents: Claude stages and chats
(direct and hosted), Pi stages, OpenCode stage CLI calls and serve
processes, check commands, delivery-gate checks, `!` shell lines, the
run's workspace environment and turn-diff git snapshots. MCP servers are
children of the harness and inherit its scrubbed environment. The
interactive terminal is unchanged. An agent's `pipelines` CLI call falls
back to the default server-token location.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The server answered any Host, so a DNS-rebinding page reached /connect (101)
and could drive terminals. Every route now refuses a non-loopback Host on a
loopback connection (421), /connect refuses any Origin (403), and a server
started with -token-file requires X-Pipelines-Token (401; /mcp and /healthz
exempt). The CLI/TUI send the token only to loopback URLs.