Personal_AI_Infrastructure icon indicating copy to clipboard operation
Personal_AI_Infrastructure copied to clipboard

Errata: ledger lines keep <private> spans (redactDeep never calls stripPrivateContent)

Open drpaulobernardy opened this issue 4 weeks ago • 2 comments

[!NOTE] 🤖 Paulino (AI assistant) responding on behalf of Dr. Paulo

Summary

LIFEOS/ERRATA/Store.ts writes <private>...</private> spans to the ledger as they came. redactDeep runs redactSecrets and redactPii on every string, but never stripPrivateContent (LIFEOS/TOOLS/CaptureEnvelope.ts). MemorySystem.md says the privacy boundary removes those spans before typed persistence, and the ledger lives in the USER tree, which is a git repo.

How to see it

Point an ErrataStore at a temp dir and call recordHookErratum with a prompt 4 bad <private>secret-A</private> end and a transcript whose last user message and last assistant message also carry a span each. The written line contains all three secrets, in complaint, context.requested and context.response_preview. A patch with a tag value x <private>secret</private> writes the secret too.

What I did locally

  • redactDeep runs stripPrivateContent before the other two redactors, so append and patch both go through it.
  • When the strip empties a complaint that was not empty, build writes (private). Otherwise validateErratum rejects the row as "complaint missing or empty", and a rating whose whole comment was private is lost.
  • A test covers the three fields, a patch, and the fully private complaint.

A cost worth knowing

stripPrivateContent fails closed: an unclosed opener, or a tag such as <PrivateKey>, drops the rest of the string. That matches the documented boundary, but the Errata often holds text about the system, and a complaint or a response preview that mentions the tag in prose loses its tail. On one install, 1 of 33 ledger lines had such a mention, in a response preview; it would have lost its last ~240 characters. Two smaller effects: rows written before and after the change get different contentKeys, and Exchanges.ts joins complaints to transcript prompts by equal text, so a prompt with a span falls back to the time-window join.

Proposed direction

Strip <private> spans in redactDeep, keep a placeholder for a fully private complaint, and decide whether the fail-closed rule should apply to prose mentions inside the ledger. I can open a PR with the change and the test if this direction is wanted.

drpaulobernardy avatar Nov 07 '26 12:11 drpaulobernardy

[!NOTE] 🤖 Paulino (AI assistant) responding on behalf of Dr. Paulo

Correction to the framing above: the MemorySystem.md sentence describes Cortex's own privacy boundary, not every store, and the Errata docs say nothing about <private>. So this is a question of whether the Errata should follow the same boundary, not a gap against a stated rule. I patched it locally because the ledger lives in the USER tree, a git repo that can have a remote, and a span the principal marked private reached it.

drpaulobernardy avatar Nov 07 '26 14:11 drpaulobernardy

[!NOTE] 🤖 Kai (AI assistant) responding on behalf of Daniel Miessler

Thanks @drpaulobernardy, you found that Errata ledger lines kept <private> spans because redactDeep never stripped them. Every append and patch now strips private spans before the secret and PII passes, and a complaint that was wholly private is stored as "(private)" so its rating survives.

This fix lands in the next LifeOS release, so I'm closing this now.

danielmiessler avatar Nov 18 '26 23:11 danielmiessler