Security Gate
Security control skill to prevent vulnerable architecture, unsafe merges, and risky releases.
Input
- Product and technical artifacts (
PRODUCT_VISION.md,TECH_STRATEGY.md). - Backlog context for implementation planning.
- Ticket/PR context and test evidence.
- QA validation report and release candidate details.
Output
SECURITY_THREAT_MODEL.md(Step 2 / Gate A).SECURITY_BACKLOG.md(Step 3 planning handoff).SECURITY_REVIEW_REPORT.md(Step 6 / Gate B).SECURITY_RELEASE_SIGNOFF.md(Step 7 / Gate C).- Severity-classified finding list (
P0toP3).
[!CAUTION] STRICT FILENAME ENFORCEMENT: You MUST use these exact filenames. For instance, NEVER shorten
SECURITY_RELEASE_SIGNOFF.mdtoSECURITY_SIGNOFF.md.
Process
Phase 1: Security Gate A (Architecture)
- Identify attack surface and trust boundaries.
- Map sensitive data flows and storage points.
- Analyze all user-provided data vectors: For each type of data the user can input (text, files, images, audio, video, location, metadata), evaluate:
- Does it contain or could it expose PII (faces, addresses, plates, GPS coordinates)?
- Does it require sanitization, stripping, or blurring before storage or display?
- What regulatory frameworks apply (GDPR, CCPA, HIPAA)?
- Rank risks by severity (
P0-P3) and define mitigations. - Block progression to Step 3 if critical/high risks are undefined.
Phase 1.5: Security Backlog Conversion (Planning)
- Convert mitigations into security backlog tickets with clear acceptance criteria.
- Ensure each accepted risk includes owner and due date.
- Reject
P0/P1risk acceptance at planning time. - Publish
SECURITY_BACKLOG.mdfor Step 3 and sprint planning.
Phase 2: Security Gate B (Pre-Merge)
- Review PR changes for authz/authn, input validation, data handling, secrets, and dependency risk.
- Verify security-relevant tests are present for new behavior.
- Publish
SECURITY_REVIEW_REPORT.mdwith findings and required fixes. - Block merge for any open
P0orP1finding.
Phase 3: Security Gate C (Release)
- Confirm Gate B is fully resolved; risk acceptance is only allowed for
P2/P3with owner and target date. - Re-check high-risk user flows and regression-sensitive paths.
- Publish
SECURITY_RELEASE_SIGNOFF.mdwith finalGO/NO-GO. - Block release if
GOis not explicitly documented.
Templates
templates/SECURITY_THREAT_MODEL.mdtemplates/SECURITY_BACKLOG.mdtemplates/SECURITY_REVIEW_REPORT.mdtemplates/SECURITY_RELEASE_SIGNOFF.md
Commands
bash .agent/scripts/validate-security-gates.sh --root .
bash .agent/scripts/validate-security-gates.sh --root . --threat-prefix THREAT- --finding-prefix FIND-
Severity Policy
| Severity | Meaning | Gate Impact |
|---|---|---|
P0 |
Active exploit path or severe data exposure | Block merge and release |
P1 |
High-impact vulnerability with realistic exploitability | Block merge and release until fixed |
P2 |
Medium risk with available mitigation | Allow with owner + due date |
P3 |
Low-risk hardening improvement | Track in backlog |
Completeness Checklist
- □ Gate A has documented attack surface, data flow, and mitigations.
- □ Gate B report exists and no open
P0/P1remains. - □ Gate C sign-off exists with explicit
GOorNO-GO. - □ All accepted risks include owner and target date.
Rules
- ALWAYS classify findings using
P0toP3. - ALWAYS block merge when
P0orP1findings are open. - ALWAYS block release when sign-off is missing or
NO-GO. - ALWAYS require owner + due date for accepted
P2/P3risks. - NEVER close a gate without written evidence artifacts.
- STRICT FILENAMES: Always use the exact filenames specified in the Output section.