evaluate()) never raises — see Evaluation for why.
GovernanceError
Base class. Catch this if you want to handle anything from the SDK.GovernanceProblemError
Raised when Rubric returns an RFC 9457 problem response (e.g.,401 invalid_identity, 403 forbidden, 429). Carries the parsed problem details.
Typical sources
| When | Likely problem |
|---|---|
Governance.bootstrap() with a bad token | invalid_identity (401) |
| Re-enrollment of a revoked identity | forbidden (403) |
| Enrollment rate-limit exceeded | enrollment_rate_limited (429) |
| Token refresh after revocation | invalid_identity (401) |
Example
GovernanceDeniedError (LangChain only)
Raised by the LangChain adapter when a tool call is denied. Subclass ofPermissionError.
isError=True / permissionDecision: "deny").
What does NOT raise
These are deliberately silent:- Evaluator failures.
evaluate()returns default-allow; error is logged. - DLP detector failures. Treated as no-detection; error is logged.
- Audit event flush failures. Events are retried; errors are logged.
- Trace upload failures. Audit event still ships without
traceId; error is logged. - Bundle pull failures. SDK keeps using last-known-good bundle; error is logged.
- JWT refresh failures (transient). Retried with exponential backoff. Only after the JWT actually expires does the SDK surface a problem.