Risk Register
For changes that touch sensitive areas (authentication, data, migrations, infrastructure), document the risks explicitly. This is what senior developers do naturally - making it explicit ensures nothing is overlooked.
When to Use
Use this skill when your change involves:
- Authentication/Authorization - Login, sessions, permissions, tokens
- User Data - PII, passwords, payment info, user content
- Data Migrations - Schema changes, data transformations, backfills
- External Integrations - Third-party APIs, webhooks, OAuth
- Infrastructure - Deployment, scaling, configuration changes
- Breaking Changes - API changes, behavioral changes, deprecations
Quick Start
/risk-register
Or specify the change:
/risk-register "Adding password reset functionality"
The Risk Register Template
For each risky change, complete this register:
# Risk Register: [Feature/Change Name]
## Summary
Brief description of what's changing and why it's sensitive.
## Top 3 Risks
### Risk 1: [Name]
**Likelihood:** Low / Medium / High
**Impact:** Low / Medium / High / Critical
**Description:**
What could go wrong?
**Mitigation:**
How are we preventing this?
**Detection:**
How would we know if this happened?
**Response:**
What do we do if it happens?
---
### Risk 2: [Name]
...
### Risk 3: [Name]
...
## Testing Strategy
### Pre-deployment
- [ ] Unit tests cover the change
- [ ] Integration tests for critical paths
- [ ] Manual testing of edge cases
- [ ] Security review completed
### Post-deployment
- [ ] Smoke test in production
- [ ] Monitor error rates
- [ ] Watch for anomalies in [specific metrics]
- [ ] Verify [specific functionality] works
## Monitoring & Alerting
What should we watch after deployment?
| Metric | Normal Range | Alert Threshold | Response |
|--------|--------------|-----------------|----------|
| Login failure rate | < 5% | > 10% | Check auth service |
| API error rate | < 1% | > 5% | Investigate errors |
| ... | ... | ... | ... |
## Rollback Strategy
### Can we rollback?
Yes / Partial / No (explain why)
### Rollback steps
1. [Step 1]
2. [Step 2]
3. [Step 3]
### Rollback time estimate
[X minutes/hours]
### Data implications
What happens to data created after deployment if we rollback?
## Approval
- [ ] Engineer reviewed risks
- [ ] Security reviewed (if auth/data)
- [ ] Stakeholder aware of risks
Risk Categories
Authentication Risks
| Risk |
Impact |
Common Mitigations |
| Session hijacking |
Critical |
Secure cookies, HTTPS, token rotation |
| Credential stuffing |
High |
Rate limiting, MFA, breach detection |
| Token leakage |
Critical |
Short expiry, secure storage, no logging |
| Privilege escalation |
Critical |
Strict authz checks, principle of least privilege |
| Account takeover |
Critical |
Email verification, suspicious activity alerts |
Data Risks
| Risk |
Impact |
Common Mitigations |
| Data loss |
Critical |
Backups, soft deletes, transaction safety |
| Data corruption |
Critical |
Validation, constraints, idempotency |
| Data leakage |
Critical |
Access controls, encryption, audit logs |
| Privacy violation |
High |
PII handling, consent, data minimization |
| Compliance breach |
High |
Audit trails, retention policies |
Migration Risks
| Risk |
Impact |
Common Mitigations |
| Failed migration |
High |
Dry runs, backups, reversible migrations |
| Data inconsistency |
High |
Validation checks, reconciliation |
| Downtime |
Medium |
Rolling deploys, feature flags |
| Performance degradation |
Medium |
Index analysis, query optimization |
Example Risk Register
# Risk Register: Password Reset Feature
## Summary
Adding password reset via email. Touches auth system, sends emails with tokens,
allows password changes without current password.
## Top 3 Risks
### Risk 1: Token Theft/Replay
**Likelihood:** Medium
**Impact:** Critical
**Description:**
Reset tokens could be intercepted or reused to take over accounts.
**Mitigation:**
- Tokens expire in 1 hour
- Single use (invalidated after use)
- Tokens are cryptographically random (32 bytes)
- HTTPS only
**Detection:**
- Alert on multiple reset attempts for same user
- Log all password resets with IP
**Response:**
- Invalidate all tokens for affected user
- Force password change
- Notify user of suspicious activity
---
### Risk 2: Email Enumeration
**Likelihood:** High
**Impact:** Medium
**Description:**
Attackers could use the reset form to discover which emails have accounts.
**Mitigation:**
- Same response for valid/invalid emails
- Rate limiting on reset endpoint
- CAPTCHA after 3 attempts
**Detection:**
- Monitor for high volume of reset requests
- Alert on requests from same IP for many emails
**Response:**
- Block IP temporarily
- Enable additional rate limiting
---
### Risk 3: Token Logged/Exposed
**Likelihood:** Low
**Impact:** Critical
**Description:**
Reset token appears in logs, error messages, or URLs shared externally.
**Mitigation:**
- Token in POST body, not URL
- Logging excludes token field
- Error messages are generic
**Detection:**
- Grep logs for token patterns
- Review error handling
**Response:**
- Purge affected logs
- Rotate any exposed tokens
- Notify affected users
## Testing Strategy
### Pre-deployment
- [x] Unit tests for token generation, validation, expiry
- [x] Integration test for full reset flow
- [x] Test expired token rejection
- [x] Test reused token rejection
- [x] Security review of token handling
### Post-deployment
- [ ] Smoke test: Complete reset flow in production
- [ ] Monitor email delivery rate
- [ ] Watch for spike in reset requests
## Monitoring & Alerting
| Metric | Normal | Alert | Response |
|--------|--------|-------|----------|
| Reset requests/hour | < 100 | > 500 | Check for abuse |
| Reset completion rate | > 80% | < 50% | Check email delivery |
| Failed reset attempts | < 10% | > 30% | Check token generation |
## Rollback Strategy
### Can we rollback?
Yes - feature flag controls access to reset endpoint.
### Rollback steps
1. Disable `PASSWORD_RESET_ENABLED` feature flag
2. Invalidate all outstanding reset tokens
3. Communicate to support team
### Rollback time estimate
~5 minutes (feature flag toggle)
### Data implications
Outstanding reset tokens will be invalidated. Users mid-reset will need to retry.
Integration with Wiggum
When wiggum detects changes to auth, data, or migrations, it should prompt:
This change touches [auth/data/migrations].
Should we create a risk register? (y/n)
If yes, use this skill to document risks before proceeding.
Remember
- Be specific - "data loss" is too vague; "orphaned records if parent deleted" is actionable
- Be honest - If you can't roll back, say so
- Think like an attacker - What would you try if you wanted to break this?
- Think like ops - How would you know something is wrong at 3am?
The goal isn't to prevent all risks - it's to know what the risks are and have a plan.
1---2name: risk-register3description: Document risks for changes touching auth, data, or migrations. Lists top risks, how to test/monitor them, and rollback strategy.4---5
6# Risk Register
7
8For changes that touch sensitive areas (authentication, data, migrations, infrastructure), document the risks explicitly. This is what senior developers do naturally - making it explicit ensures nothing is overlooked.
9
10## When to Use
11
12Use this skill when your change involves:
13
14- **Authentication/Authorization** - Login, sessions, permissions, tokens
15- **User Data** - PII, passwords, payment info, user content
16- **Data Migrations** - Schema changes, data transformations, backfills
17- **External Integrations** - Third-party APIs, webhooks, OAuth
18- **Infrastructure** - Deployment, scaling, configuration changes
19- **Breaking Changes** - API changes, behavioral changes, deprecations
20
21## Quick Start
22
23```
24/risk-register
25```
26
27Or specify the change:
28```
29/risk-register "Adding password reset functionality"
30```
31
32## The Risk Register Template
33
34For each risky change, complete this register:
35
36```markdown
37# Risk Register: [Feature/Change Name]
38
39## Summary
40Brief description of what's changing and why it's sensitive.
41
42## Top 3 Risks
43
44### Risk 1: [Name]
45**Likelihood:** Low / Medium / High
46**Impact:** Low / Medium / High / Critical
47
48**Description:**
49What could go wrong?
50
51**Mitigation:**
52How are we preventing this?
53
54**Detection:**
55How would we know if this happened?
56
57**Response:**
58What do we do if it happens?
59
60---
61
62### Risk 2: [Name]
63...
64
65### Risk 3: [Name]
66...
67
68## Testing Strategy
69
70### Pre-deployment
71- [ ] Unit tests cover the change
72- [ ] Integration tests for critical paths
73- [ ] Manual testing of edge cases
74- [ ] Security review completed
75
76### Post-deployment
77- [ ] Smoke test in production
78- [ ] Monitor error rates
79- [ ] Watch for anomalies in [specific metrics]
80- [ ] Verify [specific functionality] works
81
82## Monitoring & Alerting
83
84What should we watch after deployment?
85
86| Metric | Normal Range | Alert Threshold | Response |
87|--------|--------------|-----------------|----------|
88| Login failure rate | < 5% | > 10% | Check auth service |
89| API error rate | < 1% | > 5% | Investigate errors |
90| ... | ... | ... | ... |
91
92## Rollback Strategy
93
94### Can we rollback?
95Yes / Partial / No (explain why)
96
97### Rollback steps
981. [Step 1]
992. [Step 2]
1003. [Step 3]
101
102### Rollback time estimate
103[X minutes/hours]
104
105### Data implications
106What happens to data created after deployment if we rollback?
107
108## Approval
109
110- [ ] Engineer reviewed risks
111- [ ] Security reviewed (if auth/data)
112- [ ] Stakeholder aware of risks
113```
114
115## Risk Categories
116
117### Authentication Risks
118
119| Risk | Impact | Common Mitigations |
120|------|--------|-------------------|
121| Session hijacking | Critical | Secure cookies, HTTPS, token rotation |
122| Credential stuffing | High | Rate limiting, MFA, breach detection |
123| Token leakage | Critical | Short expiry, secure storage, no logging |
124| Privilege escalation | Critical | Strict authz checks, principle of least privilege |
125| Account takeover | Critical | Email verification, suspicious activity alerts |
126
127### Data Risks
128
129| Risk | Impact | Common Mitigations |
130|------|--------|-------------------|
131| Data loss | Critical | Backups, soft deletes, transaction safety |
132| Data corruption | Critical | Validation, constraints, idempotency |
133| Data leakage | Critical | Access controls, encryption, audit logs |
134| Privacy violation | High | PII handling, consent, data minimization |
135| Compliance breach | High | Audit trails, retention policies |
136
137### Migration Risks
138
139| Risk | Impact | Common Mitigations |
140|------|--------|-------------------|
141| Failed migration | High | Dry runs, backups, reversible migrations |
142| Data inconsistency | High | Validation checks, reconciliation |
143| Downtime | Medium | Rolling deploys, feature flags |
144| Performance degradation | Medium | Index analysis, query optimization |
145
146## Example Risk Register
147
148```markdown
149# Risk Register: Password Reset Feature
150
151## Summary
152Adding password reset via email. Touches auth system, sends emails with tokens,
153allows password changes without current password.
154
155## Top 3 Risks
156
157### Risk 1: Token Theft/Replay
158**Likelihood:** Medium
159**Impact:** Critical
160
161**Description:**
162Reset tokens could be intercepted or reused to take over accounts.
163
164**Mitigation:**
165- Tokens expire in 1 hour
166- Single use (invalidated after use)
167- Tokens are cryptographically random (32 bytes)
168- HTTPS only
169
170**Detection:**
171- Alert on multiple reset attempts for same user
172- Log all password resets with IP
173
174**Response:**
175- Invalidate all tokens for affected user
176- Force password change
177- Notify user of suspicious activity
178
179---
180
181### Risk 2: Email Enumeration
182**Likelihood:** High
183**Impact:** Medium
184
185**Description:**
186Attackers could use the reset form to discover which emails have accounts.
187
188**Mitigation:**
189- Same response for valid/invalid emails
190- Rate limiting on reset endpoint
191- CAPTCHA after 3 attempts
192
193**Detection:**
194- Monitor for high volume of reset requests
195- Alert on requests from same IP for many emails
196
197**Response:**
198- Block IP temporarily
199- Enable additional rate limiting
200
201---
202
203### Risk 3: Token Logged/Exposed
204**Likelihood:** Low
205**Impact:** Critical
206
207**Description:**
208Reset token appears in logs, error messages, or URLs shared externally.
209
210**Mitigation:**
211- Token in POST body, not URL
212- Logging excludes token field
213- Error messages are generic
214
215**Detection:**
216- Grep logs for token patterns
217- Review error handling
218
219**Response:**
220- Purge affected logs
221- Rotate any exposed tokens
222- Notify affected users
223
224## Testing Strategy
225
226### Pre-deployment
227- [x] Unit tests for token generation, validation, expiry
228- [x] Integration test for full reset flow
229- [x] Test expired token rejection
230- [x] Test reused token rejection
231- [x] Security review of token handling
232
233### Post-deployment
234- [ ] Smoke test: Complete reset flow in production
235- [ ] Monitor email delivery rate
236- [ ] Watch for spike in reset requests
237
238## Monitoring & Alerting
239
240| Metric | Normal | Alert | Response |
241|--------|--------|-------|----------|
242| Reset requests/hour | < 100 | > 500 | Check for abuse |
243| Reset completion rate | > 80% | < 50% | Check email delivery |
244| Failed reset attempts | < 10% | > 30% | Check token generation |
245
246## Rollback Strategy
247
248### Can we rollback?
249Yes - feature flag controls access to reset endpoint.
250
251### Rollback steps
2521. Disable `PASSWORD_RESET_ENABLED` feature flag
2532. Invalidate all outstanding reset tokens
2543. Communicate to support team
255
256### Rollback time estimate
257~5 minutes (feature flag toggle)
258
259### Data implications
260Outstanding reset tokens will be invalidated. Users mid-reset will need to retry.
261```
262
263## Integration with Wiggum
264
265When wiggum detects changes to auth, data, or migrations, it should prompt:
266
267```
268This change touches [auth/data/migrations].
269Should we create a risk register? (y/n)
270```
271
272If yes, use this skill to document risks before proceeding.
273
274## Remember
275
276- **Be specific** - "data loss" is too vague; "orphaned records if parent deleted" is actionable
277- **Be honest** - If you can't roll back, say so
278- **Think like an attacker** - What would you try if you wanted to break this?
279- **Think like ops** - How would you know something is wrong at 3am?
280
281The goal isn't to prevent all risks - it's to **know what the risks are** and have a plan.