Files
devvm/testdata/script
w3cjandClaude Opus 5.5 7dba353351 fix(agentlogin): Redact parses settings files whole and scrubs what ~/.claude.json's servers lose
A VM with network policy got secrets from the agents' settings files that
Redact couldn't read or didn't look for: TOML lines it couldn't parse
(multi-line arrays, quoted dotted keys, spaces around dots) were copied as
they were, and JSON's string lists, URLs and env values under names that
don't look secret were never scrubbed.

Redact now parses each file whole (JSON with UseNumber, TOML with
BurntSushi/toml), refuses one that doesn't parse, and writes the copy from
what it parsed, through one walk for both formats: values under
secret-looking keys, and lists and tables under them (but key bindings);
every value of env and headers tables (env, environment, headers,
http_headers, shell_environment_policy.set), but references, paths, URLs
(scrubbed, or whole under a credential's name: credName) and true, false
and numbers up to five digits; scrubURL for every URL; scrubArgs for every
list; known key shapes anywhere. scrubArgs also scrubs URLs in arguments
and in --flag=URL, for ~/.claude.json too.

Claude Code's own settings env (settings.json's top-level env) keeps its
documented configuration variables (claudeEnv: ANTHROPIC_MODEL and the
model families, CLAUDE_CODE_*, DISABLE_*, MAX_*, *_TIMEOUT_MS), unless the
name says it's a credential (credName: KEY, TOKEN as a word, SECRET, PASS,
AUTH, CREDENTIAL, COOKIE, HEADER), so Claude in the VM keeps its model and
limits. MCP servers' env and headers keep no value.

Tests: TestRedactTOMLLeavesNothingUnread, TestRedactJSONArraysURLsAndEnv,
TestRedactClaudeEnv (failing before), TestRedactTOML and TestRedactRefuses
updated; sync.txtar's unreadable config.toml is now one that doesn't parse.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 14:45:38 -07:00
..