Cloudflare AI Gateway

One gateway in front of every AI call.

AI Gateway sits between your apps and any AI model. It inspects, governs, logs, and protects every request — without changing a line of client code. Below: what it does, then a live playground you can break.

← Back to itlinux.cc

What it actually does

Every prompt from any client — a browser, curl, OpenCode, Claude Code, Cursor — flows through the same gateway. That's where policy lives.

Inline DLP

Scans prompt content in real time. A prompt containing an SSN, credit card, or secret is blocked at the edge with an HTTP 424 — before it ever reaches the model.

Guardrails

Model-safety layer that flags or blocks unsafe categories (self-harm, hate, weapons, and more) on both the prompt and the response.

Full logging & audit

Every request/response is logged with status codes and block actions. See exactly what was asked, answered, or blocked — no client opt-in required.

Caching & rate limits

Cache identical responses to cut cost and latency, and apply per-app rate limits — all at the gateway, independent of the upstream provider.

Works on any client

OpenCode, Claude Code, Cursor, curl, or this web page — anything that sends prompts through the gateway gets the same policy. One toggle, everywhere.

Provider-agnostic

Point it at Workers AI, OpenAI, Anthropic, Google, or others. Swap models without touching your governance — the policy stays put.

How a request flows

01

Client sends prompt

Any app POSTs a prompt through the gateway URL.

02

DLP + Guardrails scan

Content is inspected inline against policy.

03

Allow → model

Clean prompts reach the model; response returns 200.

BLOCK

Sensitive → 424

SSN/PII/unsafe content is stopped before the model. Nothing leaks.

Try it yourself

This chat runs on a free Workers AI model behind the gateway. Ask a normal question and you'll get an answer. Paste a fake SSN like 123-45-6789 and watch it get blocked inline.

AI Gateway PlaygroundLive · DLP + Guardrails enabled
Ciao! I'm running on a free Workers AI model, fronted by Cloudflare AI Gateway with DLP + Guardrails. Ask me about Linux, Cloudflare, soccer, or cycling — or try to sneak in a fake SSN and watch the gateway stop it. 🛡

Real DLP block signature: HTTP 424 · {"code":2030,"message":"Request content blocked due to DLP policy violations"}