AWS · SECURITY · AI
AWS WAF AI Security: protecting MCP, A2A and LLM endpoints
On this page
- API Portal builds an inventory of your APIs and AI endpoints from traffic logs and configuration, with nothing to install, and treats each new endpoint as a shadow API until you manage it.
- The AI Security rule group checks MCP and A2A messages against their protocol in WAF itself, then calls Bedrock Guardrails for prompt attacks, harmful content and sensitive information.
- It protects CloudFront distributions, Application Load Balancers and API Gateway REST APIs only, in seven Regions plus CloudFront.
- It costs $5.00 per million inspected requests on top of the $0.60 WAF request fee, and Bedrock charges separately for the content checks.
AWS WAF AI Security is a new managed rule group that recognises LLM, MCP and A2A traffic, blocks malformed agent messages and sends prompts and replies to Amazon Bedrock Guardrails for checking. It launched on 23 November 2026 together with API Portal, a new Amazon API Gateway feature that finds the AI endpoints you already run. It was the first launch in {{link:post:aws-agent-plumbing-before-reinvent-2026}}, our overview of the week before re:Invent 2026. Here it is in depth: what it does, how to draw it, and when it is worth paying for.
The problem: AI endpoints nobody reviewed
An MCP server or an LLM endpoint takes minutes to stand up. As AWS's security blog puts it, one can sit behind a load balancer or a CloudFront distribution without ever passing through your API gateway, so it is missing from the registry and from the security review.
That leaves two gaps: you do not know which AI endpoints you have, and the firewall in front of them sees only JSON over HTTPS, not the protocol the agents speak.
Discovery: API Portal finds what is running
API Portal lives in the API Gateway console, but it covers APIs behind CloudFront, Application Load Balancers and API Gateway alike. You turn on discovery for one account or for a whole organisation in AWS Organizations. It reads the service logs and configuration records of those entry points, so there are no agents to deploy, no logs to forward and no traffic to reroute.
Each endpoint it finds is listed by host, path and HTTP method, labelled public or private, and starts life as a shadow API: reachable but not governed. It also reports each AI endpoint's type, whether an LLM inference endpoint, an MCP server or an A2A server. Once you manage an endpoint, API Portal checks its authentication, throttling and WAF protection, and shows the security events WAF found on it. API Portal is available in 32 Regions.
Protection: two layers in one rule group
The rule group is AWSManagedRulesAISecurityRuleSet, version 1.0, and it uses 400 WCU. It first labels each request as LLM, MCP, A2A or not recognised. It recognises MCP at protocol versions 2025-06-18, 2025-11-25 and 2026-07-28, and A2A at version 1.0 only. Anything else gets no checks.
Layer one, protocol compliance, runs entirely in WAF. Baseline checks catch clearly malformed messages and block by default. AWS's example is a header that claims tools/list while the body calls a file-reading tool. Strict checks flag valid but unusual messages, often an old client, and count by default.
Layer two, content assessment, is optional. You turn it on and give WAF an IAM role, and WAF calls Bedrock Guardrails with your account's identity. You do not create a guardrail yourself, and the categories are fixed. Prompt attacks (jailbreak, prompt injection, prompt leakage) are checked on requests and on MCP and A2A replies. Harmful content is checked on LLM and A2A requests. Sensitive information, such as passwords, AWS keys and card numbers, is checked on responses when response inspection is on. By default only a high-severity prompt attack blocks; everything else counts and adds a label you can act on in your own rules.
Two details matter for design. If the Bedrock call fails, the request passes with a guardrails:call_failed label; override that rule to block if you want to fail closed, knowing throttling will then block too. And Bedrock's own Converse and InvokeModel APIs are not assessed: AWS says to attach a guardrail to those calls directly.
How to draw it
- The WAF box gets a dependency. Draw a line from WAF to Bedrock Guardrails, labelled with the IAM role. It is a real runtime call with its own quotas and its own bill.
- The entry point becomes a deliberate choice. AWS's advice is to put CloudFront in front of your APIs, MCP servers, A2A servers and LLM endpoints, including ones outside AWS, and attach the protection pack (web ACL) there. With VPC origins, the load balancer or private REST API is reached only through CloudFront.
- Discovery sits beside the path, not on it. Draw API Portal off to one side, reading logs and configuration from the entry points. No request passes through it.
Add CloudWatch too: every label is a metric in the AWS/WAFV2 namespace.
When to use it, and when not
Use it when you expose MCP servers, A2A agents or OpenAI, Anthropic, Gemini or Ollama style endpoints to callers you do not fully control, and you want one place to see and stop protocol tricks and prompt attacks. API Portal is worth turning on regardless: discovery does not need WAF.
Think twice in these cases:
- Unsupported resources. WAF refuses to attach a protection pack with this rule group to AppSync, Cognito, App Runner, Bedrock AgentCore Gateway, Verified Access, ELB for Envoy or Amplify.
- Region and data location. The rule group runs in US East (N. Virginia), US East (Ohio), US West (Oregon), Europe (London), Europe (Stockholm), Asia Pacific (Tokyo) and Asia Pacific (Sydney), and for CloudFront. Behind CloudFront, each edge location sends text to the nearest of those Regions, and you cannot choose which. If data must stay in one country, use an ALB or REST API in that Region.
- Large bodies. Only the inspected part of a body is checked: 8 KB by default for an ALB, 16 KB for CloudFront or API Gateway, up to 64 KB for requests. Long prompts and big tool results beyond that are not assessed.
- Firewall Manager. The rule group is not yet supported by AWS Firewall Manager, so you cannot roll it out through Firewall Manager policies.
What it costs
On AWS's pricing page, a request inspected by the API Security or AI Security rule group costs $5.00 per million requests on top of the $0.60 per million WAF request fee. You pay it once per request even if both groups inspect it, there is no subscription fee, and it is the same in every Region. A request that an earlier rule allows or blocks, or that a scope-down statement leaves out, is not charged. So place the rule group after your other rules and scope it to your AI paths, such as /v1/chat/*. Amazon Bedrock charges separately for the Guardrails checks, and its quotas apply to your account. WAF pricing changes on 1 February 2027, when web ACL and rule fees go away.
Roll it out the way AWS suggests: add it with the four default-block rules overridden to count, read the labels on your own traffic, then remove the overrides one at a time.
Frequently asked questions
Is AWS WAF AI Security generally available?
Yes. AWS announced API Portal, the API Security rule group and the AI Security rule group as generally available on 23 November 2026.
Do I need to create a Bedrock guardrail?
No. You turn on content assessment in the rule group and supply an IAM role. WAF calls Bedrock Guardrails with a fixed set of categories that you cannot change, and Bedrock charges and quotas apply to your account.
What happens if the Bedrock Guardrails call fails?
By default the request passes with a guardrails:call_failed label and a reason such as throttling. To fail closed, override the Guardrails_CallFailed rule to block.
Does it protect calls to Bedrock's Converse or InvokeModel APIs?
No. Those are labelled not recognised. AWS recommends specifying a guardrail in the Converse or InvokeModel request itself.
based on The AWS What's New posts for WAF AI endpoint protection and API Gateway API Portal (23 November 2026), the AWS Security Blog's introduction to API and AI security, the AWS WAF Developer Guide page for the AI Security rule group, and the AWS WAF pricing page.


