You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Amazon Bedrock Agents with Memory can persist summaries of past sessions and inject them into future orchestration prompts as system instructions. If untrusted tool output (for example, content fetched from external webpages, files, or third‑party APIs) is incorporated into the input of the Memory Summarization step without sanitization, an attacker can poison long‑term memory via indirect prompt injection. The poisoned memory then biases the agent’s planning across future sessions and can drive covert actions such as silent data exfiltration.
8
11
9
12
This is not a vulnerability in the Bedrock platform itself; it’s a class of agent risk when untrusted content flows into prompts that later become high‑priority system instructions.
10
13
11
-
## How Bedrock Agents Memory works (relevant pieces)
14
+
###How Bedrock Agents Memory works
12
15
13
16
- When Memory is enabled, the agent summarizes each session at end‑of‑session using a Memory Summarization prompt template and stores that summary for a configurable retention (up to 365 days). In later sessions, that summary is injected into the orchestration prompt as system instructions, strongly influencing behavior.
14
17
- The default Memory Summarization template includes blocks like:
@@ -17,14 +20,14 @@ This is not a vulnerability in the Bedrock platform itself; it’s a class of ag
17
20
- Guidelines require strict, well‑formed XML and topics like "user goals" and "assistant actions".
18
21
- If a tool fetches untrusted external data and that raw content is inserted into $conversation$ (specifically the tool’s result field), the summarizer LLM may be influenced by attacker‑controlled markup and instructions.
19
22
20
-
## Attack surface and preconditions
23
+
###Attack surface and preconditions
21
24
22
25
An agent is exposed if all are true:
23
26
- Memory is enabled and summaries are reinjected into orchestration prompts.
24
27
- The agent has a tool that ingests untrusted content (web browser/scraper, document loader, third‑party API, user‑generated content) and injects the raw result into the summarization prompt’s `<conversation>` block.
25
28
- Guardrails or sanitization of delimiter‑like tokens in tool outputs are not enforced.
26
29
27
-
## Injection point and boundary‑escape technique
30
+
###Injection point and boundary‑escape technique
28
31
29
32
- Precise injection point: the tool’s result text that is placed inside the Memory Summarization prompt’s `<conversation> ... $conversation$ ... </conversation>` block.
30
33
- Boundary escape: a 3‑part payload uses forged XML delimiters to trick the summarizer into treating attacker content as if it were template‑level system instructions instead of conversation content.
@@ -61,13 +64,13 @@ Notes:
61
64
62
65
</details>
63
66
64
-
## Why it persists and how it triggers
67
+
###Why it persists and how it triggers
65
68
66
69
- The Memory Summarization LLM may include attacker instructions as a new topic (for example, "validation goal"). That topic is stored in the per‑user memory.
67
70
- In later sessions, the memory content is injected into the orchestration prompt’s system‑instruction section. System instructions strongly bias planning. As a result, the agent may silently call a web‑fetching tool to exfiltrate session data (for example, by encoding fields in a query string) without surfacing this step in the user‑visible response.
68
71
69
72
70
-
## Reproducing in a lab (high level)
73
+
###Reproducing in a lab (high level)
71
74
72
75
- Create a Bedrock Agent with Memory enabled and a web‑reading tool/action that returns raw page text to the agent.
73
76
- Use default orchestration and memory summarization templates.
Amazon Bedrock is a fully managed service that makes it easy to build and scale generative AI applications using foundation models (FMs) from leading AI startups and Amazon. Bedrock provides access to various FMs through a single API, allowing developers to choose the most suitable model for their specific use cases without managing the underlying infrastructure.
0 commit comments