policycheck-extension
Chrome extension that injects check_seller_policy WebMCP tool into e-commerce sites for AI agent trust verification
A Chrome extension that injects a check_seller_policy WebMCP tool into e-commerce sites, enabling AI agents to verify seller trustworthiness before purchasing. When you visit an e-commerce site in Chrome Canary 146+ (with WebMCP enabled), this extension automatically registers a check_seller_policy tool via navigator.modelContext.registerTool(). Any AI agent operating on the page can discover and call this tool alongside the seller's own tools.
Summary extracted from the README.
PolicyCheck Chrome Extension
A Chrome extension that injects a check_seller_policy WebMCP tool into e-commerce sites, enabling AI agents to verify seller trustworthiness before purchasing.
What it does
When you visit an e-commerce site in Chrome Canary 146+ (with WebMCP enabled), this extension automatically registers a check_seller_policy tool via navigator.modelContext.registerTool(). Any AI agent operating on the page can discover and call this tool alongside the seller's own tools.
The tool calls the PolicyCheck API and returns:
- Risk score (0-10)
- Risk level (low / medium / high / critical)
- Buyer protection rating (A+ to F)
- Risk factors with severity ratings (binding arbitration, no-refund clauses, restocking fees, liability caps, etc.)
- Plain-language summary
How it works
- Extension detects e-commerce pages via heuristics (known domains, Shopify/WooCommerce markers, Schema.org Product markup, cart/checkout signals)
- If WebMCP is available (
navigator.modelContextexists), registerscheck_seller_policytool - Tool attempts to extract policy text from the current page (footer links, policy sections)
- When an agent calls the tool, it sends the data to the PolicyCheck API and returns structured risk data
- Extension badge shows status: ✓ (registered), ! (e-commerce but no WebMCP), or number of risk factors found
Install (Developer Mode)
- Open Chrome Canary 146+
- Enable
chrome://flags/#enable-webmcp-testing - Go to
chrome://extensions/ - Enable Developer mode (toggle in top right)
- Click Load unpacked
- Select the
policycheck-extensionfolder - Visit any e-commerce site — the extension icon will show a green ✓ when the tool is registered
Architecture
┌─────────────────────────────────────────────┐
│ Web Page (MAIN world) │
│ │
│ content.js │
│ ├── Detects e-commerce page │
│ ├── Registers check_seller_policy tool │
│ │ via navigator.modelContext │
│ └── Posts status via window.postMessage │
├─────────────────────────────────────────────┤
│ bridge.js (ISOLATED world) │
│ └── Relays postMessage → chrome.runtime │
├─────────────────────────────────────────────┤
│ background.js (Service Worker) │
│ ├── Updates badge icon/text │
│ └── Stores status/results for popup │
├─────────────────────────────────────────────┤
│ popup.html/js │
│ └── Shows status and last risk assessment │
└─────────────────────────────────────────────┘
The content script runs in the MAIN world (required for navigator.modelContext access). A bridge script in the ISOLATED world relays messages to the background service worker for badge updates and popup state.
E-commerce Detection
The extension uses multiple heuristics:
- Known domain matching (Amazon, eBay, Shopify stores, etc.)
- Shopify platform markers (
meta[name="shopify-checkout-api-token"],window.Shopify) - WooCommerce markers (
.woocommerceclass) - Cart/checkout signal counting (add-to-cart, buy-now, shopping-cart, checkout, product-price)
- Schema.org Product structured data
- Open Graph product meta tags
Files
policycheck-extension/
├── manifest.json # Manifest V3
├── icons/ # Extension icons (16/32/48/128)
├── src/
│ ├── content.js # MAIN world — tool registration + e-commerce detection
│ ├── bridge.js # ISOLATED world — message relay
│ ├── background.js # Service worker — badge + storage
│ ├── popup.html # Extension popup UI
│ └── popup.js # Popup logic
└── README.md
Requirements
- Chrome Canary 146+ with
chrome://flags/#enable-webmcp-testingenabled - The PolicyCheck API at
https://policycheck.tools/api/checkmust be accessible
License
MIT