AxioRank Docs
Integrations

LiteLLM proxy

Govern every framework behind a LiteLLM proxy with one AxioRank guardrail.

The LiteLLM adapter is a proxy guardrail, not a per-agent wrapper: every tool call a model proposes through the proxy is scored by AxioRank before any client sees it. One hook governs every framework and language behind the proxy with zero per-agent code.

Install

pip install "axiorank[litellm]"

Configure the proxy

Create the hook in your proxy's custom callbacks module:

custom_callbacks.py
from axiorank import AsyncAxioRank
from axiorank.integrations.litellm import axiorank_guardrail

proxy_handler_instance = axiorank_guardrail(
    AsyncAxioRank(api_key="axr_live_..."),
)

and reference it from the proxy config:

config.yaml
litellm_settings:
  callbacks: ["custom_callbacks.proxy_handler_instance"]

What happens on deny

By default (on_deny="block"), a denied tool call is stripped from the model's response and replaced with a short, model-readable refusal, so the agent sees why the action vanished and can re-plan; allowed tool calls in the same turn pass through untouched. on_deny="raise" fails the whole request instead.

Fail open or closed

fail_open=True (default) lets responses through untouched if AxioRank is unreachable, so the proxy never becomes a single point of failure. fail_open=False fails the request instead: the zero-trust posture, at an availability tradeoff. Denies are always enforced in either mode.

Next steps

On this page