Skip to content

fix(secrets): trust source-managed models env markers - #87873

Closed
Alix-007 wants to merge 1 commit into
openclaw:mainfrom
Alix-007:issue-87723-secrets-audit-env-ref
Closed

Alix-007 wants to merge 1 commit into
openclaw:mainfrom
Alix-007:issue-87723-secrets-audit-env-ref

Conversation

@Alix-007

@Alix-007 Alix-007 commented May 29, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #87723

Summary

  • track models.providers.*.apiKey env SecretRefs from source config as provider-scoped generated models.json markers
  • suppress PLAINTEXT_FOUND only when the generated marker matches that source provider
  • keep arbitrary all-caps strings and cross-provider marker reuse warning as plaintext

Real behavior proof

Behavior addressed: secrets audit distinguishes source-managed generated env markers in models.json from plaintext provider keys without broadening the all-caps heuristic.
Real environment tested: Linux source checkout at ffd4a801454a4dfc1929faa13c61dc9b3d62cbe5 with dependencies installed via pnpm install --frozen-lockfile.
Exact steps or command run after this patch: git diff --check; one-shot node --import tsx script that writes temporary openclaw.json and agents/main/agent/models.json, then calls runSecretsAudit for same-provider and cross-provider marker cases.
Evidence after fix: terminal output copied from the one-shot audit proof:

{"sameProviderSuppressed":true,"crossProviderStillWarns":true}

Observed result after fix: the matching source-managed CUSTOM_PROVIDER_API_KEY marker is not reported as plaintext for its provider, while the same marker under an unrelated provider still reports PLAINTEXT_FOUND.
What was not tested: full src/secrets/audit.test.ts did not complete locally within the bounded verification window; CI should run the committed Vitest regression tests.

Verification

  • git diff --check
  • node --import tsx - <<'EOF' ... EOF, output shown above
  • Attempted: node scripts/run-vitest.mjs run src/secrets/audit.test.ts -t "source-managed custom env apiKey markers|custom env apiKey marker suppression" --reporter=verbose; stopped after it ran over two minutes with no output on this host

@Alix-007
Alix-007 requested a review from a team as a code owner May 29, 2026 03:45
@openclaw-barnacle openclaw-barnacle Bot added size: S triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 29, 2026
@clawsweeper

clawsweeper Bot commented May 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed May 30, 2026, 9:21 AM ET / 13:21 UTC.

Summary
The PR tracks env SecretRef models.providers.*.apiKey markers from source config by provider, suppresses matching generated models.json plaintext findings, and adds same-provider plus cross-provider regression tests.

PR surface: Source +35, Tests +47. Total +82 across 2 files.

Reproducibility: yes. for source-level reproduction: current main persists source env SecretRef ids into generated models.json, but secrets audit flags custom env marker strings as plaintext unless they are known markers. I did not run tests because this review was required to keep the checkout read-only.

Review metrics: none identified.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Let the in-progress current-head checks finish, or replace them with equivalent maintainer-visible focused proof before merge.

Risk before merge

  • [P1] Four current-head check runs were still in progress at review time, so maintainers should wait for them or equivalent focused proof before merging.

Maintainer options:

  1. Decide the mitigation before merge
    Merge the narrow provider-scoped audit fix after current-head checks complete, allowing the merge to resolve secrets audit: Improve UX by distinguishing plaintext secrets from environment variable references #87723.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P2] No repair lane is needed because I found no actionable patch defect; the remaining action is maintainer merge or rejection after checks finish.

Security
Cleared: The diff changes only secrets-audit classification and tests; suppression stays source-managed and provider-scoped without broadening arbitrary plaintext handling.

Review details

Best possible solution:

Merge the narrow provider-scoped audit fix after current-head checks complete, allowing the merge to resolve #87723.

Do we have a high-confidence way to reproduce the issue?

Yes for source-level reproduction: current main persists source env SecretRef ids into generated models.json, but secrets audit flags custom env marker strings as plaintext unless they are known markers. I did not run tests because this review was required to keep the checkout read-only.

Is this the best way to solve the issue?

Yes. Provider-scoped source marker suppression is narrower than the issue's keyword heuristic suggestion and preserves warnings for arbitrary all-caps strings and cross-provider marker reuse.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against a17c7a56da25.

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix terminal output for same-provider suppression and cross-provider warning behavior, and the current-head real behavior proof check passed.

Label justifications:

  • P2: This fixes a normal-priority secrets-audit false positive with limited blast radius and security UX impact.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes after-fix terminal output for same-provider suppression and cross-provider warning behavior, and the current-head real behavior proof check passed.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix terminal output for same-provider suppression and cross-provider warning behavior, and the current-head real behavior proof check passed.
Evidence reviewed

PR surface:

Source +35, Tests +47. Total +82 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 35 0 +35
Tests 1 47 0 +47
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 82 0 +82

What I checked:

Likely related people:

  • joshavant: Prior merged work hardened SecretRef-safe models.json persistence and custom/provider secret reuse on the same secrets/model config surface. (role: feature-history owner; confidence: high; commits: 8e20dd22d890, 36d2ae2a2235; files: src/secrets/audit.ts, src/secrets/audit.test.ts, src/agents/models-config.providers.source-managed.ts)
  • steipete: Current blame and recent history show adjacent marker-helper and shared coercion work affecting the audit classification boundary. (role: recent area contributor; confidence: high; commits: ec7e3eaf649a, 77d9ac30bb8d, 85912849cc0b; files: src/secrets/audit.ts, src/agents/model-auth-markers.ts, src/secrets/audit.test.ts)
  • vincentkoc: Recent path history includes adjacent secrets and model-auth-marker changes near this audit surface. (role: adjacent recent contributor; confidence: medium; commits: 42e3d8d69314, a4bb9b1438e2; files: src/secrets/audit.ts, src/secrets/audit.test.ts, src/agents/model-auth-markers.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 29, 2026
@Alix-007

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented May 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. labels May 29, 2026
@Alix-007

Copy link
Copy Markdown
Contributor Author

Maintainer note: this PR is now marked proof: sufficient and status: 👀 ready for maintainer look, and current PR checks show no pending or failing jobs. I tried enabling auto-merge / merging, but this account only has read permission on openclaw/openclaw, so a maintainer needs to perform the merge.

@Alix-007
Alix-007 force-pushed the issue-87723-secrets-audit-env-ref branch from f386257 to c4a5fd6 Compare May 29, 2026 09:45
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 29, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 29, 2026
@Alix-007
Alix-007 force-pushed the issue-87723-secrets-audit-env-ref branch from c4a5fd6 to c897450 Compare May 30, 2026 13:15
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 30, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 30, 2026
@Alix-007

Alix-007 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

Closing to keep my open queue focused — open ~6 days without maintainer review and needs a rebase (behind ~1900) for the stale-base node checks. #87723 has a single 👍 and no active discussion. Happy to reopen and refresh if a maintainer wants the secrets-audit UX fix landed. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

secrets audit: Improve UX by distinguishing plaintext secrets from environment variable references

1 participant