Skip to content

Configurable Redaction

sarmakska edited this page Jun 4, 2026 · 1 revision

Configurable redaction

slipstream's memory, dashboard log and replay exports stay on the local machine, but they still record what the agent saw. Configurable redaction lets you scrub patterns (API keys, customer emails, internal hostnames) before they ever hit the store.

The file

.claude/slipstream/redact.json, at the project root. Created on first session if missing.

{
  "patterns": [
    { "name": "openai-key", "regex": "sk-[A-Za-z0-9]{32,}", "replace": "[OPENAI_KEY]" },
    { "name": "anthropic-key", "regex": "sk-ant-[A-Za-z0-9-_]{32,}", "replace": "[ANTHROPIC_KEY]" },
    { "name": "aws-access", "regex": "AKIA[0-9A-Z]{16}", "replace": "[AWS_KEY]" },
    { "name": "github-token", "regex": "gh[pousr]_[A-Za-z0-9]{36,}", "replace": "[GH_TOKEN]" },
    { "name": "bearer", "regex": "Bearer\\s+[A-Za-z0-9._-]+", "replace": "Bearer [REDACTED]" },
    { "name": "email", "regex": "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}", "replace": "[EMAIL]" }
  ],
  "scope": ["observations", "dashboard", "export"]
}

Each entry has a name (used in audit output), a JavaScript-compatible regex, and a replace string.

Default patterns

Ship-day defaults cover the obvious leakers: OpenAI, Anthropic and AWS keys, GitHub tokens, generic Bearer headers, and email addresses. They are enabled by default and can be removed by editing the file. The defaults are conservative on purpose; nothing matches plain prose.

Adding a custom pattern

Append to the patterns array. The regex is compiled with the g flag at load. Example for an internal hostname scheme:

{ "name": "internal-host", "regex": "[a-z0-9-]+\\.internal\\.example\\.com", "replace": "[HOST]" }

Restart the session (or call sp_remember of any text to force a reload) and the new rule applies to subsequent captures.

Scope of application

The scope array controls where the patterns run:

  • observations — strip before writing to the observation store. This is the most important scope; the memory is searchable, so anything captured here is recoverable.
  • dashboard — strip before appending to the dashboard event log. The dashboard tab shows redacted text.
  • export — strip when building a slipstream export archive, even if the underlying store still contains the raw values. This lets you keep richer local data but share scrubbed bundles.

Redaction runs on tool input and output strings. It does not alter what the agent itself sees in the live session — only what gets persisted. If you need pre-send redaction (so the model itself never receives the secret), use the editor's own redaction features upstream of slipstream.


SarmaLinux . sarmalinux.com . Repository

Clone this wiki locally