contextjet-ai/awesome-llm-observability/redact-pii-for-tracing
Claude Code and agent skill by contextjet-ai/awesome-llm-observability
- community
Checking that the SKILL.md file is still in the repository.
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.
Install
npx vskill@latest install contextjet-ai/awesome-llm-observability/redact-pii-for-tracingSKILL.md
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 - Presidio 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._
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/redact-pii-for-tracing/SKILL.md
Popularity
- Repository stars
- 42
- Repository forks
- 30
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/contextjet-ai/awesome-llm-observability/redact-pii-for-tracing)