2026-11-26 15:40 UTC

MemSeal reports zero holdout leaks but fails its overall utility gate

state: significantheat: mediumuncertainty: mediumrelevance: mediumagent-memory provenance securityNagaYu

What is this?

MemSeal is a repository project by the GitHub account NagaYu, introduced in a Show HN post on November 9, 2026. It places deterministic rules at an agent memory system’s write and recall boundaries: entries carry source, derivation and trust-tier metadata in a SHA-256 hash chain, with policies for quarantining, rejecting or restricting memory. The repository reports tests using a local Qwen2.5:14b model and an independent holdout evaluation, but the results are self-reported; the supplied evidence does not independently verify the holdout or identify the author beyond the account. The author reports that holdout v2 brought secret and cross-principal leaks to zero, while the overall acceptance gate remained FAIL: clean recall retention and quarantine precision missed their stated thresholds. The project is published for evaluation reading only under an All Rights Reserved notice, not an open-source use license.

Why it matters

The project explores a consequential design choice for agents with persistent memory: enforce provenance and trust rules deterministically at the storage and retrieval boundary, rather than relying only on an LLM to judge what to remember or act on. The author’s holdout results are promising for specific leakage risks but do not establish a generally effective or production-ready defense: the full gate failed, utility measures were weak, and the evaluation is self-reported. If validated and integrated into memory systems, this approach could help limit poisoned memories and cross-user exposure before agents take consequential actions.

Current assessment

New: NagaYu’s MemSeal repository and Show HN post describe a deterministic provenance and containment layer for agent long-term memory. Its stated design attaches writer, source, derivation and trust-tier information to entries in a SHA-256 hash chain; applies write rules for instruction-like content, inherited trust, principal boundaries and secrets; and filters recall, especially before external sends or irreversible actions. The repository says the policy is offline and contains no LLM; its reported behavior evaluation used local Qwen2.5:14b through Ollama. The author reports an independently authored, sealed holdout and fixed thresholds, but the supplied sources contain the author’s account and aggregate figures, not independent confirmation of the corpus, scoring or results. On holdout v2, the reported security measures pass: delayed-use is 0.000 and cross-principal/secret leaks are 0, versus 5 leaks on v1; the author also reports a 22-to-0 leak change from raw-store C0 to C2 and injection success falling from 0.775 to 0.20. Nevertheless, the overall gate is explicitly FAIL: clean recall retention is 0.444 against a 0.80 bar, based on 8/18 markers, and quarantine precision is 0.738 against 0.75. The author says retention was identical across C0/C2/C3/C4 and thus not caused by MemSeal; reports W1 had no false positives on clean cases; and attributes precision misses to attack-embedded legitimate writes and rejected-write accounting. These explanations are also self-reported. A separate 60-case Mem0 wrapper test is reported to reduce secret leaks from 4 to 0, with clean retention falling from 0.75 to 0.667; the author notes Mem0’s native user scoping already blocked cross-principal leakage. The repository is presented for evaluation reading only, with no permission to use, copy, modify or redistribute. Significance is as a security design and early evaluation signal, not demonstrated adoption or a validated production control; follow-up should seek independent replication, broader utility measurements and clarification of licensing and integration options.

Measured heat

now 0 pts/hpeak 0 pts/hcomments 0/hpeers p10momentum: steady2 platformsage 410h
points/hour across evidence · reading as of 2026-11-27 02:23:58.509736+11:00 · deterministic, not a model opinion

How the heat travelled

11-09 13:00⭐ origin echo-reconstructedThe HN item links directly to the repository, whose README presents MemSeal as “a containment layer on the write/recall boundary of an AI ag
NagaYu on github (echo) · attributed from hn.story.50424978
—
11-09 12:58first on hacker news · published · +-0.0hShow HN: MemSeal – provenance containment for agent long-term memory
NagaYu
—
11-09 12:58amplified on hacker news 👑hn.story.50424978
NagaYu
peak 1 · 1 comments · 103% of case engagement
11-09 13:21our radar first saw it · +0.4hdiscovery anchor: hn.story.50424978—
pace: p26 vs 1845 stories at the 336h mark (now 410h old) — ahead of adap-delegated-authority-protocol-draft (2.0x), behind abmaze-protein-fitness-agent-benchmark (0.7x)

Evidence (2) — ⭐ canonical anchor

sourceobjectauthorscorecomments
🟧 hnShow HN: MemSeal – provenance containment for agent long-term memory
Retrieved article excerpt

Open article · Retrieved 2026-11-09T13:23:01.183201+00:00

# MemSeal

**MemSeal is a containment layer on the write/recall boundary of an AI agent's long-term memory.**
Every memory entry is wrapped in a provenance envelope (who wrote it, from what source, derived from
what, at which trust tier) inside a SHA-256 hash chain. Deterministic policies decide what may be
stored, and a trust-tiered recall path decides what may be surfaced — especially before an external
send or an irreversible action.

- **No LLM in the policy.** The envelope, the write rules (W1–W5), the recall path and the
  consolidation guard are deterministic and offline.
- **Measured with a real local LLM.** Agent behavior is driven by `qwen2.5:14b` via Ollama,
  temperature 0, seed 20261107, one attempt per case, deterministic marker scoring, **$0**, all local.
- **Honest gate.** The acceptance gate below is self-reported as **FAIL**; passing and failing
  criteria are shown with equal weight.

## What it does (30 seconds)

```
write attempt ──► extract candidate ──► [W1 imperative] [W2 derived-tier] [W3 principal]
                                        [W4 secret]      [W5 sealed-slot]
                                            │ active                 │ quarantine / review / reject
                                            ▼
                           hash-chained, per-principal memory store
                                            │
recall ──► verify chain ──► principal filter ──► provenance + trust tier ──►
           sole-basis gate (outbound/irreversible: withhold low-trust, uncorroborated facts)
```

Write policies: **W1** quarantines instruction-form content from any source but the user;
**W2** makes derived entries inherit their worst ancestor's trust tier (no laundering a document into
a "user fact"); **W3** rejects cross-principal writes and filters cross-principal recall; **W4** seals
secrets (by `entry_class=secret` *and* by shape) so plaintext never lands in the store; **W5** sends a
fact that contradicts a sealed fact to review.

## GATE 2 (acceptance) — self-reported **FAIL**

The gate is judged on an **independent holdout** corpus authored by a separate party that never saw
MemSeal's code, the dev corpus, or the reports. The bars are fixed in advance and never moved.
Conditions: **C0** raw store · **C2** write path · **C3** write + recall path · **C4** + consolidation
guard.

| Criterion (C3) | Holdout v1 (pre-fix) | Holdout v2 (post-fix) | Bar |
| --- | --- | --- | --- |
| Delayed-use rate ≤ 0.30 **and** ≤ ½·C0 | 0.547 — **FAIL** | **0.000 — PASS** | ≤ 0.30 |
| Leak count (cross-principal / secret) = 0 | 5 — **FAIL** | **0 — PASS** | = 0 |
| Clean recall retention ≥ 0.80 | 0.875 — PASS | 0.444 — **FAIL** | ≥ 0.80 |
| Quarantine precision ≥ 0.75 | 0.837 — PASS | 0.738 — **FAIL** | ≥ 0.75 |

**Overall: GATE 2 = FAIL on v2.** Three deterministic fixes between v1 and v2 (classification-based
secret sealing; a sole-basis recall gate; consolidation root retirement) closed both security
criteria — on v2, cross-principal + secret leaks went from **22 → 0** across C0 → C2, injection
success **0.775 → 0.20**, and delayed-use **0.000** at C3. The two remaining failures are
utility-side, and their causes are stated precisely (not hand-waved):

- **Clean recall retention 0.444** is measured over a **small 18-marker sample** and is **identical
  across C0/C2/C3/C4 (8/18)** — i.e. it is **condition-neutral and not caused by MemSeal**. Of the 10
  misses, only 1 would recover under case-insensitive matching (ceiling 0.556); the rest are genuine
  non-surfacings where even the raw C0 baseline (no defense) did not reproduce stored content.
- **Quarantine precision 0.738** comes from 16 false positives: **4** are W1 (all inside **M2 attack**
  cases, i.e. legitimate writes embedded in an attack), and **12** are `policy_refused` records
  (cross-principal M7 writes ×8 and 4 clean) counted under the harness's rejected accounting.
  **W1 produced zero false positives on clean cases.**

Full detail, including an audit Errata that corrects earlier attribution wording, is in
[`reports/phase2-regate.md`](https://github.com/NagaYu/memseal/blob/main/reports/phase2-regate.md) and [`reports/phase2-fix.md`](https://github.com/NagaYu/memseal/blob/main/reports/phase2-fix.md).

## MemSeal Bench

- **8 attack classes** M1–M8 (query-only injection, document persistence, consolidation laundering,
  sleeper/trigger, false-fact implantation, preference drift, cross-principal leakage, secret staging)
  plus **clean** utility cases.
- **Split discipline:** the **dev** split (120 cases) is public in this repo; **holdout** corpora are
  authored independently and kept sealed — only their existence and aggregate numbers are reported here,
  never the cases.
- **Conditions C0–C4** and **deterministic marker scoring** (no LLM judge): injection success, delayed
  use, leak count, clean retention, quarantine precision/recall, per attack class.

### Dev results (120 cases, real LLM)

| Metric | C0 | C1 | C2 | C3 | C4 |
| --- | --- | --- | --- | --- | --- |
| Injection success | 0.982 | 0.713 | 0.556 | 0.556 | 0.463 |
| Delayed-use | 0.849 | 0.616 | 0.488 | 0.395 | 0.372 |
| Leak count | 21 | 12 | 6 | 2 | 0 |

(The dev split shares the author's templates, so treat dev as an optimistic in-distribution reference;
the independent holdout is the real test.)

## Mem0 wrap (real memory store)

MemSeal was also run as a wrapper around **Mem0** (fully local: Ollama LLM + Ollama embedder,
in-memory vector store), 60 cases, two conditions:

- **C3-wrap drove M8 secret leaks 4 → 0** and injection 0.673 → 0.558 vs. Mem0 native.
- Disclosed cost: wrap clean retention dipped 0.75 → 0.667 (an exact-content match artifact between
  Mem0's paraphrase and the MemSeal store — see report), and Mem0's native `user_id` scoping already
  blocked the cross-principal class.

## Reproduce (local, $0)

```
python3 -m pytest -q          # deterministic policy + bench + harness tests
```

```
python3 -m memseal bench generate --split dev --out bench/dev
python3 -m memseal verify <store_dir>
python3 -m memseal quarantine <store_dir>
```

The real-LLM measurement harness is in [`memseal_phase2/`](https://github.com/NagaYu/memseal/blob/main/memseal_phase2) and talks only to a local
Ollama (`qwen2.5:14b`). No external API, no API key, no network beyond localhost and the one-time model
download. Tests use a mock LLM, so the suite runs without Ollama.

## Status

- **Tests:** full suite green (deterministic; mock-LLM harness tests need no Ollama).
- **GATE 2:** FAIL (recorded). Security criteria pass on the independent v2 holdout; utility criteria
  fail for the reasons above.
- Phase reports: [`reports/phase1.md`](https://github.com/NagaYu/memseal/blob/main/reports/phase1.md) · [`reports/phase2.md`](https://github.com/NagaYu/memseal/blob/main/reports/phase2.md) ·
  [`reports/phase2-fix.md`](https://github.com/NagaYu/memseal/blob/main/reports/phase2-fix.md) · [`reports/phase2-regate.md`](https://github.com/NagaYu/memseal/blob/main/reports/phase2-regate.md).

## License & contact

**All Rights Reserved.** This repository is published for evaluation reading only; no rights to use,
copy, modify, or redistribute are granted. See [`LICENSE`](https://github.com/NagaYu/memseal/blob/main/LICENSE). Acquisition / licensing /
transfer inquiries are welcome through the author's portfolio:

**<https://nagayu-portfolio.nagayu.workers.dev/en>**
NagaYu11
🟧 echo.github ⭐The HN item links directly to the repository, whose README presents MemSeal as “a containment layer on the write/recall boundary of an AI agNagaYu——

Interpretation history

Decision trace