class ACPSDKError(RuntimeError):
    """Base error for ACP Python SDK."""


class PolicyDenied(ACPSDKError):
    def __init__(
        self,
        *,
        trace_id: str,
        reason: str | None = None,
        decision_payload: dict | None = None,
    ) -> None:
        self.trace_id = trace_id
        self.reason = reason
        self.decision_payload = decision_payload or {}
        super().__init__(f"policy_denied trace_id={trace_id} reason={reason!r}")


class PolicyEscalated(ACPSDKError):
    def __init__(
        self,
        *,
        trace_id: str,
        reason: str | None = None,
        decision_payload: dict | None = None,
    ) -> None:
        self.trace_id = trace_id
        self.reason = reason
        self.decision_payload = decision_payload or {}
        super().__init__(f"policy_escalated trace_id={trace_id} reason={reason!r}")
