Framework integration

CrewAI

Wrap a CrewAI Agent after assigning its local BaseTools and before the Crew begins execution.

Install

pip install 'agent-security[crewai]'

Define local tools

Keep each business capability as a named local tool. Stable tool names become policy actions, with underscores normalized to dots where supported.

Secure the agent

agent = Agent(role="Support", goal="Help safely", tools=tools)
agent = security.crewai(
    agent_id="support-agent",
    agent=agent,
    permissions={
        "customer.lookup": "ALLOW",
        "customer.delete": "DENY",
    },
)

Runtime behavior

  • Agent and tool metadata sync at construction/startup.
  • Newly discovered tools receive default-DENY.
  • A denied or approval-required tool implementation does not execute.
  • Transport exhaustion fails closed.

Limits

The adapter intercepts local CrewAI BaseTool objects. External execution paths require gateway enforcement.