Skip to main content
Evaluations help you systematically test your agent. Create test cases with expected outcomes, run them against your agent, and track quality over time.

Why Evaluate?

Manual testing in the Playground is useful for exploration, but evaluations provide:
  • Consistency - Same tests run the same way every time
  • Regression detection - Know immediately if changes break something
  • Quality metrics - Track scores over time
  • Documentation - Test cases describe expected behavior

The Evaluate Page

Open any agent and go to the Evaluate section. You’ll see:
  • Test Cases - Your collection of input/expected output pairs
  • Run History - Past evaluation runs and their results
  • Current Run - Real-time progress when an evaluation is running

Creating Test Cases

A test case defines:

From Scratch

  1. Click Create Test Case
  2. Enter the user input
  3. Describe the expected output
  4. Add any specific criteria
  5. Save

From Playground

When you have a good conversation in the Playground:
  1. Note the user message and agent response
  2. Go to Evaluate and create a test case
  3. Use the conversation as your baseline

Import Bulk

For many test cases:
  1. Click Import
  2. Upload a JSON or CSV file with your test cases
  3. Map the columns to fields
  4. Import

Writing Good Test Cases

Be specific about expectations

Instead of “should be helpful”, specify:

Cover different scenarios

Build a diverse test suite:
  • Happy paths (common, expected use)
  • Edge cases (unusual inputs)
  • Error handling (what happens when things go wrong)
  • Out of scope (things the agent shouldn’t do)

Use criteria for precision

Criteria let you check specific aspects:

Tag for organization

Use tags to group related tests:
  • password-reset - All password-related tests
  • billing - Payment and subscription tests
  • edge-case - Unusual scenarios
  • regression - Tests for fixed bugs

Running Evaluations

Run All Tests

  1. Click Run Evaluation
  2. Wait for all tests to complete
  3. Review results

Run Single Test

To test one case:
  1. Find the test case
  2. Click the play button
  3. See the result inline

Run with Different Models

Compare how different models perform:
  1. Click Run Evaluation
  2. Select a different model from the dropdown
  3. Compare results to previous runs

Long runs and automatic resume

A run evaluates its test cases in successive batches, so it reaches the end whatever its size (a run covers at most 500 test cases). In Current Run, the progress keeps increasing until every test case has a result. If a run stops making progress, for example because the platform interrupted it, the run resumes automatically:
  • A scheduled check runs every 2 minutes and resumes any run that has shown no activity for 3 minutes. Expect the progress to move again within about 5 minutes.
  • The run resumes at the first test case without a result. Results already stored are kept and are not evaluated again.
  • The run keeps the list of test cases it started with. Test cases you add, disable, or delete after the start do not change it and apply to your next run. A run started on a single test case resumes on that test case only.
Each multi-turn test case runs in its own conversation, so its turns never mix with the turns of another test case or of a retried attempt. If 5 resumes in a row store no new result, the run stops with the status failed and the reason Run stopped after 5 resume attempts without any new result. The reason is stored in the run’s error field, which the API returns when you fetch the run. A resume that stores at least one new result resets this count, so a long run that stalls from time to time is not failed. To investigate a failed run, run the first test case without a result on its own, as described in Run Single Test.

Batch settings for self-hosted platforms

On a self-hosted platform, platform administrators can tune how runs are split. In Builder, open the Agent Evaluations workspace settings and edit the keys under batch: If a test case still reaches the runtime’s nested-call limit, the run lowers its own depth limit and resumes automatically.

Understanding Results

After a run completes, you’ll see:

Summary

  • Score - Overall pass rate (0-100%)
  • Passed/Failed - Count of each
  • Duration - How long the run took

Per-Test Results

For each test case:

Errored cases

An errored case is a test case that the evaluation could not measure, because the call to your agent or to the judge model failed. A failed case means the judge scored your agent’s answer and found it below expectations. An errored case means no judgment was produced, so it says nothing about your agent’s quality. An errored case behaves as follows:
  • It has no score. It is excluded from the run score and from regression detection, so an outage or a quota limit never lowers your score.
  • It is counted under Errored in the run summary, separately from Passed and Failed. The Errored count appears only when at least one case errored.
  • It is never stored as passed, including a multi-turn case: the conversation stops at the first turn that fails.
  • Its actual output is empty. When the agent call fails, the judge is not called.
  • Its feedback starts with the failure kind, followed by the error message, for example AGENT_RATE_LIMITED: ....
In the per-test results, an errored case shows the same icon and a 0% score badge as a failed case. Read the feedback to tell them apart. The failure kind names the cause and tells you whether to act:

Automatic replays

Before a case is stored as errored, temporary failures are replayed automatically:
  • Agent rate limit or outage (AGENT_RATE_LIMITED, AGENT_UNAVAILABLE): the whole case is replayed after the delay the LLM gateway asks for, or 5 seconds when the gateway gives none, with each wait capped at 60 seconds. The run replays the case up to 3 times by default (the config.queue.max_retries setting of the evaluation service), then stores it as errored. Replays are not counted in the results.
  • Multi-turn case: a replay restarts from the first turn in a new conversation, so the turns that had already answered run again and their agent and judge calls are billed again.
  • Judge rate limit or outage (JUDGE_RATE_LIMITED, JUDGE_UNAVAILABLE): only the judge call is replayed, with the answer your agent already gave, so your agent is not called again. The same replay limit applies, within 60 seconds of total waiting per judgment.
  • Monthly quota exhausted (AGENT_QUOTA_EXHAUSTED, JUDGE_QUOTA_EXHAUSTED): never replayed, because a monthly quota does not reset before the next month.
Other failure kinds are not replayed.

Regression Detection

When you run multiple evaluations, the system detects:
  • Improvements - Tests that now pass
  • Regressions - Tests that used to pass but now fail
  • Score changes - How individual test scores changed

Working with History

Compare Runs

Select two runs to see side-by-side comparison:
  • Which tests changed status
  • Score differences
  • What’s improved vs regressed

Delete Runs

To remove old evaluation data:
  1. Find the run in history
  2. Click the delete button
  3. Confirm

Export Results

Export evaluation data for reporting:
  1. Select a run
  2. Click Export
  3. Download as JSON or CSV

Runs without a user

An evaluation run started from the Evaluate page or the API executes as the user who started it: calls to the agent and to the judge model authenticate as that user, and quota and cost are charged to that user’s organization. Two background jobs start or resume runs that have no user:
  • The stalled-run job checks every 2 minutes for runs that are still running but have stored nothing for more than 3 minutes (and for less than 24 hours). It resumes each of them from the first case that has no result.
  • The nightly evaluation batch runs the test cases of every agent that has some. It ships disabled.
These runs authenticate to Agent Factory and to the LLM Gateway with an organization API key stored in the AGENT_FACTORY_API_KEY secret of the Agent Evaluations workspace. This section is for platform administrators, including operators of self-hosted deployments. Configure the key on every environment where agents are evaluated: without it, a stalled run is failed instead of resumed.

Configure the organization API key

Before you begin, make sure that you have:
  • The orgs:apikeys:create permission in the organization that owns the evaluated agents.
  • Access to the secrets of the Agent Evaluations workspace in Builder. By default, only workspace owners can manage secrets.
To create the key and store it:
  1. In Governance, start creating an API key in the organization that owns the evaluated agents.
  2. In the permission tree, grant agent-factory:agents:read and llm-gateway:models:chat-completions. Sending a message to an agent is authorized as a read of that agent, so the key needs no write permission.
  3. Set the scopes agent-factory:agents:* and llm-gateway:models:*. To restrict the key further, list the ids of the evaluated agents and of the models they and the judge use instead of the wildcards.
  4. Create the key and copy its value. The value starts with iak_ and is displayed only once.
  5. In Builder, open the Agent Evaluations workspace, then open Settings and select Secrets.
  6. In the Additional Secrets form, enter AGENT_FACTORY_API_KEY in New key and the key value in New value, then select +.
  7. Select Save Secrets.
For self-hosted deployments that inject workspace secrets from environment variables, you can set WORKSPACE_SECRET_agent-evaluations_AGENT_FACTORY_API_KEY instead. A secret saved in the workspace takes precedence over the environment variable. When you rotate the key, the previous value stops working immediately: save the new value in AGENT_FACTORY_API_KEY right away.

Verify runs without a user

Saving the secret does not start a run. Check the result the next time the stalled-run job resumes a run:
  1. In Builder, open the Activity feed of the Agent Evaluations workspace.
  2. Search for EVAL_AUTH_NOT_CONFIGURED. No error event with this code after the time you saved the secret means that the jobs found a usable key.
  3. On the Evaluate page of an agent whose run was resumed, open Run History. The resumed run finishes, and its cases have results instead of AGENT_ERROR or JUDGE_AUTH errors.

Limits of the organization API key

The key changes the identity that the agent, the judge, and the agent’s tools see. Plan for these limits:
  • One organization: Agent Factory grants the key only the agents of the key’s organization. A run without a user on an agent of another organization fails with 403 Access denied, stored as AGENT_ERROR on each case.
  • Nightly batch across organizations: the nightly batch evaluates every agent that has test cases, whatever its organization. Before you enable it, restrict it to the agents of the key’s organization. Otherwise the agents of every other organization fail with 403 each night.
  • Identity change on resume: a run started by a user and resumed by the stalled-run job changes identity during the run. Cases run before the stall used the user’s identity, and cases run after it use the key. Quota and cost of the resumed cases are charged to the key’s organization. If the user’s organization is not the key’s organization, the resumed cases fail with 403 (AGENT_ERROR).
  • Tools: the capabilities and tools that the agent calls receive the key’s scopes, not a user session. A tool that requires a user session may fail in a run without a user.

Troubleshoot runs without a user

EVAL_AUTH_NOT_CONFIGURED

  • Symptom: the Activity feed of the Agent Evaluations workspace shows an error event EVAL_AUTH_NOT_CONFIGURED. A run has the status failed, with an error that starts with EVAL_AUTH_NOT_CONFIGURED:.
  • Cause: the AGENT_FACTORY_API_KEY secret is missing, or its value is not an organization API key (it does not start with iak_). The jobs launch no case that would fail: the stalled-run job fails each run that still has cases to run, without writing any result, and the nightly batch stops before it creates any batch, run, or result.
  • Fix (platform administrator): configure the organization API key. A failed run is not resumed: start the evaluation again from the Evaluate page.
  • Verify: check that no new EVAL_AUTH_NOT_CONFIGURED event appears.

Cases fail with AGENT_ERROR or JUDGE_AUTH in a resumed run

  • Symptom: in a run resumed without a user, cases fail with AGENT_ERROR (agent call) or JUDGE_AUTH (judge call).
  • Cause: if the error message names the AGENT_FACTORY_API_KEY secret, the secret was removed while the run was in progress. A 401 without this message means that the platform refused the key, for example because it expired or was rotated without updating the secret. A 403 means that the agent, or the user who started the run, belongs to another organization than the key (see Limits of the organization API key).
  • Fix (platform administrator): save a valid key in AGENT_FACTORY_API_KEY, or rotate the key and save the new value. Then run the evaluation again from the Evaluate page.
  • Verify: check the next resumed run.

Best Practices

Always run your full test suite before publishing changes. Catch regressions before users do.
When you find and fix a bug, add a test case to prevent it from returning.
A failing test might mean the agent is wrong, or it might mean the test expectation needs updating.
Overly specific expectations break easily. Focus on what matters, not exact wording.
Include tests that verify the agent uses the right tools for the right tasks.

Advanced: Tool Expectations

For agents with tools, you can specify expected tool usage:
This checks that the agent:
  • Calls the expected tools with correct arguments
  • Doesn’t call forbidden tools

Next Steps

Configure settings

Set up retention, sharing, and safety guardrails

View analytics

See how users interact with your published agent