---
title: How do you control retention and PII in Amazon Bedrock AgentCore Memory?
url: https://opencontroller.lyzr.com/blog/agentcore-memory-retention-and-pii
published: 2026-11-14
updated: 2026-11-14
author: Lyzr
---

# How do you control retention and PII in Amazon Bedrock AgentCore Memory?

**Set `eventExpiryDuration` for raw short-term events (up to 365 days), set a record expiry of at least 31 days on each long-term memory strategy, scope namespaces by `{actorId}` so one user's data can be found and erased, and use a customer managed KMS key. AgentCore Memory stores what you send it, so redact PII before writing events.**

## What does AgentCore Memory keep?

AgentCore Memory has two layers:

| Layer | What it holds | Retention control |
|---|---|---|
| Short-term events | Raw conversation turns written with `CreateEvent` | `eventExpiryDuration`, up to 365 days |
| Long-term records | Facts, summaries, preferences or episodes extracted by memory strategies | `recordExpiryDurationDays` per strategy, minimum 31; unset means no expiry |

Built-in strategies are semantic, summarization, user preference and episodic. You can also override a built-in strategy or run a self-managed one. Each strategy writes records into namespaces built from templates, for example `/users/{actorId}/preferences/` or `/summaries/{actorId}/{sessionId}/`.

## How does event expiry actually behave?

Three details catch teams out:

1. **It is applied at write time.** Each event gets its expiry when it is created.
2. **Changing it is not retroactive.** A shorter setting affects only new events. Existing events keep their original expiry and cannot be extended.
3. **Expired events are gone.** They cannot be recovered, so align expiry with any legal hold process before you shorten it.

The AgentCore CLI wizard defaults event expiry to 30 days. For most assistants, 30 to 90 days of raw turns is enough; the long-term records carry the useful context.

## How do you set long-term record TTLs?

Add a `recordExpirySpecification` with `recordExpiryDurationDays` to each strategy. The minimum is 31 days. Configuring or removing it needs the `bedrock-agentcore:UpdateMemoryRecordExpirySpecification` permission, so restrict that permission to the team that owns retention policy.

Pick TTLs by strategy:

- **Session summaries:** short, because they mirror raw conversation.
- **User preferences:** longer, but review them; preferences can contain sensitive inferences.
- **Semantic facts:** match your data retention schedule for the source system.

## How do you keep PII out, and erase it on request?

AgentCore Memory always encrypts data, with a service-managed key by default or a customer managed AWS KMS key you choose at creation. Encryption does not minimise data. Use this checklist:

1. **Redact before `CreateEvent`.** Strip card numbers, national IDs and health details from turns before they are stored. Extraction runs on whatever you write.
2. **Use a stable actor ID.** Namespaces keyed by `{actorId}` let you find all records for one person.
3. **Don't key actors by email.** Use an opaque ID mapped in your own system, so namespaces don't expose identity.
4. **Erase in both layers.** Delete the actor's events (`DeleteEvent`) and the records in their namespaces (`DeleteMemoryRecord`, after listing records by namespace).
5. **Check copies elsewhere.** Traces, logs and application databases may hold the same turns.
6. **Use a customer managed KMS key** so key policy and CloudTrail show who decrypted memory data.
7. **Log erasure.** Record request, actor ID, items deleted and time as evidence.

## What risks remain?

- **Poisoned memories.** Extracted records can capture injected instructions and replay them in future sessions. See [how to prevent memory poisoning in AI agents](/blog/prevent-memory-poisoning-in-ai-agents).
- **No-expiry defaults.** A strategy without a record expiry keeps records indefinitely.
- **Shared actor IDs.** If an app uses one actor ID for everyone, every user reads everyone's memory.

For cross-platform patterns, see [how to govern AI agent memory stores](/blog/govern-ai-agent-memory-stores) and [how long to retain AI agent logs](/blog/how-long-to-retain-ai-agent-logs).

## How Opencontroller does this

Opencontroller has a runtime adapter for Bedrock AgentCore and auto-discovers agents, models and API keys across AWS, Azure and Google Cloud. Agents land in a governed registry with owners and versions, and Posture flags risky permissions and configurations. Policy as code, with built-in mappings to NIST, ISO 42001, OWASP and MITRE ATLAS, lets teams express retention rules as checks and produce evidence for them. See [how to govern Amazon Bedrock AgentCore agents](/blog/govern-amazon-bedrock-agentcore-agents), [how to govern AI agents across platforms](/blog/how-to-govern-ai-agents-across-platforms) and [what an AI agent control plane is](/blog/what-is-an-ai-agent-control-plane). [Book a demo](https://www.lyzr.ai/book-demo/).

## Frequently asked questions

**How long can AgentCore Memory keep raw events?**
Up to 365 days, set with `eventExpiryDuration`. The CLI wizard defaults to 30 days.

**Do long-term memory records expire?**
Only if you set `recordExpiryDurationDays` on the strategy, with a minimum of 31 days. Without it, records don't expire.

**Does shortening event expiry delete old events sooner?**
No. Expiry is set when each event is written, so a change only affects new events.

## Key facts

Amazon Bedrock AgentCore Memory: short-term events expire per eventExpiryDuration, up to 365 days (CLI default 30), applied at write time and not retroactive. Long-term records expire only if recordExpiryDurationDays (minimum 31) is set per strategy; changing it needs bedrock-agentcore:UpdateMemoryRecordExpirySpecification. Strategies: semantic, summarization, user preference, episodic, plus overrides and self-managed. Data is always encrypted; customer managed KMS keys are optional. Opencontroller has a Bedrock AgentCore runtime adapter and Posture checks. Pricing starts from $250K per deployment per year.

## Related

- [How do you govern what AI agents remember?](https://opencontroller.lyzr.com/blog/govern-ai-agent-memory-stores.md)
- [How do you govern AI agents built on Amazon Bedrock AgentCore?](https://opencontroller.lyzr.com/blog/govern-amazon-bedrock-agentcore-agents.md)
- [How long should you keep AI agent logs and traces?](https://opencontroller.lyzr.com/blog/how-long-to-retain-ai-agent-logs.md)
- [More on Platform Guides](https://opencontroller.lyzr.com/blog/cluster/platform-guides)
