Skip to content

Secret vault (#60)

security.redact_secrets with vault: true replaces each detected secret by <SECRET_n> and keeps the originals in an in-memory SecretVault owned by the WarTools instance. The result carries a random vaultId.

  • Per session, in memory, TTL 15 min (refreshed on each vault: true call), max 1000 entries per session and 1000 live session vaults (expired vaults are swept when a new one opens; past the cap the vault closest to expiry is evicted). Never part of KvStore, snapshots, checkpoints, PolicyStateStore or traces. toJSON / repr / ToString return only [SecretVault n entries]. resetSession (Node) clears it.
  • Never cached: security.restore_secrets, security.vault_clear and security.redact_secrets with vault: true bypass the idempotency cache even with allowSideEffects, so plaintext never reaches the PolicyStateStore and a cleared vault stays cleared.
  • Traces: RedactingTraceSink masks every live vault value ([REDACTED_VAULT]) before the PatternEngine runs, even when the pattern engine would not have detected it.
  • security.restore_secrets { text, vaultId? } replaces known canonical placeholders (<SECRET_1>, not <SECRET_01>) in one non-recursive pass; unknown ones stay untouched. It returns real secrets, so it is requiresApproval and sideEffects (never cached or retried by default). A wrong or missing vault, another session, or an expired vault gives INVALID_INPUT without echoing any value. vaultId is compared in constant time.
  • security.vault_clear discards the session's vault and returns { cleared }.
  • Input that already contains <SECRET_ is rejected when vault: true (it would be ambiguous on restore).