Skip to main content
The SDK raises only at construction time and at framework boundaries. The hot path (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

Example

GovernanceDeniedError (LangChain only)

Raised by the LangChain adapter when a tool call is denied. Subclass of PermissionError.
LangChain’s agent loop catches this and surfaces it as a tool failure to the model. You only catch it yourself if you want to handle denials specially. The MCP and Claude Agent adapters do not raise on deny — they return native tool-result shapes (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.
This is by design. A flaky network or a misconfigured Rubric should not stop your agent from doing its job.