CrewAI
Guard a CrewAI tool or an entire toolbelt with AxioRank before it runs.
guard_tool wraps a CrewAI BaseTool so its arguments are scored by AxioRank
before the tool executes; guard_tools does the same for a whole toolbelt. The
tool's name, description, and args schema are untouched, so the guarded tool is
a drop-in replacement anywhere the original was used.
Install
pip install "axiorank[crewai]"Guard a crew's tools
from axiorank import AxioRank
from axiorank.integrations.crewai import guard_tools
from crewai import Agent
axio = AxioRank(api_key="axr_live_...")
researcher = Agent(
role="Researcher",
goal="Find and summarize sources",
backstory="Methodical and careful.",
tools=guard_tools([search_tool, scrape_tool, file_writer], axio, on_deny="return"),
)Every _run now goes through your gateway first: allow runs the tool, deny
blocks it, and a require_approval policy holds it for a human verdict before
the crew continues.
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
and stops the task instead.
Inspect what tools return
Pass inspect_results=True to also score the OUTPUT of untrusted-source tools
(web fetches, file reads, email) for indirect prompt injection before the crew
ingests it.
Next steps
- Framework integrations: the shared model and
axio.trace(). - Python SDK: the underlying client.