How It Works
Fishnet sits between CrewAI and AI providers, intercepting every LLM request:- Configure CrewAI agents to use Fishnet’s proxy URLs
- CrewAI sends requests to
localhost:8473instead of OpenAI/Anthropic directly - Fishnet enforces policies: spend caps, rate limits, prompt drift detection
- Fishnet injects real credentials from its encrypted vault
- Requests are forwarded to upstream providers
- All actions are logged in Fishnet’s tamper-proof audit trail
Prerequisites
- Fishnet running on
localhost:8473(see Installation) - CrewAI installed:
pip install crewai crewai-tools - API keys stored in Fishnet’s credential vault
Setup
Store credentials in Fishnet
Add your API keys to Fishnet’s encrypted vault:
These keys are encrypted at rest. CrewAI will never see them.
Multi-Agent Example
Here’s a complete CrewAI workflow protected by Fishnet:- Tracks each agent’s token usage and cost
- Enforces rate limits across the entire crew
- Logs every task execution
- Applies prompt drift detection
- Blocks requests if budget is exceeded
Security Features
Spend Limits Per Crew
Set daily budgets infishnet.toml:
Rate Limiting
Prevent crews from flooding providers:Model Allowlisting
Restrict which models your agents can use:gpt-3.5-turbo, Fishnet blocks it.
Prompt Drift Detection
Detect when agent prompts deviate from expected baselines:Audit Trail
Every crew execution is logged:- Agent name and role
- Task description
- Model used
- Token usage (input/output)
- Cost in USD
- Timestamp
- Approval/denial decision
Advanced Usage
Tools with Fishnet
CrewAI tools work normally through Fishnet:Hierarchical Crews
Fishnet supports hierarchical process flows:Parallel Execution
Run multiple crews with shared rate limits:Monitoring Crew Performance
View real-time metrics in Fishnet’s dashboard:- Total requests today
- Token usage by agent
- Cost breakdown by model
- Rate limit headroom
- Budget remaining
Troubleshooting
Crew fails to start
Crew fails to start
Check that Fishnet is running:Start if needed:
401 Authentication errors
401 Authentication errors
Verify credentials are stored:Add missing keys:
Budget exceeded
Budget exceeded
Your daily spend cap was hit. Check current spend:Increase budget in Restart Fishnet:
fishnet.toml:Rate limit errors
Rate limit errors
Your crew is making too many requests. View rate limit config:Increase if needed:Or add delays between tasks in your crew.
Slow crew execution
Slow crew execution
Fishnet adds less than 10ms latency per request. If your crew is slow:
- Check upstream provider status
- Review Fishnet logs for errors:
- Verify you’re not hitting provider rate limits
Example: Production-Ready Crew
Here’s a full example with error handling and monitoring:Next Steps
Configure Spend Limits
Set budgets and prevent runaway crew costs
Prompt Drift Detection
Detect prompt injection in agent workflows
Alerts & Webhooks
Get notified when crews violate policies
Audit Trail
Review and export all crew executions