derive-security-from-risk
Skill54 starsChanged 6 months agoMITView on GitHub
Derives security requirements from a named threat.
In this repository31 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- architecture-sketchingSkill
- autonomous-bug-fixSkill
- behavioral-foundationSkill
- brainstormingSkill
- codebase-onboardingSkill
- code-reviewSkill
- debuggingSkill
- demand-eleganceSkill
- derive-nfr-from-driverSkill
- dispatching-parallel-agentsSkill
- durable-workSkill
- executing-plansSkill
- finishing-a-development-branchSkill
- plan-before-codeSkill
- pr-workflowSkill
- receiving-code-reviewSkill
- refactoringSkill
- requesting-code-reviewSkill
- requirements-elicitationSkill
- safety-guardrailsSkill
- security-auditSkill
- self-improvementSkill
- subagent-strategySkill
- test-writingSkill
- traceability-gateSkill
- using-git-worktreesSkill
- using-superpowersSkill
- verify-before-doneSkill
- template-skillSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 29
NOT: when nobody can name the threat yet — run a threat-modelling session first.
- Distinctive: line 41
If no named threat exists, stop.
- Very specific: line 82
Read the parent artifact with view.
- Distinctive: line 84
Read the threat record. Confirm it names a threat actor, a target asset, and a damaging outcome.
- Distinctive: line 115
Must exit 0. Then regenerate the RTM:
- Distinctive: line 133
DO NOT: write an SR that mitigates a threat without an owner.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill 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
Derive Security From Risk
Turns a ratified business driver or functional requirement — together with a named threat — into a Security Requirement (SR) the gate can verify. This skill does NOT propose generic controls and does NOT parent SRs to unspecified parent risks; every SR names the obligation or threat it satisfies.
When to Use
- A
BR-*orFR-*exists for the engagement and processes regulated data, money, identity, or controlled access. - A threat modelling session (STRIDE, LINDDUN, attack tree) has produced a concrete threat the architecture must mitigate.
- A compliance obligation (PCI, HIPAA, APRA CPS 234, GDPR, ISO 27001 Annex A) maps to a control the design must enforce.
- NOT when nobody can name the threat yet — run a threat-modelling session first; do not derive a control to look productive.
Prerequisites
- The parent
BR-*orFR-*exists inrequirements/<engagement>/and is ratified. - A named threat or obligation is recorded in
requirements/<engagement>/threats/<threat-id>.md(free-form, but the SR body must cite it). spec/artifact-schema.mdis the contract for SR frontmatter.
If no named threat exists, stop. The TOGAF red thread breaks the moment a control mitigates a threat nobody named.
How to Run
bash scripts/verify-traceability.sh requirements/<engagement>
# create requirements/<engagement>/SR/SR-NNN.md
bash scripts/verify-traceability.sh requirements/<engagement>Quick Reference
| Action | Tool | Notes |
| Read parent BR/FR | view | Get exact id. |
| Read threat record | view | The threat ID goes in the SR body. |
| Write SR | create | Frontmatter per schema; measurable: true. |
| Verify lineage | bash scripts/verify-traceability.sh | Must pass before commit. |
Example SR frontmatter:
---
id: SR-003
layer: SR
title: PII masking before persistence
parent_ids: [BR-001, FR-002]
owner: security.lead@example.com
measurable: true
ratified_by: ""
target: "Zero unmasked PII fields in storage; verified by daily DLP scan."
derivation_skill: derive-security-from-risk
tags: [pii, masking, data-protection, threat-T03]
---Procedure
Step 1: Assess
- Read the parent artifact with
view. Confirm the data classification (public / internal / confidential / regulated) is stated. - Read the threat record. Confirm it names a threat actor, a target asset, and a damaging outcome. A "threat" of "users might do something bad" is not a threat — stop.
Step 2: Derive
For each named threat or obligation, produce one SR with:
- A control statement that names what the system MUST or MUST NOT do (RFC 2119 register, not prose).
- A measurable target: a scan, a metric, an audit query, an attestation cadence. If the control cannot be measured the gate rejects it.
- A traceable obligation: cite the threat ID or the regulation clause in the body. The agent never invents the obligation — it cites one.
Step 3: Link
parent_idsincludes the affectedBR-*and/orFR-*. SRs MAY also parent to anNFR-*when the control constrains an existing quality attribute (e.g. an availability SR for a fraud-detection service).derivation_skill: derive-security-from-riskis mandatory.
Step 4: Confirm
bash scripts/verify-traceability.sh requirements/<engagement>Must exit 0. Then regenerate the RTM:
bash scripts/gen-rtm.sh requirements/<engagement>Pitfalls
- DO NOT emit a generic "encrypt everything" SR with no threat cited. Generic controls produce generic audits and miss the actual risk.
- DO NOT parent an SR to a threat record directly — the threat is the justification (cited in the body); the parent is always a ratified requirement.
- DO NOT mark
measurable: truewithout defining how it is measured. The gate cannot tell, but the auditor can. - DO NOT ratify the SR from the agent. The Security Architect (or
a human approver) sets
ratified_byafter review. - DO NOT write an SR that mitigates a threat without an owner. An unowned control is an unowned control failure six months from now.
Verification
SR-*.mdfilename equals itsid.parent_idsresolves to ratifiedBR-*/FR-*/NFR-*.- Body cites a named threat ID or a specific regulatory clause.
targetdescribes how the control is measured.bash scripts/verify-traceability.sh requirements/<engagement>exits 0.bash scripts/verify.shpasses the full gate.
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.

