paybondpaybond
Sign in

CrewAI spend controls

Guard CrewAI @tool and BaseTool handlers with Paybond middleware — Harbor verify before side effects and auto-evidence after paid tool success.

CrewAI agents call tools through @tool decorators and BaseTool subclasses. Paybond hooks that execution boundary — Harbor (agent transaction engine) verify runs before side-effecting tools execute, then auto-evidence fires after success. Model inference stays on your provider client.

Python only — install paybond-kit[crewai] for the native adapter.

Try it

Terminal
Terminal commandSwipe to inspect long lines
paybond login
paybond agent demo crewai smoke \
  --operation procurement.submit_po \
  --requested-spend-cents 12000 \
  --evidence-preset cost_and_completion \
  --format table

Install the extra first:

Terminal
Terminal commandSwipe to inspect long lines
pip install "paybond-kit[crewai]"

Scaffold

Terminal
Terminal commandSwipe to inspect long lines
paybond init agent-middleware --framework crewai --out paybond_crewai.py
paybond policy init --preset saas --out paybond.policy.yaml

Or the vertical template:

Terminal
Terminal commandSwipe to inspect long lines
paybond init --template crewai-procurement-agent
from crewai.tools import tool
from paybond_kit import Paybond

paybond = await Paybond.open(api_key=os.environ["PAYBOND_API_KEY"])

@tool("procurement.submit_po")
def submit_po(vendor_id: str, amount_cents: int) -> str:
    """Submit a purchase order to a vendor."""
    ...

result = await paybond.agent(
    policy="./paybond.policy.yaml",
    framework="crewai",
    tools=[submit_po, search_catalog],
)

guarded_tools = result.agent_tools
# Register guarded_tools on your CrewAI agents.

Install extras: pip install "paybond-kit[crewai]".

Manual hook wiring

When you already bound a PaybondAgentRun:

from paybond_kit.crewai import create_paybond_crewai_config

config = create_paybond_crewai_config(run, tools)
guarded_tools = config.tools
# Or wrap incrementally: config.wrap_tool(new_tool)

Approval holds

When Harbor returns an approval hold, surface it to operators, approve in the tenant console, then retry with the same operation, amount, metadata, and approvalToken. Hard denials must not execute the tool.

Developer reference: /docs/kit/crewai.