Skip to content

Add LLM PII and secret redaction skill and prompt - #92

Merged
rmkr-dev merged 3 commits into
mainfrom
add-llm-pii-redaction
Nov 8, 2026
Merged

rmkr-dev merged 3 commits into
mainfrom
add-llm-pii-redaction

Conversation

@rmkr-dev

@rmkr-dev rmkr-dev commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

Adds the llm-pii-redaction-guardrails skill and matching add-llm-pii-redaction prompt.

Nothing in the catalogs already covered redaction for an LLM gateway. Logging, prompt-injection, eval, and gateway routing mention the problem and leave the pipeline to another entry. This pair is that pipeline.

  • Redact once, before the provider call, and reuse that view for logs, traces, prompt caches, and eval fixtures.
  • Deterministic detectors (email, phone, Luhn-checked cards, named national IDs, API keys, JWTs), an optional recognizer, and an allowlist.
  • Per-route mode: mask, typed placeholder, or reversible tokens with a request-scoped vault. Secrets are never restored. Restore only on the response to that caller.
  • Overlapping spans redact the union of every surviving finding. A slice that meets an API key, JWT, or other secret stays non-restorable, including when a longer personal-data span contains it or the spans only partly overlap. Reversible-mode tests cover that nested case and a partial overlap. Combining spans does not mean the detectors found every secret.
  • Stream hold-back so a value or placeholder split across chunks is still caught.
  • Fail-closed by default, with fail-open only where a route opts in.
  • Counters by entity type and action, with no raw values. Latency sits in the gateway budget.
  • Tests include golden fixtures, false positives and negatives, a leak test against a stub provider and the log appender, and the nested and partial-overlap cases above.

Only skillbook/skills.json and promptbook/prompts.json change. Catalogs are 54 skills and 54 prompts. Local site check passed.

@rmkr-dev
rmkr-dev merged commit 4f7a895 into main Nov 8, 2026
1 check passed
@rmkr-dev
rmkr-dev deleted the add-llm-pii-redaction branch November 8, 2026 05:23
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.

1 participant