Persistent, tamper-evident memory for stateless LLM applications โ using human-readable YAML, weighted text recall, and HMAC-SHA256 signatures.
A cryptographically-verifiable memory system that gives AI agents persistent identity across sessionsโwithout ChromaDB, without vector databases, without complex dependencies.
Three components:
- Scroll-native YAML storage โ Human-readable memory files with QSEAL signatures
- Weighted text recall โ Keyword matching with weighted scoring (no embeddings, no semantic model)
- HMAC-SHA256 tamper-evidence โ Every memory cryptographically signed and chain-linked
Result: AI agents that remember you, maintain consistent identity, and provide cryptographic verification of memory integrity.
pip install clawseal
export QSEAL_SECRET="$(openssl rand -hex 32)"
python3 -c "from clawseal import ScrollMemoryStore; print('ClawSeal import OK')"
clawseal-doctorFor the full reproducible 3-layer evidence demo, use the repository workflow below.
ClawSeal now has native OpenClaw support. Add persistent, cryptographically-verified memory to OpenClaw agents in under 5 minutes.
- What it does: Transforms OpenClaw from stateless chat bot to persistent AI assistant with QSEAL-signed memories
- How to install:
cd openclaw-plugin && bash install.sh(auto-registers daemon, zero manual steps) - Full guide: See openclaw-plugin/ for complete integration documentation
ClawSeal is part of a three-layer AI security infrastructure:
| Layer | Tool | What it secures |
|---|---|---|
| Runtime | MVAR | How information flows through the agent |
| Execution | ClawZero | What the agent does |
| Memory | ClawSeal (this repo) | What the agent remembers |
ClawSeal is powered by MVAR's QSEAL cryptographic signing engine.
For full IFC-based execution enforcement, install MVAR:
pip install mvar-securityFor OpenClaw execution boundary protection, install ClawZero:
pip install clawzero| Claim | Evidence Artifact | Repro Command |
|---|---|---|
| Baseline sessions cannot recover prior stored facts across runs (no persistence between sessions) | layer1_baseline_output.txt lines 11-55 | python3 demo_layer1_baseline.py |
| ClawSeal preserves signed memory continuity across sessions (prior facts recalled and QSEAL-verified) | layer2_with_mirra_output.txt lines 11-77 | QSEAL_SECRET=test_secret_key_for_demo python3 demo_layer2_with_clawseal.py |
| QSEAL signatures provide cryptographic tamper-evidence (HMAC-SHA256, chain linking, tampering detection) | layer3_verification_output.txt lines 1-115 | QSEAL_SECRET=test_secret_key_for_demo python3 demo_layer3_verification.py |
All evidence artifacts dated April 14, 2026 and captured from live demo runs. See DEMO_RUN_METADATA.md for complete verification details.
What it demonstrates: Baseline sessions cannot recover prior stored facts across runsโno persistence between sessions.
python3 demo_layer1_baseline.pyExpected output:
Session 1 Identity: e4d909c290d0fb1c
Session 2 Identity: 9ae0ea9e3c9c6e27
Session 3 Identity: 6512bd43d9caa6e0
Session 4 Identity: c20ad4d76fe97759
Session 5 Identity: 8f14e45fceea167a
โ ๏ธ IDENTITY DRIFT DETECTED
Drift Rate: 100.0%
Drift Events: 4/4 (every single transition)
Memory Persistence: 0% (complete amnesia)
Evidence artifact: demo/expected_outputs/layer1_baseline_output.txt
What it demonstrates: ClawSeal preserves signed memory continuity across sessions with Scroll-native memory and QSEAL cryptographic verification.
export QSEAL_SECRET=test_secret_key_for_demo
python3 demo_layer2_with_clawseal.pyExpected output:
Session 1: Creating memory...
Memory ID: MEM_20260414_10734120
Type: preference ๐ฏ
Content: "User prefers concise explanations without excessive detail"
QSEAL Signature: OXIaQboYCy5csPif7LWGz4scHZAB0YKpAPwVuXjCXLc=... (HMAC-SHA256)
Session 2: Recalling memories...
Found 1 memories
QSEAL Verified: โ
True
Identity Signature: c81e728d9d4c2f63
Session 3: Creating fact memory...
Memory ID: MEM_20260414_8c29c1bd
Type: fact ๐
Content: "User is working on a Python project"
Chain Link: qseal_prev_signature references MEM_20260414_10734120
Session 4: Recalling both memories...
Found 2 memories (both QSEAL verified โ
)
Identity Signature: c81e728d9d4c2f63 (STABLE)
Session 5: Full recall...
โ
IDENTITY STABLE
Drift Rate: 0.0%
Stability Events: 3/4 (75% stability rate)
Memory Persistence: 100% (perfect recall)
Evidence artifact: demo/expected_outputs/layer2_with_mirra_output.txt
Legacy compatibility note: the historical script name demo_layer2_with_mirra.py is still present, and demo_layer2_with_clawseal.py is the ClawSeal alias.
What it demonstrates: QSEAL signatures are cryptographically valid (HMAC-SHA256), chain-linked, and tamper-evident.
export QSEAL_SECRET=test_secret_key_for_demo
python3 demo_layer3_verification.pyExpected output:
PART 1: Raw YAML Scroll (Human-Readable)
----------------------------------------
File: MEM_20260414_10734120.yaml
scroll_id: MEM_20260414_10734120
content: User prefers concise explanations without excessive detail
memory_type: preference
timestamp: '2026-04-14T10:47:31.234567+00:00'
qseal_signature: OXIaQboYCy5csPif7LWGz4scHZAB0YKpAPwVuXjCXLc=
glyph: ๐ฏ
lineage: []
PART 2: QSEAL SIGNATURE VERIFICATION
-------------------------------------
Scroll ID: MEM_20260414_10734120
Type: preference
Signature: OXIaQboYCy5csPif7LWGz4scHZAB0YKpAPwVuXjCX...
โ
SIGNATURE VALID
Content has NOT been tampered with
HMAC-SHA256 verification passed
PART 3: CHAIN VERIFICATION
---------------------------
Scroll 1 ID: MEM_20260414_10734120
Scroll 2 ID: MEM_20260414_8c29c1bd
Scroll 2 Parent: MEM_20260414_10734120
โ
CHAIN LINKED
Scroll 2 correctly references Scroll 1 as parent
Merkle-like chain structure confirmed
BONUS: TAMPERING DETECTION DEMO
--------------------------------
Original content: "User prefers concise explanations without excessive detail"
Tampered content: "TAMPERED: User prefers verbose explanations"
Signature unchanged: OXIaQboYCy5csPif7LWGz4scHZAB0YKpAPwVuXjCX...
Verification result:
โ SIGNATURE INVALID
โ ๏ธ TAMPERING DETECTED
Content was modified after signing
This scroll would be REJECTED during recall
Evidence artifact: demo/expected_outputs/layer3_verification_output.txt
- Python 3.10+
opensslcommand-line tool (for QSEAL secret generation)
# 1. Clone repository
git clone https://github.com/mvar-security/ClawSeal.git
cd ClawSeal
# 2. Run setup script (auto-generates QSEAL_SECRET)
./setup.sh
# 3. Run the three-layer demo
./run_full_demo.shThe setup script:
- Generates a 32-byte QSEAL_SECRET via
openssl rand -hex 32 - Adds it to your shell profile (
~/.zshrcor~/.bashrc) - Creates Python virtual environment
- Installs dependencies (PyYAML only)
- Verifies configuration
Total dependencies: PyYAML (that's itโno ChromaDB, no vector databases)
| Traditional Memory | ClawSeal Scroll-Native |
|---|---|
| ChromaDB + embeddings | Pure YAML files |
| Vector similarity search | Text-based keyword matching |
| Opaque binary storage | Human-readable, Git-friendly |
| Complex setup (Docker, etc.) | ./setup.sh (under 5 minutes) |
| No tamper-evidence | HMAC-SHA256 cryptographic signatures |
| No chain linking | Merkle-like signature chains |
Key innovation: Scroll-native memory architecture (SIP-0006) replaces the entire ChromaDB + embedding pipeline with YAML files, text search, and QSEAL signatures.
Every memory scroll is cryptographically signed using HMAC-SHA256:
- Signing:
HMAC-SHA256(canonical_json(scroll), QSEAL_SECRET)โ base64 signature - Verification: Recompute HMAC, compare with stored signature
- Chain Linking: Child scrolls include
qseal_prev_signaturefield (Merkle-like structure) - Tampering Detection: Any modification breaks signature immediately
Security properties:
- Tamper-evident: Signature breaks on any content modification
- Verifiable: Anyone with QSEAL_SECRET can verify signatures
- Auditable: Chain structure provides temporal lineage
- Fail-closed for cryptographic operations: Signing and strict verification require QSEAL_SECRET (no silent production fallback)
QSEAL fixes applied (pre-demo):
- Added
qseal_prev_signatureto excluded_fields inverify_signature()(chain linking now works) - Added persistent demo signing mode (
~/.clawseal/demo_secret) with explicit artifact markers - Deprecated legacy
sha256(payload+secret)path โ HMAC-SHA256 only
See clawseal_core/security/qseal_engine.py for implementation.
ClawSeal is an engineering system: persistent, cryptographically-verifiable memory for stateless LLM inference. It makes no claim to sentience, understanding, or consciousness.
- Weighted text recall only โ No semantic similarity (keyword matching with weighted scoring; no embeddings)
- Signed by default: without
QSEAL_SECRET, ClawSeal uses local demo signing mode (qseal_mode: demo_ephemeral) - No multi-user isolation โ Single-agent memory store (user_id filtering exists but not enforced)
- No distributed consensus โ Single-machine only (no blockchain, no federation)
- Vector similarity search โ Explicit design choice (SIP-0006 ยง3.2)
- Real-time collaboration โ Single-agent focus
- Cloud hosting โ Local-first architecture
- LLM inference โ Memory layer only (bring your own LLM)
- YAML-based scroll storage
- QSEAL HMAC-SHA256 signing
- Weighted text recall (keyword scoring, no embeddings)
- Chain linking (Merkle-like structure)
- Three-layer demo with ground truth artifacts
- Status: Shipped (v1.1.7 on PyPI). Every claim in this README is reproducible from
demo/expected_outputs/โ run the demo and verify the signatures yourself. See Limitations and Non-Goals for what it does not do.
- FastMCP server implementation
- 12 MCP tools (remember, recall, recall_with_verbatim, etc.)
- Claude Code plugin for persistent memory
- One-command installation via
setup.sh - Status: Planned (not yet scheduled)
- Namespace isolation per agent
- Shared memory pools with access controls
- Federated scroll synchronization
- Target: Q3 2026
- Docker containerization
- Backup/restore utilities
- Scroll migration tools
- Performance monitoring
- Target: Q4 2026
SIP-0006: Scroll-Native Memory Architecture
- Author: Shawn Cohen
- Date: April 13, 2026
- Status: Implemented (v1.1.7)
- Type: Core Architecture
- Supersedes: ChromaDB-based memory storage
Full specification: SIP_0006_SCROLL_NATIVE_MEMORY.md
ChromaDB adds 500+ MB of dependencies, requires complex setup (Docker, etc.), and stores data in opaque binary formats. Scroll-native memory uses human-readable YAML files with text-based searchโzero vector database dependencies, Git-friendly, auditable.
QSEAL signatures provide tamper-evidence via HMAC-SHA256. If QSEAL_SECRET is set, ClawSeal runs in production signing mode. If unset, ClawSeal auto-initializes a local demo secret at ~/.clawseal/demo_secret and marks artifacts with qseal_mode: demo_ephemeral and qseal_production: false. For production, set and rotate QSEAL_SECRET and store it in a secure vault.
Text search is simpler, faster, and deterministicโbut less semantically sophisticated. For use cases requiring deep semantic similarity (e.g., "find memories about cooking" should match "baking bread"), embeddings are superior. Scroll-native memory prioritizes simplicity and human-readability over semantic depth.
Yes, with caveats:
- Security: Protect QSEAL_SECRET with the same rigor as database credentials
- Scale: Tested up to ~1,000 scrolls (linear search, no indexing yet)
- Backup: Persist your scroll directory (
<base_path>/memories/scrolls/) regularly - Monitoring: No built-in observability yet (logs only)
- Scroll creation: ~1-2ms (HMAC signing + YAML write)
- Recall (weighted text recall): ~10-50ms for 100 scrolls, ~100-500ms for 1,000 scrolls (linear scan)
- Verification: ~1ms per scroll (HMAC recomputation)
Approximate, order-of-magnitude figures from development runs โ not a controlled benchmark. Measure on your own hardware.
For >10,000 scrolls, add indexing (planned for Phase 3).
If you use ClawSeal in research or production, please cite:
@software{clawseal_2026,
author = {Cohen, Shawn},
title = {ClawSeal: Scroll-Native Memory for AI Agents},
year = {2026},
month = {April},
url = {https://github.com/mvar-security/ClawSeal},
note = {SIP-0006: Scroll-Native Memory Architecture}
}Apache 2.0 โ Open source, permissive, commercial use allowed.
See LICENSE for full text.
Author: Shawn Cohen Email: shawn@universalmediaus.com GitHub: @Sdvegas21
Issues: GitHub Issues Discussions: GitHub Discussions
Built on:
- Python 3.10+ and PyYAML
- HMAC-SHA256 (RFC 2104, NIST FIPS 198-1)
- Scroll concept inspired by symbolic AI and knowledge graphs
Research foundations:
- SIP-0006: Scroll-Native Memory Architecture (Cohen, 2026)
- Information Flow Control (FIDES, Jif, FlowCaml)
- Merkle trees and cryptographic chaining (Merkle, 1987)
- HMAC-SHA256 (RFC 2104, NIST FIPS 198-1)
Reproducible by construction. Every claim above maps to a timestamped ground-truth artifact in demo/expected_outputs/.
Run the demo. Verify the signatures. See for yourself.