Security Design
Make the security model an architectural decision, not a bug-fixing exercise after implementation.
Context
Security design identifies what must be protected, who might abuse the system, and which controls must exist at each boundary. It sits upstream of security audit: the goal here is to design the defenses, not just inspect the code later.
In Prodcraft, security design is most valuable when the system adds new trust boundaries, handles sensitive data, or depends on brownfield coexistence where old and new controls may differ.
Inputs
- architecture-doc -- Defines the system boundaries, deployment topology, and interaction patterns.
- api-contract -- Identifies externally visible actions, data entry points, and policy-sensitive operations.
Process
Step 1: Mark Assets and Trust Boundaries
Identify the data, operations, and integrations that would matter to an attacker or regulator. Draw the trust boundaries explicitly: browser to backend, service to service, job worker to datastore, admin surface to normal user surface.
Step 2: Enumerate Abuse Paths
For each boundary, ask:
- how could an unauthorized actor reach this path
- what happens if input is malicious, replayed, or oversized
- what data could leak through logs, errors, or side channels
- how could rollout or coexistence create a weaker path than the intended one
Step 3: Assign Concrete Controls
Define the required controls at each boundary:
- authentication and session controls
- authorization and tenant isolation
- input validation and output encoding
- secret handling and key rotation expectations
- audit logging, alerting, and fail-closed behavior
Step 4: Record the Threat Model
Capture attacker assumptions, control decisions, unresolved risks, and the checks downstream phases must enforce. The output should be actionable enough that implementation and security audit know what to build and what to verify.
Outputs
- threat-model -- Assets, trust boundaries, abuse paths, required controls, and explicit residual risks.
Quality Gate
Anti-Patterns
- Security by generic checklist -- controls that ignore the real boundaries of the system.
- Auth-only thinking -- focusing on login while ignoring authorization, secret handling, or data leakage.
- Invisible residual risk -- acting as if security is complete when key assumptions remain open.
- Brownfield blind spot -- designing new controls without modeling weaker legacy paths still in service.
Related Skills
1---2name: security-design3description: Use when the architecture is defined and the team must turn trust boundaries, sensitive data paths, and attacker assumptions into concrete control design before implementation and audit.4---56# Security Design78> Make the security model an architectural decision, not a bug-fixing exercise after implementation.910## Context1112Security design identifies what must be protected, who might abuse the system, and which controls must exist at each boundary. It sits upstream of security audit: the goal here is to design the defenses, not just inspect the code later.1314In Prodcraft, security design is most valuable when the system adds new trust boundaries, handles sensitive data, or depends on brownfield coexistence where old and new controls may differ.1516## Inputs1718- **architecture-doc** -- Defines the system boundaries, deployment topology, and interaction patterns.19- **api-contract** -- Identifies externally visible actions, data entry points, and policy-sensitive operations.2021## Process2223### Step 1: Mark Assets and Trust Boundaries2425Identify the data, operations, and integrations that would matter to an attacker or regulator. Draw the trust boundaries explicitly: browser to backend, service to service, job worker to datastore, admin surface to normal user surface.2627### Step 2: Enumerate Abuse Paths2829For each boundary, ask:3031- how could an unauthorized actor reach this path32- what happens if input is malicious, replayed, or oversized33- what data could leak through logs, errors, or side channels34- how could rollout or coexistence create a weaker path than the intended one3536### Step 3: Assign Concrete Controls3738Define the required controls at each boundary:3940- authentication and session controls41- authorization and tenant isolation42- input validation and output encoding43- secret handling and key rotation expectations44- audit logging, alerting, and fail-closed behavior4546### Step 4: Record the Threat Model4748Capture attacker assumptions, control decisions, unresolved risks, and the checks downstream phases must enforce. The output should be actionable enough that implementation and security audit know what to build and what to verify.4950## Outputs5152- **threat-model** -- Assets, trust boundaries, abuse paths, required controls, and explicit residual risks.5354## Quality Gate5556- [ ] Trust boundaries are explicit57- [ ] High-value assets and abuse paths are documented58- [ ] Required controls are assigned per boundary59- [ ] Logging and fail-closed expectations are clear60- [ ] Residual risks and unresolved assumptions are recorded for audit or follow-up6162## Anti-Patterns63641. **Security by generic checklist** -- controls that ignore the real boundaries of the system.652. **Auth-only thinking** -- focusing on login while ignoring authorization, secret handling, or data leakage.663. **Invisible residual risk** -- acting as if security is complete when key assumptions remain open.674. **Brownfield blind spot** -- designing new controls without modeling weaker legacy paths still in service.6869## Related Skills7071- [system-design](../system-design/SKILL.md) -- supplies the structural boundaries to secure72- [security-audit](../../05-quality/security-audit/SKILL.md) -- verifies the implementation against this design73- [deployment-strategy](../../06-delivery/deployment-strategy/SKILL.md) -- uses the threat model when rollout posture affects exposure74- [monitoring-observability](../../07-operations/monitoring-observability/SKILL.md) -- exposes the signals needed to detect security-relevant failure modes