Risk Management Skill-Graph — CONCEPT:AU-AHE.assimilation.skill-workflow-ingest / AU-OS.safety.prompt-injection-scanner
Comprehensive risk management patterns enforced by the Emerald Exchange RiskGuard engine.
P0 Risk Controls
Circuit Breakers
| Control | Threshold | Action | Recovery |
|---|---|---|---|
| Portfolio Drawdown | > 10% from peak | HALT all trading | Manual resume only |
| Daily Loss Limit | > 3% of equity | HALT new orders | Next trading day |
| Regime Shift | KS-test p < 0.05 | HALT + alert | Manual review |
| Kill Switch | Manual trigger | HALT immediately | emerald_orders(action='resume') |
Position Sizing — Kelly Criterion
Kelly fraction = W - (1-W)/R
Where:
W = historical win rate
R = win/loss ratio (avg win / avg loss)
Capped at: min(kelly, max_position_pct=2%)
Pre-Trade Validation
Every order passes through RiskGuard.pre_trade_check():
- Halt check: Is trading halted?
- Position size: Does this exceed 2% equity limit?
- Concentration: Portfolio exposure to single asset?
- Cash availability: Sufficient buying power?
- Live gate: If live mode, require human approval (OS-5.1)
Regime Detection — CONCEPT:EX-AHE.harness.ee-11
Hidden Markov Model (HMM)
- 3-state model: Bull, Bear, Neutral
- Trained on rolling 252-day windows
- State transitions trigger portfolio adjustments
KS-Test Regime Shift
- Kolmogorov-Smirnov test on recent vs historical prediction distributions
- Detects distribution drift before traditional drawdown signals
- p-value < 0.05 triggers circuit breaker
Monitoring Schedule
| Check | Interval | MCP Tool |
|---|---|---|
| Drawdown | 5 minutes | emerald_risk(action='drawdown_check') |
| Daily P&L | 5 minutes | emerald_risk(action='daily_loss_check') |
| Regime | 15 minutes | emerald_signals(action='regime') |
| Portfolio snapshot | 15 minutes | emerald_portfolio(action='positions') |
Human-in-the-Loop — OS-5.1
- Paper → Live promotion: Requires explicit human approval via
graph_orchestrate.request_approval - Kill switch: Any agent can halt; only human can resume live trading
- Audit trail: All risk events persisted as
RiskSnapshotnodes in KG
Integration Points
- Risk MCP:
emerald_risk— status, drawdown, daily loss, Kelly, limits - Orders MCP:
emerald_orders— halt/resume kill switch - KG Ontology:
RiskSnapshot,regimeState,isHaltedOWL classes - Workflow:
risk-monitoringcron (every 5 min)