Skip to content

Fix redaction checks, fill read-back, page text and tool list for the hosted broker - #44

Draft
figitaki wants to merge 6 commits into
mainfrom
carey/hosted-fixes
Draft

figitaki wants to merge 6 commits into
mainfrom
carey/hosted-fixes

Conversation

@figitaki

@figitaki figitaki commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Add a test that redaction tags do not carry over to a new document. A cross-site load can reuse node ids, so the same uids come back on empty fields. Tags are keyed by document, so those fields are not redacted until a new fill. Tags are not cleared on navigation, because Back can restore a filled document from the back/forward cache. (EMG-293, Filled-field redaction tags survive navigation and hit unrelated fields #33)
  • After fill_secret or await_fill writes, the broker reads each field back. For each field the result gives the value length, whether it matches the secret, and validity.valid. The match is exact, except that a grouped card number (4242 4242 …) still matches; a password field never gets that tolerance. A field the page removed from the document is not confirmed. It also gives confirmed. It never gives the value or any part of it. A field that drops the value no longer fails the fill; the result reports it. (EMG-294, fill_secret: confirm the field state after a fill #34)
  • snapshot has a new text field with visible headings and alert, status and live regions. It is capped in count and length, and each entry is scrubbed whole before it is cut. Text longer than 16384 characters is left out. Element text in the snapshot is now also scrubbed before its 120-character cut. (EMG-295, snapshot: include visible page text so agents can read results and errors #35)
  • Remove list_network_requests from tools/list while it returns only not_implemented. It comes back when it is implemented (Implement list_network_requests with metadata only and body suppression #17). (EMG-303)
  • Update the tool reference, skill, site and design docs to match.

Testing

  • bun test: 164 pass, 0 fail.
  • bun run typecheck and bun run fmt:check pass.
  • New e2e tests: same uids on a reloaded form after a cross-site hop are not redacted until a new fill; a page that clears the card number gets length: 0, matches: false, a bad expiry format gets valid: false, and a field the page removes gets matches: false; the receipt page's confirmation text shows in the snapshot; a card number shown as status text is redacted.
  • New test/page-text.test.ts for the text summary caps, and for scrubbing before the cut, including a secret longer than the cut and element text. New test/inject.test.ts for the read-back comparison.

🤖 Generated with Claude Code

figitaki and others added 4 commits October 22, 2026 14:39
A cross-site load gets a new renderer process, which numbers its nodes
from the start again. The same form then gets the same element uids on a
new document. Redaction tags are keyed by document, so the new fields
are not redacted until a new fill. Add an e2e test for this case.

Do not clear tags on navigation. Back can restore the old document from
the back/forward cache with its filled values, and those must stay
redacted.

Refs EMG-293, #33.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Masked or script-controlled inputs can drop a value, and the result
still said filled: true. Now the broker reads each field back over CDP
after the write and compares it to the value in broker memory. The
result gives, per field, the value length, whether it matches the
secret when spaces and punctuation are ignored, and validity.valid. It
also gives confirmed, which is true when every field matches. It never
gives the value or any part of it. await_fill returns the same result.

A field that holds fewer characters than were written no longer fails
the fill. The result reports it instead.

Add a fixture page that clears the card number on input and rejects
the expiry format, and an e2e test for it.

Refs EMG-294, #34.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An agent could not read a success message or an error, because the
snapshot listed only interactive elements. Now the snapshot has a text
field with the page's visible headings and its alert, status and live
regions. It has at most 20 headings and 10 alerts, and each entry has
at most 200 characters. Each entry goes through the value scan before
it is cut, so a cut cannot leave part of a secret. innerText leaves out
field values.

The receipt fixture marks its confirmation as a status region. The
formatted checkout fixture shows the card number in a status line,
which the snapshot shows redacted.

Refs EMG-295, #35.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The tool only returns not_implemented, but agents see it in tools/list
and try it. Remove it from the registered tools and from the docs. The
stub stays in the source. It comes back when it is implemented (#17).

Refs EMG-303.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@figitaki figitaki left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Three issues reproduced against this head, with details inline.

Comment thread src/browser/page-text.ts Resolved
Comment thread src/browser/inject.ts Resolved
Comment thread src/browser/inject.ts Resolved
figitaki and others added 2 commits October 23, 2026 17:01
The snapshot cut heading, alert and element text before the value scan.
A secret longer than the cut lost its end, no longer matched, and its
start reached the agent. Now the page returns the whole text, the broker
scrubs it, and then cuts it. Text longer than 16384 characters is left
out instead of cut.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The read-back treated a field as confirmed in two wrong cases:

- The page removed the field. Its detached node kept the old value. A
  removed field now reports no length and matches: false.
- The page changed a password, for example it removed punctuation. The
  comparison ignored all punctuation and applied NFKC to every secret.
  It is now exact. Only a number of digits, spaces and hyphens, in a
  field that is not a password input, may match with separators added.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant