ACP Worker: Starting… Active: L1 Proxy DLP Classifier: Detecting… SQLite DO: Ready

Live Reverse-Exfiltration Workbench · MessageChannel + Dedicated Worker + SQLite DO

ACP Context Firewall Lab

Connecting your own personal Agent Client Protocol (ACP) harness to a website lets you reuse your preferences and model across the web instead of using isolated site chatbots. It also creates a reverse data-leak risk: an untrusted site can prompt your agent to disclose off-site personal data. This workbench sends live JSON-RPC 2.0 ACP messages across two browser MessageChannel pairs and a Dedicated Worker to measure what four defense layers (L0–L3) actually stop.

1. Why this matters

Browsers isolate websites with the Same-Origin Policy and Storage Partitioning. Bridging a shared personal ACP agent into https://shop.example opens a reverse path: hostile prompts, product reviews, or WebMCP tool descriptions can coerce the agent into leaking salary, address, private repo, or bank.example tab data.

2. What this opens up

Visitors can bring their own model, API keys, and portable profile to any site—sharing only checked fields such as shipping_country, shoe_size, and budget_limit—without creating siloed chatbot accounts or exposing off-site private context.

3. How the tests work

Pick any defense layer (L0–L3) and run 8 attacks over real MessagePort channels into /agent-worker.js. Compare a system prompt, a port-authority DLP proxy, a taint-lock diff gate, and a per-origin clean-room Worker recorded in a SQLite Durable Object.

Architecture How an untrusted site reaches your agent across two MessagePort hops
Browser Runtime · Real MessageChannel pairs + Dedicated Worker (/agent-worker.js)
Untrusted Site

Untrusted Storefront https://shop.example

session/prompt · DOM reviews · WebMCP tools/call
  • Sends JSON-RPC 2.0 ACP requests over MessagePort #1
  • Injects hostile prompts, product reviews, and freeform search_catalog({ query }) tool calls
Firewall Boundary

Policy Gate & DLP Proxy public/lib/firewall-engine.js

  1. L1 Proxy DLP: Decodes Zero-Width, URL, Hex, and Base64; blocks literal secret strings
  2. L2 Taint + Schema: Flags untrusted input, pauses for diff approval, locks WebMCP args to closed enums
  3. L3 Clean-Room: Loads only user-checked claims into the Worker + runs on-device classifier

Switch layers below to re-run all 8 attacks over the same live JSON-RPC 2.0 pipes.

L3 CLEAN-ROOM

Isolated Origin Worker /agent-worker.js

claims: { shipping_country, shoe_size, budget_limit }
No ungranted secrets No cross-tab history
L0–L2 SHARED

Shared Multi-Tab Session

salary · address · repo · bank.example balance

Secrets stay in Worker memory, so paraphrases, acrostics, and length oracles slip past filters.

Cloudflare Edge Worker src/worker.ts + FirewallAuditLedger SQLite Durable Object

Edge Telemetry & Audit

Re-checks every attack verdict server-side on POST /api/evaluate and stores each session's granted scopes, blocked/leaked counts, and transcripts in SQLite at GET /api/audit/:sessionId.

Every test sends real JSON-RPC 2.0 ACP frames across two MessageChannel pairs into /agent-worker.js. Selecting Layer 3 removes ungranted claims from the Worker's session memory altogether.

1. Pick a Defense Layer

Choose how strongly to isolate your personal agent before running attacks over live MessageChannel pipes.

2. Choose Allowed Personal Fields

Check only the fields https://shop.example is allowed to receive; Layer 3 omits unchecked fields from Worker memory.

Grant Claim & Canary Value Origin Status

3. Run an Attack Vector

Click any scenario to send a real JSON-RPC 2.0 ACP turn across MessageChannel into /agent-worker.js.

Idle

4. Inspect Firewall Verdict & Wire Output

Run any attack or the full 8×4 scorecard to compare raw Worker output against what reaches the site.

Pending

Enforcement Decision & Memory Scope

    Delivered to Untrusted Site (https://shop.example)

    Run an attack to view site-delivered output.

    Raw ACP Worker Output & Tool Call (Before Mediation)

    Run an attack to view raw Worker output.

    Proxy Normalization & Classifier Trace

    {}
    Captured JSON-RPC 2.0 MessagePort Wire Frames (0)
    []

    SQLite Durable Object Audit Ledger

    Session loading… persisted at /api/audit/:sessionId.

    Time Layer Attack Verdict Scopes
    No evaluations recorded yet.

    5. 8×4 Attack-vs-Defense Layer Scorecard

    Click any cell to run that exact (attack, layer) test over live MessageChannel frames and inspect the verdict.

    Attack Scenario L0: Prompt Only L1: Proxy DLP L2: Taint + Diff + Schema L3: Clean-Room + Classifier
    Key terms & further reading
    Agent Client Protocol (ACP) ↗
    JSON-RPC 2.0 protocol for connecting a host application or browser bridge to an external AI agent session.
    JSON-RPC 2.0 ↗
    Stateless remote-procedure-call message format used here to carry session/new, session/prompt, session/update, and tools/call frames.
    MessageChannel & MessagePort ↗
    Browser messaging primitives that create a direct two-ended channel between windows, iframes, and Dedicated Workers.
    Storage Partitioning ↗
    Browser isolation model that keys state by top-level site so data from bank.example cannot bleed into shop.example.
    WebMCP ↗
    Draft browser API letting websites declare structured JSON Schema tools that connected agents can invoke directly.
    port-authority Mediation Proxy ↗
    Reference browser bridge pattern that intercepts MessagePort traffic between a page and a personal agent outside page JavaScript.