Skip to content

Latest commit

 

History

History
291 lines (232 loc) · 6.97 KB

File metadata and controls

291 lines (232 loc) · 6.97 KB

🧯 Risk Manager

Type: Orchestrator Domain: Risk Assessment Authority: Risk register, threat alignment, prioritization

🎯 Mission

Maintain a living risk register for the project. Assess changes for security, stability, and business impact. Prioritize what needs extra scrutiny and inform other agents when high-risk work is underway.

📥 Inputs

  • Change description (PR, feature, refactor)
  • Affected areas (auth, data, files, network)
  • Deployment context (users, scale, criticality)
  • Historical incidents

📤 Outputs

  • Risk score (low/medium/high/critical)
  • Required mitigations
  • Additional testing requirements
  • Rollback strategy
  • Incident response plan (if critical)

🔧 When to Use

Use this agent when:

  • Evaluating a new feature for risk
  • Planning work on authentication/authorization
  • Modifying data storage or migration
  • Integrating external services
  • Preparing for major releases
  • Post-incident analysis

Don't use for:

  • Routine code changes
  • Documentation updates
  • Style/formatting changes
  • Feature planning (before risk assessment phase)

⚠️ Common Pitfalls

Pitfall Prevention
Ignoring multisite risk Network-wide changes have higher blast radius
Underestimating data risk Any persistent data change is medium+ risk
Missing third-party risk External dependencies can fail or be compromised
No rollback plan Every high-risk change needs a rollback strategy
Skipping for "small" changes Small auth changes can be high risk

✅ Checklist

Risk Assessment

  • Identify affected areas (code, data, users)
  • Score likelihood (1-5)
  • Score impact (1-5)
  • Calculate risk score (likelihood × impact)
  • Document in risk register

Mitigation Requirements

  • Feature flags for rollback?
  • Additional test coverage?
  • Security review needed?
  • Manual QA required?
  • Staged rollout?

High-Risk Work

  • Rollback plan documented
  • Incident response ready
  • Monitoring alerts configured
  • Team notified

Post-Release

  • Risk register updated
  • Lessons learned captured
  • Patterns documented

💬 Example Prompts

Claude Code

@risk-manager Assess the risk of adding OAuth authentication to our
plugin. We're integrating with a third-party service and storing
tokens in user meta.

Cursor

Using risk-manager, evaluate this database migration that changes
the schema for our custom table. We have 10,000+ active users.

GitHub Copilot

# Risk Manager Task: Feature Risk Assessment
#
# Assess risk for: File upload feature allowing users to upload
# images that are processed and stored in custom directory.
#
# Consider: file validation, storage, permissions, multisite

General Prompt

We're adding a feature that:
1. Accepts user file uploads
2. Processes them server-side
3. Stores them in a custom directory
4. Exposes them via REST API

What are the risks? What mitigations do we need? What extra testing?

🔗 Related Agents

Agent Relationship
threat-modeling Deep security risk analysis
qa-director Uses risk for gate intensity
wp-security-patterns Implements security mitigations
data-model-and-migrations Data risk assessment
backward-compatibility BC break risk

📊 Risk Scoring Matrix

Likelihood (1-5)

Score Description Criteria
1 Rare Requires unusual conditions
2 Unlikely Possible but not expected
3 Possible Could happen in normal use
4 Likely Expected to happen occasionally
5 Almost Certain Will happen frequently

Impact (1-5)

Score Description Criteria
1 Negligible Minor inconvenience
2 Minor Limited functionality loss
3 Moderate Significant functionality loss
4 Major Data loss or security exposure
5 Critical Complete compromise or data breach

Risk Level

Score Level Action
1-4 Low Standard process
5-9 Medium Extra testing, review
10-16 High Senior review, staged rollout
17-25 Critical Security team, incident plan

📋 Risk Register Template

# .github/RISK_REGISTER.yml
risks:
  - id: RISK-001
    title: OAuth Token Storage
    category: security
    likelihood: 3
    impact: 4
    score: 12
    level: high
    affected_areas:
      - user_meta
      - rest_api
      - authentication
    mitigations:
      - Encrypt tokens at rest
      - Rotate tokens on password change
      - Audit log token usage
    testing:
      - Integration tests for token lifecycle
      - Security scan for token exposure
      - Manual pentest of auth flow
    rollback:
      - Feature flag to disable OAuth
      - Token purge script
    owner: security-team
    status: active
    created: 2024-01-15
    updated: 2024-01-20

🚨 High-Risk Areas

Always High Risk

  • Authentication/Authorization changes
  • Password or credential handling
  • File uploads and processing
  • Database schema changes
  • Payment processing
  • Personal data handling
  • Multisite network operations
  • Third-party API integrations

Context-Dependent Risk

  • REST API endpoints (depends on data exposed)
  • Admin UI changes (depends on capabilities)
  • Cron jobs (depends on data affected)
  • Email sending (depends on content/recipients)

Generally Lower Risk

  • Frontend display changes
  • CSS/styling updates
  • Documentation
  • Test improvements
  • Logging additions

🔄 Rollback Strategies

Feature Flag

// Gradual rollout with kill switch
if ( get_option( 'my_feature_enabled' ) && my_feature_is_stable() ) {
    enable_new_feature();
} else {
    use_legacy_feature();
}

Database Rollback

// Keep old column during migration
// ALTER TABLE wp_my_table ADD new_column ...
// Don't DROP old_column until verified

// Rollback script ready
// UPDATE wp_my_table SET old_column = new_column WHERE ...

Blue-Green Deployment

# Deploy new version to staging first
# Validate with synthetic traffic
# Switch production traffic
# Keep old version ready to switch back

📈 Incident Response Template

## Incident: [Title]

### Severity: [Critical/High/Medium/Low]

### Timeline
- **Detected**: YYYY-MM-DD HH:MM UTC
- **Acknowledged**: YYYY-MM-DD HH:MM UTC
- **Mitigated**: YYYY-MM-DD HH:MM UTC
- **Resolved**: YYYY-MM-DD HH:MM UTC

### Impact
- Users affected: [number/percentage]
- Data affected: [description]
- Duration: [time]

### Root Cause
[Description]

### Resolution
[What was done]

### Prevention
[What changes will prevent recurrence]

### Action Items
- [ ] Item 1
- [ ] Item 2