Repository navigation
v3.0.8 - data-sen-secret marking (an accident guard, not a boundary) and dialog text kept off disk
This release also carries 3.0.7, which was never published on its own.
[3.0.8] - 2026-09-26 - data-sen-secret marking: an accident guard, not a boundary
Added
- A
data-sen-secretmarker on an element (or an ancestor of one, through shadow-root hosts) now makeseval,extractandattrrefuse rather than hand back that value, protects the marked page from an accidental screenshot or auto-capture write, and givesset_attra write path to place the marker itself. This is protection against a cooperating agent accidentally re-reading or re-exposing a secret it already marked — not a security boundary. A deliberately adversarialevalruns arbitrary JavaScript in the exact same JS realm as the marked element: it can already read the value directly,fetch()it to another origin, stash it inwindow.nameor storage for another tab to read, or erase the marker withremoveAttributebefore anything checks again. Same-originfetch, another tab, or page JavaScript that moves the value out from under the marked element can all still reach it; none of that is gated by anything below. Do not mark an element and then runevalon that page expecting the secret to stay contained Mark the secret's element as soon as the action that revealed it returns, before any other action on that page, then capture the value with the credential broker and useset_attrfor any writes. Marking only affects later actions: capture files the revealing action already wrote (typicallyNNN-navigate.html/.md) keep the value and are not deleted.evalrefuses when a marker is present anywhere on the page at the moment of the call — a point check with nothing sticky remembered across calls. It does not re-check after the expression runs and does not remember that a page was ever marked once the call returns; an expression that reveals or removes the marker as part of its own execution is not caught by this, by design (see above — that gap cannot be closed by an in-page check at all, so this does not pretend to).extractandattrrefuse when the resolved element, or any ancestor of it (walking up through shadow-root hosts), carries the marker. Where a read is possible without touching the marked value at all —extract's selector/whole-page HTML and markdown forms — they instead read off a clone of the page imported into a fresh, inert document (document.implementation.createHTMLDocument, never the live document) with every[data-sen-secret]descendant stripped before serializing, so a marked descendant elsewhere in a larger fragment doesn't force a full refusal. Whole-pageextractin text mode has no such clone available (innerTextneeds real layout), so it refuses outright instead, the same aseval.- Screenshot and auto-capture check the same live marker scan
evaluses across the top document, open shadow roots, and same-originiframe/frame/object/embed— not just a regex over the top document's serialized HTML — before writing anything to disk. Once marked, a page produces no screenshot and no captured.html/.md/console file; files captured before the mark are left as they are. - Native dialog (
alert/confirm/prompt/beforeunload) text keeps 3.0.7's credential-shape redaction and file suppression; a marker with no matching shape (a bare TOTP seed, say) is not specially redacted in dialog text, which is exactly the "no boundary" limitation stated above, not a regression from 3.0.7. set_attrallows writing exactly two attribute names:data-sen-nonce(a broker nonce, resolved to the single first-VISIBLE match the same wayextract/click/typeresolve a selector) anddata-sen-secretitself. Writingdata-sen-secretmarks every element the selector matches, hidden duplicates included — not just the one a human would call "the" match — and can never remove or weaken an existing mark: re-marking an already-marked element is a no-op, and marking never touches an attribute other than the marker.set_attr'sok/no element matched/refused: target element is markedresponses differ by outcome, so a caller who can vary the selector and watch which result comes back has a prefix oracle over what's on the page; this is the same category of limitation as the shape-blind dialog case above, not something this guard closes.- Not covered: markup inside an
<iframe srcdoc="…">attribute.extract's HTML form andattr srcdocreturn that attribute text verbatim, marked elements included, even thoughevalrefuses on the same page. SUPERPOWERS_CHROME_ALLOW_CREDENTIAL_CAPTURE=1disables all of the above, same as the credential-shape guard everywhere else.
Fixed
formatActionResponse(used byclick,selectandeval) ignored themidFlightresult shape thatwithDialogAwarenessForSessionreturns when the action itself opens a native dialog ({ midFlight, actionResult, dialog, artifacts }). It readurl,pageSizeandcapturePrefixoff the top level, where they don't exist on that shape, so the agent gotCurrent URL: unknown, an empty size and aFiles: ???.html, …line instead of the dialog text and thedialog::accept/dialog::dismissinstructions — and, when the dialog message was credential-shaped, the⚠️ … suppressednotice never appeared either (#53).formatActionResponsenow renders a midFlight result the same wayformatCaptureResponse's null-capture dialog branch already does. Follow-up from #51; doesn't leak (the finalredactUnlessAllowedpass still redacts the response text either way).- On that same midFlight shape,
evalreportedResult: undefinedbecause it read the value off the wrapper instead of the wrapped action result. It now shows the evaluated value.
Tests
test/response-format-midflight.test.mjs(new): a midFlight result renders the dialog markdown anddialog::acceptinstructions instead of the capture-shaped fallback, surfaces the suppressed-credential notice when the wrapped action result carries one, falls back toDialog opened: <kind>only when no artifacts are supplied, and leaves the normal (non-midFlight) capture path unchanged.formatEvalDescriptionreads the eval value from the wrapped action result on a midFlight result.
[3.0.7] - 2026-09-25 - Native dialog text no longer copied to disk
Security
- Native dialog text leaked to disk. In 3.0.6 and earlier, the message of an
alert/confirm/prompt/beforeunloaddialog (and aprompt's default value) was written unredacted to the.md,.htmland-console.txtcapture files whenever an action ran while a dialog was open or opened one. Page JavaScript controls that text, so a page could put a token there and bypass the 3.0.6 credential-shape guard (#50). - Both dialog short-circuits in
capture.js(a dialog already open during a capture, and an action that opens one) now apply the same credential-shape check as the rest of auto-capture. On a match no dialog files are written. For actions that open a dialog through the before/after capture path (type, keyboard_press, hover, drag_drop, double_click, right_click, file_upload), the agent still gets the dialog text with credential-shaped substrings replaced by[REDACTED credential-shaped], thedialog::accept/dialog::dismissinstructions, and the⚠️ … suppressednotice. For click, select and eval the response shows no instructions or notice yet (#53); the next call's dialog refusal carries the redacted text and the instructions.SUPERPOWERS_CHROME_ALLOW_CREDENTIAL_CAPTURE=1restores the old behavior. - Session dirs are normally removed when the server exits, but one left behind by a crash may still hold dialog text captured by 3.0.6 or earlier. Delete old session dirs under
superpowers/browser/in the cache dir ($XDG_CACHE_HOME, else~/.cacheon Linux,~/Library/Cacheson macOS,%LOCALAPPDATA%on Windows).
Changed
- The use_browser response-formatting helpers (
formatCaptureResponse,formatActionResponse,redactUnlessAllowed, etc.) moved frommcp/src/index.tsto the newmcp/src/response-format.ts, mirroringpayload.ts, so tests can import them without booting Chrome or an MCP server.
Tests
test/lib/capture-credential-guard.test.mjs: both dialog short-circuits write no dialog files for a credential-shaped message, a benign dialog still captures normally, and the opt-out restores capture. The after-dialog branch still returns the dialog artifacts, including the accept/dismiss instructions.test/response-format-dialog-guard.test.mjs(new):formatCaptureResponsereturns the notice, the accept/dismiss instructions and the dialog text together for a suppressed dialog, and omits the notice for a benign one.test/credential-guard-mcp.test.mjs: the bundled MCP server on real headless Chrome, typing into a field that opens analertcarrying a token, returns the notice,dialog::acceptand[REDACTED credential-shaped], never the raw token, and writes no dialog files.