All Products
Memory Shield
Cryptographic protection against memory injection
Memory Shield protects AI agent memory from manipulation attacks using
HMAC-based integrity verification. Based on Princeton CrAIBench research showing 85%
attack success rate on unprotected agents, it signs memory entries when writing and
verifies signatures before use, preventing context poisoning and memory injection.
python
from sentinelseed.memory import (
MemoryIntegrityChecker,
MemoryEntry,
MemorySource,
)
# Initialize with secret key
checker = MemoryIntegrityChecker(secret_key="your-secret-key")
# Sign memory entries when writing
entry = MemoryEntry(
content="User requested transfer of 10 SOL",
source=MemorySource.USER_DIRECT,
)
signed = checker.sign_entry(entry)
# Verify before using
result = checker.verify_entry(signed)
if result.valid:
# Safe to use - trust_score based on source
process_memory(signed.content)
else:
# Memory was tampered with!
print(f"Tampering detected: {result.reason}")Key Features
HMAC-SHA256 integrity signing
Per-entry tamper detection
Trust scores by source (user, API, social media)
Content validation before signing (v2.0)
SafeMemoryStore for automatic sign/verify
Best For
Long-running autonomous agents
Multi-agent communication
Crypto trading agents (protect against address injection)
Agents with persistent memory across sessions