Update demo_scenarios.py
Browse files- demo_scenarios.py +28 -163
demo_scenarios.py
CHANGED
|
@@ -4,170 +4,35 @@ Comprehensive scenarios showing the value of mechanical enforcement
|
|
| 4 |
"""
|
| 5 |
|
| 6 |
DEMO_SCENARIOS = {
|
| 7 |
-
"
|
| 8 |
-
"name": "High-Risk Database Operation",
|
| 9 |
"action": "DROP DATABASE production CASCADE",
|
| 10 |
-
"
|
| 11 |
-
"
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
"
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
"
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
},
|
| 33 |
-
|
| 34 |
-
"config_change": {
|
| 35 |
-
"name": "Configuration Change",
|
| 36 |
-
"action": "UPDATE config SET timeout=30 WHERE service='payment'",
|
| 37 |
-
"description": "Update payment service timeout configuration",
|
| 38 |
-
"context": {
|
| 39 |
-
"environment": "production",
|
| 40 |
-
"service": "payment",
|
| 41 |
-
"change_type": "configuration",
|
| 42 |
-
"affected_services": ["payment", "checkout"],
|
| 43 |
-
"validation_required": True
|
| 44 |
-
}
|
| 45 |
-
},
|
| 46 |
-
|
| 47 |
-
"user_permission_grant": {
|
| 48 |
-
"name": "User Permission Grant",
|
| 49 |
-
"action": "GRANT admin_role TO user@company.com",
|
| 50 |
-
"description": "Grant administrative privileges to user",
|
| 51 |
-
"context": {
|
| 52 |
-
"environment": "production",
|
| 53 |
-
"role": "admin_role",
|
| 54 |
-
"user": "user@company.com",
|
| 55 |
-
"justification": "New team member",
|
| 56 |
-
"approver": "cto@company.com"
|
| 57 |
-
}
|
| 58 |
-
},
|
| 59 |
-
|
| 60 |
-
"sensitive_data_access": {
|
| 61 |
-
"name": "Sensitive Data Access",
|
| 62 |
-
"action": "SELECT * FROM pci_data WHERE card_number LIKE '4111%'",
|
| 63 |
-
"description": "Access to PCI-sensitive payment card data",
|
| 64 |
-
"context": {
|
| 65 |
-
"environment": "production",
|
| 66 |
-
"data_classification": "pci",
|
| 67 |
-
"user_role": "analyst",
|
| 68 |
-
"purpose": "fraud investigation",
|
| 69 |
-
"masking_required": True
|
| 70 |
-
}
|
| 71 |
-
},
|
| 72 |
-
|
| 73 |
-
"auto_scaling_adjustment": {
|
| 74 |
-
"name": "Auto-Scaling Adjustment",
|
| 75 |
-
"action": "scale deployment frontend from 10 to 50 pods",
|
| 76 |
-
"description": "Increase frontend service capacity",
|
| 77 |
-
"context": {
|
| 78 |
-
"environment": "production",
|
| 79 |
-
"service": "frontend",
|
| 80 |
-
"current_pods": 10,
|
| 81 |
-
"target_pods": 50,
|
| 82 |
-
"reason": "Black Friday traffic spike",
|
| 83 |
-
"budget_impact": "$1200/day"
|
| 84 |
-
}
|
| 85 |
-
},
|
| 86 |
-
|
| 87 |
-
"emergency_rollback": {
|
| 88 |
-
"name": "Emergency Rollback",
|
| 89 |
-
"action": "rollback_service payment to v1.1.0 immediately",
|
| 90 |
-
"description": "Emergency rollback due to critical bug",
|
| 91 |
-
"context": {
|
| 92 |
-
"environment": "production",
|
| 93 |
-
"service": "payment",
|
| 94 |
-
"from_version": "v1.2.0",
|
| 95 |
-
"to_version": "v1.1.0",
|
| 96 |
-
"severity": "critical",
|
| 97 |
-
"incident_id": "INC-2024-789",
|
| 98 |
-
"approved_by": "oncall_engineer"
|
| 99 |
-
}
|
| 100 |
-
}
|
| 101 |
-
}
|
| 102 |
-
|
| 103 |
-
# License tier definitions
|
| 104 |
-
LICENSE_TIERS = {
|
| 105 |
-
"trial": {
|
| 106 |
-
"name": "Trial",
|
| 107 |
-
"price": 0,
|
| 108 |
-
"enforcement": "advisory",
|
| 109 |
-
"max_agents": 3,
|
| 110 |
-
"gates_available": ["confidence_threshold", "risk_assessment"],
|
| 111 |
-
"limitations": ["No mechanical enforcement", "14-day limit", "Community support"],
|
| 112 |
-
"best_for": "Evaluation and testing"
|
| 113 |
-
},
|
| 114 |
-
"starter": {
|
| 115 |
-
"name": "Starter",
|
| 116 |
-
"price": 2000,
|
| 117 |
-
"enforcement": "human_approval",
|
| 118 |
-
"max_agents": 10,
|
| 119 |
-
"gates_available": ["license_validation", "confidence_threshold", "risk_assessment", "admin_approval"],
|
| 120 |
-
"features": ["Human-in-the-loop gates", "Basic audit trail", "Email support"],
|
| 121 |
-
"best_for": "Small teams with human oversight"
|
| 122 |
-
},
|
| 123 |
-
"professional": {
|
| 124 |
-
"name": "Professional",
|
| 125 |
-
"price": 5000,
|
| 126 |
-
"enforcement": "autonomous",
|
| 127 |
-
"max_agents": 50,
|
| 128 |
-
"gates_available": ["license_validation", "confidence_threshold", "risk_assessment", "rollback_feasibility", "budget_check"],
|
| 129 |
-
"features": ["Autonomous execution", "Advanced audit", "Priority support", "SLA 99.5%"],
|
| 130 |
-
"best_for": "Mid-size companies wanting automation"
|
| 131 |
-
},
|
| 132 |
-
"enterprise": {
|
| 133 |
-
"name": "Enterprise",
|
| 134 |
-
"price": 15000,
|
| 135 |
-
"enforcement": "full_mechanical",
|
| 136 |
-
"max_agents": 1000,
|
| 137 |
-
"gates_available": ["license_validation", "confidence_threshold", "risk_assessment", "rollback_feasibility", "compliance_check", "budget_check", "custom_gates"],
|
| 138 |
-
"features": ["Full mechanical enforcement", "Compliance automation", "Custom gates", "24/7 support", "SLA 99.9%", "Differential privacy audit"],
|
| 139 |
-
"best_for": "Large enterprises with compliance needs"
|
| 140 |
}
|
| 141 |
}
|
| 142 |
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
"
|
| 147 |
-
|
| 148 |
-
"professional": "Automated risk gates",
|
| 149 |
-
"enterprise": "Mechanical enforcement",
|
| 150 |
-
"improvement": "92% reduction in operational risk"
|
| 151 |
-
},
|
| 152 |
-
"decision_speed": {
|
| 153 |
-
"oss": "Minutes to hours",
|
| 154 |
-
"starter": "Minutes with human",
|
| 155 |
-
"professional": "Seconds (autonomous)",
|
| 156 |
-
"enterprise": "Milliseconds (mechanical)",
|
| 157 |
-
"improvement": "100x faster decisions"
|
| 158 |
-
},
|
| 159 |
-
"false_positives": {
|
| 160 |
-
"oss": "High (conservative)",
|
| 161 |
-
"starter": "Medium (human calibrated)",
|
| 162 |
-
"professional": "Low (ML-optimized)",
|
| 163 |
-
"enterprise": "Minimal (continuously tuned)",
|
| 164 |
-
"improvement": "85% reduction in false positives"
|
| 165 |
-
},
|
| 166 |
-
"operational_cost": {
|
| 167 |
-
"oss": "High (manual review)",
|
| 168 |
-
"starter": "Medium (partial automation)",
|
| 169 |
-
"professional": "Low (mostly automated)",
|
| 170 |
-
"enterprise": "Minimal (fully automated)",
|
| 171 |
-
"improvement": "75% reduction in OpEx"
|
| 172 |
-
}
|
| 173 |
-
}
|
|
|
|
| 4 |
"""
|
| 5 |
|
| 6 |
DEMO_SCENARIOS = {
|
| 7 |
+
"DROP DATABASE production": {
|
|
|
|
| 8 |
"action": "DROP DATABASE production CASCADE",
|
| 9 |
+
"context": "Environment: production, User: junior_dev, Time: 2AM, Backup: 24h old, Criticality: critical",
|
| 10 |
+
"description": "Irreversible deletion of production database"
|
| 11 |
+
},
|
| 12 |
+
"DELETE FROM users WHERE status='active'": {
|
| 13 |
+
"action": "DELETE FROM users WHERE status = 'active'",
|
| 14 |
+
"context": "Environment: production, User: admin, Records: 50,000+, No backup, Criticality: high",
|
| 15 |
+
"description": "Mass deletion of active users"
|
| 16 |
+
},
|
| 17 |
+
"GRANT admin TO new_user": {
|
| 18 |
+
"action": "GRANT admin_role TO new_user@company.com",
|
| 19 |
+
"context": "Environment: production, User: team_lead, New User: intern, No MFA, Criticality: medium",
|
| 20 |
+
"description": "Grant admin privileges to new user"
|
| 21 |
+
},
|
| 22 |
+
"UPDATE transactions SET amount=amount*10": {
|
| 23 |
+
"action": "UPDATE transactions SET amount = amount * 10 WHERE date = '2024-01-15'",
|
| 24 |
+
"context": "Environment: production, User: finance_bot, Records: 10,000+, No rollback, Criticality: critical",
|
| 25 |
+
"description": "Massive transaction amount modification"
|
| 26 |
+
},
|
| 27 |
+
"DEPLOY_TO production (no tests)": {
|
| 28 |
+
"action": "deploy_service payment_api:v2.0.0 to production with 100% rollout",
|
| 29 |
+
"context": "Environment: production, Tests: failed, Rollback: complex, Criticality: high",
|
| 30 |
+
"description": "Deploy untested version to production"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
}
|
| 32 |
}
|
| 33 |
|
| 34 |
+
def get_scenario_context(scenario_name):
|
| 35 |
+
"""Get context for a scenario"""
|
| 36 |
+
if scenario_name in DEMO_SCENARIOS:
|
| 37 |
+
return {"description": DEMO_SCENARIOS[scenario_name]["context"]}
|
| 38 |
+
return {"description": "Environment: production, User: developer"}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|