zuplo 7.2.3 → 7.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/docs/ai-gateway/integrations/ai-sdk.mdx +3 -2
  2. package/docs/ai-gateway/integrations/claude-code.mdx +3 -2
  3. package/docs/ai-gateway/integrations/codex.mdx +7 -5
  4. package/docs/ai-gateway/integrations/goose.mdx +4 -3
  5. package/docs/ai-gateway/integrations/langchain.mdx +3 -3
  6. package/docs/ai-gateway/integrations/openai.mdx +3 -3
  7. package/docs/ai-gateway/policies/overview.mdx +3 -17
  8. package/docs/ai-gateway/universal-api.mdx +4 -3
  9. package/docs/caching/custom-caching-policy.mdx +1 -1
  10. package/docs/caching/gateway-caching.mdx +3 -3
  11. package/docs/caching/overview.mdx +10 -10
  12. package/docs/dedicated/akamai/ai-powered-applications.mdx +2 -2
  13. package/docs/dev-portal/zudoku/configuration/search.md +5 -0
  14. package/docs/dev-portal/zudoku/openapi-extensions/x-mcp-server.md +30 -0
  15. package/docs/policies/_index.md +12 -7
  16. package/docs/policies/ai-gateway-auth-v2-inbound/doc.md +168 -0
  17. package/docs/policies/ai-gateway-auth-v2-inbound/intro.md +10 -0
  18. package/docs/policies/ai-gateway-auth-v2-inbound/schema.json +74 -0
  19. package/docs/policies/ai-gateway-configuration-executor-v2-inbound/doc.md +442 -0
  20. package/docs/policies/ai-gateway-configuration-executor-v2-inbound/intro.md +14 -0
  21. package/docs/policies/ai-gateway-configuration-executor-v2-inbound/schema.json +60 -0
  22. package/docs/policies/ai-gateway-configuration-loader-v2-inbound/doc.md +105 -0
  23. package/docs/policies/ai-gateway-configuration-loader-v2-inbound/intro.md +6 -0
  24. package/docs/policies/ai-gateway-configuration-loader-v2-inbound/schema.json +60 -0
  25. package/docs/policies/ai-gateway-dlp-inbound/doc.md +127 -0
  26. package/docs/policies/ai-gateway-dlp-inbound/intro.md +5 -0
  27. package/docs/policies/ai-gateway-dlp-inbound/schema.json +4050 -0
  28. package/docs/policies/ai-gateway-fallback-model-v2-inbound/doc.md +10 -2
  29. package/docs/policies/ai-gateway-fallback-model-v2-inbound/intro.md +2 -2
  30. package/docs/policies/ai-gateway-fallback-model-v2-inbound/schema.json +22 -8
  31. package/docs/policies/ai-gateway-metering-v2-inbound/doc.md +19 -16
  32. package/docs/policies/ai-gateway-metering-v2-inbound/intro.md +9 -0
  33. package/docs/policies/ai-gateway-metering-v2-inbound/schema.json +20 -24
  34. package/docs/policies/ai-gateway-model-filtering-v2-inbound/doc.md +6 -5
  35. package/docs/policies/ai-gateway-model-filtering-v2-inbound/intro.md +2 -2
  36. package/docs/policies/ai-gateway-model-filtering-v2-inbound/schema.json +17 -3
  37. package/docs/policies/ai-gateway-semantic-cache-v2-inbound/doc.md +72 -0
  38. package/docs/policies/ai-gateway-semantic-cache-v2-inbound/intro.md +9 -0
  39. package/docs/policies/ai-gateway-semantic-cache-v2-inbound/schema.json +120 -0
  40. package/docs/policies/akamai-ai-firewall-v2-inbound/doc.md +87 -0
  41. package/docs/policies/akamai-ai-firewall-v2-inbound/intro.md +10 -0
  42. package/docs/policies/{akamai-ai-firewall → akamai-ai-firewall-v2-inbound}/schema.json +36 -9
  43. package/docs/policies/akamai-firewall-for-ai-inbound/schema.json +1 -0
  44. package/docs/policies/akamai-firewall-for-ai-outbound/schema.json +1 -0
  45. package/docs/policies/amberflo-metering-inbound/schema.json +1 -0
  46. package/docs/policies/api-key-inbound/schema.json +1 -0
  47. package/docs/policies/audit-log-inbound/schema.json +1 -0
  48. package/docs/policies/auth0-jwt-auth-inbound/schema.json +1 -0
  49. package/docs/policies/authzen-inbound/schema.json +1 -0
  50. package/docs/policies/axiomatics-authz-inbound/schema.json +1 -0
  51. package/docs/policies/basic-auth-inbound/schema.json +1 -0
  52. package/docs/policies/bot-detection-inbound/schema.json +1 -0
  53. package/docs/policies/brownout-inbound/schema.json +1 -0
  54. package/docs/policies/caching-inbound/schema.json +1 -0
  55. package/docs/policies/cdn-cache-control-outbound/schema.json +1 -0
  56. package/docs/policies/change-method-inbound/schema.json +1 -0
  57. package/docs/policies/clear-headers-inbound/schema.json +1 -0
  58. package/docs/policies/clear-headers-outbound/schema.json +1 -0
  59. package/docs/policies/clerk-jwt-auth-inbound/schema.json +1 -0
  60. package/docs/policies/cognito-jwt-auth-inbound/schema.json +1 -0
  61. package/docs/policies/comet-opik-tracing-v2-inbound/doc.md +78 -0
  62. package/docs/policies/comet-opik-tracing-v2-inbound/intro.md +10 -0
  63. package/docs/policies/{comet-opik-tracing-inbound → comet-opik-tracing-v2-inbound}/schema.json +40 -5
  64. package/docs/policies/complex-rate-limit-inbound/schema.json +1 -0
  65. package/docs/policies/composite-inbound/schema.json +1 -0
  66. package/docs/policies/composite-outbound/schema.json +1 -0
  67. package/docs/policies/curity-phantom-token-inbound/schema.json +1 -0
  68. package/docs/policies/data-loss-prevention-inbound/doc.md +22 -6
  69. package/docs/policies/data-loss-prevention-inbound/schema.json +10 -1
  70. package/docs/policies/data-loss-prevention-outbound/doc.md +23 -6
  71. package/docs/policies/data-loss-prevention-outbound/schema.json +10 -1
  72. package/docs/policies/firebase-jwt-inbound/schema.json +1 -0
  73. package/docs/policies/formdata-to-json-inbound/schema.json +1 -0
  74. package/docs/policies/galileo-tracing-v2-inbound/doc.md +72 -0
  75. package/docs/policies/galileo-tracing-v2-inbound/intro.md +8 -0
  76. package/docs/policies/{galileo-tracing-inbound → galileo-tracing-v2-inbound}/schema.json +40 -5
  77. package/docs/policies/geo-filter-inbound/schema.json +1 -0
  78. package/docs/policies/graphql-analytics-outbound/schema.json +1 -0
  79. package/docs/policies/graphql-cache-inbound/schema.json +1 -0
  80. package/docs/policies/graphql-complexity-limit-inbound/schema.json +1 -0
  81. package/docs/policies/graphql-disable-introspection-inbound/schema.json +1 -0
  82. package/docs/policies/graphql-introspection-filter-outbound/schema.json +1 -0
  83. package/docs/policies/http-deprecation-outbound/schema.json +1 -0
  84. package/docs/policies/ip-address-restriction-inbound/schema.json +1 -0
  85. package/docs/policies/jwt-scopes-inbound/schema.json +1 -0
  86. package/docs/policies/ldap-auth-inbound/schema.json +1 -0
  87. package/docs/policies/mcp-auth0-oauth-inbound/schema.json +1 -0
  88. package/docs/policies/mcp-capability-filter-inbound/schema.json +1 -0
  89. package/docs/policies/mcp-clerk-oauth-inbound/schema.json +1 -0
  90. package/docs/policies/mcp-cognito-oauth-inbound/schema.json +1 -0
  91. package/docs/policies/mcp-entra-oauth-inbound/schema.json +1 -0
  92. package/docs/policies/mcp-google-oauth-inbound/schema.json +1 -0
  93. package/docs/policies/mcp-keycloak-oauth-inbound/schema.json +1 -0
  94. package/docs/policies/mcp-logto-oauth-inbound/schema.json +1 -0
  95. package/docs/policies/mcp-oauth-inbound/schema.json +1 -0
  96. package/docs/policies/mcp-okta-oauth-inbound/schema.json +1 -0
  97. package/docs/policies/mcp-onelogin-oauth-inbound/schema.json +1 -0
  98. package/docs/policies/mcp-ping-oauth-inbound/schema.json +1 -0
  99. package/docs/policies/mcp-token-exchange-inbound/schema.json +1 -0
  100. package/docs/policies/mcp-workos-oauth-inbound/schema.json +1 -0
  101. package/docs/policies/mock-api-inbound/schema.json +1 -0
  102. package/docs/policies/moesif-inbound/schema.json +1 -0
  103. package/docs/policies/monetization-inbound/schema.json +1 -0
  104. package/docs/policies/mtls-auth-inbound/schema.json +1 -0
  105. package/docs/policies/okta-fga-authz-inbound/schema.json +1 -0
  106. package/docs/policies/okta-jwt-auth-inbound/schema.json +1 -0
  107. package/docs/policies/open-id-jwt-auth-inbound/schema.json +1 -0
  108. package/docs/policies/openfga-authz-inbound/schema.json +1 -0
  109. package/docs/policies/openmeter-inbound/schema.json +1 -0
  110. package/docs/policies/prompt-injection-outbound/schema.json +1 -0
  111. package/docs/policies/propel-auth-jwt-inbound/schema.json +1 -0
  112. package/docs/policies/query-param-to-header-inbound/schema.json +1 -0
  113. package/docs/policies/quota-inbound/schema.json +1 -0
  114. package/docs/policies/rate-limit-inbound/schema.json +1 -0
  115. package/docs/policies/readme-metrics-inbound/schema.json +1 -0
  116. package/docs/policies/remove-headers-inbound/schema.json +1 -0
  117. package/docs/policies/remove-headers-outbound/schema.json +1 -0
  118. package/docs/policies/remove-query-params-inbound/schema.json +1 -0
  119. package/docs/policies/replace-string-outbound/schema.json +1 -0
  120. package/docs/policies/request-size-limit-inbound/schema.json +1 -0
  121. package/docs/policies/request-validation-inbound/schema.json +1 -0
  122. package/docs/policies/require-origin-inbound/schema.json +1 -0
  123. package/docs/policies/require-user-claims-inbound/schema.json +1 -0
  124. package/docs/policies/secret-masking-outbound/schema.json +1 -0
  125. package/docs/policies/semantic-cache-inbound/schema.json +3 -2
  126. package/docs/policies/set-body-inbound/schema.json +1 -0
  127. package/docs/policies/set-headers-inbound/schema.json +1 -0
  128. package/docs/policies/set-headers-outbound/schema.json +1 -0
  129. package/docs/policies/set-query-params-inbound/schema.json +1 -0
  130. package/docs/policies/set-status-outbound/schema.json +1 -0
  131. package/docs/policies/set-upstream-api-key-inbound/schema.json +1 -0
  132. package/docs/policies/sleep-inbound/schema.json +1 -0
  133. package/docs/policies/stripe-webhook-verification-inbound/schema.json +1 -0
  134. package/docs/policies/supabase-jwt-auth-inbound/schema.json +1 -0
  135. package/docs/policies/traffic-splitting-inbound/schema.json +1 -0
  136. package/docs/policies/upstream-aws-federated-auth-inbound/schema.json +1 -0
  137. package/docs/policies/upstream-aws-service-auth-inbound/schema.json +1 -0
  138. package/docs/policies/upstream-azure-ad-service-auth-inbound/schema.json +1 -0
  139. package/docs/policies/upstream-firebase-admin-auth-inbound/schema.json +1 -0
  140. package/docs/policies/upstream-firebase-user-auth-inbound/schema.json +1 -0
  141. package/docs/policies/upstream-gcp-federated-auth-inbound/schema.json +1 -0
  142. package/docs/policies/upstream-gcp-jwt-inbound/schema.json +1 -0
  143. package/docs/policies/upstream-gcp-service-auth-inbound/schema.json +1 -0
  144. package/docs/policies/upstream-oauth-client-credentials-inbound/schema.json +1 -0
  145. package/docs/policies/upstream-zuplo-jwt-auth-inbound/schema.json +1 -0
  146. package/docs/policies/validate-json-schema-inbound/schema.json +1 -0
  147. package/docs/policies/web-bot-auth-inbound/schema.json +1 -0
  148. package/docs/policies/xml-to-json-outbound/schema.json +1 -0
  149. package/package.json +5 -5
  150. package/docs/ai-gateway/policies/akamai-ai-firewall.mdx +0 -122
  151. package/docs/ai-gateway/policies/authentication.mdx +0 -43
  152. package/docs/ai-gateway/policies/comet-opik-tracing.mdx +0 -177
  153. package/docs/ai-gateway/policies/fallback-model.mdx +0 -40
  154. package/docs/ai-gateway/policies/galileo-tracing.mdx +0 -161
  155. package/docs/ai-gateway/policies/metering.mdx +0 -47
  156. package/docs/ai-gateway/policies/model-filtering.mdx +0 -49
  157. package/docs/ai-gateway/policies/semantic-cache.mdx +0 -48
@@ -0,0 +1,127 @@
1
+ The Data Loss Prevention (DLP) policy scans the **content** of AI requests and
2
+ responses — system prompts, message text, thinking blocks, tool-result text, and
3
+ (by default) tool-call arguments — for sensitive data, and applies a per-rule
4
+ action when something is found. It never inspects structural fields: model
5
+ names, temperatures, token counts, and usage pass through untouched.
6
+
7
+ Detection runs entirely inside your gateway using the built-in DLP engine (62
8
+ data types backed by regexes, checksums such as Luhn and IBAN mod-97, and
9
+ context-word scoring). Nothing is sent to a third-party scanning service.
10
+
11
+ ## Rules
12
+
13
+ `rules` is a map. Each key names a built-in data type id (like `id-us-ssn`) or a
14
+ group selector (like `pii`, `secret`, or any dash-aligned prefix such as
15
+ `secret-aws`); each value is a rule object stating what happens when that type
16
+ is found:
17
+
18
+ - `mask` — replace the matched text with a placeholder; the conversation
19
+ continues.
20
+ - `block` — reject the request (or terminate the response) with an error naming
21
+ the detected types, never the values.
22
+ - `log` — record a finding and let the traffic pass; use it to trial a rule.
23
+ - `off` — exclude this type from a group enabled by a broader key.
24
+
25
+ A rule states its action in one of two ways, never both: a single `action`
26
+ applying in both directions, or the directional pair `inboundAction` /
27
+ `outboundAction` — `inboundAction` governs what callers send the model,
28
+ `outboundAction` governs what the model sends back (buffered responses whole,
29
+ streaming responses as they stream). Either directional field alone limits the
30
+ rule to that direction.
31
+
32
+ Types you do not mention are not scanned. The most specific key wins (exact id
33
+ beats a prefix beats a group) and the winning entry decides everything for its
34
+ type, direction included. When one stretch of text matches multiple rules, the
35
+ severest action wins (block > mask > log).
36
+
37
+ ```json
38
+ "rules": {
39
+ "pii": { "inboundAction": "mask", "outboundAction": "block" },
40
+ "contact-phone": { "action": "off" },
41
+ "secret": { "action": "block" },
42
+ "finance-credit-card": { "action": "mask", "partialMask": { "keepLast": 4 } },
43
+ "finance-cvv": { "action": "block", "detection": "corroborated" }
44
+ }
45
+ ```
46
+
47
+ ### Detection levels
48
+
49
+ Each type combines its pattern with evidence — a checksum where the format has
50
+ one, context words (like "cvv" or "routing number") where it does not.
51
+ `detection` says how much evidence a match needs: `corroborated` additionally
52
+ requires one of the type's context words near the match (types without context
53
+ words behave as standard); `standard` (the default) uses the catalog as tuned —
54
+ distinctive shapes such as a dashed SSN act on their own, ambiguous shapes such
55
+ as a bare CVV need nearby context; `aggressive` counts every pattern match and
56
+ is false-positive-prone — pair it with `log` for audits. There are no numeric
57
+ confidence thresholds to tune.
58
+
59
+ ## Masking
60
+
61
+ The default replacement is the typed placeholder `[{type}]`, which renders the
62
+ detected type id in UPPER_SNAKE form — `bob@acme.com` becomes `[CONTACT_EMAIL]`
63
+ — keeping masked conversations legible to the model. Set a rule's `mask` to a
64
+ literal like `[REDACTED]` to hide the type instead.
65
+ `partialMask: { "keepLast": 4 }` keeps the last four characters and `*`-fills
66
+ the rest, preserving length (`**** **** **** 4242`).
67
+
68
+ ## Allowed values
69
+
70
+ `allowValues` lists exact strings never flagged by any rule — documentation
71
+ samples like Stripe's public test card, or your own support email address. The
72
+ exemption applies to the whole value even when it arrives split across streaming
73
+ chunks.
74
+
75
+ ## Custom rules
76
+
77
+ `customRules` adds your own detections: the same rule object plus a `name`, a
78
+ regex `pattern`, and optional `context` words (`detection: "corroborated"` then
79
+ means "only near one of those words"). Names must be distinct and must not reuse
80
+ a built-in type id or group selector — built-in types are configured through
81
+ `rules`. An invalid pattern or a colliding name fails the configuration at
82
+ request time — a broken guardrail never degrades into a silent pass-through.
83
+
84
+ ## Streaming responses
85
+
86
+ Streaming responses are scanned as they stream. Providers emit deltas of a few
87
+ characters, so each channel's text is first coalesced into scan pieces of at
88
+ least 64 characters (clients concatenate deltas, so only the chunking shifts —
89
+ never the text). The scanner carries a bounded tail of already-scanned text
90
+ (`streaming.maxCarryChars`, default 512) into each new piece's scan, and each
91
+ piece is released once the scan including its successor passes — so a value
92
+ split across pieces is fully maskable before anything is delivered, at the cost
93
+ of roughly one coalesced piece (~64 characters) of latency. When a `block` rule
94
+ fires mid-stream, the stream terminates with the endpoint's native
95
+ content-filter events (OpenAI clients see a `content_filter` error chunk and
96
+ `[DONE]`; Anthropic clients see a well-formed `message_delta` with
97
+ `stop_reason: "content_filter"` and `message_stop`). Setting
98
+ `streaming.boundaryScan: false` scans each chunk alone and releases it
99
+ immediately — lower cost, but values split across chunks are missed.
100
+
101
+ ## Failure posture
102
+
103
+ This policy is a guardrail and fails closed by default: content whose shape
104
+ cannot be inspected is denied (`onUnknownShape: "deny"`, which also covers a
105
+ streamed SSE event that cannot be parsed), and an internal scanner failure
106
+ blocks with a 500 (`onError: "block"`). A detected value that masking cannot
107
+ reach — one whose evidence spans two separate message fields, so no single field
108
+ can be rewritten — is blocked instead of forwarded half-covered. Error responses
109
+ (4xx/5xx) from the upstream are never scanned. Response hooks compose with other
110
+ AI Gateway policies on compatibility dates of 2026-03-01 or later.
111
+
112
+ ## Known limits
113
+
114
+ - Masking is complete for streamed values up to two coalesced scan pieces (~128
115
+ characters) regardless of how finely the provider chunks its deltas, for types
116
+ whose shape alone is decisive (dashed SSNs, cards, prefixed secrets). A longer
117
+ value (or one past `maxCarryChars`) is still detected — and can block — but
118
+ its earliest pieces may already have been delivered.
119
+ - A context-gated match (a weak form, or a `corroborated` rule) whose context
120
+ word arrives only in a LATER piece can leak the characters delivered before
121
+ the context made it actionable; detection and blocking still fire.
122
+ - Streamed `logprobs` are removed from scanned chat streams: masking rewrites
123
+ the text they describe, and stale logprobs are worse than absent ones.
124
+ - Context words must appear in the conversation text itself; JSON field names in
125
+ your application's data are not visible to the scanner.
126
+ - Multi-line values such as PEM private key blocks are not detected across
127
+ streaming chunk boundaries.
@@ -0,0 +1,5 @@
1
+ Scans AI request and response content — system prompts, message text, and
2
+ tool-call arguments — for sensitive data such as credit cards, national
3
+ identifiers, and API keys, applying per-rule actions (mask, block, or log).
4
+ Detection runs entirely inside the gateway, and streaming responses are scanned
5
+ as they stream.