CrewAI
Drop-in safe shell tool for CrewAI agents with multi-layer safety screening.
Step 1: Install the integration
pip install tyga-crewai
Set your API key (optional for Gate 1):
export A2A_API_KEY="a2a_your_key_here"
Step 2: Add the safety layer
Use SafeShellTool() as a drop-in replacement anywhere you use shell execution:
from crewai import Agent, Task, Crew from tyga_crewai import SafeShellTool # SafeShellTool screens every command through the safety shield safe_shell = SafeShellTool() devops_agent = Agent( role="DevOps Engineer", goal="Monitor and maintain server health", backstory="You manage production infrastructure safely.", tools=[safe_shell], verbose=True ) health_check = Task( description="Check disk usage and running services on the server.", expected_output="A summary of disk usage and service status.", agent=devops_agent ) crew = Crew(agents=[devops_agent], tasks=[health_check]) result = crew.kickoff() # Safe commands (df -h, systemctl status) execute normally # Dangerous commands (rm -rf, chmod 777) are blocked
Step 3: Verify
python -c " from tyga_crewai import SafeShellTool tool = SafeShellTool() print(tool.run('uptime')) # system uptime print(tool.run('rm -rf /home')) # BlockedError: Gate 1 matched "
Gate 1 runs locally (free). Set
A2A_API_KEY for Gate 2 + OCSF audit.