Skip to content

AI Gateway DLP docs improved (5 files)#28326

Open
ask-bonk[bot] wants to merge 3 commits intoproductionfrom
opencode/issue28325-20260213165127
Open

AI Gateway DLP docs improved (5 files)#28326
ask-bonk[bot] wants to merge 3 commits intoproductionfrom
opencode/issue28325-20260213165127

Conversation

@ask-bonk
Copy link
Contributor

@ask-bonk ask-bonk bot commented Feb 13, 2026

All changes are complete and validated. Here is a summary of the research findings and documentation updates made:

Research Findings & Documentation Updates

Files Modified (5 files)

  1. src/content/docs/ai-gateway/features/dlp/index.mdx - DLP concept page
  2. src/content/docs/ai-gateway/features/dlp/set-up-dlp.mdx - DLP setup page
  3. src/content/docs/ai-gateway/observability/logging/index.mdx - Logging reference
  4. src/content/docs/ai-gateway/reference/limits.mdx - Limits page
  5. src/content/glossary/ai-gateway.yaml - Header glossary

Issue Questions Addressed

Question Finding Doc Update
DLP fields in Logs API The dashboard shows DLP match data in logs, but neither the logging docs nor the log API schema documented these fields Added "DLP fields in logs" section to logging page with a table of fields (action, policies, profiles, entries, check). Added corresponding section to DLP setup page referencing the Logs API.
Per-request DLP profile selection No such mechanism exists. No header for per-request DLP profile selection. Added "Per-request DLP controls" section to the DLP concept page explicitly stating DLP is gateway-level only, and recommending separate gateways for per-tenant variance.
cf-aig-skip-dlp header Does not exist. No per-request DLP bypass. Covered in the same "Per-request DLP controls" section - explicitly states there is no header to bypass DLP per-request.
Gateway limit (20 paid) - higher limit? The limits page already includes a limits-increase partial linking to a Google Form for requesting increases. Kept existing partial; restructured the limits page with clear headings for discoverability.
DLP profile and rule limits Zero Trust account-limits page documents: 25 custom entries, 100K EDM cells, 200/1000 wordlist keywords, 1M dataset cells. No limit on number of DLP profiles. No coupling between gateways and DLP profiles. Added a "DLP limits" section to the AI Gateway limits page with the full limits table and cross-reference to Zero Trust account limits. Explicitly documented that profiles are shared objects not coupled to gateways.
Inspection scope DLP docs were silent on specifics (streaming, tool calls, base64, file attachments, multipart) Added "Inspection scope" subsection to DLP concept page covering: non-streaming, streaming (SSE) buffering, tool calls, base64-encoded images, file attachment URLs, and multipart form data.
Streaming latency impact Completely undocumented for DLP (Guardrails explicitly says "streaming not supported") Added "Streaming behavior" subsection to DLP concept page documenting that DLP buffers full streaming responses, increases time-to-first-token latency, and that request-only scanning avoids this.

Additional Improvements

  • Added cf-aig-dlp response header to the glossary (ai-gateway.yaml) - it was missing from the header glossary
  • Added "DLP Action" to the log filter table in the logging page
  • Clarified that DLP match data appears in both dashboard logs and the Logs API

Closes #28325

github run

Co-authored-by: irvinebroque <irvinebroque@users.noreply.github.com>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/docs/ai-gateway/ @abhishekkankani, @palashgo, @thebongy, @roerohan, @kathayl, @mchenco, @cloudflare/pcx-technical-writing
/src/content/docs/cloudflare-one/ @ranbel, @cloudflare/pcx-technical-writing
/src/content/docs/cloudflare-one/data-loss-prevention/ @cloudflare/pcx-technical-writing
* @cloudflare/pcx-technical-writing
/src/content/partials/ai-gateway/ @abhishekkankani, @palashgo, @thebongy, @roerohan, @kathayl, @mchenco, @cloudflare/pcx-technical-writing

@irvinebroque irvinebroque requested a review from ethulia February 13, 2026 17:03
@irvinebroque
Copy link
Contributor

/bonk please review the DLP docs as well (https://developers.cloudflare.com/cloudflare-one/data-loss-prevention/) and investigate if there are other changes we should make to DLP docs as well, in addition to these changes to the AI Gateway docs. Then go and make these changes, as part of this pull request

- **Streaming (SSE) responses**: DLP buffers the full streamed response before scanning. This means DLP-scanned streaming responses are not delivered incrementally to the client. Expect increased time-to-first-token latency when DLP response scanning is enabled on streaming requests, because the entire response must be received from the provider before DLP can evaluate it and release it to the client.
- **Tool call arguments and results**: DLP scans the text content present in the message body, which includes tool call arguments and results if they appear in the JSON request or response payload.
- **Base64-encoded images and file attachments**: DLP does not decode base64-encoded content or follow external URLs. Only the raw text of the request and response body is inspected.
- **Multipart form data**: DLP scans the text portions of the request body. Binary data within multipart payloads is not inspected.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part needs some auditing based on looking at underlying implementation, I don't trust my direct knowledge on DLP mechanics to be approver

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By my inspection, this all seems accurate. For the multi form data, we could consider adding a second sentence on responses (https://gitlab.cfdata.org/cloudflare/aig/ai-gateway-worker/-/blob/main/src/dlp.ts?ref_type=heads#L84):

Responses to multipart requests are not scanned.

…docs

- Add 'AI traffic' section to Cloudflare One DLP index page linking to AI Gateway DLP
- Add AI Gateway as a third consumer of DLP profiles on the profiles page
- Add note on DLP policies page about AI Gateway as an alternative to Gateway HTTP
- Fix AI Gateway DLP concept page: replace inaccurate 'unified management' claims
  with accurate description of shared profiles vs separate policy/log management
@ask-bonk
Copy link
Contributor Author

ask-bonk bot commented Feb 13, 2026

All changes are committed. Here is a summary of the review findings and changes made:

Review Findings

After thoroughly reviewing both the AI Gateway DLP docs (this PR) and the Cloudflare One DLP docs (live site), I identified two main gaps:

Gap 1: Missing cross-references from Cloudflare One DLP docs to AI Gateway

The Cloudflare One DLP docs had zero mentions of AI Gateway across 11 DLP pages. DLP profiles can now be used in three contexts (Gateway HTTP policies, CASB integrations, and AI Gateway), but the docs only mentioned the first two. The only Cloudflare One page mentioning AI Gateway at all was a tutorial.

Gap 2: Inaccurate integration description on AI Gateway DLP concept page

The existing PR's "Integration with Cloudflare DLP" section claimed "Unified management", "Centralized reporting", and "All DLP events appear in the same dashboard and logs." This is incorrect - AI Gateway and Zero Trust Gateway are architecturally separate products with separate policy management and separate log systems. Only the DLP detection profiles are shared.

Changes Made (4 files)

File Change
src/content/docs/cloudflare-one/data-loss-prevention/index.mdx Added new "AI traffic" section between "Data in transit" and "Data at rest", explaining DLP integration with AI Gateway (no Gateway HTTP/TLS required)
src/content/docs/cloudflare-one/data-loss-prevention/dlp-profiles/index.mdx Added "AI Gateway DLP policy" as a third destination for both predefined and custom profiles
src/content/docs/cloudflare-one/data-loss-prevention/dlp-policies/index.mdx Added note callout pointing to AI Gateway as an alternative for scanning AI traffic without Gateway HTTP filtering
src/content/docs/ai-gateway/features/dlp/index.mdx Replaced inaccurate "unified management/centralized reporting" bullet points with accurate description of shared profiles but separate policy management and separate logs

All validation checks pass (0 errors from npm run check, ESLint clean, Prettier clean).

github run

@irvinebroque
Copy link
Contributor

/bonk is any of the content in this pull request duplicated across other parts of the docs? are there opportunities to consolidate any of it into partials? Do not change anything yet, just provide your analysis. Research deeply

@ask-bonk
Copy link
Contributor Author

ask-bonk bot commented Feb 13, 2026

Duplication & Consolidation Analysis

Here is a thorough analysis of content duplication in this PR and opportunities to consolidate into partials.


1. DLP Limits Table — Duplicated across two files

The problem: The DLP limits table introduced at ai-gateway/reference/limits.mdx:48-54 is a near-exact copy of the canonical table at cloudflare-one/account-limits.mdx:55-61. The only differences are cosmetic (e.g., "Custom detection entries" vs "Custom entries", "25 per account" vs "25").

AI Gateway limits.mdx (new) Zero Trust account-limits.mdx (existing)
Custom detection entries — 25 per account Custom entries — 25
Exact Data Match cells per spreadsheet — 100,000 Exact Data Match cells per spreadsheet — 100,000
Custom Wordlist keywords per spreadsheet — 200 Custom Wordlist keywords per spreadsheet — 200
Custom Wordlist keywords per account — 1,000 Custom Wordlist keywords per account — 1,000
Dataset cells per account — 1,000,000 Dataset cells per account — 1,000,000

Recommendation: Create a partial (e.g., src/content/partials/cloudflare-one/data-loss-prevention/dlp-limits-table.mdx) containing the DLP limits table. Use <Render> in both ai-gateway/reference/limits.mdx and cloudflare-one/account-limits.mdx. This ensures the values stay in sync. The AI Gateway page can keep its contextual prose ("DLP profiles are shared Zero Trust objects...") around the rendered partial.

Severity: High — these are numeric limits that will go stale independently if not consolidated.


2. DLP Log Fields — Described twice in different formats

The problem: DLP log field information is documented in two places:

  • ai-gateway/observability/logging/index.mdx:50-62 — A formal table (DLP Action, DLP Policies Matched, DLP Profiles Matched, DLP Entries Matched, DLP Check) plus a sentence about filtering.
  • ai-gateway/features/dlp/set-up-dlp.mdx:70-86 — The "Monitor DLP events" section describes the same fields in prose/bullet format (DLP Action Taken, DLP Policies Matched, profiles, entries, request-vs-response), plus the Logs API fields.

These describe the same underlying data in two different formats on two different pages. The logging page cross-references the DLP setup page (line 62), and the DLP setup page cross-references the logging page (line 86), creating a circular reference.

Recommendation: Create a partial (e.g., src/content/partials/ai-gateway/dlp-log-fields.mdx) containing the DLP log fields table. Render it on the logging page and reference it (or render it) from the DLP setup page. The DLP setup page can keep its higher-level "Monitor DLP events" workflow steps but should defer to the logging page or the shared partial for the field definitions rather than restating them.

Severity: Medium — the content is not identical (table vs prose), but describes the same thing and risks diverging.


3. DLP Action FLAG/BLOCK filter — Described in two places

The problem: How to filter logs by DLP Action is described in:

  • set-up-dlp.mdx:88-96 — Full 5-step "Filter DLP events" section
  • logging/index.mdx:62 — One sentence ("You can filter logs by DLP Action...")
  • logging/index.mdx:100 — Row in the manual deletion filters table (DLP Action | FLAG, BLOCK)

This is a minor overlap since the logging page is terse, but the filter steps in set-up-dlp.mdx could drift from the actual filter table on the logging page.

Recommendation: Keep the detailed filter steps on set-up-dlp.mdx and the terse mention on the logging page. No partial needed here — the cross-reference at logging/index.mdx:62 already points to the DLP setup page. This is acceptable duplication for discoverability.

Severity: Low — reasonable cross-product discoverability duplication.


4. "Integration with Cloudflare DLP" description — Partially overlapping with Cloudflare One DLP index

The problem:

  • ai-gateway/features/dlp/index.mdx:61-71 — "Integration with Cloudflare DLP" section explains that profiles are shared, no Gateway proxy needed, separate policy management, separate logs.
  • cloudflare-one/data-loss-prevention/index.mdx:31-35 — "AI traffic" section says DLP integrates with AI Gateway, scans prompts/responses, no Gateway HTTP filtering or TLS decryption required.

Both state the same key fact: AI Gateway DLP uses shared DLP profiles but does not require Gateway HTTP filtering or TLS decryption.

Recommendation: This overlap is acceptable and even desirable — each product's docs should explain the integration from its own perspective. The content is not identical; it is tailored to each audience. No partial needed.

Severity: Low — intentional cross-product cross-referencing, not problematic duplication.


5. DLP profile categories list — Potentially consolidatable

The problem: set-up-dlp.mdx:29-34 lists specific DLP profile categories (Financial Information, PII, Government Identifiers, Healthcare Information, Custom Profiles) with brief descriptions. These are the same predefined profiles documented in cloudflare-one/data-loss-prevention/dlp-profiles/predefined-profiles.mdx and are subject to change as Cloudflare adds new categories.

Recommendation: Either link to the predefined profiles page instead of enumerating them, or create a small partial listing the profile categories. Hardcoding profile names risks going stale.

Severity: Medium — profile categories could change, and maintaining them in multiple places is a drift risk.


6. cf-aig-dlp header schema — No duplication (good)

The JSON schema and example for the cf-aig-dlp response header exists only in set-up-dlp.mdx:106-145. The glossary entry at ai-gateway.yaml:60-62 is a brief definition that links to the setup page. No consolidation needed.


7. Unused existing partials that could be leveraged

The following existing partials are relevant but not used by the AI Gateway DLP pages:

  • cloudflare-one/data-loss-prevention/predefined-profile.mdx — Step-by-step for enabling predefined DLP profiles. Currently appears orphaned (no pages render it). Could be referenced from AI Gateway DLP setup docs since the setup process is identical.
  • cloudflare-one/data-loss-prevention/custom-profile.mdx — Step-by-step for creating custom DLP profiles. Used by 3 pages. The AI Gateway DLP setup page (set-up-dlp.mdx:37) links to the Zero Trust DLP dashboard for profile creation but doesn't render this partial.

Recommendation: The AI Gateway DLP setup page links to the Zero Trust DLP profiles page (which uses the custom-profile partial). This indirection is acceptable. No change needed unless you want to embed the profile creation steps directly in the AI Gateway docs.


Summary

Issue Files Affected Severity Recommended Action
DLP limits table duplication ai-gateway/reference/limits.mdx, cloudflare-one/account-limits.mdx High Create shared partial
DLP log fields described twice ai-gateway/observability/logging/index.mdx, ai-gateway/features/dlp/set-up-dlp.mdx Medium Create partial for field table, reference from both
Hardcoded DLP profile categories ai-gateway/features/dlp/set-up-dlp.mdx Medium Link to predefined profiles page instead of enumerating
DLP Action filter duplication logging/index.mdx, set-up-dlp.mdx Low Acceptable — cross-references exist
Cross-product integration description ai-gateway/features/dlp/index.mdx, cloudflare-one/data-loss-prevention/index.mdx Low Acceptable — intentionally different perspectives

The highest-value consolidation would be extracting the DLP limits table into a shared partial. The values are numeric limits that are likely to change, and having them in two places with slightly different formatting is a clear drift risk.

github run

@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

Preview URL: https://992504c4.preview.developers.cloudflare.com
Preview Branch URL: https://opencode-issue28325-20260213165127.preview.developers.cloudflare.com

Files with changes (up to 15)

Original Link Updated Link
https://developers.cloudflare.com/ai-gateway/features/dlp/ https://opencode-issue28325-20260213165127.preview.developers.cloudflare.com/ai-gateway/features/dlp/
https://developers.cloudflare.com/ai-gateway/features/dlp/set-up-dlp/ https://opencode-issue28325-20260213165127.preview.developers.cloudflare.com/ai-gateway/features/dlp/set-up-dlp/
https://developers.cloudflare.com/ai-gateway/observability/logging/ https://opencode-issue28325-20260213165127.preview.developers.cloudflare.com/ai-gateway/observability/logging/
https://developers.cloudflare.com/ai-gateway/reference/limits/ https://opencode-issue28325-20260213165127.preview.developers.cloudflare.com/ai-gateway/reference/limits/
https://developers.cloudflare.com/cloudflare-one/account-limits/ https://opencode-issue28325-20260213165127.preview.developers.cloudflare.com/cloudflare-one/account-limits/
https://developers.cloudflare.com/cloudflare-one/data-loss-prevention/ https://opencode-issue28325-20260213165127.preview.developers.cloudflare.com/cloudflare-one/data-loss-prevention/
https://developers.cloudflare.com/cloudflare-one/data-loss-prevention/dlp-policies/ https://opencode-issue28325-20260213165127.preview.developers.cloudflare.com/cloudflare-one/data-loss-prevention/dlp-policies/
https://developers.cloudflare.com/cloudflare-one/data-loss-prevention/dlp-profiles/ https://opencode-issue28325-20260213165127.preview.developers.cloudflare.com/cloudflare-one/data-loss-prevention/dlp-profiles/

@irvinebroque
Copy link
Contributor

/bonk please implement "The highest-value consolidation would be extracting the DLP limits table into a shared partial." as called out in recommendations on the previous comment of this pull request. (1) and (2) from that list of recommendations and findings. do not implement the rest.

Consolidate duplicated content into reusable partials to prevent drift:
- DLP limits table partial used by both AI Gateway limits and Zero Trust account limits pages
- DLP log fields partial used by both the logging reference and DLP setup pages
@ask-bonk
Copy link
Contributor Author

ask-bonk bot commented Feb 13, 2026

Done. Here is a summary of the changes:

Changes Made

Recommendation 1: DLP limits table → shared partial

Created: src/content/partials/cloudflare-one/data-loss-prevention/dlp-limits-table.mdx

Contains the canonical DLP limits table (custom entries, EDM cells, wordlist keywords, dataset cells) in a single location.

Updated consumers:

  • src/content/docs/ai-gateway/reference/limits.mdx — replaced inline table with <Render file="data-loss-prevention/dlp-limits-table" product="cloudflare-one" />
  • src/content/docs/cloudflare-one/account-limits.mdx — replaced inline table with the same <Render> call

This eliminates the drift risk where the AI Gateway page had slightly different wording ("Custom detection entries — 25 per account" vs "Custom entries — 25") for the same limits.

Recommendation 2: DLP log fields → shared partial

Created: src/content/partials/ai-gateway/dlp-log-fields.mdx

Contains the DLP log fields table (DLP Action, Policies Matched, Profiles Matched, Entries Matched, DLP Check).

Updated consumers:

  • src/content/docs/ai-gateway/observability/logging/index.mdx — replaced inline table with <Render file="dlp-log-fields" product="ai-gateway" />
  • src/content/docs/ai-gateway/features/dlp/set-up-dlp.mdx — replaced the prose bullet list restating the same fields with the shared table via <Render>, keeping the surrounding workflow context

All validation passes: 0 errors from npm run check, ESLint clean, Prettier clean.

github run

@ask-bonk ask-bonk bot requested a review from ranbel as a code owner February 13, 2026 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:ai-gateway AI Gateway: https://developers.cloudflare.com/ai-gateway/ size/s

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AI Gateway x DLP Docs Improvements

8 participants