Error Handling
Error handling
Averment throws structured errors at runtime when an action is not allowed.
When errors occur
Errors are thrown in safe execution mode when the action is not allow.

js

If the decision is caution, review, or block, Averment throws instead of executing.
Example

js

Error structure

js

Common error codes
CodeMeaning
BLOCKED_BY_POLICYAction is blocked
REVIEW_REQUIREDAction requires active attention
CAUTION_REQUIREDAction requires awareness; soft gate
ENGINE_REQUIREDNo engine provided
INVALID_INPUTMissing or invalid fields
INVALID_LLM_CONFIGBYOLLM config is invalid
Errors are a normal part of the system flow and often indicate that safety controls are working as intended.