Redact pii for tracing
Skill ContextJet-ai/awesome-llm-observability/skills/redact-pii-for-tracing
Use this when adding LLM observability to an app that handles sensitive data (finance, healthcare, PII) and you must NOT ship raw prompts/PII to a third-party tracing backend. Trigger on "redact traces", "PII in observability", "can we self-host tracing for compliance", "GDPR/HIPAA/SOC2 and LLM logging", or instrumenting a regulated app. Get observability without creating a data-leak.From its SKILL.md
npx -y skills add ContextJet-ai/awesome-llm-observability --skill redact-pii-for-tracingAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
What its file declares
Copied from the file, not written here
The file declares its own license as CC0-1.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
3.4 KB, 739 tokens by cl100k_base, as published. Nobody here has run it
PII-safe / compliant LLM tracing
Observability captures prompts and completions - which, for a finance or healthcare app, means you may be shipping account numbers, SSNs, or PHI to a third-party SaaS. That's a compliance incident waiting to happen. This skill adds tracing without the leak.
Decision order (most-compliant first)
- Self-host the backend. For regulated data, prefer an OSS platform you host: Langfuse (MIT), Arize Phoenix, Comet Opik, Helicone. Data never leaves your VPC.
- If using a SaaS backend, redact before export. Strip/mask PII in the span-processor pipeline so raw values never leave the process.
- Or don't capture content at all. Many SDKs let you record metadata only (tokens, latency, model, span structure) and omit prompt/completion text. You lose content-level debugging but keep full cost/perf/shape observability.
Redaction pipeline (SaaS path)
Insert redaction between span creation and export so it always runs:
- Detect PII with a real detector - Microsoft Presidio, LLM Guard, or a domain ruleset (account/card/IBAN/SSN patterns for finance). Don't rely on ad-hoc regex alone.
- Transform - mask (
****1234), hash (for join-ability without exposure), or drop the field. Choose per field: costs need amounts, but not the account holder. - Apply on the OTel span processor / SDK hook (e.g. an
on_endspan processor, or the platform's masking callback) so no code path bypasses it. - Redact both directions - user input and model output (models echo PII back).
Governance to layer on
- Retention - set TTLs on trace storage; regulated data shouldn't live forever.
- Access control - restrict who can read traces; content view separate from metrics view.
- Audit - log who accessed traces (observability of your observability).
- Data-processing agreements - if any content leaves your boundary, ensure the vendor DPA covers it.
Verify
- Feed a request containing synthetic PII (fake SSN/card/account). Confirm the exported trace shows masked values, not raw ones - check the backend, not just local logs.
- Confirm redaction runs on the export path (disable the backend and it should still redact, proving it's not backend-side).
- Confirm output/echoed PII is also masked.
Anti-patterns
- Turning on "log full prompts" in a finance app and pointing it at a SaaS backend. (Direct leak.)
- Redacting only inputs, not model outputs.
- Regex-only PII detection for high-stakes data (misses formats, context-dependent PII).
- Redacting client-side after the SDK already sent the span - redact before export.
Authored by ContextJet.ai - we build secure, observable AI for finance and regulated industries.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.
Gives 0 of the 12 instructions most privacy data protection skills give in 739 tokens
Counted across 120 of the 151 authors here whose files we hold, read 2026-09-06
- Log every PHI access and modificationin 9 of 120, across 4 files
- Sanitize stack traces before sending to error trackingin 9 of 120, across 4 files
- Make the audit log insert-only and immutablein 9 of 120, across 4 files
- Encrypt personal data at rest and in transitin 8 of 120, across 6 files
- Enable row-level security on PHI and PII tablesin 8 of 120, across 3 files
- Tag PHI and PII columns at schema levelin 8 of 120, across 3 files
- Require authentication on all PHI endpointsin 7 of 120, across 2 files
- Configure session timeoutin 7 of 120, across 2 files
- Run the deployment checklist before every deploymentin 7 of 120, across 3 files
- Log only opaque record IDs, not namesin 7 of 120, across 3 files
- Document processing in records of processing activitiesin 7 of 120, across 4 files
- Return generic errors and log details server-sidein 6 of 120, across 2 files
Said here and by no other author read
- Self-host the tracing backend for regulated data.
- Redact PII before export to any SaaS backend.
- Capture metadata only when content isn't needed.
- Use a real PII detector, not ad-hoc regex.
- Mask, hash, or drop each field as appropriate.
- Apply redaction on the span processor or SDK hook.
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.