Repository navigation
v0.4.0
Added
-
Namespace allowlist (#8).
lethe_tagaccepted a namespace straight from
its caller, so an agent driving the MCP server could direct a delete at any
table the configured database user could write — not only the stores Lethe
was set up to sweep. Confirmed by reproduction against v0.3.1: a single tag
call naming an unrelated table, then the ordinary preview/confirm/forget
sequence, deleted the row and produced a certificate reading
all_verified: true. The certificate was honest, which is what made it
hard to notice — nothing malfunctioned.Lethe(allowed_namespaces={"pgvector": {"documents"}})and
LETHE_ALLOWED_NAMESPACES=pgvector:documents,...name the(store, namespace)pairs a deployment may ever tag, and therefore ever delete from.Enforced in
Lethe.tag, not at the MCP boundary: the ledger is what
forget()deletes from, so guarding one entry point would leave the CLI, the
library andreconcile(tag_untracked=True)able to write entriesforget()
would then honour.reconcilevalidates every target before scanning, so a
refusal cannot leave a partial remediation.forget()enforces it too, not onlytag(). A ledger row can predate
the allowlist, or be written by anything with SQL access to
lethe_provenance, and the delete path is the one that matters. A layer
outside the allowlist is recorded as unhandled — the same shape as a store
with no configured connector — soall_verifiedgoes False and the
certificate reports that a layer was found and deliberately not swept, rather
than omitting it. Allowed layers in the same run are still swept; the ledger
is preserved so an operator can fix the configuration and retry.Unset means unrestricted, preserving existing behaviour on upgrade — but
a value that is set and empty is a misconfiguration, not a way to say "allow
nothing", because running unrestricted due to a variable expanding to nothing
is the exact failure this control exists to prevent.lethe_statusnow
reportsnamespace_allowlistso an operator can see which mode they are in,
and MCP returns aNAMESPACE_NOT_ALLOWEDenvelope rather than an INTERNAL
traceback. -
lethe ledger-scope— lists what the ledger holds against the configured
allowlist, and--purge-disallowedclears rows outside it (removing Lethe's
record that they exist; it does not delete from the store). Configuring an
allowlist does not retroactively clean the ledger, and a row tagged before it
existed blocks that subject from ever certifying again — so it has to be
visible and clearable. Exits non-zero while out-of-policy rows remain.
Fixed
lethe forget— the command that actually deletes — did not apply the
allowlist at all; it was wired intoreconcileonly.preview()(and solethe_forget_preview) did not mark layers that
forget()will refuse, so the confirm token was minted over a blast radius
that misstated what would happen. Layers now carryallowed.build_contextvalidated the allowlist only after opening a database
connection. Configuration is now checked before any side effect, so a
malformed allowlist fails startup rather than leaving a connection open.