Documentation Index
Fetch the complete documentation index at: https://docs.polaxis.io/llms.txt
Use this file to discover all available pages before exploring further.
Quick Start
Get Polaxis running in under 5 minutes.
Install
Get your API key
- Sign up at polaxis.io
- Go to Dashboard → Agents → Create Agent
- Copy your API key — it starts with
ag_
Add to your agent
from polaxis import Polaxis
guard = Polaxis(
api_key="ag_prod_...",
agent_id="your-agent-id"
)
# Before every tool call:
result = await guard.evaluate("send_email", {
"to": "customer@example.com",
"subject": "Invoice",
"body": "..."
})
# → allow | escalate (block raises BlockedError)
That’s it. Every tool call your agent makes is now governed.
What happens next
| Decision | Meaning | Action |
|---|
allow | Safe to proceed | Tool call executes |
block | Policy violation | BlockedError raised |
escalate | Needs human approval | SDK waits, Slack notification sent |
Full example
import asyncio
from polaxis import Polaxis, BlockedError
guard = Polaxis(api_key="ag_prod_...", agent_id="billing-agent")
async def run_agent():
tools = [
("send_email", {"to": "user@co.com", "body": "Your invoice is ready"}),
("charge_card", {"amount": 4999, "currency": "usd"}),
("delete_records", {"table": "users", "where": "inactive=true"}),
]
for tool_name, tool_input in tools:
try:
result = await guard.evaluate(tool_name, tool_input)
print(f"✓ {tool_name} — {result.decision}")
# ... execute your tool here
except BlockedError as e:
print(f"✗ {tool_name} blocked — {e.reason}")
asyncio.run(run_agent())