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
| Code | Meaning |
|---|---|
| BLOCKED_BY_POLICY | Action is blocked |
| REVIEW_REQUIRED | Action requires active attention |
| CAUTION_REQUIRED | Action requires awareness; soft gate |
| ENGINE_REQUIRED | No engine provided |
| INVALID_INPUT | Missing or invalid fields |
| INVALID_LLM_CONFIG | BYOLLM config is invalid |
Errors are a normal part of the system flow and often indicate that safety controls are working as intended.