feat(dashboard): widget capabilities — net CSP, host tools, hardened shared sandbox#111687
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 20, 2026, 5:19 AM ET / 09:19 UTC. Summary PR surface: Source +2250, Tests +2110, Docs +21, Other +150. Total +4531 across 68 files. Reproducibility: not applicable. This PR introduces a new dashboard capability model rather than fixing a reported existing-behavior failure. The relevant validation is after-fix runtime proof of the new granted and denied flows. Review metrics: 2 noteworthy metrics.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Land only after maintainers explicitly approve the dashboard capability and Gateway API contract, the branch is refreshed against current main, and redacted browser-runtime evidence shows both a granted capability path and denial/revocation containment. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR introduces a new dashboard capability model rather than fixing a reported existing-behavior failure. The relevant validation is after-fix runtime proof of the new granted and denied flows. Is this the best way to solve the issue? Unclear: the shared-host approach is a plausible consolidation, but the permanent capability and Gateway API contract requires maintainer approval and real browser evidence before it can be judged the best solution. AGENTS.md: unclear because the file could not be read completely. Codex review notes: model internal, reasoning high; reviewed against 9056c43368d6. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +2250, Tests +2110, Docs +21, Other +150. Total +4531 across 68 files. View PR surface stats
Security concerns:
What I checked:
Likely related people:
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. How this review workflow works
Review history (3 earlier review cycles) |
d4b89d5 to
5c7d4f8
Compare
5c7d4f8 to
b972032
Compare
|
Landed in 154a49a78b050820408fb93d2070acc422944e81 from exact source head 07aeb637811c5a69cdb6cc735e2320ad2b9a5501. Proof:
Security decision: WebRTC data-channel egress is an explicitly accepted modeled residual. Current Chromium does not implement CSP |
…shared sandbox (openclaw#111687) * feat(boards): enforce widget capability grants * feat(ui): expose dashboard widget capabilities * test(dashboard): align rebased gateway contracts * refactor(dashboard): finish capability alignment * chore: internalize unused board sandbox exports * test(dashboard): bind grants to widget instances * fix(dashboard): close widget authority lifetime gaps * refactor(ui): preserve modular widget frame ownership * test(ui): preserve explicit MCP App lease refresh * test(ui): use shared dashboard sandbox server * fix(ui): settle widget requests on reconnect * fix(ui): retry transient widget document loads * refactor(dashboard): document WebRTC egress residual * fix(dashboard): clear landing checks
What Problem This Solves
Dashboard widgets render but have no safe reach: no network for a self-updating weather card, no gateway data, no automation triggers, and prompt sends always need per-click confirmation. This PR is the capability layer of the session-dashboard program (design:
docs/web/dashboard-architecture.md): declared, operator-granted, byte-and-revision-bound widget capabilities.Why This Change Was Made
frame-srcagainst self-navigation exfiltration.webrtc 'block', so scriptable widgets retain WebRTC data-channel egress. This accepted tradeoff is documented in the dashboard architecture: the same residual already ships for inline chat widgets and the MCP Apps host; sensitive OpenClaw data requires an operator-granted, byte-frozendata:readcapability; Permissions-Policy blocks camera and microphone. A DOM API guard is follow-up defense-in-depth, not the boundary.net= CSP: granted widgets get exactly their declared HTTPS origins asconnect-src; pending/rejected get'none'.openclaw.prompt.send(user-activation; confirm skipped only with grantedprompt),openclaw.state.emit(8 KB cap, 5s coalescing, rate-limited),openclaw.data.read(allowlisted sessions/usage/cron/agents/health bindings viaboard.data.read),openclaw.cron.trigger(exactcron.trigger:<jobId>grants viaboard.action).User Impact
The full agent-built live dashboard loop: declare
net/tools onshow_widget, operator one-tap grant (revision-bound), widget fetches its API on an interval / reads gateway data / triggers cron — all inside the sandbox with server-side enforcement.Evidence
Exact head
07aeb637811: Blacksmith Testboxtbx_01kxztfe7zbmnppaewartkp7ekpassed the sandbox HTTP/CSP, MCP UI resource, and real Chromium dashboard E2E shards (16 tests); the landing repair also passed 12 focused widget-host tests, targeted lint, docs-map/MDX/format checks, and a clean autoreview. Broad evidence is reused from the patch-equivalent feature stack: 8,176 gateway + 4,906 UI tests green,check-changedclean, protocol/native generation + Linux SDK baseline verified; earlier rounds included a 390-test focused matrix, Chromium exploit + dashboard E2E, and dual autoreviews. New RPCs (board.prompt.authorize,board.data.read,board.action) are registered with release-train entries.