Observed since 20 Oct, 18:25 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Memory integrity verification for AI agents. Implements ACRF-04 defense pattern.
Memory integrity verification for AI agents. Implements the ACRF-04 (Memory Poisoning) defense pattern.
Part of the ACRF framework: https://github.com/kannasekar-alt/ACRF PyPI: https://pypi.org/project/acrf-memory-guard/ Presented at RSA Conference 2026.
No Docker. No setup. Just Python 3.10+.
Step 1 - Install:
pip install acrf-memory-guard
Step 2 - Sign every memory write:
from acrf_memory_guard import sign_entry
import os
secret = os.environ["ACRF_MEMORY_SECRET"]
entry = {"user_id": "john", "role": "Junior Developer"}
signed = sign_entry(entry, secret)
memory_store.write(signed)
Step 3 - Verify on every memory read:
from acrf_memory_guard import read_safe
import os
secret = os.environ["ACRF_MEMORY_SECRET"]
raw = memory_store.read("john")
entry = read_safe(raw, secret)
If the entry has been modified between sign and read, read_safe raises MemoryIntegrityError. Your application fails closed.
AI agents often store user profiles, session state, or contextual information in memory stores. If an attacker tampers with these entries, they can manipulate agent decisions.
Example:
This is ACRF-04: memory poisoning.
acrf-memory-guard makes every memory entry tamper-evident. A signed entry that has been modified will not load.
Set your secret once:
export ACRF_MEMORY_SECRET="your-secret-from-vault"
Verify all entries in a JSON memory store:
acrf-memory-guard verify-store memory_store.json
Output when valid:
OK: 5 entries verified
Output when tampered:
FAIL: 1 of 5 entries failed integrity check
john: Memory integrity check failed.
Expected: sha256:9f4a2b8c1e6d3f7a0b5c9e2d4...
Got: sha256:6343536004920d0fe642b02ca...
The defense is fail-closed. A tampered or unsigned entry never loads.
In production:
What NOT to do:
Wrap your memory store with two helper functions:
from acrf_memory_guard import sign_entry, read_safe
import os
SECRET = os.environ["ACRF_MEMORY_SECRET"]
def write_memory(store, key, entry):
store[key] = sign_entry(entry, SECRET)
def read_memory(store, key):
return read_safe(store[key], SECRET)
That is it. Every memory operation is now integrity-protected. A tampered entry will never reach your agent decision logic.
MP-1 All memory writes signed with a tamper-evident hash
MP-2 Memory reads validated against signature before being used in decisions
MP-3 Deny-by-default on signature mismatch
It only ensures that the entry you read is byte-identical to the entry you signed. That is the ACRF-04 defense pattern.
LangChain memory, CrewAI memory, AutoGen state, custom dict-based stores. If your agent reads structured data that influences decisions, sign it.
Ravi Karthick Sankara Narayanan Kanna Sekar
Apache 2.0
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.0 | 5 May 2026 | 0 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 18:25 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:036a465ab88f48acd65946bceec5151f6ddfdfca11ee9bf93801b0f864a0cfcc