Repository navigation
fix: strip apiKey from models.json to prevent secret leakage (Layer 1, #11829) - #83754
jing11223344 wants to merge 1 commit into
Conversation
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as superseded: the useful Layer 1 problem is now tracked by a canonical issue, while this branch is conflicting, lacks real behavior proof, removes marker-backed auth too broadly, and only targets the old root models.json serialization path. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: #88562 is open and specifically tracks generated models.json apiKey serialization plus plugin catalog sidecar leakage. So I’m closing this here and keeping the remaining discussion on #88562. Review detailsBest possible solution: Keep the canonical generated-catalog secret issue open and land one marker-aware, security-reviewed fix that covers root models.json, plugin catalog sidecars, runtime auth, and audit behavior. Do we have a high-confidence way to reproduce the issue? Yes for the patch defect: source inspection shows the PR deletes every provider apiKey, while current main recognizes non-secret apiKey markers and requires apiKey for generated provider rows with models unless auth explicitly allows missing keys. I did not run mutating tests because this review is read-only. Is this the best way to solve the issue? No. The patch is root-only against an older planner shape and removes marker-backed auth metadata indiscriminately; the safer path is the canonical issue's marker-aware root/plugin catalog fix. Security review: Security review needs attention: The diff touches credential persistence and needs attention because it removes auth markers indiscriminately, misses current plugin catalog sidecars, and uses an unassigned CVE placeholder.
AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 6069a030c4ed. |
|
ClawSweeper applied the proposed close for this PR.
|
Description
Layer 1 quick fix for #11829: strip
apiKeyfrom each provider before serializing tomodels.jsonto prevent secret leakage into prompt context.Problem
The model catalog serializes resolved
apiKeyvalues intomodels.json, which gets included in prompt context. This can leak LLM provider keys to the agent.Fix
Before writing
models.json, each provider'sapiKeyfield is stripped via object destructuring. The rest of the provider config (endpoint, model list, parameters) is preserved.Changes
src/agents/models-config.plan.ts: Added sanitization step inplanOpenClawModelsJsonWithDeps()between secret resolution and JSON serialization.Verification