Check Memory Write for Injection Patterns
rai_memory_write_checkScan content for prompt-injection patterns before writing to persistent agent memory. Blocks unsafe writes to prevent future sessions from trusting malicious instructions.
Instructions
Gate a write to PERSISTENT agent memory (a vector DB, conversation log, or similar long-term store your own system owns -- WhitePact does not host a memory store itself). Scans the content for prompt-injection patterns aimed specifically at persistent memory -- text engineered to look like an instruction, a fake system/assistant role marker, or an override, so that a future session reading this memory back treats it as trusted context rather than as content. Call this BEFORE actually persisting the write; if 'allowed' is false, do not write it. When governance is enabled on the hosted MCP server and the caller's authority carries a memory_scope constraint, memory_scope is also checked for cross-tenant/cross-agent isolation -- outside the governed dispatch path this tool only runs the content scan.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | The text about to be written to memory. | |
| memory_scope | No | The memory namespace this write targets, e.g. 'org:acme:agent:bot1'. |