Intercepts LLM requests and responses flowing through an AWS AgentCore Gateway and inspects them with CrowdStrike Guardian. Prompt injection, PII, and other risks are blocked or redacted before they reach the model or the caller.
Step 1 — Create the ECR repository
Step 2 — Build and push the container image
Step 3 — Deploy with Terraform
Step 4 — Load the Guardian bearer token
Step 5 — Register the interceptor
Configuration reference
Verifying the deployment
An AWS AgentCore Gateway already created and routing traffic to at least one target.
A CrowdStrike Guardian API endpoint and bearer token from your Guardian application collector setup.
Docker, the AWS CLI, and Terraform ≥ 1.6 installed locally.
Step 1 — Create the ECR repository
The Lambda runs as a container image. Terraform manages the ECR repository, but the image must exist before Terraform can create the Lambda function.
Copy the sample vars file and fill in your values:
Run a targeted apply to create only the ECR repository:
Note the ecr_repository_uri output for the step.
Step 2 — Build and push the container image
Step 3 — Deploy with Terraform
Uncomment and set image_uri in terraform/terraform.tfvars :
Add any optional variables you need (see Configuration reference ), then apply:
Terraform creates and wires together:
Step 4 — Load the Guardian bearer token
Terraform creates the Secrets Manager secret shell but does not write the token value, keeping it out of Terraform state. After terraform apply completes, load your Guardian bearer token directly:
Step 5 — Register the interceptor
The Terraform AWS provider does not yet have a native resource for AgentCore interceptor configuration. Register the interceptor through the AWS console after terraform apply completes.
The Lambda ARN is printed as a Terraform output:
Open Amazon Bedrock → AgentCore → Gateways and select your gateway.
Choose Edit Gateway .
Expand Additional Configuration .
Set Request Interceptor Lambda ARN to the Lambda ARN and enable Pass request header .
Set Response Interceptor Lambda ARN to the same Lambda ARN and enable Pass request header .
Existing interceptors: AgentCore supports at most one REQUEST and one RESPONSE interceptor per gateway. If your gateway already has an interceptor, your CrowdStrike team to merging the functions.
Existing interceptors: AgentCore supports at most one REQUEST and one RESPONSE interceptor per gateway. If your gateway already has an interceptor, your CrowdStrike team to merging the functions.
Large responses: If your inference target returns responses larger than ~3 MB (before base64 encoding), enable Exclude response body in the interceptor's payload filter settings. This disables response-body inspection for that gateway but allows request-side inspection to continue.
Large responses: If your inference target returns responses larger than ~3 MB (before base64 encoding), enable Exclude response body in the interceptor's payload filter settings. This disables response-body inspection for that gateway but allows request-side inspection to continue.
VPC placement: If the Lambda needs to reach a private Guardian endpoint, set the subnet_ids and security_group_ids variables before running terraform apply . The module automatically attaches the VPC execution policy and configures the vpc_config block on the function.
VPC placement: If the Lambda needs to reach a private Guardian endpoint, set the subnet_ids and security_group_ids variables before running terraform apply . The module automatically attaches the VPC execution policy and configures the vpc_config block on the function.
Configuration reference
Set these in terraform.tfvars . Only the first five are required.
Per-request headers (forwarded automatically when passRequestHeaders: true is set in the gateway interceptor configuration, which the module sets by default):
Verifying the deployment
Confirm the interceptor is registered:
Open Amazon Bedrock → AgentCore → Gateways , select your gateway, and verify the interceptor appears under Interceptors with both REQUEST and RESPONSE points listed.
A successful inspection logs one of:
Send a test request with a prompt injection attempt:
When the Guardian policy has Malicious Prompt detection enabled, the gateway returns HTTP 400 before the request reaches the upstream model.
Lambda logs show AIDR unreachable
Confirm aidr_api_endpoint does not include a path (base URL only).
If the Lambda is in a VPC, verify the security group allows outbound HTTPS (port 443) and a NAT gateway provides internet access.
Increase aidr_timeout_s if the Guardian API is timing out under load.
Lambda logs show state_store.save failed
Confirm the Lambda execution role has DynamoDB permissions on the state table ( terraform apply should have handled this — check the IAM role in the console if the policy is missing).
Response-side inspection degrades gracefully when DynamoDB is unavailable: request-side inspection still works; the response handler falls back to the llm_provider variable for provider detection.
Response-side inspection is skipped
HTTP streaming responses are not intercepted — this is an AgentCore platform limitation.
Responses larger than ~3 MB (encoded) exceed the Lambda 6 MB payload limit. Enable Exclude response body in the interceptor's payload filter settings in the console, or reduce the upstream model's max-tokens setting.
aws-agentcore-gateway-lambda-interceptor is a community-driven, open source project designed to intercept and inspect LLM requests and MCP tool calls flowing through AWS AgentCore Gateway with CrowdStrike Guardian. While not a formal CrowdStrike product, aws-agentcore-gateway-lambda-interceptor is maintained by CrowdStrike and supported in partnership with the open source developer community.
For additional details on the support policy for this project, please see SUPPORT.md .
MIT License — see LICENSE for full text.
The full story
This article is one source in a clustered incident — the cluster page carries the summary, timeline and every other outlet covering it.
