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

CrewAI
Your agents
HTTPS
Govyn Proxy
Policy · Budget · Logs
API
OpenAI API
LLM provider

Step-by-step setup

1

Start the Govyn proxy

bash
npx govyn start --config govyn.yaml
2

Configure CrewAI agents to use Govyn

python
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
)
3

Run your crew with governance

python
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.

govyn.yaml
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?

Independent budgets for each agent in a crew
Per-task spending limits
Prevent expensive model usage by role
Rate limiting to avoid agent feedback loops
Full replay of multi-agent conversations
Monitor which agents consume the most budget

Get started in 5 minutes

Add governance to your CrewAI agents with a single config change. No code rewrites.

Read the docs

Frequently asked questions

Can I give each CrewAI agent its own budget?
Yes. Each agent gets a unique Govyn API key with independent budget, model, and rate limit policies. Your researcher agent can have a $3/day limit on gpt-4o-mini while your writer agent gets $5/day on gpt-4o.
How does Govyn handle CrewAI's agent delegation?
When one CrewAI agent delegates to another, each agent's LLM calls go through Govyn with their respective API keys. Delegation works transparently — Govyn enforces each agent's policies independently regardless of the orchestration pattern.
Can I see which agent in my crew is spending the most?
Yes. Govyn's dashboard and replay logs are keyed by agent API key, so you can see exactly how much each crew member is spending, which models they're using, and how many requests they're making.

Related integrations

Explore more