fix(models): omit plaintext api keys from models.json#84987
Conversation
|
Codex review: needs real behavior proof before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. from source inspection: docs support models.json-only custom providers, while current planning skips before merge/redaction when no resolved providers exist. I did not run a local generation path because this review is read-only. PR rating Rank-up moves:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. Real behavior proof Risk before merge
Maintainer options:
Next step before merge Security Review findings
Review detailsBest possible solution: Keep the redaction boundary, but make existing models.json-only providers flow through the same migrate-then-redact rewrite path and prove the upgrade in a real setup. Do we have a high-confidence way to reproduce the issue? Yes, from source inspection: docs support models.json-only custom providers, while current planning skips before merge/redaction when no resolved providers exist. I did not run a local generation path because this review is read-only. Is this the best way to solve the issue? No, not yet: stripping provider apiKey before serialization is the right boundary, but this patch needs to handle existing-only models.json providers and include real behavior proof. Label changes:
Label justifications:
Full review comments:
Overall correctness: patch is incorrect Security concerns:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 277a4b695264. |
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Fixes #11829.
This implements the Layer 1 hardening for
models.jsongeneration:apiKeyvalues before serializing agent-visiblemodels.jsonmodels.jsonkeys intoauth-profiles.jsonbefore redacting the generated file, so upgrades do not silently erase the only available credentialReal behavior proof:
ensureOpenClawModelsJson()was exercised through the existing models-config harness with a pre-existingmodels.jsoncontaining a plaintext provider key.models.jsonomits that plaintext key and the key is preserved inauth-profiles.jsonundercustom-proxy:models-json.OPENAI_API_KEYremains as a non-secret marker.Validation:
corepack pnpm exec vitest run --reporter=dot src/agents/models-config.applies-config-env-vars.test.ts src/agents/models-config.skips-writing-models-json-no-env-token.test.ts-> 4 files passed, 26 tests passedcorepack pnpm exec oxlint src/agents/models-config.ts src/agents/models-config.plan.ts src/agents/models-config.applies-config-env-vars.test.ts src/agents/models-config.skips-writing-models-json-no-env-token.test.tsgit diff --checkTaskBounty: https://www.task-bounty.com/task/fix-security-roadmap-protecting-api-keys-from-agen-uej5sq