Skip to main content
Averta returns one decision for each checkpoint. The wrapper turns that decision into concrete provider behavior.

Outcomes

If Averta returns a decision that does not fit the checkpoint, the SDK treats it as an invalid decision response and throws. That is fail-closed behavior, not a recoverable warning.

Response Fields

JavaScript SDK decision objects use camelCase. Python SDK decision objects and the raw API use snake_case.

Handling Blocks

Blocked checkpoints throw AvertaSdkError.
When the error came from a checkpoint decision, checkpointDecision in JavaScript or checkpoint_decision in Python contains the decision payload that caused the block.

Decision Callbacks

Provider wrappers call onDecision after checkpoint decisions. Use it while integrating and when building internal logs.
Different checkpoint events carry different fields:

Rewrite Rules

Output rewrite is intentionally bounded. The wrapper:
  1. checks original final text with rewriteAttempt: 0
  2. asks the provider for a safer answer when Averta returns rewrite
  3. checks the rewritten text with rewriteAttempt: 1
  4. returns the rewritten result only if the second check is allow
There is no unbounded rewrite loop. If the rewritten output is blocked or asks for a tool, the wrapper throws.