Evaluating CrewAI agents with promptfoo: what it covers and when teams need it
Promptfoo can evaluate a CrewAI crew and run automated red team checks against it, so a team can repeat the same functional and security tests before each release. The work fits a team whose crew calls tools, passes tasks between roles and changes behaviour whenever a prompt, tool definition or model is updated. Without a repeatable suite, those changes are usually judged by a few manual runs, and a regression in one agent's handoff can go unnoticed until users report it. promptfoo covers LLM evaluation, automated red teaming and code scanning, and it can be used as a CLI, as a library or inside CI/CD pipelines. Its documentation states that the software runs completely locally, so evals run on your machine and talk directly with the LLM. That matters for crews that handle customer or internal data, because the test traffic follows the same provider path your application uses.
The starting point is the promptfoo CrewAI guide, which describes evaluating CrewAI agent security and performance with automated red team testing. Read it alongside your own crew definition, and confirm with the guide's current instructions how the crew is exposed to promptfoo as a provider and which CrewAI and promptfoo versions it targets. Before you commit to the work, decide what the crew is meant to do, which roles hold tools with side effects, and which outputs a reviewer would have to sign off on. Those answers shape both the functional tests and the red team scope.
Teams usually need this when a crew moves from a prototype to a process that other people rely on, when a regulator or customer asks for test evidence, or when several agents share tools that reach business systems. DeployOpen plans and builds these test suites as fixed-scope work, starting from the guide and your crew's design. Ask for the agents, tools, data sources and environments in scope in writing, and confirm whether the team will run tests locally or on a self-hosted promptfoo server, since the server's single-instance limits affect how shared results are stored.
How promptfoo reaches the CrewAI crew under test
The flow starts in the promptfoo CLI running on your own machine, which reads the test config and calls a provider wrapper that starts the crew with each test input. The crew's agents call their tools and the model endpoint, and the output returns to promptfoo, where assertions and red team graders score it. Check the trust boundary: the tools and data sources sit inside the crew's environment, so any access they have is access an injected prompt can reach.
Test inputs flow from the local CLI through the wrapper into the crew, and outputs return for grading.
Setting up promptfoo against a CrewAI crew
This sequence takes a CrewAI crew from a fresh Node.js check to a working functional eval and a red team scan, with a check at each step so you know the setup is sound before you trust the results. The output is a local, repeatable test harness that your team can extend.
Confirm the Node.js runtime version
Check that Node.js 22.22.0 or newer is installed on the machine that will run the evals, since the promptfoo npm release requires that version or later. Run
node --versionand compare the result with the requirement. Your engineer owns this check, and it is done when the version prints at or above 22.22.0 on the same host or CI runner you plan to use. Confirm the version your CI image uses as well, because a mismatch there is a common reason pipelines fail on the first run.Install promptfoo and confirm the CLI
Install the promptfoo package from npm, either globally or as a project dependency so the version is pinned with the crew code. Run
promptfoo --versionto confirm the CLI resolves and reports the version you installed. Record the pinned version in your repository, because red team plugins and output formats can change between releases. The step is complete when the CLI runs and the version is recorded in version control.Wrap the crew as a custom provider
Write a provider file that accepts a prompt string, starts the CrewAI crew with that input, and returns an object containing the final output and the trace data the crew produced, such as which agent ran and which tools were called. Keep the return shape fixed so every test reads the same fields. Check the wrapper by calling it directly with one fixed prompt twice and confirming that the output keys match on both calls, even though the model text may vary. Confirm that the wrapper makes no calls outside the endpoints your team has approved.
Write a minimal config with functional tests
Create a promptfoo configuration that points at the wrapped crew and adds a small set of test cases with assertions for the behavior you need, such as the crew producing a final answer in the expected format, calling the expected tool for a known request, and refusing an out-of-scope request. Use deterministic assertions where you can, such as string or JSON checks, before adding model-graded ones. The config is ready when it validates without errors and lists every test you intended to write.
Run the functional eval and confirm it stays local
Run the eval from the command line and review the results table, including pass and fail counts and the trace data returned by the wrapper. Confirm that evals run on your machine and that the crew calls only the model endpoints you configured. Check network traffic during the first run if your policy requires it. The step is done when the run completes, the failures are explained by the crew or by the tests, and the results are saved where your team can review them.
Add a red team configuration
Add a redteam section to the configuration that names the purpose of the crew, the plugins that test the risks most relevant to your agents, and the strategies to apply. Keep the scan size small for the first run so the output is easy to review. Confirm the target is the same provider used for functional tests, and that the purpose text accurately describes what the crew is allowed to do. The configuration is ready when it validates and the chosen plugins match the crew's tools and data.
Run the red team scan and review findings
Generate the red team test cases and run the scan against the crew, then review each finding with its prompt, the crew's output and the trace showing which agent and tool acted. Confirm that a finding reproduces when you rerun the same test, since a single failing run may reflect model variation. Record the scan as your baseline. The setup is complete when the scan runs end to end, every finding is either confirmed or dismissed with a written reason, and the configuration is committed to version control.
Configuration choices for a CrewAI evaluation and red team
This table compares the main configuration decisions for testing a CrewAI crew with promptfoo, including how the crew is wrapped, how results are graded, how deep tests reach, and where results are stored. Read each row against your own risk profile: the right choice depends on what the crew can do, who reviews results, and how many people need to see them.
| Decision | Option | Trade-off | When to choose it |
|---|---|---|---|
| Provider target | Whole crew as one provider | Tests the final output the user sees, but a failure rarely shows which agent caused it | Early smoke tests and red team scans that treat the crew as a black box |
| Provider target | Individual agent or task as a provider | Pinpoints the failing agent, but misses problems that appear only when agents hand work to each other | When one agent holds a sensitive tool, such as a file writer or a search connector |
| Assertion style | Deterministic assertions (contains, regex, JSON schema, tool call checks) | Fast, cheap and repeatable, but cannot judge whether a free-text answer is helpful or safe | Known outputs, required fields, forbidden tool calls and fixed formats |
| Assertion style | LLM-as-a-judge grading | Handles open-ended answers, but the judge model adds cost, variance and its own review need | Tone, policy compliance and whether an injected instruction was followed in natural language |
| Test depth | Tool-level tests with fixed tool inputs | Isolates permission and parameter handling, but skips the agent's own planning and prompting | Checking that a tool refuses out-of-scope arguments or another user's records |
| Test depth | End-to-end red team scan of the crew | Reflects realistic attack paths through the full workflow, with longer runs and harder root-cause analysis | Pre-release assessment and periodic checks before a crew reaches production |
| Results sharing | Community CLI with local results | Free and runs on your machine, but results stay with the person who ran them unless you share files yourself | One engineer or a small group running evaluations from a repository |
| Results sharing | Self-hosted promptfoo server | Central view for a team, but the self-hosted app uses a local SQLite database and lacks built-in authentication and SSO, so confirm the fit for your environment | Shared review during evaluation work where a single instance is acceptable |
| Results sharing | Enterprise deployment with access control and SSO | Adds team access control and SSO, with custom pricing that you confirm through a quote | Multiple teams that need role-based access and audit-ready review of crew test results |
Writing functional tests that check each agent's role and output
A crew needs functional tests at two levels: the crew as a whole, and each task on its own. Crew-level tests send a realistic request to the crew through the provider you connected and check the final result: whether the right agent or task handled the request, whether the handoff between agents passed the information the next agent needed, and whether the returned output matches the format your downstream code expects. Task-level tests exercise one agent's role in isolation, so a failure points to a specific role rather than to the whole workflow. Start by writing down, for each agent, the inputs it accepts, the output schema it must return and the requests it must decline. Those three lists become your assertions. Confirm in the promptfoo CrewAI guide which provider setup and test structure it recommends for your CrewAI version before you copy its examples.
Refusal of out-of-scope requests deserves its own test group. For a research crew, for example, a request to draft a customer contract should be declined or routed back to the user, not quietly completed by whichever agent has the most general tools. Write these cases as explicit assertions on the refusal wording and on the absence of any task output, and include near-miss requests that sit on the boundary of each role. Keep test inputs maintainable by storing them in separate files grouped by role, not inline in one large configuration, so that when a role's description or tools change you update only the cases that depend on it. Tag each case with the agent it targets. When you rename a role or split a task, a tag-based report shows which cases need review and which still hold. Ask your team to own the expected outputs for each role, since those expectations change more often than the crew's code does.
Which red team checks matter most for a multi-agent crew
A CrewAI crew passes work, tool outputs and context between several agents, so a weakness in one agent can reach the others. The cards below set out the risk areas we would prioritize in a promptfoo red team, and each one maps to coverage described in the promptfoo red teaming documentation.
Injection through tool outputs
An agent that reads a web page, file or API response can receive instructions hidden in that content, and the next agent in the crew may act on them. Test each handoff where one agent's output becomes another agent's input, and check whether injected text changes the task, the tools called or the final answer. Confirm with your team which injection plugins and strategies apply to the tools your crew actually uses.
Red teaming docsExcessive tool permissions
Tools assigned to an agent define what that agent can do, and a broad permission set widens the damage from any successful injection. Compare each agent's tool list with the job it performs, and test whether an agent can call tools outside its role or take actions the task never requested. Ask your platform owner to list which agents hold write, delete or external-send tools before the first scan.
Data exposure across agents
Agents in a crew often share a context window or task output, so an agent with access to customer records can pass them to an agent that should not see them. Probe whether one agent reveals data it received from another, from its system prompt or from a tool result. Identify which data classes each agent is allowed to hold, then write tests that try to pull those classes across a handoff.
Authorization gaps
A crew often acts on behalf of a user, but the agents may run under a shared service identity with broader rights than that user has. Test whether a request from a low-privilege user can cause an agent to fetch another user's records or call a function above that user's role. Set up separate test identities and confirm with your identity team how the crew authenticates to each downstream system.
Memory and shared context carry-over
If a crew keeps memory between runs or reuses shared context, instructions or data from one session can persist into another user's session. Check whether content planted in one run changes behavior in a later run, and whether one user's data appears in another user's output. Confirm with your team how CrewAI memory is configured in your deployment before you decide which carry-over tests to run.
Questions teams ask before running CrewAI red teams
What does a CrewAI evaluation or red team engagement actually include?
It covers connecting the crew to promptfoo as a provider, writing functional tests for what each agent and the crew as a whole should do, and running automated red team checks against the agents for injection, unsafe tool use and data exposure. The work also includes reading the results, separating real findings from grading noise, and recording evidence. Engagements are usually fixed-scope, so the agents, tools, plugins and deliverables are agreed in writing before work starts. The promptfoo CrewAI guide is the reference for the basic setup, and the scope decides how far beyond it the work goes.
What drives the effort of a CrewAI red team up or down?
Effort follows the shape of the crew and the number of test cases. The main drivers are:
- The number of agents and how they hand work to each other, since each handoff is an attack surface to test.
- The number of tools and how much each one can change state, read private data or call external services.
- The number of functional test cases and red team plugins, and how many attack strategies run against each one.
- How much stubbing the tools need, and whether the crew can run without touching production systems.
- How many grading decisions need human review.
Ask any quote to break the work down along these lines.
Can our in-house team run CrewAI red teams without a partner?
Yes, if the team has someone comfortable with Python, the CrewAI codebase and promptfoo's YAML configuration, and if they can own the test environment. promptfoo is open source under the MIT license and runs locally from the command line, so a single engineer can start with a small suite. Teams often struggle later, when they need to model authorization properly, stub tools safely, interpret results and keep the suite current as agents change. Decide early who will maintain the tests after the first run.
What does the work need from our team before it starts?
Plan to provide four things: a test environment that mirrors the crew without live customer data, stubs or sandboxed versions of the tools the agents call, separate test identities with the roles you want to check, and model access that the test runs can use. Name a technical owner who can answer questions about the agents' intended behavior and approve the scope. Confirm with your model provider which keys, quotas and data terms apply to test traffic, because red team runs send many prompts.
Is promptfoo free to start with for CrewAI testing?
The promptfoo Community edition is free and includes all LLM evaluation features, all model providers and integrations, and red teaming with 10k probes per month, with community support. Its pricing page describes this allowance, so confirm the current terms there before planning a large scan. Enterprise and On-Premise editions add team sharing, SSO, access control, continuous monitoring and priority support at custom pricing, and are only needed if your organization requires those controls.
Which parts of the work should we bring in a partner for?
Consider a partner when the crew touches sensitive data or regulated systems, when you need authorization testing across several user roles, or when results must be reviewed by security or compliance teams who expect a documented method. A partner is also useful for a first scan when the team has no baseline, and for retesting after fixes. DeployOpen plans and runs these engagements in infrastructure you control, delivers findings with fixes and a retest, and prepares the evidence your reviewers ask for. It does not issue audit reports or certifications.
How long should we keep CrewAI red team results and who should see them?
Keep results for as long as your own policies and any applicable compliance commitments require, and confirm that retention period with your compliance lead. Red team output can contain sample prompts, tool responses and sometimes data the agents accessed, so restrict access to the people who need it and store it inside your environment. Ask any partner how results, traces and test identities are handled and deleted at the end of the engagement.
How DeployOpen scopes and supports CrewAI evaluations
DeployOpen plans the crew's test scope and deliverables in writing before any work starts. The scope names the crews and agents under test, the tasks and tools each agent can call, the test identities and data the team will provide, and the environment where promptfoo will run. It also states which functional checks and which red team plugin families are in scope, how findings will be reported, and what a retest covers. Because the scope is agreed up front, your security, compliance and platform teams can review exactly what will be probed before any test traffic reaches a crew. Ask for the scope to list the CrewAI version and the model providers the crew uses, since both change how the provider is wired and how results should be read.
DeployOpen then configures promptfoo inside your environment rather than on a vendor-hosted service. The provider connection to the crew, the test configuration, the credentials for model endpoints and the location of result files are set up on infrastructure you control, so the prompts, tool outputs and any sensitive data stay within your boundary. Promptfoo documentation states that evals run locally and talk directly with the LLM, which makes the network path and the credential handling easier to review. Where your team needs shared results or access control across several people, confirm early whether the self-hosted or Enterprise options fit, because the self-hosted app has no built-in authentication or SSO and is not recommended for production use.
DeployOpen runs the functional and red team checks against the agreed scope, then documents each finding with the evidence needed to reproduce it, the suggested fix and a retest after the fix is applied. The written report is the record your team keeps. Ongoing testing as the crew changes is available as a retainer, which suits teams that update agent roles, tools or models often. Ask for the retainer terms in writing alongside the initial scope.

