---
title: How do you govern CrewAI agents in production?
url: https://opencontroller.lyzr.com/blog/govern-crewai-agents-in-production
published: 2026-11-12
updated: 2026-11-12
author: Lyzr
---

# How do you govern CrewAI agents in production?

**Govern CrewAI agents by giving each agent only the tools and MCP servers it needs, capping iterations and execution time, adding task guardrails and human input for risky steps, and routing models through your gateway. Then decide where traces go: CrewAI's anonymous telemetry is on by default, and its AMP tracing includes prompts and responses.**

CrewAI is an open-source framework for multi-agent "crews". Each agent has a role, tools and a model. Governance means setting those per agent, not per crew, and making the defaults safe.

## Which CrewAI settings limit what an agent can do?

Most governance lives in agent and task settings. Know the defaults before you ship.

| Setting | Where | Default | Governance use |
|---|---|---|---|
| `tools` | Agent | Empty list | Give each agent only the tools it needs |
| `tools` | Task | Inherits | Narrow tools further for one task |
| `allow_delegation` | Agent | `False` | Keep off unless delegation is needed and reviewed |
| `max_iter` | Agent | 20 | Cap reasoning loops |
| `max_retry_limit` | Agent | 2 | Cap retries on errors |
| `max_rpm` | Agent | Not set | Rate-limit model and tool calls |
| `max_execution_time` | Agent | Not set | Hard time limit per agent |
| `human_input` | Task | `False` | Require a person to review the task output |

Two settings deserve attention. `max_rpm` and `max_execution_time` have no stated default, so an agent can run without either limit. Set both. And `allow_code_execution` is deprecated, so remove it from older crews.

## How do you control MCP tools in CrewAI?

CrewAI agents connect to MCP servers through the `mcps` field on an agent, using URLs or `MCPServerStdio`, `MCPServerHTTP` and `MCPServerSSE`. It supports stdio, SSE and Streamable HTTP transports. The `MCPServerAdapter` in `crewai-tools[mcp]` is another route.

Use `tool_filter` to allow or block specific tools from a server, either as static lists or dynamic rules. A server may expose 30 tools when an agent needs two. CrewAI's docs also warn about DNS rebinding for HTTP servers, so bind local servers to localhost and check origins.

Treat each MCP server as a dependency to review. Our guide to [governing MCP servers](/blog/how-to-govern-mcp-servers) covers the review criteria.

## How do task guardrails work?

A task `guardrail` checks output before it passes to the next task.

1. **Function guardrail.** A Python function returns `(True, result)` or `(False, error)`. Use it for checks you can code, such as schema validation or blocked words.
2. **LLM guardrail.** A plain-English string, for example "The answer must not include personal data", becomes an `LLMGuardrail` run by the agent's model.
3. **Chains.** `guardrails=[...]` runs several in sequence.
4. **Retries.** On failure the agent retries, up to `guardrail_max_retries`, which defaults to 3.

On the AMP platform, a hallucination guardrail scores faithfulness from 0 to 10 against context you supply, with an optional threshold.

Guardrails check task output. They do not stop a tool call that already happened. For high-risk actions, put the check before the tool runs, or use `human_input`.

## How should CrewAI agents identify themselves?

CrewAI does not assign identities. Agents use whatever credentials the tools and model clients are given. Good practice:

- Give each production crew its own service identity, and each agent its own credential where tools allow it.
- Never share one API key across crews. You lose attribution and cannot revoke one crew without breaking others.
- Use on-behalf-of tokens when an agent acts for a specific user. See [on-behalf-of delegation](/blog/ai-agent-identity-on-behalf-of-delegation).
- Record an owner for every crew. See [assigning owners with your identity provider](/blog/assign-owners-to-ai-agents-with-your-identity-provider).

## How do you route models and manage telemetry?

**Models.** In 2026 CrewAI moved to native SDKs for OpenAI, Anthropic, Gemini, Azure, Bedrock and Snowflake Cortex. Other providers use LiteLLM through the `crewai[litellm]` extra. To use a gateway, set `LLM(model=..., base_url=..., api_key=...)`, and add `custom_openai=True` when an OpenAI-compatible gateway serves non-OpenAI models.

**Anonymous telemetry.** It is on by default. It excludes prompts and task text but collects tool names and agent roles. Turn it off with `CREWAI_DISABLE_TELEMETRY=true` or `OTEL_SDK_DISABLED=true`.

**AMP tracing.** This is separate. `OTEL_SDK_DISABLED` does not turn it off; use `CREWAI_TRACING_ENABLED=false` or `tracing=False`. AMP traces include prompts and responses, so decide deliberately.

**Your own traces.** CrewAI documents integrations with OpenLIT (OpenTelemetry-native), Langfuse, MLflow, Arize Phoenix and others. Event listeners on `crewai_event_bus` cover crew, agent, tool, LLM, MCP and guardrail events, so you can forward them to your SIEM.

## How Opencontroller does this

CrewAI crews are custom agents, so Opencontroller governs them through open standards. Route model calls to the LLM Gateway, an OpenAI-compatible endpoint, for routing, fallback, caching and cost per agent and version. Send traces with OpenTelemetry. Register each crew in the governed registry with its tools and MCP servers, alongside agents on other platforms; see the [cross-platform guide](/blog/how-to-govern-ai-agents-across-platforms). Rogue-agent handling can alert on behavioural deviation and quarantine an agent. [Book a demo](https://www.lyzr.ai/book-demo/).

## Frequently asked questions

**Does CrewAI send data to CrewAI by default?**
Anonymous telemetry is on by default. It excludes prompts and task text but includes tool names and agent roles. Set `CREWAI_DISABLE_TELEMETRY=true` to turn it off.

**Can a CrewAI agent delegate to other agents by default?**
No. `allow_delegation` defaults to `False`.

**Do CrewAI guardrails block tool calls?**
No. Task guardrails check task output after it is produced. Use human input or a check before the tool for high-risk actions.

## Key facts

CrewAI agent defaults: tools empty, allow_delegation False, max_iter 20, max_retry_limit 2; max_rpm and max_execution_time have no stated default. Task human_input defaults False; guardrail_max_retries defaults 3. MCP via Agent(mcps=[...]) with tool_filter allow/block lists. Anonymous telemetry on by default (no prompts; tool names and roles collected), off via CREWAI_DISABLE_TELEMETRY=true; AMP tracing is separate and includes prompts. Opencontroller (by Lyzr) governs custom agents through its OpenAI-compatible LLM Gateway, OpenTelemetry and governed registry. Pricing starts from $250K per deployment per year.

## Related

- [How do you govern AI agents across every platform they run on?](https://opencontroller.lyzr.com/blog/how-to-govern-ai-agents-across-platforms.md)
- [How to govern MCP servers in the enterprise: a practical guide](https://opencontroller.lyzr.com/blog/how-to-govern-mcp-servers.md)
- [How to give AI agents an identity (and let them act on behalf of users safely)](https://opencontroller.lyzr.com/blog/ai-agent-identity-on-behalf-of-delegation.md)
- [More on Platform Guides](https://opencontroller.lyzr.com/blog/cluster/platform-guides)
