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.
npm create cloudflare@latest— put the handler insrc/index.js.wrangler secret put TRUSTGUARD_API_KEY- Route AI paths in
wrangler.toml; zone WAF still runs first. wrangler deploy