Evaluate calls against cost efficiency and runaway policies locally. Returns an AurexDecision without network I/O.
Agent hint
Use for pre_call_check / preCallCheck, proceed/downgrade/compress/block actions.
In scope
Out of scope
proceedNo violation; call proceeds normally.
downgradeSwap to a cheaper suggested model.
compressPrune duplicate system prompts from context.
blockHalt call when budget or policy violated.
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_messagesconst decision = auditor.preCallCheck({
model: "gpt-4o",
prompt: "Generate python code...",
workflowId: "user_session_123",
});
if (decision.action === "block") {
throw new Error(`Blocked: ${decision.reason}`);
}