Skip to content

feat(waf): AWS WAF AI traffic monetization with Amazon CloudFront (CDK)#3161

Open
NithinChandranR-AWS wants to merge 1 commit into
aws-samples:mainfrom
NithinChandranR-AWS:NithinChandranR-AWS-feature-waf-cloudfront-ai-monetization-cdk
Open

feat(waf): AWS WAF AI traffic monetization with Amazon CloudFront (CDK)#3161
NithinChandranR-AWS wants to merge 1 commit into
aws-samples:mainfrom
NithinChandranR-AWS:NithinChandranR-AWS-feature-waf-cloudfront-ai-monetization-cdk

Conversation

@NithinChandranR-AWS

Copy link
Copy Markdown
Contributor

Description

First CDK pattern for native AWS WAF AI traffic monetization (GA June 15, 2026). Deploys an Amazon CloudFront distribution with AWS WAF Bot Control and the new MonetizeAction that charges AI bots via the x402 payment protocol.

Architecture

AI Bot → Amazon CloudFront → AWS WAF Bot Control (classifies bot) → MonetizeAction → HTTP 402 + x402 payment manifest → Bot pays USDC → Content served

Services

  • AWS WAF (Bot Control managed rule group + MonetizeAction)
  • Amazon CloudFront
  • Amazon S3

Key details

  • Uses native MonetizeAction (not the pre-GA Lambda@Edge workaround from sample-x402-content-monetization repo)
  • TEST mode by default (Base Sepolia testnet, no real money)
  • Zero Lambda functions — pure infrastructure configuration
  • 9 CloudFormation resources
  • Deployed and tested in us-east-1: normal requests return 200, GPTBot returns 402 with valid x402 payment manifest

Testing performed

  • Normal curl → HTTP 200 (content served)
  • GPTBot User-Agent → HTTP 402 + base64 x402 manifest with USDC pricing, Base Sepolia network, correct payTo address
  • Payment manifest validated: x402Version 2, amount 10000 (0.01 USDC), asset 0x036CbD53842c5426634e7929541eC2318f3dCF7e (USDC on Base Sepolia)

@NithinChandranR-AWS NithinChandranR-AWS force-pushed the NithinChandranR-AWS-feature-waf-cloudfront-ai-monetization-cdk branch 2 times, most recently from aeb78cd to d6e5a06 Compare June 20, 2026 07:52
@NithinChandranR-AWS NithinChandranR-AWS force-pushed the NithinChandranR-AWS-feature-waf-cloudfront-ai-monetization-cdk branch from d6e5a06 to 0d1bdf4 Compare June 20, 2026 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants