openrouter-data-privacy

Featured

Implement data privacy controls for OpenRouter API usage. Use when handling PII, meeting GDPR/CCPA requirements, or protecting sensitive data in prompts. Triggers: 'openrouter privacy', 'openrouter pii', 'openrouter gdpr', 'openrouter data handling'.

AI & Automation 2,926 stars 433 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# OpenRouter Data Privacy ## Overview When sending data through OpenRouter to upstream LLM providers, you're responsible for ensuring prompts don't leak PII inappropriately. OpenRouter itself does not train on API data, but each upstream provider has its own data retention and training policies. This skill covers PII detection and redaction, placeholder substitution, provider selection for privacy, and consent tracking. ## PII Detection and Redaction ```python import re from dataclasses import dataclass from typing import Optional @dataclass class PiiScanResult: clean_text: str findings: list[dict] has_pii: bool PII_RULES = [ ("email", r'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b'), ("phone", r'\b(?:\+1[-.\s]?)?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}\b'), ("ssn", r'\b\d{3}-\d{2}-\d{4}\b'), ("credit_card", r'\b(?:\d{4}[- ]?){3}\d{4}\b'), ("api_key", r'\bsk-or-v1-[a-zA-Z0-9]+\b'), ("ip_address", r'\b(?:\d{1,3}\.){3}\d{1,3}\b'), ] REPLACEMENTS = { "email": "[EMAIL]", "phone": "[PHONE]", "ssn": "[SSN]", "credit_card": "[CARD]", "api_key": "[API_KEY]", "ip_address": "[IP]", } def scan_and_redact(text: str) -> PiiScanResult: """Scan text for PII and return redacted version with findings.""" findings = [] clean = text for pii_type, pattern in PII_RULES: matches = re.findall(pattern, clean) for match in matches: findings.append({"type": pii_type, "value_prefix": match[:4] + "..."}) ...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
yesterday
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category