Skip to content

fix: redact dotted API key activity previews - #99460

Merged
steipete merged 3 commits into
openclaw:mainfrom
ooiuuii:fix/activity-dotted-api-redaction
Jul 3, 2026
Merged

steipete merged 3 commits into
openclaw:mainfrom
ooiuuii:fix/activity-dotted-api-redaction

Conversation

@ooiuuii

@ooiuuii ooiuuii commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Closes #99459

What Problem This Solves

Control UI Activity output previews could expose dotted credential assignments such as app.api.key=.... Object-shaped tool results were also vulnerable because stringifyOutput adds quoted JSON keys before preview redaction.

Why This Change Was Made

The Activity preview owner now handles both reachable shapes:

  • properties/config text with dotted, underscored, dashed, or joined API-key names;
  • quoted object/JSON keys and quoted values, including spaces, apostrophes, and escaped quote punctuation.

Non-sensitive dotted fields remain visible. The Activity-local rules retain full masking and path redaction; the sibling browser detail redactor intentionally partial-masks values, so replacing this owner with that helper would change the secrecy contract.

AI-assisted: yes. Maintainer deep review expanded the original one-character regex change after fresh autoreview found two additional object-result bypasses.

User Impact

Activity previews no longer display dotted API-key values from text or structured tool results. Ordinary config context such as server.port remains readable.

Evidence

Exact head: 96ef4176e33fa999cbb66582bf08f187aa8ca33b

  • node scripts/run-vitest.mjs ui/src/ui/activity-model.test.ts ui/src/ui/app-tool-stream.node.test.ts ui/src/ui/views/activity.test.ts
    • 32 tests passed before exact-head rebase; exact CI reruns on the final head.
    • Production updateActivityFromToolEvent coverage proves properties text, object-shaped JSON, punctuation/escaped quotes, and non-sensitive preservation.
  • Fresh autoreview
    • First accepted finding: quoted JSON property names bypassed the original PR.
    • Second accepted finding: apostrophes inside double-quoted values bypassed the first repair.
    • Final run: clean, no accepted/actionable findings, 0.97 confidence.
  • Duplicate search

Rendered-browser proof gap: the required existing-profile Chrome attachment returned no user tabs. Per the browser-use safety rule, no isolated browser substitute was used. The production model path, rendered Activity consumer, focused tests, and exact-head hosted CI remain the available proof.

@clawsweeper

clawsweeper Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 3, 2026, 7:35 AM ET / 11:35 UTC.

Summary
The PR broadens Control UI Activity preview redaction for dotted API-key names and quoted object-result secrets, with focused regression coverage.

PR surface: Source +8, Tests +54. Total +62 across 2 files.

Reproducibility: yes. Source inspection and a read-only regex probe show current main leaves app.api.key=visible-leaked-value-1234567890 unredacted, and the caller/render path confirms that string can become an Activity preview.

Review metrics: none identified.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #99459
Summary: This PR is the open candidate fix for the canonical Activity preview dotted API-key redaction issue.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

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:

  • none.

Next step before merge

  • No ClawSweeper repair lane is needed; the remaining action is maintainer review and normal merge/check gating for the open PR.

Security
Cleared: The diff only strengthens local Activity preview masking and adds focused tests; it does not add dependencies, workflows, permissions, or new secret-handling sinks.

Review details

Best possible solution:

Land this narrow Activity model redaction change with its regression test after maintainer review and required checks pass, then close the linked issue through the merged PR.

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

Yes. Source inspection and a read-only regex probe show current main leaves app.api.key=visible-leaked-value-1234567890 unredacted, and the caller/render path confirms that string can become an Activity preview.

Is this the best way to solve the issue?

Yes. Updating the Activity-local preview redactor is the narrowest maintainable fix; the sibling browser redactor partial-masks and has a different detail-view contract, so reusing it here would change more behavior than needed.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against b52d98861e8c.

Label changes

Label justifications:

  • P2: This is a focused Control UI secret-preview redaction bug with limited local blast radius but meaningful credential exposure 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 (terminal): The PR body/comment provide after-fix terminal proof through the production Activity model path showing dotted API-key and password values redacted while non-sensitive config remains visible.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body/comment provide after-fix terminal proof through the production Activity model path showing dotted API-key and password values redacted while non-sensitive config remains visible.
Evidence reviewed

PR surface:

Source +8, Tests +54. Total +62 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 9 1 +8
Tests 1 54 0 +54
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 63 1 +62

What I checked:

  • Repository policy read: Read the full root policy and the scoped UI guide; the review applied the repo rules requiring full-path PR review, proof assessment, security review, and UI scope checks. (AGENTS.md:1)
  • Current main misses dotted API-key assignments: Current main still uses api[_-]?key in the Activity preview assignment redactor, so a dotted key segment such as app.api.key= is not covered by that pattern. (ui/src/ui/activity-model.ts:46, b52d98861e8c)
  • Read-only regex reproduction: A focused node -e probe left app.api.key=visible-leaked-value-1234567890 unchanged with the current regex and redacted it with the PR assignment pattern. (ui/src/ui/activity-model.ts:46, b52d98861e8c)
  • PR head changes the implicated redactor: The PR head adds quoted JSON-value redaction rules and changes the assignment rule to api[_.-]?key, which covers the reported dotted spelling while preserving the Activity-local full masking behavior. (ui/src/ui/activity-model.ts:46, 96ef4176e33f)
  • Focused regression test added: The new test calls updateActivityFromToolEvent, asserts dotted API-key and password redaction, verifies object-shaped JSON redaction, and preserves the non-sensitive server.port value. (ui/src/ui/activity-model.test.ts:27, 96ef4176e33f)
  • Runtime caller checked: Tool stream events call updateActivityFromToolEvent before formatting the regular tool card output, so the changed model path is on the live Activity-entry path for tool results and updates. (ui/src/ui/app-tool-stream.ts:851, b52d98861e8c)

Likely related people:

  • BunsDev: The historical Activity tab feature commit introduced the Activity model, tool-stream wiring, and Activity render surface involved in this PR. (role: feature introducer; confidence: high; commits: 9799716c7181; files: ui/src/ui/activity-model.ts, ui/src/ui/app-tool-stream.ts, ui/src/ui/views/activity.ts)
  • steipete: Live PR metadata shows this account is assigned, and the final two PR commits expand the fix to quoted object-result redaction and quoted punctuation handling. (role: current PR follow-up owner; confidence: medium; commits: 1a4221a69200, 96ef4176e33f; files: ui/src/ui/activity-model.ts, ui/src/ui/activity-model.test.ts)
  • Vincent Koc: A recent release-history commit carries the Activity model and related UI redaction files in the current main lineage, which is useful routing context but not proof of bug authorship. (role: recent history carrier; confidence: low; commits: e085fa1a3ffd; files: ui/src/ui/activity-model.ts, ui/src/ui/app-tool-stream.ts, ui/src/ui/browser-redact.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.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jul 3, 2026
@ooiuuii

ooiuuii commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Added after-fix terminal proof to the PR body. The proof imports the production updateActivityFromToolEvent path, feeds a fake tool-result config dump through it, and shows the Activity output preview as app.api.key=[redacted] / spring.datasource.password=[redacted] while the raw fake values are absent and server.port=8080 remains visible.

@clawsweeper

clawsweeper Bot commented Jul 3, 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.

@steipete steipete self-assigned this Jul 3, 2026
@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. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 3, 2026
@steipete
steipete force-pushed the fix/activity-dotted-api-redaction branch from 71f2a55 to 96ef417 Compare July 3, 2026 11:28
@steipete

steipete commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Land-ready verification for exact head 96ef4176e33fa999cbb66582bf08f187aa8ca33b:

  • Deep review traced the rendered Control UI activity path from tool events through object serialization and found the original one-character key matcher still leaked quoted JSON values. The final fix keeps the existing key/value shape while redacting double- and single-quoted values, including spaces, apostrophes, and escaped quotes.
  • Focused proof: node scripts/run-vitest.mjs ui/src/ui/activity-model.test.ts ui/src/ui/app-tool-stream.node.test.ts ui/src/ui/views/activity.test.ts — 3 files, 32 tests passed.
  • Fresh autoreview found and repaired two escaping/quote-class findings; final rerun reported no accepted/actionable findings (0.97 confidence).
  • Hosted exact-head CI run 28657612835: passed.
  • Duplicate search: Activity preview can leave dotted API key assignments unredacted #99459 is the canonical linked issue; no competing PR or issue found.

Known proof gap: the required existing-profile Chrome bridge exposed no attached user tab, so rendered browser capture was blocked. I did not substitute an isolated browser or source-only claim; the production event-to-render path is covered by the focused tests above.

@steipete
steipete merged commit e51b446 into openclaw:main Jul 3, 2026
81 of 85 checks passed
@steipete

steipete commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 4, 2026
* fix: redact dotted API key activity previews

* fix(ui): redact quoted activity secrets

* fix(ui): handle quoted secret punctuation

---------

Co-authored-by: Peter Steinberger <[email protected]>
wheakerd pushed a commit to wheakerd/clawdbot that referenced this pull request Jul 15, 2026
* fix: redact dotted API key activity previews

* fix(ui): redact quoted activity secrets

* fix(ui): handle quoted secret punctuation

---------

Co-authored-by: Peter Steinberger <[email protected]>
(cherry picked from commit e51b446)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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.

Activity preview can leave dotted API key assignments unredacted

2 participants