CrewAI + Govyn — Govern Your CrewAI Agents
Running CrewAI crews with Anthropic's Claude means multiple agents making concurrent API calls with premium pricing. Without governance, a crew of five agents can exhaust your monthly budget in a single afternoon — and you have no visibility into which agent is responsible.
How it works
Step-by-step setup
Start the Govyn proxy
npx govyn start --config govyn.yaml Configure CrewAI agents with Govyn
from crewai import Agent, Crew, Task
from langchain_anthropic import ChatAnthropic
llm = ChatAnthropic(
model="claude-sonnet-4-20250514",
anthropic_api_url="http://localhost:4111",
anthropic_api_key="gvn_agent_crew_analyst"
)
analyst = Agent(
role="Data Analyst",
goal="Analyze financial reports",
llm=llm
) Run your crew
task = Task(
description="Analyze Q4 earnings reports",
agent=analyst
)
crew = Crew(agents=[analyst], tasks=[task])
result = crew.kickoff() Example policy
Define governance rules for your CrewAI agents in a simple YAML file.
agents:
crew_analyst:
budget:
daily: $8.00
monthly: $150.00
models:
allow: [claude-sonnet-4-20250514, claude-haiku-4-5-20251001]
context:
max_input_tokens: 30000
rate_limit:
requests_per_minute: 15
crew_summarizer:
budget:
daily: $3.00
models:
allow: [claude-haiku-4-5-20251001] Why use Govyn with CrewAI?
Get started in 5 minutes
Add governance to your CrewAI agents with a single config change. No code rewrites.
Read the docsFrequently asked questions
Does Govyn work with CrewAI's hierarchical crew structure?
Can I limit context window usage for cost control?
How do I monitor a running crew's spend in real time?
Related integrations
Add budget controls and policy enforcement to CrewAI multi-agent crews using OpenAI. Govern every agent in your crew independently.
Govern LangChain agents using Claude models. Enforce budgets, restrict models, and log every completion with Govyn's proxy.
Govern OpenClaw agents using Claude. Add budget enforcement, model policies, and conversation replay to your OpenClaw workflows.
Explore more
How the Meta email deletion incident could have been prevented with 4 lines of YAML, and why OpenClaw built-in limits are not enough.
POLICY TEMPLATESet daily and monthly spending limits for AI agents. Prevent runaway costs with hard budget caps enforced at the proxy level.
POLICY TEMPLATEDetect and stop AI agent infinite loops automatically. Prevent runaway tool calls and recursive chains with proxy-level loop detection.
COMPARISONCompare Govyn and AgentOps for AI agent management. Proxy-level governance vs SDK-based observability and tracing.