Help defend against memory poisoning in Amazon Bedrock AgentCore with multi-layer write validation
Security Blog
This article presents a defense-in-depth solution to prevent memory poisoning attacks in Amazon Bedrock AgentCore, where attackers embed malicious instructions in persistent memory that can influence agent behavior across sessions.
- Deploy a Lambda interceptor on AgentCore Gateway that evaluates memory writes against four signals: semantic drift, instruction patterns, namespace boundaries, and write-rate anomalies
- Semantic drift detection using Amazon Titan Text Embeddings V2 identifies attacks using non-English or obfuscated phrasing that regex patterns miss
- Returns ALLOW, QUARANTINE, or DENY decisions based on composite scoring; quarantined writes redirect to isolated namespaces
- Compose with existing AgentCore controls: IAM conditions, Cedar policies, custom memory-strategy prompts, and Bedrock Guardrails
- Implement using AWS CDK to provision Lambda with provisioned concurrency, DynamoDB for write-rate tracking, and SNS for security alerts
- Validation adds ~26ms latency on warm path; estimated cost ~$2.50/day for 10,000 memory writes
- Test results show 100% detection rate on 11 scenarios including benign writes and eight attack payloads
The solution aligns with Well-Architected Agentic AI Lens best practices and requires no changes to agent code.
The AWS News Feed is currently looking for gold sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.
Related articles
Nov 17
2026
2026
Securely exposing Amazon Bedrock AgentCore Runtime
Nov 16
2026
2026
Build memory-aware AI agents with Agentic Retrieve on Amazon Bedrock Managed Knowledge Base
Nov 17
2026
2026
Amazon Bedrock AgentCore Memory now provides full session summaries
Aug 28
2026
2026
Amazon Bedrock AgentCore Memory now supports fine-grained access control
The AWS News Feed is currently looking for silver sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.