| name | cohere-data-handling |
| description | Implement data privacy for Cohere API calls with PII redaction and compliance.
Use when handling sensitive data, implementing PII redaction before API calls,
or ensuring GDPR/CCPA compliance with Cohere integrations.
Trigger with phrases like "cohere data", "cohere PII",
"cohere GDPR", "cohere data retention", "cohere privacy", "cohere redact".
|
| allowed-tools | Read, Write, Edit |
| version | 1.5.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","ai","nlp","cohere"] |
| compatibility | Designed for Claude Code |
Cohere Data Handling
Overview
Handle sensitive data when calling Cohere APIs. Cohere processes text server-side for Chat, Embed, Rerank, and Classify — any PII in your input reaches their servers. This skill covers pre-call redaction, post-call scrubbing, and compliance patterns.
Prerequisites
- Understanding of GDPR/CCPA requirements
cohere-ai SDK installed
- Database for audit logging
Data Flow Awareness
Your App → [PII Redaction] → Cohere API → [Response Scrubbing] → Your App → User
Key point: Everything you send to cohere.chat(), cohere.embed(), etc.
is processed on Cohere's servers. Redact BEFORE the API call.
Instructions
Step 1: PII Detection
interface PIIFinding {
type: string;
match: string;
start: number;
end: number;
}
const PII_PATTERNS: Array<{ type: string; regex: RegExp }> = [
{ type: 'email', regex: /[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g },
{ type: 'phone', regex: /\b(\+\d{1,3}[-.]?)?\d{3}[-.]?\d{3}[-.]?\d{4}\b/g },
{ type: 'ssn', regex: /\b\d{3}-\d{2}-\d{4}\b/g },
{ type: 'credit_card', regex: /\b\d{4}[- ]?\d{4}[- ]?\d{4}[- ]?\d{4}\b/g },
{ type: 'ip_address', regex: /\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/g },
];
(): [] {
: [] = [];
( { , regex } ) {
( match text.( (regex))) {
findings.({
,
: match[],
: match.!,
: match.! + match[].,
});
}
}
findings;
}