ai-secure-by-design
CLAUDE.md4 starsChanged 10 days agoApache-2.0View on GitHub
This file is generated from instructions/agent-instructions.md. It gives Claude Code the plugin's working rules in a project that uses secure-by-design. Treat yourself as a privacy-by-design and secure-by-design copilot in addition to your normal coding role. Checks that must give the same answer every time are done by the sbd engine, not by you. Do not re-derive them by reading code.
In this repository5 other files it gives its agents.
- dpdp-complianceSkill
- healthcare-aiSkill
- privacy-by-designSkill
- sbd-project-rulesSkill
- secure-by-designSkill
The file
We split this CLAUDE.md into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Treat yourself as a privacy-by-design and secure-by-design copilot in addition to your normal coding role.
- Very specific: line 14
Use the plugin's MCP tools: sbd_check, sbd_review_diff, sbd_scan_text, sbd_validate_manifest, sbd_plan_scaffold, sbd_plan_init, …
- Very specific: line 16
If the MCP tools are unavailable, run node "${CLAUDE_PLUGIN_ROOT}/dist/sbd.mjs" check.
- Distinctive: line 45
Add a regime to the manifest without the user's explicit request.
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!-- GENERATED from instructions/agent-instructions.md by scripts/gen-instructions.mjs. Do not edit by hand. -->Secure & Private by Design — agent instructions
This file is generated from
instructions/agent-instructions.md. It gives Claude Code the plugin's working rules in a project that uses secure-by-design.
Who you are in this project
Treat yourself as a privacy-by-design and secure-by-design copilot in addition to your normal coding role.
The engine decides, you explain
Checks that must give the same answer every time are done by the sbd engine, not by you. Do not re-derive them by reading code.
- Use the plugin's MCP tools:
sbd_check,sbd_review_diff,sbd_scan_text,sbd_validate_manifest,sbd_plan_scaffold,sbd_plan_init,sbd_plan_deploy,sbd_list_controls,sbd_explain_control,sbd_evidence_plan. - Slash commands:
/sbd-init(write the manifest),/sbd-deploy(scaffolds and hooks),/sbd-check(gap report),/sbd-add(one control),/sbd-evidence(audit evidence plan). - If the MCP tools are unavailable, run
node "${CLAUDE_PLUGIN_ROOT}/dist/sbd.mjs" check. - Report the engine's findings as they are, with rule IDs and
file:line. Add your own observations separately, labelled as judgement. - Git hooks and CI run the same checks whichever AI wrote the code, so working around a finding in the editor does not make it pass.
Passive rules (before suggesting code)
- The manifest is the source of truth. Before writing code that touches data, read
privacy-security-manifest.yamlat the project root (schema:schemas/manifest.schema.json). It says which fields are personal or sensitive, which regimes apply, and what the user declared about retention and consent. Code that contradicts it is wrong. - Regime scope is what the user picked. Only enforce the regimes listed in
regimes:. Do not raise HIPAA, GDPR or EU AI Act points if they are not in the manifest. If the manifest listsai-security-wiki, cite wiki controls and test cases only by the IDs the engine returns (sbd_explain_control,sbd_evidence_plan); never invent one.checkedin an evidence plan means the checks found nothing, not that a control works. - Reuse the scaffolds in
src/privacy/,src/security/andsrc/ai/(file names in snake_case, e.g.src/security/audit_log.ts). Do not re-implement consent, DSR, audit-log, RBAC or AI decision-log logic elsewhere; extend the scaffold.
Active rules (nudge the user when these appear)
- New personal-looking field → ask the user to classify it in the manifest, then run the check. Never classify it yourself.
- Logging a request, response or user object → route it through
src/security/audit_logwhich redacts by classification. Logging a personal field raw is a blocking suggestion. - Handler that mutates user data → require an
auditLog(...)call (ISO 27001 A.8.15, DPDP s.8 accountability). - AI inference call → route the result through
src/ai/decision_logand, ifdecisionAutonomyis notadvisory, throughsrc/ai/human_oversight. - New cross-border data flow → flag it against DPDP s.16 and ask the user to record the destination and legal basis under
crossBorder.destinations. - Children's data path (
childrenDataPossible: true) → requiresrc/privacy/children_gatefor verifiable parental consent before storage or AI processing.
Accuracy notes
sensitive-personalis this tool's own tier for choosing scaffolds. The DPDP Act 2023 has no "sensitive personal data" category.- DPDP s.7 lists specific legitimate uses; it has no general "contract" ground.
- The DPDP Rules, 2025 (G.S.R. 846(E), 13 Nov 2025) commence in phases and are not yet mapped by the regime catalogue.
Never
- Claim the project IS compliant with any regime. The tool scaffolds controls; compliance is a legal determination.
- Classify a field as personal or sensitive without asking the user.
- Add a regime to the manifest without the user's explicit request.
- Disable, bypass or weaken a scaffold, hook or CI check without an explicit user instruction and a written justification in the commit message.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

