Skip to main content

Coverage

Ask — the Worker returns 403 on block and forwards everything else, so an ask gate is allowed. Write the rule as Block if you need a hard stop. Use it when you already terminate traffic at Cloudflare and want flagged content blocked before it reaches your origin, with no application changes. Not when you need to inspect model responses or mask content, and not for employee use of third-party AI — this protects your applications, not their browser. Limits. Input only, and no redaction: the sample branches on block and ignores transformed_payload. Scope the Worker to your AI routes, and decide deliberately whether a fetch failure should allow or block. Full comparison: Coverage.
  1. npm create cloudflare@latest — put the handler in src/index.js.
  2. wrangler secret put TRUSTGUARD_API_KEY
  3. Route AI paths in wrangler.toml; zone WAF still runs first.
  4. wrangler deploy
Optional: push repeat offenders to a Cloudflare IP List and block in WAF before the Worker.