AxioRank Docs
Integrations

LlamaIndex

Guard a LlamaIndex FunctionTool with AxioRank before it runs.

guard_tool wraps a LlamaIndex FunctionTool so its arguments are checked by AxioRank before it runs. The schema, name, and description are preserved, so the wrapped tool is a drop-in replacement.

Install

pip install "axiorank[llamaindex]"

Guard a tool

Provide client (sync), async_client (async), or both. LlamaIndex derives the direction it needs from whichever you supply.

from axiorank import AxioRank
from axiorank.integrations.llamaindex import guard_tool
from llama_index.core.tools import FunctionTool

axio = AxioRank(api_key="axr_live_...")

tool = FunctionTool.from_defaults(fn=deploy_service)
safe_tool = guard_tool(tool, axio, on_deny="return")
# ...hand safe_tool to your agent as usual.

Recover or fail

on_deny="return" returns a short, model-readable refusal the agent can re-plan around. The default, on_deny="raise", raises AxioRankDeniedError instead.

Next steps

On this page