Configure rate limits for AI traffic on AgentCore gateway Amazon Web Services (AWS) announced support for rate limiting on its Amazon Bedrock AgentCore gateway, a fully managed, serverless AI gateway, giving users fine-grained control over AI traffic. The new feature allows per-user rules for requests per minute, concurrent connections, and token throughput across MCP, inference, and HTTP targets, with token rate limits applying to inference targets only. This helps ensure downstream services remain available under heavy traffic spikes. Artificial Intelligence /blogs/machine-learning/ Configure rate limits for AI traffic on AgentCore gateway Amazon Bedrock AgentCore gateway https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway.html is a fully managed, serverless AI gateway that provides a single, secure entry point for AI traffic https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway-supported-targets.html . AgentCore gateway routes traffic to tools such as managed web search https://github.com/awslabs/agentcore-samples/tree/main/01-features/07-centralize-and-govern-your-ai-infrastructure/01-gateway/01-attach-targets/mcp/connectors/websearch , managed knowledge bases /blogs/aws/introducing-amazon-bedrock-managed-knowledge-base-for-faster-more-accurate-enterprise-ai-applications/ , MCP servers https://github.com/awslabs/agentcore-samples/tree/main/01-features/07-centralize-and-govern-your-ai-infrastructure/01-gateway/01-attach-targets/mcp , inference models https://github.com/awslabs/agentcore-samples/tree/main/01-features/07-centralize-and-govern-your-ai-infrastructure/01-gateway/01-attach-targets/llm-inference LLMs , agents https://github.com/awslabs/agentcore-samples/tree/main/01-features/07-centralize-and-govern-your-ai-infrastructure/01-gateway/01-attach-targets/http/agents A2A https://github.com/a2aproject/A2A , agents as tools, etc. , or HTTP https://github.com/awslabs/agentcore-samples/tree/main/01-features/07-centralize-and-govern-your-ai-infrastructure/01-gateway/01-attach-targets/http endpoint. Today, we are announcing support for rate limiting on AgentCore gateway, giving you fine-grained control over how much traffic individual users can consume through your gateway. Rate limiting https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway-rate-limits.html in AgentCore gateway gives you per-user control over how users consume your tools, inference models, and agents. Define OAuth or IAM-based rules for requests per minute, concurrent connections, and token throughput, making sure downstream services remain available under heavy traffic spikes. Centralized rate limiting for AI traffic with AgentCore gateway AgentCore gateway provides three target types: MCP https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway-targets-mcp.html targets, inference https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway-targets-inference.html targets, and HTTP https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway-targets-http.html passthrough targets. The following rate limiting metrics are supported on the targets. - Request rate limits, measured in requests per second RPS and requests per minute RPM , apply to all target types. Each limit defines a maximum count of requests permitted within the given time window, and the gateway measures every incoming request against it. A request counts as exactly one unit toward the configured limit, regardless of how long it takes to complete, a request that finishes in 50 milliseconds and one that streams for 90 seconds each consume exactly one unit from the per-second or per-minute limit. Token rate limits , measured in tokens per minute TPM , apply to inference targets only. Token rate limiting accounts for both input tokens and output tokens. The full round-trip token cost of a request counts against the limit. AgentCore gateway uses a general-purpose tokenizer to estimate the incoming tokens for a request and deducts it from the rate-limit bucket upfront before the gateway dispatches the inference call. Once the inference call returns a response, which includes actual input and output token usage reported by the model provider, the gateway reconciles the limit by accounting for the true token consumption. Connection rate limits , measured in connections per second CPS , apply to all target types. Unlike request rate limits, connection rate limiting tracks how long each request holds an open connection. For example, if a streaming inference call takes 100 seconds to complete, that request consumes one connection slot for the entire duration. CPS provides an additional mechanism for protecting targets against long-lived concurrent sessions particularly useful when you need to cap how many simultaneous connections a target sustains, rather than how many requests arrive in each window. For this use case, assume three user groups: Basic, Advanced, and Beta. AgentCore Identity https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/identity.html handles inbound authentication using JSON Web Tokens https://www.jwt.io/introduction what-is-json-web-token JWT with Microsoft Entra ID https://www.microsoft.com/en-us/security/business/identity-access/microsoft-entra-id as the identity provider and also serves as the token vending service for outbound targets. Policy in Amazon Bedrock AgentCore https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/policy.html enforces role-based access control RBAC , scoping each group’s access to specific targets and models. The following diagram illustrates this configuration. Basic users operate under more restrictive rate limits than Advanced users, while Beta users receive elevated limits on restricted models, enabling the organization to benchmark performance and suitability before rolling these models out to the broader organization. Before setting up rate limits for each user-group, review the rate limit structure. Rate limit structure A rate limit configuration consists of two parts: dimension keys and entries. Dimension keys define how the gateway groups incoming traffic into rate buckets. Entries define the allowed throughput for each bucket. In this post, we use the AWS Command Line Interface AWS CLI /cli/ to create the rate limit configuration. The following example demonstrates the relationship between dimension keys and entries. This rate limit uses targetName as the dimension key and defines two entries: a specific entry for the Booking target MCP server , a high-traffic target, at 100 requests per second, and a wildcard entry that applies 10 requests per second individually to each remaining target, meaning every other target receives its own 10 RPS bucket. Dimension keys define how the gateway groups traffic into rate buckets. When a request arrives, the gateway resolves each dimension key to its value from the request context and uses the resulting combination to assign the request to the correct rate bucket. AgentCore gateway supports the following dimension keys: targetName , toolName , qualifiedModelId , $.context.jwt.