Skip to main content
Technical Deep DiveInfrastructure

API Gateways and Agent Readiness: How Kong, Apigee, and AWS API Gateway Affect Your Score

Your API gateway is the front door for AI agents. Configured correctly, it adds rate-limit transparency, smart caching, and traffic segmentation. Configured badly, it blocks agent User-Agents, mangles headers, and silently rejects the fastest-growing channel of API traffic. We scanned 500 businesses and found that 67% of gateway-protected APIs block AI agents by default.

AH
AgentHermes Research
April 15, 202613 min read

The Gateway Paradox: Security That Blocks Revenue

API gateways exist to protect your backend. They authenticate requests, enforce rate limits, cache responses, and block malicious traffic. Every major API at scale runs behind one. Stripe uses a custom gateway. GitHub routes through a sophisticated internal proxy. Shopify, Twilio, and Slack all interpose gateway layers between the internet and their services.

The problem is that these gateways were designed for a world where API consumers were other software systems with predictable traffic patterns and known client libraries. AI agents are different. They send unfamiliar User-Agent strings. They make bursty, exploratory requests as they discover capabilities. They negotiate content types dynamically. And most critically, they need metadata in response headers that most gateways strip or never expose.

The result: businesses invest in API gateways to improve their API infrastructure, and those same gateways reduce their Agent Readiness Score by blocking the agents that want to use it. We call this the gateway paradox, and it affects two thirds of the businesses we scan that use managed gateway products.

67%
of gateways block agent User-Agents
82%
hide rate-limit headers from responses
15-60ms
latency overhead per request
+25pts
possible from gateway config alone

Gateway-by-Gateway Breakdown

We tested each major managed gateway with a standard agent request pattern: discovery, authentication, data retrieval, and tool invocation. Here is how they scored out of the box versus after agent-optimized configuration.

Kong Gateway

Score range: 52-61

Agent-Friendly

  • Plugin ecosystem includes AI-specific rate-limiting
  • Custom response transformations let you expose rate-limit headers
  • Open-source version available for self-hosted control
  • AI Gateway plugin routes to multiple LLM providers

Agent-Hostile (Default)

  • Default bot-detection plugin blocks non-browser User-Agents
  • Response transformation adds 8-15ms latency per hop
  • Plugin ordering can mangle Content-Type negotiation

Apigee (Google)

Score range: 48-58

Agent-Friendly

  • Sophisticated quota policies with developer-app granularity
  • Built-in analytics separate traffic by API key and consumer
  • Monetization features support per-call billing models
  • JSONThreatProtection policy validates payloads automatically

Agent-Hostile (Default)

  • Spike arrest policies can reject burst agent traffic patterns
  • Shared flow complexity makes it hard to debug agent-specific issues
  • No native MCP or agent-card.json passthrough configuration

AWS API Gateway

Score range: 45-55

Agent-Friendly

  • Lambda authorizers enable custom agent authentication logic
  • Usage plans map directly to agent tier management
  • WebSocket APIs support long-running agent conversations
  • CloudWatch integration gives per-agent traffic dashboards

Agent-Hostile (Default)

  • WAF default rules block many automated User-Agents
  • 10MB payload limit restricts large structured data responses
  • 29-second timeout kills slow agent tool calls
  • No built-in rate-limit header exposure on responses

The score ranges reflect default versus optimized configurations. Every gateway can reach the upper end of its range with the right settings. The key insight: the gateway itself is not the differentiator. Configuration is the differentiator. Stripe scores 68 with a custom gateway. A business using Kong with default settings might score 35.

The Agent-Ready Gateway Checklist

Six configuration changes that turn any managed gateway from agent-hostile to agent-friendly. Each includes the scoring impact we measured across our scan dataset.

User-Agent Allowlisting

+8 to +12 points on D2 API Quality

AI agents identify with User-Agent strings like "Claude-Agent/1.0" or "GPT-Agent/4.0". Default bot-blocking rules reject these.

Action: Allowlist AI agent User-Agents in your WAF and bot-detection rules. Create a separate rule group for known AI agent patterns.

Rate-Limit Header Exposure

+6 to +9 points on D8 Reliability

Agents need X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset headers to self-throttle and avoid 429 errors.

Action: Configure your gateway to pass through or inject rate-limit headers on every response, not just 429 responses.

Content-Type Negotiation

+4 to +7 points on D6 Data Quality

Agents send Accept: application/json. Gateways that force text/html or strip the Accept header break agent parsing.

Action: Ensure your gateway preserves the Accept header and returns the correct Content-Type. Support application/json as the default for API routes.

Agent Traffic Segmentation

+3 to +5 points on D9 Agent Experience

Without separate analytics, you cannot measure agent-driven revenue, debug agent-specific errors, or optimize agent paths.

Action: Tag agent traffic with a custom header or API key prefix. Create a separate dashboard for agent requests, latency, and error rates.

CORS for Agent Clients

+5 to +8 points on D2 API Quality

Browser-based agent interfaces (Claude web, ChatGPT) make cross-origin requests. Strict CORS blocks them silently.

Action: Add Access-Control-Allow-Origin for known agent platform origins. Include Access-Control-Expose-Headers for rate-limit and pagination headers.

Latency Budget Management

+4 to +8 points on D8 Reliability

Every gateway hop adds 5-20ms. Agents have latency budgets. If your gateway adds 3 hops (WAF + auth + transform), you burn 15-60ms before your API even responds.

Action: Measure gateway overhead separately from backend latency. Target under 50ms total gateway overhead. Cache frequently-requested agent data at the gateway layer.

How Stripe, GitHub, and Shopify Configure Their Gateways

The highest-scoring platforms in our leaderboard all use API gateways, but they configure them with agent access in mind. Stripe returns X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset on every single response. GitHub exposes the same headers plus X-RateLimit-Resource to distinguish between different endpoint pools. Shopify includes Retry-After on 429 responses with precise reset timing.

None of these platforms block automated User-Agents. They authenticate via API keys and OAuth tokens, not by inspecting the client. This is the critical architectural decision: authenticate the request, not the requester. An agent with a valid API key should be treated identically to a cURL command or a Python script with the same key.

All three also expose their CORS headers correctly, enabling browser-based agent clients to access APIs without preflight failures. And all three document their rate limits publicly, so agents can self-throttle before hitting enforcement.

The pattern is clear: top-scoring platforms treat their gateway as an enablement layer, not just a protection layer. They configure it to help agents succeed, not just to stop bad actors. The gateway becomes a feature of the API rather than an obstacle in front of it.

How Gateway Configuration Maps to Your Score

Gateway configuration touches four of the nine scoring dimensions in the AgentHermes framework. D2 API Quality (weighted 0.15) is the most affected, since the gateway directly controls endpoint accessibility, response formats, and header integrity. D8 Reliability (0.13) captures latency, uptime, and rate-limit transparency. D7 Security (0.12) evaluates authentication mechanisms and TLS termination. D6 Data Quality (0.10) measures structured response formatting.

Combined, these four dimensions represent 50% of the total score weight. A gateway misconfiguration can therefore tank half your score. Conversely, an agent-optimized gateway configuration is one of the highest-leverage changes a technical team can make. We have seen businesses jump from Bronze (40-59) to Silver (60-74) with gateway changes alone.

Dimension
Weight
Gateway Impact
Max Points
D2 API Quality
0.15
Endpoint access, headers, Content-Type
+12
D8 Reliability
0.13
Latency, rate-limit headers, uptime
+9
D7 Security
0.12
TLS, auth, WAF config
+8
D6 Data Quality
0.10
Response format, Content-Type negotiation
+7

Frequently Asked Questions

Do I need an API gateway to be agent-ready?

No. An API gateway is not required for agent readiness. Many high-scoring businesses serve agents directly from their application servers. However, if you already have a gateway, misconfiguring it is one of the fastest ways to drop your score. A well-configured gateway adds rate-limit transparency, caching, and analytics that can boost your score by 15-25 points.

Which API gateway is best for agent readiness?

Kong edges ahead slightly due to its AI Gateway plugin and flexible response transformation. But the gateway matters less than the configuration. Any gateway configured with agent User-Agent allowlisting, rate-limit header exposure, and proper Content-Type negotiation will score well. Stripe, which scores 68, uses a custom in-house gateway.

My gateway blocks automated traffic by default. Will AI agents be blocked?

Almost certainly yes. Most WAF and bot-detection rules classify non-browser User-Agents as bots and block them. AI agents do not run in browsers and will be rejected. You need to create explicit allowlist rules for agent User-Agent patterns. This is the single most common gateway misconfiguration we see in our scans.

How does gateway latency affect my Agent Readiness Score?

The D8 Reliability dimension measures response time. Each gateway hop adds 5-20ms of latency. Three hops (WAF, authentication, response transformation) can add 15-60ms. AgentHermes penalizes APIs with p95 latency over 500ms and rewards those under 200ms. If your gateway adds 60ms to an already-slow backend, you will feel it in your score.

Can my gateway expose an MCP endpoint?

Yes. Your gateway can route /mcp or /.well-known/agent-card.json to a dedicated MCP service behind it. Kong and AWS API Gateway both support WebSocket passthrough for MCP SSE transport. The key is ensuring your gateway does not strip or modify the SSE headers that MCP relies on for streaming tool responses.


Is your gateway blocking AI agents?

Run a free Agent Readiness Scan and see exactly how your API gateway affects your score. Takes 60 seconds.


Share this article: