From langchain-pack
Implement LangChain data privacy and handling best practices. Use when handling sensitive data, implementing PII protection, or ensuring data compliance in LLM applications. Trigger with phrases like "langchain data privacy", "langchain PII", "langchain GDPR", "langchain data handling", "langchain compliance".
How this skill is triggered — by the user, by Claude, or both
Slash command
/langchain-pack:langchain-data-handlingThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
- [Overview](#overview)
Best practices for handling sensitive data, PII protection, and compliance in LangChain applications including detection, masking, retention, consent, and audit logging.
Build a PIIDetector class with regex patterns for email, phone, SSN, credit card, IP address, and date of birth. Implement detect(), mask(), and redact() methods.
Wrap chains with PII protection using RunnableLambda preprocessing that redacts PII before sending to the LLM.
Implement DataRetentionManager with configurable retention periods, auto-cleanup of expired interactions, and GDPR right-to-erasure support.
Build ConsentManager with consent types (LLM processing, retention, analytics, training) and decorator-based consent enforcement.
Create AuditLogger and AuditCallback to log all LLM calls with user ID, model, token count, and PII detection status.
See detailed implementation for complete PII detector, privacy pipeline, and compliance code.
| Issue | Cause | Solution |
|---|---|---|
| PII not detected | Missing pattern | Add regex to PIIPattern list |
| Retention not enforced | Cleanup not scheduled | Add cron job for cleanup |
| Consent check failed | User not registered | Create consent record first |
Basic usage: Apply langchain data handling to a standard project setup with default configuration options.
Advanced scenario: Customize langchain data handling for production environments with multiple constraints and team-specific requirements.
Use langchain-security-basics for additional security measures.
npx claudepluginhub aiminnovations/claude-code-plugins-plus --plugin langchain-packGuides collaborative design exploration before implementation: explores context, asks clarifying questions, proposes approaches, and writes a design doc for user approval.
Creates structured, bite-sized implementation plans from specs or requirements before writing code. Useful for breaking down multi-step tasks into testable steps with file structure and task boundaries.
Synthesizes the current conversation into a structured spec (PRD) and publishes it to the project issue tracker with a ready-for-agent label, without interviewing the user.
4plugins reuse this skill
First indexed Jul 11, 2026