"""Safety policy shared by future OMEGA agent adapters."""
from dataclasses import dataclass

@dataclass(frozen=True)
class AgentDecision:
    action: str
    confidence: float
    rationale: str
    requires_human: bool

def gate_decision(action: str, confidence: float, *, high_stakes: bool = False) -> AgentDecision:
    """Route low-confidence or high-stakes agent actions to human review."""
    if not 0 <= confidence <= 1:
        raise ValueError("confidence must be between 0 and 1")
    return AgentDecision(action=action, confidence=confidence,
                         rationale="Confidence threshold or high-stakes policy applied",
                         requires_human=high_stakes or confidence < 0.85)
