Quickstart
Get your first agent governed in under 5 minutes.
1. Install
bash
pip install gavrun2. Get an API key
Sign in at agentmanager.gavrun.ai, go to API Keys, and create a key.
3. Configure
python
import gavrun
gavrun.configure(
api_key="gavrun_live_...",
agent_name="my-agent",
agent_manager_url="https://api.gavrun.ai",
environment="prod", # "dev" | "staging" | "prod"
)Or via environment variables:
bash
GAVRUN_API_KEY=gavrun_live_...
GAVRUN_AGENT_MANAGER_URL=https://api.gavrun.ai
GAVRUN_ENV=prod
GAVRUN_AGENT_NAME=my-agentpython
import gavrun
gavrun.configure() # reads from env4. Guard a tool call
python
client = gavrun.get_client()
result = client.guard(
action="delete_user",
execute=lambda: delete_user(user_id),
tools=["delete_user"],
prompt=f"Delete user {user_id} from the database.",
max_tokens=500,
)
if result.denied:
print("Blocked by policy.")
elif result.requires_human_review:
print("Waiting for human approval...")
# poll get_approval_status()
elif result.executed:
print("Done:", result.result)5. Create a policy
In the Gavrun dashboard:
- Add
delete_userto Tools → Review (requires human approval) - Add
read_userto Tools → Allow - Everything else is denied by default
6. Assign the policy to your agent
In the dashboard under Agents, select your agent and assign the policy.
Next: SDK reference →