Module 7 — AI Controls (Safe AI Usage)
Goal: See which AI tools your people use, stop sensitive data from being pasted into them, and protect any AI apps you build yourself.
| 👤 Who does this | Security team |
| ⏱️ Time | ~45 minutes |
| 🎯 You'll finish with | Visibility into AI usage, a policy that lets people use AI safely, and prompt-level data protection |
| ✋ Before you begin | Modules 3 & 5 done (devices connected, TLS decryption on). DLP-based parts need Enterprise. |
🧭 The golden rule for AI: govern, don't ban. If you hard-block ChatGPT, people just use it on their phones — and you lose all visibility. The goal is to allow AI safely: see it, control risky actions, and stop sensitive data going in.
Cloudflare's AI Security Suite — the big picture
This module (and Modules 5d, 6, 7b, 7c) together make up Cloudflare's AI Security Suite: secure and govern AI everywhere innovation happens, across the whole AI lifecycle — so you can scale AI adoption without sacrificing security. It's worth seeing how the pieces fit before diving in.
Four outcomes the suite delivers:
| Outcome | What it means | Where in this guide |
|---|---|---|
| Reduce shadow-AI risk | Understand how AI is used; manage risky/unsanctioned tools with SaaS analytics + traffic policy | 5d — Shadow IT |
| Prevent data loss | Detect sensitive info in AI-bound traffic — across model requests, browser sessions, and SaaS destinations | 6 — DLP · this module |
| Govern agent tool access | Centralize access to internal/third-party MCP servers; curate tools & prompts behind zero-trust policy | 7b — Secure AI & MCP |
| Keep costs under control | Real-time spend limits so AI usage stays predictable across models & providers | 7c — AI Gateway |
Four use cases across the AI lifecycle:
| Use case | Primary tools | Module |
|---|---|---|
| Secure workforce AI use | SWG, DLP, RBI, CASB | 5 · 6 · 5c · this module |
| Govern AI agents | MCP server portals, ZTNA | 7b |
| Build AI securely | AI Gateway, Workers (host remote MCP servers) | 7c |
| Protect AI-powered apps | AI Security for Apps (WAF) | Part D2 below |
📎 One capability this onboarding doesn't set up in depth: CASB / AI-SPM. Cloudflare's CASB adds AI Security Posture Management — it scans your sanctioned SaaS and AI tools for misconfigurations (over-shared data, risky integrations, weak settings) and helps you fix them. It complements the in-traffic controls in this suite with at-rest posture checks on the AI tools you've approved. If you've licensed CASB, run its AI-SPM scans alongside these modules. (Reference: cloudflare.com/solutions/ai-security.)
We'll do: (A) discover what's used → (B) allow-but-restrict → (C) protect prompts with DLP → (D) protect AI you build → (E) govern AI agents.
Part A — Discover which AI tools are in use
- 👉 Zero Trust → Gateway → Analytics → Shadow IT Discovery (or My Team → Shadow IT Discovery).
- 👉 Filter the application type to Generative AI.
- 📺 What you'll see: A list of AI apps your users have accessed (ChatGPT, Gemini, Claude, Perplexity, Copilot…), with how many users and how much traffic.
- 👉 For each app, set a status: mark sanctioned tools Approved and others Unapproved.
✅ Checkpoint: You now have an evidence-based picture of AI usage — the basis for your AI acceptable-use policy.
🔎 The full discover→review→enforce workflow (for all SaaS, not just AI) plus the AI-adoption journey is in Module 5d — Shadow IT & AI Security Adoption.
Part B — Allow AI, but restrict risky actions
Instead of blocking an AI app, allow it while blocking the risky parts (like file uploads).
- 👉 Zero Trust → Gateway → Firewall Policies → HTTP → Add a policy.
- ⌨️ Name:
AI - allow with guardrails. - 👉 Rule: Selector Application → in → select your AI apps (e.g. ChatGPT, Google Gemini, Claude, Perplexity).
- 👉 Expand Application granular controls and block specific actions, e.g.:
- Block Upload file
- (optionally) Block Share / create actions
- 👉 Action: Allow (with the granular blocks applied).
- 👉 Click Create policy.
📺 What this does: People can chat with the AI, but can't upload your documents into it.
✅ Checkpoint: On a pilot device, you can use ChatGPT normally, but attempting to upload a file is blocked.
Part C — Protect prompts with DLP (Enterprise)
This scans what users type into AI tools and blocks prompts containing sensitive data.
Step C1 — Turn on AI prompt detection
- 👉 Zero Trust → DLP → Detection entries (or open a DLP profile) → find AI prompt topics.
- 👉 Enable the topics you care about:
- Content topics: PII, Source Code, Credentials & Secrets, Financial Information, Customer Data
- Intent topics: jailbreak attempts, requests for malicious code, attempts to extract personal data
- 💡 Or just select a ready-made profile like "AI Prompt: PII" or "AI Prompt: AI Security."
Step C2 — Enforce it (monitor first!)
- 👉 Gateway → HTTP → Add a policy named
AI prompts - MONITOR. - 👉 Rule: Selector DLP Profile → in → your AI Prompt profile. Action Allow (logs only).
- 👉 Run it for a few days; review Gateway → Logs.
- 👉 Then add a higher-priority policy
AI prompts - BLOCKwith Action: Block for the high-confidence cases (e.g. prompts containing Credentials & Secrets).
✅ Checkpoint: Pasting a fake secret/API key into an AI chat is detected (and blocked by the block policy), visible in logs.
Part D — Protect AI apps you build
Two different tools, depending on how AI is used:
D1 — For programmatic / API AI (no device client needed): DLP for AI Gateway
If your developers call AI models through Cloudflare AI Gateway:
- 👉 Cloudflare dashboard → AI → AI Gateway → select your gateway.
- 👉 Open Features → DLP → Set up.
- 👉 Attach DLP profiles to scan the requests and responses to/from AI providers.
💡 This works without TLS decryption or the device client — it inspects traffic at the API layer. Great for governing app-to-AI calls.
🚪 AI Gateway does much more than DLP — authentication, guardrails, cost/rate limits, caching, and logging for every AI call your apps make. Full walkthrough: Module 7c — AI Gateway: Protect & Implement.
D2 — For AI apps you expose to users: AI Security for Apps (WAF)
If you host an AI app/chatbot that others reach over the web:
- 👉 Go to the zone (website) hosting your AI app → Security → Settings (or WAF → Detections).
- 👉 Enable AI Security for Apps detections — prompt injection and unsafe topics.
- 👉 Create a WAF custom rule that acts (Block/Log) when those detections fire.
💡 How they differ: AI Security for Apps stops attacks on your model (prompt injection); DLP stops sensitive data moving. Use both on AI traffic.
🕷️ The other inbound threat: AI crawlers. Beyond attacks, AI bots crawl your public content to train models — now the majority of internet traffic. To see, allow/block, or even charge them, see Module 7d — The Agentic Internet: AI Crawler & Bot Control.
Part E — Govern AI agents (MCP server portals) — optional/advanced
If you expose tools to AI agents via the Model Context Protocol (MCP):
- 👉 Zero Trust → Access controls → AI controls → MCP server portals.
- 👉 Add a portal, publish the tools/prompts you want to expose, and put an Access policy in front so only authorized agents/users can use them.
🔐 This is a big topic on its own. For the full walkthrough — securing individual MCP servers, building an MCP portal, Managed OAuth for AI clients, service tokens for bots, and request-level logging + DLP — see the companion page: Module 7b — Secure AI & MCP with Access (MCP Server Portals).
✅ Module 7 complete!
You now have:
- ✅ Visibility into which AI tools are used (Shadow IT)
- ✅ An "allow but restrict" policy for AI apps
- ✅ (Enterprise) Prompt-level DLP detecting/blocking sensitive prompts
- ✅ Protection for AI you build (API layer and/or web layer)
- ✅ (Optional) Governance for AI agents via MCP portals
Quick troubleshooting
| Problem | Fix |
|---|---|
| AI apps don't appear in Shadow IT | Needs HTTP traffic through Gateway — confirm Module 5 (Gateway with WARP + decryption) |
| Prompt DLP not catching anything | TLS decryption off, or AI prompt topics not enabled (Part C1); also needs Enterprise |
| Granular "block upload" not available for an app | Not all apps support every granular control — block the app's upload domain instead, or isolate it |
| Users complain AI is fully blocked | You created a Block instead of Allow+granular — switch to the Part B pattern |
👉 Next: Module 8 — Cloudflare WAN
Connect whole offices and data centers to Cloudflare. (Optional; requires Enterprise network add-on.)