Skip to content

StrataGUARD

Hard-rule risk gate. Blocks actions that violate explicit risk constraints. Rules are regime-aware and asset-aware. GUARD is never learned — always auditable.

StrataGUARD(asset=None)

from strata import StrataGUARD

guard = StrataGUARD(asset="TSLA")   # HIGH vol profile: relaxed min_abs_bias
guard = StrataGUARD(asset="SPY")    # LOW vol ETF: relaxed max_trap_risk
guard = StrataGUARD()               # no asset profile — regime defaults only

Supported asset profiles: AAPL, TSLA, SPY, NVDA, QQQ

guard.evaluate(state, decision, confidence) → (bool, str)

approved, reason = guard.evaluate(state, decision, decision["confidence"])
# (True,  "OK")
# (False, "TRAP_RISK_HIGH (0.67 > 0.60 [RANGING])")
# (False, "LOW_CONFIDENCE (0.21 < 0.35)")
# (False, "WEAK_BIAS (0.08 < 0.15 [TRENDING])")

Guard Rules

Rules are evaluated in order. First failing rule returns (False, reason).

Rule Condition Description
MIN_CONFIDENCE confidence < threshold Reject low-confidence signals
MAX_TRAP_RISK trap_risk > threshold Block when trap risk is elevated
MIN_ABS_BIAS abs(bias) < threshold Require directional conviction
MAX_UNCERTAINTY uncertainty > threshold Block in highly ambiguous conditions

All thresholds are regime-dependent and optionally adjusted by asset volatility profile.

Thresholds by Regime

Rule TRENDING RANGING TRANSITIONING CHOPPY
MIN_CONFIDENCE 0.35 0.45 0.50 0.60
MAX_TRAP_RISK 0.65 0.60 0.55 0.45
MIN_ABS_BIAS 0.10 0.15 0.20 0.25
MAX_UNCERTAINTY 0.80 0.70 0.65 0.55