ZuploZuplo
LoginStart for Free
  • Documentation
  • API Reference
Introduction
Getting Started
    Develop in the portal
      1 - Setup Your Gateway2 - Rate Limiting3 - API Key Auth4 - Deploy5 - Dynamic Rate LimitingDynamic MCP Server - Quickstart
    Develop locally with the CLI
      1 - Setup Your Gateway2 - Rate Limiting3 - API Key Auth4 - Deploy5 - Dynamic Rate LimitingDynamic MCP Server - Quickstart
Concepts
Development
Policies
Handlers
API Keys
Rate Limiting
Caching
MCP Server
MCP Gateway
AI Gateway
    IntroductionGetting StartedSource ControlUniversal API
    Providers
    Teams
    Apps
    Policies
      OverviewAPI key authenticationModel FilteringFallback ModelBudgets and CostsSemantic cacheAkamai AI FirewallComet Opik tracingGalileo tracing
    Cookbooks
    Integrations
Developer Portal
Monetization
GraphQL
Deploying & Source Control
Analytics
Observability
Networking & Infrastructure
Account Management
Programming API
Build with AI
Zuplo CLI
Migration Guides
Platform LimitsVersion Support PolicySecuritySupportTrust & ComplianceChangelog
powered by Zudoku
Policies

Akamai AI Firewall

akamai-ai-firewall-v2-inbound

The Akamai AI Firewall policy sends an app's prompts and completions to Akamai Firewall for AI and blocks a request or response that your Akamai configuration denies. It's the gateway's guardrail policy: it can answer a request itself instead of letting it reach the provider.

One entry covers both directions. The policy scans the prompt before the provider call and the completion afterward, including streaming responses—there's no separate outbound policy to add.

Detection rules and their categories live in Akamai Control Center, not in Zuplo. The policy forwards text and enforces the decision that comes back, acting only on rules that deny. Rules set to alert are ignored.

Adding the policy to an app

  1. In your gateway's repository, set the policy's credentials and push:

    Code
    { "name": "akamai-ai-firewall-v2-inbound", "policyType": "akamai-ai-firewall-v2-inbound", "handler": { "export": "AkamaiAIFirewallV2InboundPolicy", "module": "$import(@zuplo/runtime)", "options": { "configurationId": "your-configuration-id", "api-key": "your-akamai-api-key" } } }
  2. Open the app's Policies tab, click Add Policy, and add Akamai AI Firewall. Leave the entry's options alone so it inherits the declaration's configuration.

To protect every new app in a team, add the policy to the team's policy template.

Options

OptionDefaultWhat it does
configurationId—Required. Your Akamai configuration
api-key—Required. Note the hyphen—apiKey is rejected
applicationId—Optional Akamai application identifier
endpointsAll shapesWhich API shapes to inspect
onUnknownShapedenyWhat to do with a request shape the policy can't read
streamingAccumulation.enabledtrueScan streaming completions. false stops scanning responses for streaming requests
streamingAccumulation.eventsInterval5How many streamed events to buffer between checks
streamingAccumulation.checkIntervalMsnoneAlso check on a timer. Off unless set

Unknown option keys are rejected.

What a blocked caller sees

A block returns 400 in the provider's own error format—not problem details—with the Akamai rule ID in code:

Code
{ "error": { "message": "Request blocked by AI Firewall during completion request. <rule message> (Rule: <ruleId>)", "code": "<ruleId>" } }

For a streaming response, the gateway withholds output until each check passes, so blocked content never reaches the client. The stream then ends with a content-filter stop rather than an HTTP error, so clients see a content-filter finish reason. Holding events until a check returns adds to time to first token.

Blocked requests are counted against the app and appear in its Dashboard—see Monitoring usage.

Failure modes

SituationResult
Options are invalid or incompleteFails closed—request rejected
The request body can't be readFails closed—request rejected
An endpoint shape the policy can't inspect, such as embeddings400, code guardrail_uninspectable
Akamai is unreachable, or returns an errorFails open—traffic proceeds unguarded

Because the policy fails open, an expired Akamai key silently disables the firewall while the gateway keeps returning 200s. Monitor blocked counts so a sudden drop to zero doesn't go unnoticed.

An endpoint the policy can't inspect is denied by default. That's different from an endpoint you exclude with endpoints, which passes through silently. A provider error response is never scanned.

If a request is rejected with a configuration error, the usual cause is a chain entry that overrode options and dropped the credential—entry options replace the declared ones wholesale rather than merging. Omit them to inherit. See Options and secrets.

Additional resources

  • Akamai Firewall for AI
  • Akamai AI security solutions
Edit this page
Last modified on August 5, 2026
Semantic cacheComet Opik tracing
On this page
  • Adding the policy to an app
  • Options
  • What a blocked caller sees
  • Failure modes
  • Additional resources
JSON
JSON