For the complete documentation index, see llms.txt. This page is also available as Markdown.

AWS Bedrock AgentCore

Overview

AWS Bedrock AgentCore is Amazon's managed platform for building and operating production AI agents. Its Gateway is a managed MCP endpoint that aggregates tools (Lambda, OpenAPI, and MCP servers) and serves them to your agents and MCP clients over a single URL.

Akto secures this traffic with a gateway interceptor: an AWS Lambda function that AgentCore invokes on every request and response passing through the gateway. It validates MCP tools/call traffic against your Akto guardrail policies in real time: blocking disallowed tool calls, redacting sensitive tool results, and ingesting all tool activity into the Akto dashboard.

The interceptor code and deployment script are open source: github.com/akto-api-security/aws-bedrock-agentcore.

How It Works

A single Lambda is attached to the gateway at two interception points: REQUEST (before the tool runs) and RESPONSE (after the tool returns). The same function handles both; it detects which phase it is from the event.

What gets guardrailed

MCP method
REQUEST interceptor
RESPONSE interceptor

tools/call

Validated; blocked or arguments rewritten

Result validated; blocked or redacted

tools/list, initialize, notifications/*, ping

Passed through

Passed through

What You'll Achieve

Real-time tool-call guardrails: block disallowed tools/call before the tool executes ✅ Response redaction: strip or block sensitive data in tool results before the client sees them ✅ Full observability: every MCP tool call and result is ingested into the Akto dashboard ✅ Managed enforcement: runs inside AWS as a gateway interceptor; no proxy or sidecar to operate ✅ Fail-open by design: if Akto is unreachable, traffic passes through so the gateway never breaks

Prerequisites

AWS

  • An existing AgentCore Gateway (MCP protocol): note its Gateway ID and Region

  • AWS credentials with permissions for lambda:*, iam:CreateRole / PutRolePolicy / PassRole, and bedrock-agentcore-control:GetGateway / UpdateGateway

  • For the CLI method: aws CLI v2, jq, and zip installed locally

Akto

  • Akto Data Ingestion URL (AKTO_DATA_INGESTION_URL)

  • Akto API token (AKTO_API_TOKEN)

Setup

You can deploy via CloudFormation, with the provided CLI script, or manually from the AWS Console. All three attach the same Lambda to both interception points.

Verify the Integration

Tail the Lambda logs and make a tool call through the gateway:

On a tools/call you should see:

A blocked call returns a JSON-RPC error to the client instead of the tool result, and the tool activity appears in the Akto dashboard.

Environment Variables

Only two settings are environment-driven; everything else is a fixed default tuned for the gateway use case.

Variable
Default
Description

AKTO_DATA_INGESTION_URL

(required)

Base URL of your Akto data ingestion service

AKTO_API_TOKEN

(required)

Authorization token sent to the Akto API

Guardrail Behaviour

The interceptor reads the guardrail verdict from Akto and acts on the policy behaviour:

Verdict
Action at the gateway

Allowed

Traffic passes through

Blocked (block)

Returns a JSON-RPC error; the tool never runs (REQUEST) or the result is replaced (RESPONSE)

warn / alert

Traffic is allowed and logged: a gateway has no interactive resubmit path, so warnings cannot hard-block

Modified

The tool arguments (REQUEST) or result (RESPONSE) are rewritten with Akto's redacted payload

Akto error / timeout

Fail-open: traffic passes through so the gateway never breaks

Configure which tools and patterns to block, warn, or redact in the Akto dashboard under Settings → Guardrails. The interceptor enforces whatever policies you define there.

Troubleshooting

Interceptor not firing

You should see your Lambda ARN with interceptionPoints of ["REQUEST","RESPONSE"] and passRequestHeaders: true.

Guardrails always allowing (fail-open)

The interceptor is fail-open by design: any Akto error allows the request through. Check the Lambda logs:

Common causes:

  • AKTO_DATA_INGESTION_URL not set or unreachable from the Lambda

  • The Lambda is in a VPC without outbound internet (NAT) to reach Akto

  • Guardrail policies not configured in the Akto dashboard

Tool results not guardrailed

Confirm the Response Interceptor is configured (same Lambda ARN) and that Exclude the response body is unchecked. Look for Guardrailing RESPONSE tools/call result: in the logs.

Get Support for your Akto setup

There are multiple ways to request support from Akto. We are 24X7 available on the following:

  1. In-app intercom support. Message us with your query on intercom in Akto dashboard and someone will reply.

  2. Join our discord channel for community support.

  3. Contact help@akto.io for email support.

  4. Contact us here.

Last updated