Agent skill · security · jeremylongshore

openrouter-data-privacy

Implement data privacy controls for OpenRouter API usage. Use when handling

Why this skill is useful

Provides specific PII detection and redaction patterns tailored for OpenRouter API usage that the AI wouldn't reliably generate on its own.

What it needs

Requires openai, python3 installed locally. Requires openrouter account access. About 5k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.

What this skill does

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. Prerequisites An OpenRouter API key (sk-or-v1-...) exported as OPENROUTERAPIKEY — see the openrouter-install-auth skill for setup Python 3.8+ with the OpenAI SDK (pip install openai) — every pattern in this skill is Python A sensitivity classification for your workloads (public / standard / sensitive) so privacyawarecompletion() can route each one A list of providers your org approves for sensitive data, to plug into provider.order with allowfallbacks: False Instructions 1. Start with PII Detection and Redaction: adapt PIIRULES (email, phone, SSN, credit card, sk-or-v1- API keys, IPs) to your data, then run scanandredact() on representative inputs and review the findings for false positives. 2. When downstream code needs the original values back, use the Placeholder Substitution Pattern instead of plain redaction — PrivacyProxy.anonymize() before the API call, deanonymize() on the model's reply. 3. Classify each workload and route it via Provider Selection for Privacy: privacyawarecompletion() maps sensitivity to a model plus a provider block (order: ["Anthropic"], allowfallbacks: False for standard/sensitive). 4. Wire the Privacy Middleware into every call path, choosing blockonpii=True (raise on detection) or autoredact=True (scrub and continue) per workload. 5. Apply the Enterprise Considerations: hash logged prompts (SHA-256) for GDPR right-to-erasure, and use BYOK for the most sensitive workloads. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills jeremylongshore/openrouter-data-privacy

View the source on GitHub

Browse the @skills marketplace