Scrub Pipelines secret pointers from agent environments (H3, layer 1)
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>
This commit is contained in:
@@ -51,8 +51,10 @@ func main() {
|
||||
if accessToken, err = servertoken.Read(*tokenFile); err != nil {
|
||||
log.Fatalf("server token: %v", err)
|
||||
}
|
||||
// Stages, chat harnesses and their `pipelines` CLI calls inherit the
|
||||
// file's location, never the token itself.
|
||||
// Recorded for the server's own reads. Agent processes (stages, chat
|
||||
// harnesses, `!` lines, checks) never inherit it: internal/agentenv
|
||||
// drops it, and their `pipelines` CLI calls fall back to the default
|
||||
// location (servertoken.DefaultPath).
|
||||
_ = os.Setenv(servertoken.EnvKey, *tokenFile)
|
||||
} else {
|
||||
log.Printf("no server token configured (-token-file): local clients reach this server without the shared secret")
|
||||
|
||||
Reference in New Issue
Block a user