CrewAI + Govyn — Govern Your CrewAI Agents
CrewAI orchestrates multiple agents that collaborate on tasks — and each agent makes its own LLM calls. A single crew run can trigger dozens of completions across multiple agents, making cost control nearly impossible without an external governance layer.
How it works
Step-by-step setup
Start the Govyn proxy
npx govyn start --config govyn.yaml Configure CrewAI agents to use Govyn
from crewai import Agent, Crew, Task
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
model="gpt-4o",
openai_api_base="http://localhost:4111/v1",
openai_api_key="gvn_agent_crew_researcher"
)
researcher = Agent(
role="Researcher",
goal="Find relevant data",
llm=llm
) Run your crew with governance
task = Task(
description="Research Q4 market trends",
agent=researcher
)
crew = Crew(agents=[researcher], tasks=[task])
result = crew.kickoff() Example policy
Define governance rules for your CrewAI agents in a simple YAML file.
agents:
crew_researcher:
budget:
daily: $3.00
per_task: $1.00
models:
allow: [gpt-4o-mini]
rate_limit:
requests_per_minute: 20
crew_writer:
budget:
daily: $5.00
per_task: $2.00
models:
allow: [gpt-4o]
rate_limit:
requests_per_minute: 15 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
Can I give each CrewAI agent its own budget?
How does Govyn handle CrewAI's agent delegation?
Can I see which agent in my crew is spending the most?
Related integrations
Govern CrewAI multi-agent crews using Claude. Set per-agent budgets, enforce model policies, and replay every conversation.
Add budget limits, policy enforcement, and full replay to LangChain agents using OpenAI. Five-minute setup, zero code changes.
Add governance to OpenAI Agents SDK. Enforce budgets, model policies, and audit trails for every agent run. Five-minute setup.
Explore more
SDK wrappers are door locks. Proxies are walls. A deep technical comparison of both governance architectures for AI agents in production.
FROM OUR BLOGHow smart model routing through a proxy cut our OpenAI and Anthropic bill from $2,140/mo to $578/mo. Zero code changes. Just YAML.
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.