Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add encoded-payload-redact rule#117

Merged
twschiller merged 2 commits into
mainfrom
add-encoded-payload-redact-rule
Jun 3, 2026
Merged

Add encoded-payload-redact rule#117
twschiller merged 2 commits into
mainfrom
add-encoded-payload-redact-rule

Conversation

@twschiller

Copy link
Copy Markdown
Contributor

Summary

  • New encoded-payload-redact rule: walks text nodes for long base64 / base64url / hex / percent-encoded runs, qualifies on a decoded printable-ASCII ratio (≥0.85), replaces matches with click-to-reveal placeholders. Defends against the "decode this and follow it" indirect-injection carrier where an attacker drops an encoded blob in a page region the agent reads.
  • Per-encoding length floors (base64 ≥120, hex ≥160, %-encoded ≥20 triplets) sit above common hash sizes; the printable-ratio filter discards SHA-256/SHA-512/Git SHAs and binary blobs. JWTs are skipped so secrets-redact keeps the more specific [jwt hidden] label.
  • Demo site, docs (rule count 33→34, abstract description per no-injection-examples policy), and skill files updated; default on.

Test plan

  • bun run test in extension/ — 974/974 pass, including 12 new tests covering positives (b64, b64url, hex, %-enc), false-positive guards (SHA-256, Git SHA, random hex, short b64, JWT, script/style/noscript), watcher rescan, and teardown.
  • bun run check clean in extension/ and demo-site/.
  • bun run build clean in both packages.
  • Load extension as unpacked, visit /product/p-headphones-1 on the demo, confirm "Compatibility codes" section's base64 string is replaced with the placeholder chip.

🤖 Generated with Claude Code

…tion

Walks text nodes for long base64 / base64url / hex / percent-encoded
runs above per-encoding length floors that sit above SHA-512 hex, then
qualifies each candidate on a decoded printable-ASCII ratio so hashes,
fingerprints, and binary blobs pass through while readable instructions
are redacted. JWTs are skipped so the more specific secrets-redact label
wins on overlap. Matches become inline click-to-reveal placeholders.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@vercel

vercel Bot commented Jun 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agent-browser-shield-demo-site Ready Ready Preview, Comment Jun 3, 2026 4:06pm

Request Review

@twschiller twschiller merged commit 89857f2 into main Jun 3, 2026
7 checks passed
@twschiller twschiller deleted the add-encoded-payload-redact-rule branch June 3, 2026 16:10
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