/agentic-security:privacy-data-flowfrom agentic-security
Reviews data flows for PII/PHI/PCI before writing code that handles user data. Classifies sensitivity and traces storage, encryption, third-party processors, logging, retention, and backups.
Ships in agentic-security. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Activates before you write code that reads, stores, transmits, or logs a piece of user data that may be classified PII / PHI / PCI / regulated. Privacy violations almost always look fine in code review — they're violations because of where the data goes, not what the line of code says. This skill makes the destination visible BEFORE the data flows.
You're about to call Edit / Write with a body that touches one of
these data shapes:
PII (general identifiability)
email, phone, dob, ssn, address, lat/lon,
national_id, tax_id, student_id.PHI (HIPAA)
mrn, patient_id, diagnosis, icd_code, prescription,
treatment_plan, insurance_plan.PCI (PCI-DSS)
pan, card_number, cc_num, cvv, cvc, iban,
bank_account, track_data.Special category (GDPR Art. 9 / CCPA "sensitive personal info")
Confidential business
Pause before the Edit. Don't write the code yet. Surface the data-class question.
Classify the data. For each user-data field the code touches, answer:
Trace the destination. Where does this field GO from this line of code? Walk the data flow:
| Stage | Question |
|---|---|
| Storage tier | Database table? Cache (Redis)? Log file? Disk? In-memory? |
| Encryption at rest | Is the storage tier encrypted? Per-row or per-disk? Key managed where? |
| Encryption in transit | TLS required? Mutual TLS? Cert pinning? |
| Third-party processors | Does this field reach: Stripe, Supabase, Clerk, Auth0, Sentry, PostHog, Segment, Mixpanel, OpenAI, Anthropic, AWS S3, Cloudflare, …? |
| Logging | Does it appear in stdout, error logs, exception traces, request logs, audit logs? Is it redacted? |
| Retention | How long is it kept? Where's the deletion trigger? Is "right to be forgotten" wired up? |
| Backups | Does the backup include this field? Are backups encrypted? Same retention? |
| Replication | Does the data cross a region boundary? Which? |
Map to jurisdiction. Which laws apply?
Cite the existing controls if they're in the codebase:
.agentic-security/last-scan.json flags it under crown-jewels?data_classes: rule in .agentic-security/rules.yml?Write the result to the scratchpad via MCP:
append_scratchpad({
path: ".agentic-security/agent-scratchpad/privacy/<session>/DATA_FLOW.md",
content: "<the classification + flow + jurisdiction block>"
})
Propose the literal implementation that satisfies every
requirement that DOES apply. For each defensive measure, cite the
regulation row in a code comment (e.g. // GDPR Art. 32: encryption at rest).
Refuse outright if the implementation would violate hard rules:
xxxx xxxx xxxx 1234 masked form.# DATA_FLOW.md — privacy review for <feature/file>
## Field: <patient.diagnosis>
Date: 2026-05-20T14:32:00Z
File:line: src/api/patient.ts:142
Construct: `await db.patients.update({ where: { id }, data: { diagnosis } })`
### Classification
Class: PHI (HIPAA)
Sensitivity: High
Field type: ICD-10 code + free-text notes
### Flow
Storage tier: postgres `patient_records` table (RDS, encrypted at rest with KMS)
Encryption transit: TLS 1.3 (mTLS via the app's VPC to the DB)
Third-party seen by: Sentry (error context — REDACTED via beforeSend hook)
Datadog (DOES NOT see — patient_id is hashed in logs)
OpenAI (DOES NOT see — diagnosis is never sent to LLM features)
Logging: audit_log table (success only); error logs do NOT include
the value (redacted upstream)
Retention: 7 years per HIPAA 164.530(j); deletion via
DELETE_PATIENT_DATA function with BAA evidence
Backups: encrypted; same 7y retention
Replication: us-east-1 only; no cross-region replication
### Jurisdiction
HIPAA: Yes — covered entity. BAA in place with Sentry, AWS, Datadog.
GDPR Art. 9: Yes for EU patients — explicit consent flag (`consents.research`)
required for any analytical use of diagnosis.
CCPA: Sensitive personal info; opt-out flow at /privacy/opt-out.
### Decisions
- Diagnosis updates audit-logged with actor + before/after hash.
- LLM features (`summarizeHistory()` server-side helper) read a REDACTED view that strips
free-text notes; only ICD codes flow through.
- Webhooks fired on update DO NOT include the diagnosis field
(only `patient_id` + `event: diagnosis_updated`).
### Open questions
- Cross-border data flow on customer migration to EU region: do we
need to negotiate SCC with Sentry before turning on EU?
- Patient export request: current PDF includes diagnosis verbatim; is
that the right level of detail for the right-of-access response?
/compliance --report — generate PRIVACY.md + cookie banner from the stack/compliance --report nist-ai-600-1|owasp-asvs-5|owasp-llm-top-10 — generate automated technical-control evidence/scan --all followed by /triage --show --threat-model — surface
data-class findings the scanner already detectedThe /compliance --report slash produces a privacy artifact AFTER the project
is built. This skill produces a per-field data-flow record before
the field is written. The two are complementary — privacy-docs is the
post-hoc summary; this is the pre-write gate.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
privacy-review, data-flow, pii, phi, pci, gdpr, hipaa, compliance
7 skills in this plugin
/add-scan-ruleagentic-security:add-scan-ruleWalk through the six-step recipe for adding a new SAST detector — pick the module, export scan*(), wire, fixture, test./secure-coding-guardagentic-security:secure-coding-guardGuard risky writes. Activate before eval/exec, string-concat SQL, md5/sha1/DES/RC4 crypto, or auth/jwt/oauth/cipher./security-explainagentic-security:security-explainExplain or teach a vuln. Activate on a CVE/GHSA id, "what is this vuln", "explain finding", or a Socratic walkthrough./security-fix-findingagentic-security:security-fix-findingApply a remediation patch via the deterministic MCP toolchain. Activate when user asks to fix a scanner finding./security-rotate-leakagentic-security:security-rotate-leakRotate a leaked secret end-to-end. Activate on leaked API key, exposed credential, or pushed-secret reports./security-scan-on-deployagentic-security:security-scan-on-deployRun the security scanner. Activate on ship / deploy / launch / "is this safe?" — before the deploy happens.npx claudepluginhub clear-capabilities/agentic-security --plugin agentic-securityOther plugins' skills for the same job