Cloud · Analysis
AWS WAF AI Security: MCP and A2A Protection, Costs
AWS WAF's new AI Security rule group checks MCP, A2A and LLM traffic and scores it with Bedrock Guardrails. Here's what it catches, what it misses, and why response inspection can cost far more than the firewall.
Nalini Groves · Nov 25, 2026 · 10 min read
- AWS WAF
- Amazon Bedrock
- Amazon Bedrock AgentCore
- Amazon Web Services
- Cloud & Architecture
- AI Agents & Coding
Documentation-based research

On this page
AWS made AI endpoint protection generally available in AWS WAF on November 23, 2026. A new AI Security managed rule group recognizes LLM inference, Model Context Protocol (MCP) and Agent2Agent (A2A) traffic, blocks malformed MCP and A2A messages, and sends prompts, tool calls and tool results to Amazon Bedrock Guardrails to score prompt injection, jailbreaks, harmful content and leaked secrets.
It shipped alongside API Portal, a discovery feature in API Gateway that finds shadow MCP servers, and a rewrite of WAF pricing that takes effect on February 1, 2027. For teams running agents on AWS the feature is useful, but it is narrower than the launch post suggests, and most of the cost sits in Bedrock rather than WAF. Here is what it actually checks, what it misses, and what it costs.
Quick verdict
Turn it on for any public MCP server, A2A agent or OpenAI-compatible endpoint you already front with CloudFront or an Application Load Balancer, starting in count mode. The protocol checks are cheap and catch a real class of gateway-bypass tricks. Treat the Bedrock content checks as a monitoring layer, not a guarantee: the categories are fixed, failed checks pass traffic through by default, and response inspection can cost far more than the firewall itself. Keep authentication, tool allowlists and output validation in your own code.
Scroll the table horizontally on smaller screens.
| Item | Detail |
|---|---|
| Status | Generally available since Nov 23, 2026 (rule group version 1.0) |
| Rule group | AWSManagedRulesAISecurityRuleSet, 400 WCU |
| Traffic recognized | LLM calls in OpenAI, Anthropic, Gemini and Ollama formats; MCP 2025-06-18, 2025-11-25 and 2026-07-28; A2A 1.0 |
| Content checks | Bedrock Guardrails InvokeGuardrailChecks: prompt attack, content filter, sensitive information (fixed categories) |
| Resources | CloudFront, Application Load Balancer, API Gateway REST APIs (not AgentCore Gateway, AppSync or App Runner) |
| Regions | N. Virginia, Ohio, Oregon, London, Stockholm, Tokyo, Sydney, plus CloudFront |
| WAF price (from Feb 1, 2027) | $0.60 base + $5.00 premium per 1M inspected requests, plus $7.30 per protected resource per month |
| Bedrock price | $0.08 (prompt attack), $0.07 (content filter), $0.10 (sensitive info) per 1,000 text units |
What AWS launched
The announcement bundles three things that work together. API Portal in the API Gateway console builds an inventory of the APIs behind CloudFront, Application Load Balancers and API Gateway from traffic logs and configuration, and flags which of them are LLM, MCP or A2A endpoints. API Security is a managed rule group for classic API abuse such as broken object-level authorization, token tampering and route probing. AI Security is the agent-specific rule group, and the subject of this piece.
The pitch in the AWS Security Blog post is about blind spots: an MCP server stood up for a hackathon can sit behind a load balancer without ever passing through an API gateway or a security review, and it advertises its own tools to anyone who calls tools/list. API Portal is meant to find those endpoints, and AI Security is meant to put a filter in front of them without changing backend code.
This sits next to the Stripe-billed agent access AWS added to WAF earlier this month. WAF is turning into AWS's control point for agent traffic, both for charging well-behaved agents and for filtering hostile ones.
How AI Security works: two layers
Layer 1: protocol checks inside WAF
The rule group first labels each request as LLM, MCP, A2A or not recognized. For MCP and A2A it then validates the message against the protocol version declared in the MCP-Protocol-Version or A2A-Version header. These checks are deterministic and never leave WAF. Baseline violations, which AWS describes as messages that could slip past routing or inspection, block by default. Strict violations, valid but unusual constructs, only count.
AWS's example is a request whose Mcp-Method header says tools/list while the JSON body calls a tool. A gateway that trusts the header would treat it as read-only, and the server would still run the tool. WAF blocks it because the header and body disagree. That is the strongest part of the launch: it targets a real MCP-specific bypass, it is cheap, and it works even with Bedrock turned off.
Layer 2: Bedrock Guardrails content checks
If you enable it, WAF calls Bedrock's InvokeGuardrailChecks API with an IAM role you supply. There is no guardrail resource to configure, and per the configuration docs you cannot add, remove or reweight categories. Bedrock returns a score, and WAF maps it to fixed tiers: high (0.8 and above), medium (0.6 to 0.8) and low. Only a high-severity prompt attack blocks by default; everything else counts and adds a label you can act on in your own rules.

- Prompt attack (jailbreak, prompt injection, prompt leakage): requests for LLM, MCP and A2A; responses for MCP tool results and A2A replies only, not model completions.
- Content filter (violence, hate, sexual, misconduct, insults): LLM and A2A requests only, not MCP.
- Sensitive information (nine types, including AWS access and secret keys, passwords, email addresses and card numbers): responses only.
You choose one of three modes: Disable (protocol checks only, no Bedrock calls), ProtectRequestOnly and ProtectRequestAndResponse. The choice matters for indirect prompt injection. A malicious MCP tool result arrives in a response, so only the response phase sees it. But when your app sends that tool result back to an LLM in the next request, as an OpenAI tool message or an Anthropic tool_result block, request-only mode can catch it there.
What it does not cover
The rule group documentation is unusually candid about the limits, and several matter for real agent stacks:
- Bedrock's own APIs aren't recognized. Requests in the
ConverseorInvokeModelformat getnot_recognizedand no content check. AI Security protects endpoints you expose, typically OpenAI-compatible gateways and self-hosted models, not your outbound Bedrock calls. - Version coverage is narrow. MCP 2024-11-05 and 2025-03-26 and A2A 0.3 traffic are not recognized, so older clients and servers get no checks at all.
- Failures fail open. If the Bedrock call is throttled or denied, the request is counted and passed. You can override
Guardrails_CallFailedto block, at the risk of an outage when Bedrock quotas run out. - Response inspection can fail closed. With
ProtectRequestAndResponse, an internal error in the response path returns an error to the client instead of your app's response, and no override changes that. - Resource and Region limits. It works with CloudFront, Application Load Balancers and API Gateway REST APIs, not AgentCore Gateways, and only in seven Regions plus CloudFront. AWS's launch post ties response inspection to CloudFront or Application Load Balancer protection packs.
- Data residency. For CloudFront, each edge location sends text to the nearest supported Region, which can be outside your users' or origin's country, and you can't pick it.
None of this replaces basic MCP hygiene. Authentication, per-tool permissions and least-privilege credentials still decide the blast radius when a prompt gets through. Our MCP server security checklist covers that side.
Pricing: the WAF fee is the small part
AWS also announced simplified WAF pricing. From February 1, 2027 the bill has three parts: $0.01 per protected resource per hour (about $7.30 a month), $0.60 per million inspected requests, and a $5.00 per million premium fee for requests inspected by advanced rule groups, including AI Security. Web ACL, rule, rule group, capacity and body-inspection charges disappear, and each web ACL includes 2,500 WCU, up from 1,500. Existing customers stay on current pricing until then; AWS says most will pay less, and customers protecting many low-traffic resources may pay more.
The premium fee is charged once per request however many premium groups inspect it, and only for requests that reach the rule group. Placing AI Security after cheaper rules and scoping it to paths like /mcp keeps it down. The Bedrock side is billed separately on Bedrock pricing per 1,000 text units of up to 1,000 characters each, and that is where costs climb.
Scroll the table horizontally on smaller screens.
| Component | Price | Charged on |
|---|---|---|
| WAF protected resource | $0.01/hour (~$7.30/month) | Each CloudFront distribution, ALB or API Gateway API in the web ACL |
| WAF base request | $0.60 per 1M | Every inspected request |
| WAF premium request | $5.00 per 1M | Requests the AI Security group inspects (once per request) |
| Bedrock prompt attack | $0.08 per 1,000 text units | Assessed requests and MCP/A2A responses |
| Bedrock content filter | $0.07 per 1,000 text units | LLM and A2A requests |
| Bedrock sensitive info | $0.10 per 1,000 text units | Responses, when response inspection is on |
Worked example: one public MCP server
Illustrative only, not a measured bill. Assume one CloudFront distribution, 10 million requests a month all inspected by AI Security, 2 million of them MCP tools/call messages averaging one text unit, with tool results averaging three text units.
- Guardrails disabled: $7.30 + $6.00 base + $50.00 premium = $63.30.
- ProtectRequestOnly: add 2M text units of prompt-attack checks at $0.08 per 1,000 = $160, total $223.30.
- ProtectRequestAndResponse: add 6M response text units checked for prompt attack and sensitive information at $0.18 per 1,000 = $1,080, total $1,303.30.

The pattern holds whatever the exact numbers: response inspection on chatty tools with large results dominates the bill. Cap tool result sizes, scope inspection to the tools that touch untrusted data, and size your Bedrock quota for peak traffic, as AWS recommends, so throttling doesn't quietly turn into unchecked traffic.
How it compares with the alternatives
Scroll the table horizontally on smaller screens.
| Option | Where it runs | Strengths | Trade-offs |
|---|---|---|---|
| AWS WAF AI Security | At CloudFront, ALB or API Gateway | No code changes; MCP/A2A protocol checks; labels feed your WAF rules | Fixed categories; AWS front doors only; Bedrock cost on top |
| Bedrock Guardrails in your app | Your code, via ApplyGuardrail or InvokeGuardrailChecks | Configurable filters and denied topics; works for outbound Bedrock calls | You write the integration and decide what to send |
| Cloudflare AI Security for Apps | Cloudflare WAF on endpoints labeled cf-llm | Model-agnostic; LLM endpoint discovery on all plans | Detection fields are an Enterprise paid add-on; JSON prompts only; no MCP/A2A protocol checks listed |
| Gateway or MCP proxy checks | Your AI gateway or proxy | Can see full conversations and tool context | Another service to run; gateway features vary |
If your agents already sit behind a gateway, our AI gateways comparison covers which ones add their own guardrails. For hosting choices on AWS, see how to deploy an AI agent on AWS.
How to roll it out
- Enable API Portal discovery first, for your account or AWS Organization, and look for MCP and LLM endpoints you didn't know about. Discovery doesn't need WAF.
- Add AI Security with
Disableto get protocol labels and baseline blocking with no Bedrock bill, and override the blocking rules to Count for a few days. - Create the IAM role with
bedrock:InvokeGuardrailChecks, switch toProtectRequestOnly, and review theawswaf:managed:aws:ai-security:labels in CloudWatch and WAF logs. - Turn on response inspection only for endpoints whose tool results carry untrusted content or secrets, after checking Bedrock quotas and the cost per million responses.
- Remove Count overrides one rule at a time, and decide explicitly whether
Guardrails_CallFailedshould block.
A minimal configuration that runs protocol checks only looks like this (illustrative; see the AWS docs for the full statement):
"ManagedRuleGroupConfigs": [{ "AWSManagedRulesAISecurityRuleSet": { "BedrockGuardrails": { "Disable": {} } }}]
Verdict
AI Security is the first mainstream WAF feature that understands MCP and A2A rather than treating them as generic JSON, and the protocol checks alone justify turning it on for public agent endpoints on AWS. The Bedrock layer is a sensible extra signal, but its fixed categories, fail-open default and response-inspection costs make it a tool to tune, not a box to tick. Start with discovery and protocol checks, add request inspection, and only pay for response inspection where tool output is genuinely untrusted.
Sources
- AWS What's New: AWS WAF announces automated discovery and protection for LLM, MCP, and A2A endpoints (Nov 23, 2026)
- AWS WAF Developer Guide: AI Security rule group and Configuring AI Security
- AWS What's New: AWS WAF introduces simplified pricing (Nov 23, 2026) and AWS WAF pricing
- Amazon Bedrock pricing (Guardrails, InvokeGuardrailChecks)
- AWS Security Blog: Introducing API and AI security on AWS, from discovery to protection and Introducing AWS WAF simplified pricing (Nov 23, 2026)
- Cloudflare docs: AI Security for Apps
Tools covered in this article
Frequently asked questions
- What is AWS WAF AI Security?
- A managed rule group (AWSManagedRulesAISecurityRuleSet), generally available since November 23, 2026, that recognizes LLM, MCP and A2A traffic, blocks malformed MCP and A2A messages, and can send content to Amazon Bedrock Guardrails to detect prompt attacks, harmful content and sensitive information.
- How much does AWS WAF AI Security cost?
- From February 1, 2027, requests it inspects cost $5.00 per million on top of the $0.60 per million base fee, plus $7.30 per protected resource per month. If content checks are on, Bedrock bills separately: $0.08 per 1,000 text units for prompt attack, $0.07 for content filter and $0.10 for sensitive information.
- Does AWS WAF AI Security protect MCP servers?
- Yes, for MCP protocol versions 2025-06-18, 2025-11-25 and 2026-07-28 behind CloudFront, an Application Load Balancer or an API Gateway REST API. It checks tools/call requests for prompt attacks and, with response inspection on, tool results for prompt attacks and sensitive information. Older MCP versions get no checks.
- Do I need to create a Bedrock guardrail to use it?
- No. AWS WAF calls the InvokeGuardrailChecks API with an IAM role you provide, using a fixed set of categories. There is no guardrail resource, and you can't add, remove or reweight categories.
- What happens if the Bedrock check fails?
- By default the request is counted with a guardrails:call_failed label and allowed through. You can override the Guardrails_CallFailed rule to block instead. With response inspection on, an internal error in the response path returns an error to the client.