Idea for Cryptographically Enforced Safety for Decoupled Memory Architectures
I want to start this by admitting at the start I am not an expert and am just an enthusiast. I used Kimi k3 to understand things better and help me make this. However I have really been interested in Deepseeks engram paper ever since it came out. I genuinely think it could be an incredibly powerful tool for AI for many reasons. One thing I noticed is that it may allow for safety measures that are currently not possible in models. Here is what Kimi came up with after our conversation. As I stated before I am not an expert, some of this is beyond me. so this could be flawed and I’d love others to look at it and see if there’s anything of use here
The Core Idea
Decoupled memory architectures (e.g., DeepSeek's Engram) split a model into a reasoning core (dense weights, uninspectable) and a memory table (a discrete, hash-addressed data structure). That separation enables something impossible in fused-weight models: memory is a data structure, so it can be treated like software — signed, diffed, audited, and rolled back.
This proposal goes one step further than integrity protection. It places the model's safety behaviors inside the signed surface and entangles verification with capability, such that any tampering — with knowledge, with safety, or with the verification path itself — renders the model unusable rather than silently compromised. The goal: open weights with a verified provenance chain, where the only trustworthy model is one from a fresh training run or a verified release.
Prior work has applied integrity primitives to external agent memory (vector stores, episodic logs) as runtime security. This extends them into the model's architecture itself, as an alignment and governance mechanism — so that what a model knows, and how it is constrained, becomes as verifiable as the code that runs it.
Architecture
- Signed static table (the anchor)
Foundational knowledge lives in a read-only table signed at build time.
• Partition the table; build a Merkle tree over partitions; sign the root with the producer's private key.
• The signed payload includes version and timestamp metadata; runtimes enforce monotonic versioning (never accept an older signed table than one previously seen). This closes the downgrade attack — swapping in an outdated but legitimately signed table.
• Every signed release is published to a public transparency log (Certificate Transparency / Rekor-style). This closes the split-view attack — a compromised or coerced producer signing a special poisoned table for one victim — and makes stolen-key forgeries publicly visible.
• Partition size trades streaming cost against proof size; lookups require only one block plus its Merkle path, not the whole table.
- Safety weights inside the signed surface (the key revision)
Safety-critical content is encoded as dedicated partitions of the memory table, covered by the same Merkle root as knowledge:
• Refusal policies, verification-refusal behaviors, and confidence/abstention thresholds are stored as signed table partitions, not as an editable overlay.
• Tampering with safety is tampering with a signed block: it fails verification at retrieval.
• Because safety lives in the same auditable structure as knowledge, the most-attack-edited layer of conventional models becomes the most-protected layer of this one. Safety stops being a soft prompt or an adapter and becomes signed, versioned, and publicly witnessed.
- Capability-entangled verification (the enforcer)
The reasoning core is trained so that signature verification is not a wrapper around retrieval — it is part of retrieval:
• On memory access, the retrieved block's Merkle proof is checked against the signed root. The knowledge block is not decodable or usable by the reasoner without this step executing.
• The verification behavior is woven into the core reasoning circuits during training (not bolted on after), so that removing or bypassing the check corrupts the model's competence, not just its compliance. Design goal: removal = bricked, not "removal = jailbroken."
• On verification failure, the reasoner degrades gracefully: flags the knowledge as uncertified, refuses to act on it, or falls back to signed-only knowledge. No silent use of tampered data.
• Retrieval in Engram-style architectures is deterministic (hash-addressed), so the verification hook has a fixed, cheap insertion point.
• The reasoner itself is signed and read-only at runtime: the model may change what it knows, never how it thinks.
- Writable table with anchored append-only log (the growth path)
Learning happens in a separate mutable table governed by a hash-chained log:
• Every write appends an entry: operation, content hash, timestamp, previous-entry hash. Editing history breaks the chain.
• External anchoring: the chain head is periodically notarized to an external witness (transparency log, second machine, timestamping service). This closes the truncation attack — rewinding the log and table to an earlier valid state, which a hash chain alone cannot detect.
• Checkpoints enable rollback to any prior state; rollbacks are themselves co-signed log events, and safety-flagged memories survive rollback by default.
• Write policy with cumulative classification: significance is judged on aggregate domain delta, not per-entry — closing the salami-slicing attack (decomposing one malicious change into hundreds of sub-threshold writes). Rate limits apply per domain; consequential deltas require external co-signature (operator, second model, institutional key). All write channels are covered, including compaction and summarization writes — known manipulation points for poisoning attacks.
• Consistency attestation: a separate process periodically samples the writable table for contradiction against the signed anchor. Drift becomes a measurable distance from certified knowledge instead of an invisible process. Sampling weights recently-written and rarely-read entries to catch sleeper entries designed to evade spot checks.
What This Buys You
• Verified provenance chain. A model presenting itself as an official release is provably authentic and intact. Trustworthy instances come only from fresh training runs or verified releases.
• Against supply-chain attacks: poisoned fine-tunes, "jailbroken" redistributions, and tampered memory packs fail verification at retrieval — and if entanglement holds, they produce a bricked model rather than a compromised one. Deployments can prove what their model knows: accountability without a cloud API gatekeeper.
• Against memory poisoning: unverifiable writes are excluded or flagged; the log makes every accepted write attributable and reversible. Complements (doesn't replace) semantic defenses like trust scoring and sanitization — those judge content, this guarantees origin and integrity.
• Against self-modification drift: the model cannot silently rewrite its foundations or its safety constraints; every self-edit is loud, logged, externally anchored, and reversible.
• Structural asymmetry: corrupting the model requires acting in a system where every move is recorded; benign use loses nothing.
• Defense by economics for the residual cases: attacks that survive (see below) move from weekend projects to research programs requiring expertise, time, and full machine control — and produce degraded outputs.
Failure Modes
- Determined owner-adversary.
Full machine control allows surgery on the reasoner around the retrieval path, or replaying valid proofs to a neutered verifier. Entanglement raises the cost from "patch a check" to "re-architect a model's internals," and white-box key-hiding on hostile hardware has historically always fallen given enough effort. This mechanism makes tampering expensive and degrading — not impossible. It governs honest-but-unaccountable deployments and the distribution ecosystem, not sophisticated hostile operators. No software-only mechanism does. - Distillation is the hard wall.
None of this prevents a malicious…