Skip to content

feat(memory): opt-in redaction-at-capture (KIT_MEMORY_REDACT) - #91

Closed
sandstream wants to merge 1 commit into
mainfrom
feat/memory-redact-at-capture
Closed

sandstream wants to merge 1 commit into
mainfrom
feat/memory-redact-at-capture

Conversation

@sandstream

Copy link
Copy Markdown
Owner

No-egress roadmap (#80): spillage prevention for the secret-dense memory store.

The store is raw by default (a key in any transcript is persisted to memory.db in cleartext). With KIT_MEMORY_REDACT=1, secret-shaped substrings in a message's content and a tool's tool_input are masked (same redactSecrets patterns) before they're written — the secret never lands in the DB.

Opt-in / off by default → no behavior change (raw storage stays the documented default; full suite 1445/0). FTS search still works over the redacted text for non-secret terms. Row-level class-tagging is a further follow-up. Independent of the other branches.


Generated by Claude Code

The memory store is secret-dense and raw by default (a key that appears in any
transcript is persisted to memory.db in cleartext — a stolen-laptop / backup
spillage risk). For a regulated/air-gapped deployment this adds an opt-in
capture-time redaction: with KIT_MEMORY_REDACT=1, secret-shaped substrings in a
message's `content` and a tool's `tool_input` are masked (via the same
`redactSecrets` patterns) BEFORE they are written, so the secret never lands in
the DB at all.

Off by default → no behavior change (raw storage remains the documented
default; full suite 1445/0). FTS search still works over the redacted text for
non-secret terms. Class-tagging of stored rows is a further follow-up.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg
@github-actions

Copy link
Copy Markdown

✅ Docker image built successfully

  • CLI image: docker.io/sandstream/kit:test

sandstream added a commit that referenced this pull request Jun 24, 2026
…per → 1.25.0 (#99)

Recovers two redaction PRs that conflicted with the 1.23/1.24 work:
- #91 KIT_MEMORY_REDACT=1 masks secret-shaped substrings in content/tool_input
  before they land in memory.db (spillage prevention). Off by default. Integrated
  into the current insertMessage/insertToolUse (post cache-column changes).
- #92 remove the dead src/utils/redacted.ts Redacted<T> wrapper (no importers;
  redactSecrets does the masking).

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@sandstream

Copy link
Copy Markdown
Owner Author

Recovered + merged via #99 (1.25.0). This PR conflicted with the 1.23/1.24 work; its change was rebased onto current main and landed there.

@sandstream sandstream closed this Jun 24, 2026
@sandstream
sandstream deleted the feat/memory-redact-at-capture branch June 30, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants