zuplo 6.70.15 → 6.70.21

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.
@@ -0,0 +1,59 @@
1
+ ---
2
+ title: "Zuplo CLI: Ca Certificate List"
3
+ sidebar_label: ca-certificate list
4
+ ---
5
+
6
+ <CliCommand
7
+ command="ca-certificate list"
8
+ description="Lists all CA certificates for an account"
9
+ options={[
10
+ {
11
+ "name": "account",
12
+ "type": "string",
13
+ "description": "The account name",
14
+ "required": false,
15
+ "deprecated": false,
16
+ "hidden": false
17
+ },
18
+ {
19
+ "name": "output",
20
+ "type": "string",
21
+ "description": "Output format",
22
+ "default": "default",
23
+ "required": false,
24
+ "deprecated": false,
25
+ "hidden": false,
26
+ "alias": [
27
+ "o"
28
+ ],
29
+ "choices": [
30
+ "default",
31
+ "json"
32
+ ]
33
+ }
34
+ ]}
35
+ examples={[
36
+ [
37
+ "$0 ca-certificate list",
38
+ "List all CA certificates for your account"
39
+ ],
40
+ [
41
+ "$0 ca-certificate list --account my-account",
42
+ "Explicitly specify the account"
43
+ ],
44
+ [
45
+ "$0 ca-certificate list --output json",
46
+ "List CA certificates as JSON"
47
+ ]
48
+ ]}
49
+ usage="$0 ca-certificate list [options]"
50
+ >
51
+
52
+ </CliCommand>
53
+
54
+ ## Global options
55
+
56
+ The following global options are available for all commands:
57
+
58
+ - [`--help`](./global-options.mdx#help)
59
+ - [`--api-key`](./global-options.mdx#api-key)
@@ -0,0 +1,71 @@
1
+ ---
2
+ title: "Zuplo CLI: Ca Certificate Update"
3
+ sidebar_label: ca-certificate update
4
+ ---
5
+
6
+ <CliCommand
7
+ command="ca-certificate update"
8
+ description="Updates the name of a CA certificate"
9
+ options={[
10
+ {
11
+ "name": "cert-id",
12
+ "type": "string",
13
+ "description": "The ID of the CA certificate to update",
14
+ "required": false,
15
+ "deprecated": false,
16
+ "hidden": false
17
+ },
18
+ {
19
+ "name": "name",
20
+ "type": "string",
21
+ "description": "The new name for the CA certificate (must be a valid JavaScript identifier: starts with a letter, _, or $; contains only letters, digits, _, or $)",
22
+ "required": false,
23
+ "deprecated": false,
24
+ "hidden": false
25
+ },
26
+ {
27
+ "name": "account",
28
+ "type": "string",
29
+ "description": "The account name",
30
+ "required": false,
31
+ "deprecated": false,
32
+ "hidden": false
33
+ },
34
+ {
35
+ "name": "output",
36
+ "type": "string",
37
+ "description": "Output format",
38
+ "default": "default",
39
+ "required": false,
40
+ "deprecated": false,
41
+ "hidden": false,
42
+ "alias": [
43
+ "o"
44
+ ],
45
+ "choices": [
46
+ "default",
47
+ "json"
48
+ ]
49
+ }
50
+ ]}
51
+ examples={[
52
+ [
53
+ "$0 ca-certificate update --cert-id mtlsca_abc123 --name renamed_ca",
54
+ "Rename a CA certificate"
55
+ ],
56
+ [
57
+ "$0 ca-certificate update \\\n --cert-id mtlsca_abc123 \\\n --name renamed_ca \\\n --account my-account",
58
+ "Explicitly specify the account"
59
+ ]
60
+ ]}
61
+ usage="$0 ca-certificate update --cert-id <id> --name <name> [options]"
62
+ >
63
+
64
+ </CliCommand>
65
+
66
+ ## Global options
67
+
68
+ The following global options are available for all commands:
69
+
70
+ - [`--help`](./global-options.mdx#help)
71
+ - [`--api-key`](./global-options.mdx#api-key)
@@ -8,6 +8,8 @@
8
8
  | set-query-params-inbound | Add or Set Query Parameters | Adds or sets query parameters on the incoming request. | api-gateway |
9
9
  | set-headers-inbound | Add or Set Request Headers | Adds or sets headers on the incoming request. | api-gateway |
10
10
  | akamai-ai-firewall | Akamai AI Firewall | Akamai AI Firewall Inbound Policy | ai-gateway |
11
+ | akamai-firewall-for-ai-outbound | Akamai Firewall for AI | Inspects each upstream response with Akamai's Firewall for AI detect API and replaces the response with a `403 Forbidden` if Akamai returns a `deny` rule. Useful behind AI-powered APIs to filter unsafe completions, sensitive data exposure, and toxic content before they reach the client. The body, headers, URL, and query string sent to Akamai are configurable; by default only the response body is captured. Bodies are read from a clone so the client still receives the original. | api-gateway |
12
+ | akamai-firewall-for-ai-inbound | Akamai Firewall for AI | Inspects each incoming request with Akamai's Firewall for AI detect API and blocks the request if Akamai returns a `deny` rule. Useful in front of AI-powered APIs to filter prompt injection, jailbreaks, and other unsafe inputs before they reach the model. The body, headers, URL, and query string sent to Akamai are configurable; by default only the request body is captured. Bodies are read from a clone so the upstream handler still sees the original. | api-gateway |
11
13
  | amberflo-metering-inbound | Amberflo Metering / Billing | Amberflo is a usage metering and billing service. This policy allows you to send metering calls for each API to their meter ingest endpoint. | api-gateway |
12
14
  | api-key-inbound | API Key Authentication | Authenticates requests based on API Keys using Zuplo's built-in API key management. This policy validates API keys against Zuplo's key storage, caches results for performance, and automatically adds user information to authenticated requests. | api-gateway |
13
15
  | archive-request-aws-s3-inbound | Archive Request to AWS S3 | Archive the incoming request body to AWS S3 storage | api-gateway |
@@ -57,7 +59,7 @@
57
59
  | okta-jwt-auth-inbound | Okta JWT Auth | Authenticate users using Okta issued JWT tokens. | api-gateway |
58
60
  | openfga-authz-inbound | OpenFGA Authorization | Authorize requests using OpenFGA. | api-gateway |
59
61
  | openmeter-inbound | OpenMeter | OpenMeter is a usage metering service. This policy allows you to send metering calls for each API to their event ingest endpoint. It also supports entitlement checking to verify if a subject has access to a feature. | api-gateway |
60
- | prompt-injection-outbound | Prompt Injection Detection | Uses an LLM agent to detect prompt injection attempts in user provided content or potentially poisoned response bodies. This is primarily intended to be used with downstream LLM agents who are at risk of having prompt injection attacks executed against them. | api-gateway |
62
+ | prompt-injection-outbound | Prompt Injection Detection | Uses an LLM agent to detect prompt injection attempts in user provided content or potentially poisoned response bodies. This is primarily intended to be used with downstream LLM agents who are at risk of having prompt injection attacks executed against them. | ai-gateway, mcp-gateway |
61
63
  | propel-auth-jwt-inbound | PropelAuth JWT Auth | Authenticate users using PropelAuth issued JWT tokens. | api-gateway |
62
64
  | query-param-to-header-inbound | Query Parameter to Header | Extracts a query parameter and sets it as a header in the request. | api-gateway |
63
65
  | quota-inbound | Quota | The Quota policy enables you to set monthly, weekly, daily or hourly quotas on your API. | api-gateway |
@@ -72,7 +74,7 @@
72
74
  | request-validation-inbound | Request Validation | Validates incoming requests against your OpenAPI specification. Checks query parameters, path parameters, headers, and request body to ensure they match the defined schema before processing. | api-gateway |
73
75
  | require-origin-inbound | Require Origin | Sets an allow-list for an origin header | api-gateway |
74
76
  | secret-masking-outbound | Secret Masking | Masks common secrets like Zuplo API keys, GitHub tokens, or SSH private key in the response body. | api-gateway |
75
- | semantic-cache-inbound | Semantic Cache | Respond to matched incoming requests with semantically cached content The Semantic Cache Inbound policy caches responses based on semantic similarity of cache keys rather than exact matches. This allows for more flexible caching where similar requests can return cached responses even if the cache key is not exactly the same. The policy uses Large Language Model (LLM) embeddings to determine semantic similarity between cache keys based on a configurable similarity tolerance. Options: - semanticTolerance: The semantic similarity threshold for semantic cache matches (0-1, default: 0.2). Values closer to 0 require higher similarity. Can be overridden by custom functions. - expirationSecondsTtl: The timeout of the cache in seconds (default: 3600, 1 hour). Can be overridden by custom functions. - namespace: Optional namespace to isolate cache entries (default: "default"). Useful for multi-tenant scenarios or different cache contexts. - cacheBy: Determines how cache keys are generated: 'function' for custom logic or 'propertyPath' to extract from JSON body. | api-gateway |
77
+ | semantic-cache-inbound | Semantic Cache | Respond to matched incoming requests with semantically cached content The Semantic Cache Inbound policy caches responses based on semantic similarity of cache keys rather than exact matches. This allows for more flexible caching where similar requests can return cached responses even if the cache key is not exactly the same. The policy uses Large Language Model (LLM) embeddings to determine semantic similarity between cache keys based on a configurable similarity tolerance. Options: - semanticTolerance: The semantic similarity threshold for semantic cache matches (0-1, default: 0.2). Values closer to 0 require higher similarity. Can be overridden by custom functions. - expirationSecondsTtl: The timeout of the cache in seconds (default: 3600, 1 hour). Can be overridden by custom functions. - namespace: Optional namespace to isolate cache entries (default: "default"). Useful for multi-tenant scenarios or different cache contexts. - cacheBy: Determines how cache keys are generated: 'function' for custom logic or 'propertyPath' to extract from JSON body. | ai-gateway |
76
78
  | set-body-inbound | Set Body | Sets the body of the request in the inbound pipeline - make sure to convert a GET/HEAD request to another method when using this policy. | api-gateway |
77
79
  | set-headers-outbound | Set Headers | Adds or sets headers on the on the outgoing response. | api-gateway |
78
80
  | set-status-outbound | Set Status Code | Sets the status code on the on the outgoing response. | api-gateway |
@@ -89,4 +91,4 @@
89
91
  | upstream-gcp-service-auth-inbound | Upstream GCP Service Auth | Creates an ID Token from Google's OAuth service and attaches it to the outgoing request. Useful when calling GCP services or Google APIs that are secured with GCP IAM. | api-gateway |
90
92
  | upstream-zuplo-jwt-auth-inbound | Upstream Zuplo JWT | Generates a Zuplo JWT token and attaches it to the outgoing request. This policy creates a self-signed JWT using the Zuplo JWT plugin and adds it to the specified header for upstream authentication. | api-gateway |
91
93
  | web-bot-auth-inbound | Web Bot Auth | Authenticate bots using web-bot-auth HTTP Message Signatures. | api-gateway |
92
- | xml-to-json-outbound | XML to JSON Outbound | Parses XML and converts it to JSON. | api-gateway |
94
+ | xml-to-json-outbound | XML to JSON | Parses XML and converts it to JSON. | api-gateway |
@@ -0,0 +1,79 @@
1
+ ## Setup
2
+
3
+ 1. In the Akamai Control Center, create a Firewall for AI configuration and note
4
+ its **Configuration ID**.
5
+ 2. Generate an **API key** for the configuration.
6
+ 3. Add the credentials to your Zuplo project's environment variables (or paste
7
+ them directly into the policy options):
8
+
9
+ ```text
10
+ AKAMAI_FIREWALL_FOR_AI_CONFIGURATION_ID=your-configuration-id
11
+ AKAMAI_FIREWALL_FOR_AI_API_KEY=your-api-key
12
+ ```
13
+
14
+ 4. Add the policy to any route that should be inspected by Akamai.
15
+
16
+ ## What gets sent to Akamai
17
+
18
+ Akamai's detect endpoint accepts a single text string in `llmInput`. The
19
+ `capture` option controls which parts of the incoming request are concatenated
20
+ into that string:
21
+
22
+ | Field | Default | Notes |
23
+ | ------------- | ------- | ----------------------------------------------------------------------------------- |
24
+ | `body` | `true` | Cloned before reading; only text content types (JSON, XML, form, text/\*) are sent. |
25
+ | `headers` | `false` | `Authorization`, `Proxy-Authorization`, `Cookie`, and `Set-Cookie` are stripped. |
26
+ | `url` | `false` | Origin and path only. |
27
+ | `queryString` | `false` | Off by default — query strings often contain credentials or session tokens. |
28
+
29
+ ### Including credential headers
30
+
31
+ If you do want Akamai to see credential-bearing headers (for example, to detect
32
+ tokens that have been leaked into custom headers), opt in explicitly:
33
+
34
+ ```json
35
+ {
36
+ "name": "akamai-firewall-for-ai-inbound",
37
+ "policyType": "akamai-firewall-for-ai-inbound",
38
+ "handler": {
39
+ "export": "AkamaiFirewallForAiInboundPolicy",
40
+ "module": "$import(@zuplo/runtime)",
41
+ "options": {
42
+ "configurationId": "$env(AKAMAI_FIREWALL_FOR_AI_CONFIGURATION_ID)",
43
+ "api-key": "$env(AKAMAI_FIREWALL_FOR_AI_API_KEY)",
44
+ "capture": {
45
+ "body": true,
46
+ "headers": true,
47
+ "dangerouslyIncludeAuthorizationHeader": true
48
+ }
49
+ }
50
+ }
51
+ }
52
+ ```
53
+
54
+ ## Handling alert vs deny
55
+
56
+ Akamai rules can be configured with one of two actions:
57
+
58
+ - **`deny`** — the request is always blocked with a `403 Forbidden`.
59
+ - **`alert`** — Akamai detected a match but configured the rule for monitoring
60
+ only. The `onWarn` option controls how this policy reacts:
61
+ - `"log"` (default) writes a structured warning to the Zuplo logs and allows
62
+ the request through.
63
+ - `"block"` treats `alert` the same as `deny` — useful in staging when rolling
64
+ out new rules.
65
+ - `"none"` silently allows the request through with no log line.
66
+
67
+ ## Failure modes
68
+
69
+ By default the policy is **fail-closed**: if the call to Akamai itself fails
70
+ (network error, 5xx, malformed response), the policy throws and the request is
71
+ rejected. This is the safe default for a security control. To fail open when
72
+ Akamai is unreachable, set `throwOnError: false`.
73
+
74
+ ## Pair with the outbound policy
75
+
76
+ Add
77
+ [Akamai Firewall for AI - Outbound](/docs/policies/akamai-firewall-for-ai-outbound)
78
+ to the same route to also inspect the upstream response before it's sent back to
79
+ the client. The two policies share the same configuration shape.
@@ -0,0 +1,13 @@
1
+ [Akamai Firewall for AI](https://www.akamai.com/products/firewall-for-ai)
2
+ inspects requests bound for AI applications and detects threats such as prompt
3
+ injection, jailbreak attempts, sensitive data exposure, and toxic content.
4
+
5
+ This policy sends each incoming request to Akamai's detect endpoint before it
6
+ reaches your handler. If Akamai returns a rule with a `deny` action, the request
7
+ is blocked with a `403 Forbidden`. Rules with an `alert` action (Akamai
8
+ "Monitor" mode) are logged by default but allowed through, configurable via the
9
+ `onWarn` setting.
10
+
11
+ Pair with the
12
+ [Akamai Firewall for AI - Outbound](/docs/policies/akamai-firewall-for-ai-outbound)
13
+ policy to also inspect upstream responses before they're returned to the client.
@@ -0,0 +1,126 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft-07/schema",
3
+ "$id": "http://zuplo.com/schemas/policies/auth0-jwt-auth-inbound.json",
4
+ "type": "object",
5
+ "title": "Akamai Firewall for AI",
6
+ "isDeprecated": false,
7
+ "isPaidAddOn": false,
8
+ "isEnterprise": false,
9
+ "isInternal": false,
10
+ "isBeta": false,
11
+ "isHidden": false,
12
+ "products": ["api-gateway"],
13
+ "description": "Inspects each incoming request with Akamai's Firewall for AI detect API and blocks the request if Akamai returns a `deny` rule. Useful in front of AI-powered APIs to filter prompt injection, jailbreaks, and other unsafe inputs before they reach the model.\n\nThe body, headers, URL, and query string sent to Akamai are configurable; by default only the request body is captured. Bodies are read from a clone so the upstream handler still sees the original.",
14
+ "deprecatedMessage": "",
15
+ "required": ["handler"],
16
+ "properties": {
17
+ "handler": {
18
+ "type": "object",
19
+ "default": {},
20
+ "required": ["export", "module", "options"],
21
+ "properties": {
22
+ "export": {
23
+ "const": "AkamaiFirewallForAiInboundPolicy",
24
+ "description": "The name of the exported type"
25
+ },
26
+ "module": {
27
+ "const": "$import(@zuplo/runtime)",
28
+ "description": "The module containing the policy"
29
+ },
30
+ "options": {
31
+ "title": "AkamaiFirewallForAiInboundPolicyOptions",
32
+ "type": "object",
33
+ "description": "The options for the Akamai Firewall for AI inbound policy. Sends the incoming request to Akamai's Firewall for AI detect endpoint and blocks the request if any rule returns a 'deny' action.",
34
+ "additionalProperties": false,
35
+ "required": ["configurationId", "api-key"],
36
+ "properties": {
37
+ "configurationId": {
38
+ "type": "string",
39
+ "examples": ["$env(AKAMAI_FIREWALL_FOR_AI_CONFIGURATION_ID)"],
40
+ "description": "Your Akamai Firewall for AI Configuration ID. This is the ID of the configuration in the Akamai Control Center that defines which detection rules to apply."
41
+ },
42
+ "api-key": {
43
+ "type": "string",
44
+ "examples": ["$env(AKAMAI_FIREWALL_FOR_AI_API_KEY)"],
45
+ "description": "Your Akamai Firewall for AI API key, sent as the `Fai-Api-Key` header on each detect call."
46
+ },
47
+ "capture": {
48
+ "type": "object",
49
+ "title": "Capture Settings",
50
+ "description": "Controls which parts of the incoming request are sent to Akamai for inspection. Akamai's detect endpoint receives the captured fields concatenated into a single labeled text payload as `llmInput`.",
51
+ "additionalProperties": false,
52
+ "properties": {
53
+ "body": {
54
+ "type": "boolean",
55
+ "default": true,
56
+ "description": "Include the request body. Only text-based content types (JSON, XML, form-encoded, text/\\*) are sent; binary bodies are skipped. The body is read from a clone of the request so the upstream still receives it unchanged."
57
+ },
58
+ "headers": {
59
+ "type": "boolean",
60
+ "default": false,
61
+ "description": "Include the request headers. By default `Authorization`, `Proxy-Authorization`, `Cookie`, and `Set-Cookie` are stripped — see the `dangerouslyInclude*` flags to override."
62
+ },
63
+ "url": {
64
+ "type": "boolean",
65
+ "default": false,
66
+ "description": "Include the request URL (origin and path, query string excluded). Enable `queryString` separately if you also want the query string."
67
+ },
68
+ "queryString": {
69
+ "type": "boolean",
70
+ "default": false,
71
+ "description": "Include the request query string. Query strings sometimes contain credentials or session tokens — leave this off unless you want Akamai to see them."
72
+ },
73
+ "dangerouslyIncludeAuthorizationHeader": {
74
+ "type": "boolean",
75
+ "default": false,
76
+ "x-show-example": false,
77
+ "description": "If `headers` is true, also include the `Authorization` and `Proxy-Authorization` headers. Off by default because these typically contain bearer tokens."
78
+ },
79
+ "dangerouslyIncludeCookieHeader": {
80
+ "type": "boolean",
81
+ "default": false,
82
+ "x-show-example": false,
83
+ "description": "If `headers` is true, also include the `Cookie` header. Off by default because cookies often carry session credentials."
84
+ }
85
+ }
86
+ },
87
+ "onWarn": {
88
+ "type": "string",
89
+ "enum": ["log", "block", "none"],
90
+ "default": "log",
91
+ "description": "Behavior when Akamai returns a rule with `action: \"alert\"` (Akamai's Monitor mode). `log` writes a warning and lets the request through, `block` treats the alert like a deny, `none` is silent."
92
+ },
93
+ "throwOnError": {
94
+ "type": "boolean",
95
+ "default": true,
96
+ "description": "If true (the default), the policy throws when the Akamai detect call itself fails (network error, 5xx, malformed response). Set to false to fail open and allow the request through when Akamai is unreachable."
97
+ },
98
+ "detectUrl": {
99
+ "type": "string",
100
+ "x-show-example": false,
101
+ "description": "Override the Akamai Firewall for AI detect endpoint URL. The literal `{configurationId}` is replaced with the configured ID. Defaults to `https://aisec.akamai.com/fai/v1/fai-configurations/{configurationId}/detect`. Useful for regional Akamai endpoints or for pointing tests at a mock server."
102
+ }
103
+ }
104
+ }
105
+ },
106
+ "examples": [
107
+ {
108
+ "export": "AkamaiFirewallForAiInboundPolicy",
109
+ "module": "$import(@zuplo/runtime)",
110
+ "options": {
111
+ "api-key": "$env(AKAMAI_FIREWALL_FOR_AI_API_KEY)",
112
+ "capture": {
113
+ "body": true,
114
+ "headers": false,
115
+ "queryString": false,
116
+ "url": false
117
+ },
118
+ "configurationId": "$env(AKAMAI_FIREWALL_FOR_AI_CONFIGURATION_ID)",
119
+ "onWarn": "log",
120
+ "throwOnError": true
121
+ }
122
+ }
123
+ ]
124
+ }
125
+ }
126
+ }
@@ -0,0 +1,79 @@
1
+ ## Setup
2
+
3
+ 1. In the Akamai Control Center, create a Firewall for AI configuration and note
4
+ its **Configuration ID**.
5
+ 2. Generate an **API key** for the configuration.
6
+ 3. Add the credentials to your Zuplo project's environment variables (or paste
7
+ them directly into the policy options):
8
+
9
+ ```text
10
+ AKAMAI_FIREWALL_FOR_AI_CONFIGURATION_ID=your-configuration-id
11
+ AKAMAI_FIREWALL_FOR_AI_API_KEY=your-api-key
12
+ ```
13
+
14
+ 4. Add the policy to any route whose responses should be inspected by Akamai.
15
+
16
+ ## What gets sent to Akamai
17
+
18
+ Akamai's detect endpoint accepts a single text string in `llmOutput`. The
19
+ `capture` option controls which parts of the response are concatenated into that
20
+ string:
21
+
22
+ | Field | Default | Notes |
23
+ | ------------- | ------- | ----------------------------------------------------------------------------------- |
24
+ | `body` | `true` | Cloned before reading; only text content types (JSON, XML, form, text/\*) are sent. |
25
+ | `headers` | `false` | `Set-Cookie`, `Authorization`, and `Proxy-Authorization` are stripped. |
26
+ | `url` | `false` | Origin and path of the originating request — useful as context for the response. |
27
+ | `queryString` | `false` | Off by default — query strings often contain credentials or session tokens. |
28
+
29
+ ### Including credential headers
30
+
31
+ If you do want Akamai to see credential-bearing response headers, opt in
32
+ explicitly:
33
+
34
+ ```json
35
+ {
36
+ "name": "akamai-firewall-for-ai-outbound",
37
+ "policyType": "akamai-firewall-for-ai-outbound",
38
+ "handler": {
39
+ "export": "AkamaiFirewallForAiOutboundPolicy",
40
+ "module": "$import(@zuplo/runtime)",
41
+ "options": {
42
+ "configurationId": "$env(AKAMAI_FIREWALL_FOR_AI_CONFIGURATION_ID)",
43
+ "api-key": "$env(AKAMAI_FIREWALL_FOR_AI_API_KEY)",
44
+ "capture": {
45
+ "body": true,
46
+ "headers": true,
47
+ "dangerouslyIncludeCookieHeader": true
48
+ }
49
+ }
50
+ }
51
+ }
52
+ ```
53
+
54
+ ## Handling alert vs deny
55
+
56
+ Akamai rules can be configured with one of two actions:
57
+
58
+ - **`deny`** — the response is always replaced with a `403 Forbidden`.
59
+ - **`alert`** — Akamai detected a match but configured the rule for monitoring
60
+ only. The `onWarn` option controls how this policy reacts:
61
+ - `"log"` (default) writes a structured warning to the Zuplo logs and lets the
62
+ response through.
63
+ - `"block"` treats `alert` the same as `deny` — useful in staging when rolling
64
+ out new rules.
65
+ - `"none"` silently lets the response through with no log line.
66
+
67
+ ## Failure modes
68
+
69
+ By default the policy is **fail-closed**: if the call to Akamai itself fails
70
+ (network error, 5xx, malformed response), the policy throws and the original
71
+ response is replaced with an error. This is the safe default for a security
72
+ control. To fail open when Akamai is unreachable, set `throwOnError: false`.
73
+
74
+ ## Pair with the inbound policy
75
+
76
+ Add
77
+ [Akamai Firewall for AI - Inbound](/docs/policies/akamai-firewall-for-ai-inbound)
78
+ to the same route to also inspect requests before they reach your handler. The
79
+ two policies share the same configuration shape.
@@ -0,0 +1,13 @@
1
+ [Akamai Firewall for AI](https://www.akamai.com/products/firewall-for-ai)
2
+ inspects responses produced by AI applications and detects threats such as
3
+ sensitive data exposure, toxic content, and other policy violations.
4
+
5
+ This policy sends each upstream response to Akamai's detect endpoint before it's
6
+ returned to the client. If Akamai returns a rule with a `deny` action, the
7
+ response is replaced with a `403 Forbidden`. Rules with an `alert` action
8
+ (Akamai "Monitor" mode) are logged by default but allowed through, configurable
9
+ via the `onWarn` setting.
10
+
11
+ Pair with the
12
+ [Akamai Firewall for AI - Inbound](/docs/policies/akamai-firewall-for-ai-inbound)
13
+ policy to also inspect incoming requests before they reach your handler.
@@ -0,0 +1,126 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft-07/schema",
3
+ "$id": "http://zuplo.com/schemas/policies/auth0-jwt-auth-inbound.json",
4
+ "type": "object",
5
+ "title": "Akamai Firewall for AI",
6
+ "isDeprecated": false,
7
+ "isPaidAddOn": false,
8
+ "isEnterprise": false,
9
+ "isInternal": false,
10
+ "isBeta": false,
11
+ "isHidden": false,
12
+ "products": ["api-gateway"],
13
+ "description": "Inspects each upstream response with Akamai's Firewall for AI detect API and replaces the response with a `403 Forbidden` if Akamai returns a `deny` rule. Useful behind AI-powered APIs to filter unsafe completions, sensitive data exposure, and toxic content before they reach the client.\n\nThe body, headers, URL, and query string sent to Akamai are configurable; by default only the response body is captured. Bodies are read from a clone so the client still receives the original.",
14
+ "deprecatedMessage": "",
15
+ "required": ["handler"],
16
+ "properties": {
17
+ "handler": {
18
+ "type": "object",
19
+ "default": {},
20
+ "required": ["export", "module", "options"],
21
+ "properties": {
22
+ "export": {
23
+ "const": "AkamaiFirewallForAiOutboundPolicy",
24
+ "description": "The name of the exported type"
25
+ },
26
+ "module": {
27
+ "const": "$import(@zuplo/runtime)",
28
+ "description": "The module containing the policy"
29
+ },
30
+ "options": {
31
+ "title": "AkamaiFirewallForAiOutboundPolicyOptions",
32
+ "type": "object",
33
+ "description": "The options for the Akamai Firewall for AI outbound policy. Sends the upstream response to Akamai's Firewall for AI detect endpoint and blocks the response if any rule returns a 'deny' action.",
34
+ "additionalProperties": false,
35
+ "required": ["configurationId", "api-key"],
36
+ "properties": {
37
+ "configurationId": {
38
+ "type": "string",
39
+ "examples": ["$env(AKAMAI_FIREWALL_FOR_AI_CONFIGURATION_ID)"],
40
+ "description": "Your Akamai Firewall for AI Configuration ID. This is the ID of the configuration in the Akamai Control Center that defines which detection rules to apply."
41
+ },
42
+ "api-key": {
43
+ "type": "string",
44
+ "examples": ["$env(AKAMAI_FIREWALL_FOR_AI_API_KEY)"],
45
+ "description": "Your Akamai Firewall for AI API key, sent as the `Fai-Api-Key` header on each detect call."
46
+ },
47
+ "capture": {
48
+ "type": "object",
49
+ "title": "Capture Settings",
50
+ "description": "Controls which parts of the upstream response (and the originating request URL) are sent to Akamai for inspection. Akamai's detect endpoint receives the captured fields concatenated into a single labeled text payload as `llmOutput`.",
51
+ "additionalProperties": false,
52
+ "properties": {
53
+ "body": {
54
+ "type": "boolean",
55
+ "default": true,
56
+ "description": "Include the response body. Only text-based content types (JSON, XML, form-encoded, text/\\*) are sent; binary bodies are skipped. The body is read from a clone of the response so the client still receives it unchanged."
57
+ },
58
+ "headers": {
59
+ "type": "boolean",
60
+ "default": false,
61
+ "description": "Include the response headers. By default `Set-Cookie` is stripped — see `dangerouslyIncludeCookieHeader` to override."
62
+ },
63
+ "url": {
64
+ "type": "boolean",
65
+ "default": false,
66
+ "description": "Include the originating request URL (origin and path, query string excluded). Useful as context for the response."
67
+ },
68
+ "queryString": {
69
+ "type": "boolean",
70
+ "default": false,
71
+ "description": "Include the originating request's query string. Query strings sometimes contain credentials or session tokens — leave this off unless you want Akamai to see them."
72
+ },
73
+ "dangerouslyIncludeAuthorizationHeader": {
74
+ "type": "boolean",
75
+ "default": false,
76
+ "x-show-example": false,
77
+ "description": "If `headers` is true, also include any `Authorization` or `Proxy-Authorization` headers on the response. Rarely set on responses but stripped by default for safety."
78
+ },
79
+ "dangerouslyIncludeCookieHeader": {
80
+ "type": "boolean",
81
+ "default": false,
82
+ "x-show-example": false,
83
+ "description": "If `headers` is true, also include the `Set-Cookie` header on the response. Off by default because Set-Cookie typically carries session credentials."
84
+ }
85
+ }
86
+ },
87
+ "onWarn": {
88
+ "type": "string",
89
+ "enum": ["log", "block", "none"],
90
+ "default": "log",
91
+ "description": "Behavior when Akamai returns a rule with `action: \"alert\"` (Akamai's Monitor mode). `log` writes a warning and lets the response through, `block` treats the alert like a deny, `none` is silent."
92
+ },
93
+ "throwOnError": {
94
+ "type": "boolean",
95
+ "default": true,
96
+ "description": "If true (the default), the policy throws when the Akamai detect call itself fails (network error, 5xx, malformed response). Set to false to fail open and allow the response through when Akamai is unreachable."
97
+ },
98
+ "detectUrl": {
99
+ "type": "string",
100
+ "x-show-example": false,
101
+ "description": "Override the Akamai Firewall for AI detect endpoint URL. The literal `{configurationId}` is replaced with the configured ID. Defaults to `https://aisec.akamai.com/fai/v1/fai-configurations/{configurationId}/detect`. Useful for regional Akamai endpoints or for pointing tests at a mock server."
102
+ }
103
+ }
104
+ }
105
+ },
106
+ "examples": [
107
+ {
108
+ "export": "AkamaiFirewallForAiOutboundPolicy",
109
+ "module": "$import(@zuplo/runtime)",
110
+ "options": {
111
+ "api-key": "$env(AKAMAI_FIREWALL_FOR_AI_API_KEY)",
112
+ "capture": {
113
+ "body": true,
114
+ "headers": false,
115
+ "queryString": false,
116
+ "url": false
117
+ },
118
+ "configurationId": "$env(AKAMAI_FIREWALL_FOR_AI_CONFIGURATION_ID)",
119
+ "onWarn": "log",
120
+ "throwOnError": true
121
+ }
122
+ }
123
+ ]
124
+ }
125
+ }
126
+ }
@@ -55,7 +55,7 @@
55
55
  "type": "object",
56
56
  "examples": [
57
57
  {
58
- "requests": 1
58
+ "api_requests": 1
59
59
  }
60
60
  ],
61
61
  "patternProperties": {
@@ -92,7 +92,7 @@
92
92
  "options": {
93
93
  "cacheTtlSeconds": 60,
94
94
  "meters": {
95
- "requests": 1
95
+ "api_requests": 1
96
96
  }
97
97
  }
98
98
  }