Runtime Guards

Evaluate each call before it's sent. Returns a routing decision - proceed, route to a different model, compress context, or block - without any network I/O.

Agent hint

Use for pre_call_check / preCallCheck, proceed/downgrade/compress/block actions.

In scope

  • pre_call_check API
  • Decision actions
  • auditor.ignore()

Out of scope

  • BudgetGuard config table - see BudgetGuard
  • wrap() - see Context Wrappers
proceed

No violation; call proceeds normally.

downgrade

Swap to a cheaper suggested model.

compress

Prune duplicate system prompts from context.

block

Halt call when budget or policy violated.

Python
from aurex_sdk import AurexAuditor, AurexDecision

auditor = AurexAuditor()

decision: AurexDecision = auditor.pre_call_check(
    model="gpt-4o",
    prompt="Generate python code...",
    workflow_id="user_session_123",
)

if decision.action == "block":
    raise Exception(f"Blocked: {decision.reason}")
elif decision.action == "downgrade":
    model = decision.suggested_model
elif decision.action == "compress":
    messages = decision.compressed_messages
Node.js
const decision = auditor.preCallCheck({
  model: "gpt-4o",
  prompt: "Generate python code...",
  workflowId: "user_session_123",
});

if (decision.action === "block") {
  throw new Error(`Blocked: ${decision.reason}`);
}

See also

Command Palette

Search for a command to run...