Skip to content

abokenan444/web-agent-bridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

209 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Web Agent Bridge Logo

Web Agent Bridge (WAB)

The Open AI ↔ Web Protocol & Agent Platform

robots.txt told bots what NOT to do. WAB tells AI agents what they CAN do.

npm License: Open Core One-Click DNS Discovery Discord CoderLegion

ShieldQR Trust SSL Monitor Zero-Config Adoption Tamper-Evident Audit Tests


Website Β· Documentation Β· Whitepaper Β· DNS Discovery Β· CoderLegion Β· Ψ§Ω„ΨΉΨ±Ψ¨ΩŠΨ©

Why WAB?

Currently, AI agents interact with the web by parsing the DOM, guessing selectors, or relying on fragile visual models. This is slow, error-prone, and breaks whenever a site's layout changes.

WAB solves this by providing a standardized API for the web. It creates a secure bridge between AI agents and websites, allowing agents to discover capabilities, execute commands, and interact with sites accurately β€” no DOM parsing, no scraping, no guesswork.

For Website Owners 🏒

Control exactly how AI interacts with your site. Expose specific capabilities, set rate limits, and monitor agent activity.

For AI Developers πŸ€–

Build reliable agents that work instantly on any WAB-enabled site. Stop writing custom scrapers and start using the window.AICommands standardized interface.


⚑ Quick Start

0. Zero-Config Initializer (30 seconds)

The fastest path. Auto-detects your stack (Next.js, Nuxt, SvelteKit, Astro, Laravel, WordPress, static…) and scaffolds /.well-known/wab.json plus the DNS instructions for your provider:

npx wab-init
# or non-interactive:
npx wab-init --site=https://yourdomain.com --name="Your Site" --yes

1. DNS Discovery (No Code)

Make your website instantly discoverable by AI agents by adding a single DNS TXT record. No code changes required.

_wab.yourdomain.com  TXT  "v=wab1; endpoint=https://yourdomain.com/.well-known/wab.json"

πŸ‘‰ Watch the 40-second setup video & full guide

2. The Developer Way: Install via npm

npm install web-agent-bridge
import { initWAB } from 'web-agent-bridge';

initWAB({
  siteId: 'your-site-id',
  capabilities: ['browse', 'api', 'commerce'],
});

3. The Edge Way: One-Click Edge Adoption

No origin changes needed. Drop in a Cloudflare Worker, Vercel Middleware, or Netlify Edge Function and /.well-known/wab.json is served from the edge:

// Vercel β€” middleware.ts
import { handleRequest } from '@webagentbridge/edge';
export const config = { matcher: ['/.well-known/wab.json'] };
export default (req) => handleRequest(req, {
  siteName: 'Acme', siteUrl: 'https://acme.com'
});

Or for Next.js, wrap your config:

// next.config.js
const { withWAB } = require('@webagentbridge/next');
module.exports = withWAB({}, {
  siteName: 'Acme', siteUrl: 'https://acme.com',
});

4. The Agent Builder Way: Governance-First Agents

If you're building an AI agent that touches Stripe, Gmail, ClickUp, or any sensitive API, wrap every action in the Governance Layer. Permissions, human-in-the-loop approvals, tamper-evident audit, kill-switch and spend caps β€” server-enforced and one call away:

const { WABGovernance } = require('web-agent-bridge/sdk');

// 1) one-time: register the agent identity
const { agent_id, agent_token } = await WABGovernance.register({
  apiBase: 'https://webagentbridge.com',
  displayName: 'My Stripe Agent',
});

const gov = new WABGovernance({
  apiBase: 'https://webagentbridge.com',
  agentId: agent_id,
  agentToken: agent_token,
  onApprovalRequired: async (req) => {
    // post to Slack/Email; return 'approved' or 'rejected'
    return await askHuman(req);
  },
});

// 2) define boundaries
await gov.definePolicy({
  resource: 'stripe', action: 'write', scope: 'refunds',
  max_amount: 50, daily_cap: 200, currency: 'USD',
});
await gov.definePolicy({
  resource: 'stripe', action: 'write', scope: 'refunds-large',
  max_amount: 5000, requires_approval: true,
});

// 3) wrap every action
await gov.guard(
  { resource: 'stripe', action: 'write', scope: 'refunds', amount: 49.99 },
  async () => stripe.refunds.create({ charge: 'ch_x' }),
);

πŸ‘‰ Run the full 9-step demo: node examples/governance-agent.js β€” walks register β†’ policies β†’ deny β†’ allow β†’ approval gate β†’ audit β†’ kill switch.


✨ Core Features

πŸ” DNS Discovery Protocol

The fastest way to make your site AI-ready. AI agents can find your capabilities document via DNS over HTTPS (DoH) without any initial HTTP request.

πŸ›‘οΈ Sovereign Shield & Firewall

Protect your site from malicious bots while allowing verified AI agents. Includes IP rate-limiting, Intent Engine, and Human-Gate rollback.

πŸ’» Agent OS & Workspace

A premium 4-panel workspace for non-technical users featuring an embedded browser, smart agent chat, real-time negotiation monitor, and results panel.

🌐 Universal Agent Mode

Works on any website, even those without the WAB script installed, using our advanced fallback heuristics.

πŸ—£οΈ Multilingual Support

Full Arabic and English interface with auto-detection. The smart agent understands and responds in any language the user writes in.


οΏ½ ShieldQR & Extended Trust Layer

WAB ships an end-to-end trust pipeline that lets agents (and humans) verify a site is exactly who it claims to be β€” at the protocol level, not just the TLS level.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  /.well-known/wab.json   β†’  signed Ed25519 payload          β”‚
β”‚        β–²                                                    β”‚
β”‚  _wab.<host>  DNS TXT    β†’  pk + ssl_thumbprint + endpoint  β”‚
β”‚        β–²                                                    β”‚
β”‚  TLS certificate         β†’  fingerprint pinned in DNS       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Capability What it does
πŸͺͺ Ed25519-signed wab.json Every capability document is signed; the public key is published in DNS (pk=ed25519:…). Agents detect tampering or impersonation.
πŸ” SSL fingerprint pinning ssl_thumbprint (SHA-256) and ssl_expires are embedded in both wab.json and the DNS TXT record. Mismatch = automatic distrust.
🩺 SSL Health Monitor A 24h cron sweep tracks every site's certificate; sends an email alert 7 days before expiry so renewal never surprises you.
πŸ“œ Certificate Transparency log A local CT log (cert_history) records every fingerprint observed per host β€” silent re-issuance is detectable.
πŸ›Ÿ Fallback Trust mode If TLS is degraded but the Ed25519 signature still verifies, ShieldQR returns partial trust instead of failing closed. Never blocks a legitimate site over a single moving part.
πŸ“± ShieldQR Public Scanner /shieldqr lets users scan any QR code and instantly see if the destination is a verified WAB-trusted site (green / yellow / red).
πŸ›  Admin Trust Monitor /admin/trust-monitor β€” dashboard for monitored hosts, SSL status pills, CT log entries, and one-click re-verification.

Sign your domain in one command:

node scripts/sign-wab-domain.js
# β†’ writes signed /.well-known/wab.json + prints the DNS TXT record to publish

Verify any site: https://www.webagentbridge.com/check?host=YOUR_HOST


πŸš€ Zero-Config Adoption Layer

Drop-in adoption for every popular stack β€” no origin changes, no PHP, no .htaccess edits.

Package Use it for Install
wab-init CLI Auto-detect project (Next/Nuxt/SvelteKit/Astro/Laravel/WordPress/static) and scaffold wab.json + DNS instructions. npx wab-init
@webagentbridge/next Next.js plugin: withWAB(nextConfig, { siteName, siteUrl }) adds rewrites + headers for /.well-known/wab.json. App Router + Pages Router supported. npm i @webagentbridge/next
@webagentbridge/edge Vercel Middleware & Netlify Edge Function β€” serve wab.json from the edge, configured by env vars. npm i @webagentbridge/edge
@webagentbridge/cloudflare-worker Standalone Cloudflare Worker that injects /.well-known/wab.json from KV or env vars. Optional reverse-proxy origin. wrangler deploy
SDK Auto-Discovery When a site has no wab.json, the SDK falls back through JSON-LD / Schema.org / OpenGraph / sitemap.xml / robots.txt and returns a normalized capabilities envelope so your agent still works. require('web-agent-bridge-sdk').discover(url)
const { discover } = require('web-agent-bridge-sdk');

const env = await discover('https://example.com');
// env.source       β†’ 'wab.json' | 'auto-discovery'
// env.site         β†’ { name, description, url }
// env.actions      β†’ [{ name, description, source }, …]
// env.products     β†’ [ schema.org/Product nodes … ]
// env.sitemap      β†’ [ url, … ]
// env.trust.signed β†’ boolean

The result: any agent can do something useful on any website on day one, even before the site formally adopts WAB.


οΏ½πŸ›‘οΈ Governance Layer β€” Enterprise Security & Compliance

The WAB Governance Layer sits above the protocol and turns any agent into a compliance-ready, auditable, kill-switch-controlled identity. It's the missing piece for agents that touch real money, mailboxes, or production systems.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Layer 3: Governance  (permissions Β· audit)   β”‚  ← /api/governance
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Layer 2: WAB Protocol  (AICommands Β· trust)  β”‚  ← /api/discovery
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Layer 1: Dynamic Shield  (price Β· OCR)       β”‚  ← /api/shield
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Capability What it gives you
πŸ” Permission Boundaries Per-agent resource Γ— action Γ— scope policies with effect=allow|deny. Most-specific match wins.
πŸ™‹ Human-in-the-Loop Approvals Mark any policy requires_approval: true β€” sensitive actions are routed through async human gates with TTL.
🧾 Tamper-Evident Audit Every event hash-chained with HMAC: hash_n = HMAC(secret, prev_hash β€– row). verifyAuditChain() detects any tampering.
πŸ›‘ Kill Switch One call disables an agent globally and auto-cancels all pending approvals (no resurrection).
πŸ’° Spend & Rate Limits Per-call max_amount, rolling 24h daily_cap, per-minute per_call_rate.
πŸ•΅οΈ Param Redaction password, api_key, token, cookie, cvv, ssn are automatically redacted before audit storage.

Verified end-to-end β€” 293/293 tests passing including 26 governance, 10 ShieldQR, 36 server, plus the full integration suite.

Full demo: examples/governance-agent.js Β· API surface: /api/governance/* Β· SDK: WABGovernance class.


πŸ—οΈ Architecture & Open Core Model

WAB uses an Open Core dual-license model to ensure the protocol remains free while supporting sustainable development.

Component License Description
Core SDK & Protocol MIT Discovery protocol, JS SDK, signing scripts, wab-init CLI.
ShieldQR Verifier MIT Open Ed25519 verifier β€” anyone can validate signatures and SSL pins.
Adoption Packages MIT @webagentbridge/next, @webagentbridge/edge, @webagentbridge/cloudflare-worker.
WordPress Plugin GPL-2.0 Full integration for WordPress sites.
Engines (Firewall, Price, OCR) Proprietary (Free) Advanced detection, scoring, and protection engines.
ShieldQR Threat Intel Commercial Curated impersonation-host blocklist + reputation feeds.
API Gateway & Pro Modules Commercial Enterprise features, data marketplace, SLA.

🀝 Contributing

We welcome contributions from the community! Whether it's fixing a bug, improving documentation, or proposing a new feature.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the terms described in the LICENSE file. The core protocol and SDKs are MIT licensed.


🌐 Community & Links

Β© 2026 Web Agent Bridge. Built for the AI-first web.