Outcomes
| Decision | Valid at | Wrapper behavior |
|---|---|---|
allow | All checkpoints | Continue normally. |
block | All checkpoints except tool exposure as a separate concept | Throw AvertaSdkError and stop that path. |
restrict_tools | Request checkpoint | Remove blockedTools before provider execution. |
rewrite | Output checkpoint | Ask the provider for a safer answer, then check the rewrite once. |
Response Fields
JavaScript SDK decision objects use camelCase. Python SDK decision objects and the raw API use snake_case.| JavaScript field | Python/raw API field | Meaning |
|---|---|---|
decision | decision | allow, block, restrict_tools, or rewrite. |
decisionId | decision_id | Unique decision identifier. |
eventId | event_id | Dashboard event identifier. |
policyId | policy_id | Policy that produced the decision. |
reasons | reasons | Array of reason objects with code and message. |
blockedTools | blocked_tools | Tool names removed by a restrict_tools decision. |
tool | tool | Tool identity for tool-call and tool-result decisions. |
actions.rewrite | actions.rewrite | Rewrite category for output rewrite decisions. |
runId | run_id | Tool-run identifier used to connect request and tool-call checks. |
Handling Blocks
Blocked checkpoints throwAvertaSdkError.
checkpointDecision in JavaScript or checkpoint_decision in Python contains the decision payload that caused the block.
Decision Callbacks
Provider wrappers callonDecision after checkpoint decisions. Use it while integrating and when building internal logs.
| Checkpoint | Useful event fields |
|---|---|
request | decision, originalTools / original_tools, forwardedTools / forwarded_tools, provider |
tool_call | decision, tool, provider |
tool_result | decision, tool, provider |
output | decision, outputText / output_text, rewriteAttempt / rewrite_attempt, provider |
Rewrite Rules
Output rewrite is intentionally bounded. The wrapper:- checks original final text with
rewriteAttempt: 0 - asks the provider for a safer answer when Averta returns
rewrite - checks the rewritten text with
rewriteAttempt: 1 - returns the rewritten result only if the second check is
allow