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
- Click Create Test Case
- Enter the user input
- Describe the expected output
- Add any specific criteria
- Save
From Playground
When you have a good conversation in the Playground:- Note the user message and agent response
- Go to Evaluate and create a test case
- Use the conversation as your baseline
Import Bulk
For many test cases:- Click Import
- Upload a JSON or CSV file with your test cases
- Map the columns to fields
- 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 testsbilling- Payment and subscription testsedge-case- Unusual scenariosregression- Tests for fixed bugs
Running Evaluations
Run All Tests
- Click Run Evaluation
- Wait for all tests to complete
- Review results
Run Single Test
To test one case:- Find the test case
- Click the play button
- See the result inline
Run with Different Models
Compare how different models perform:- Click Run Evaluation
- Select a different model from the dropdown
- 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.
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 underbatch:
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: ....
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 (theconfig.queue.max_retriessetting 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.
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:- Find the run in history
- Click the delete button
- Confirm
Export Results
Export evaluation data for reporting:- Select a run
- Click Export
- 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.
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:createpermission 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.
- In Governance, start creating an API key in the organization that owns the evaluated agents.
- In the permission tree, grant
agent-factory:agents:readandllm-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. - Set the scopes
agent-factory:agents:*andllm-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. - Create the key and copy its value. The value starts with
iak_and is displayed only once. - In Builder, open the Agent Evaluations workspace, then open Settings and select Secrets.
- In the Additional Secrets form, enter
AGENT_FACTORY_API_KEYin New key and the key value in New value, then select +. - Select Save Secrets.
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:- In Builder, open the Activity feed of the Agent Evaluations workspace.
- Search for
EVAL_AUTH_NOT_CONFIGURED. Noerrorevent with this code after the time you saved the secret means that the jobs found a usable key. - 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_ERRORorJUDGE_AUTHerrors.
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 asAGENT_ERRORon 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
403each 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
erroreventEVAL_AUTH_NOT_CONFIGURED. A run has the statusfailed, with an error that starts withEVAL_AUTH_NOT_CONFIGURED:. - Cause: the
AGENT_FACTORY_API_KEYsecret is missing, or its value is not an organization API key (it does not start withiak_). 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_CONFIGUREDevent 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) orJUDGE_AUTH(judge call). - Cause: if the error message names the
AGENT_FACTORY_API_KEYsecret, the secret was removed while the run was in progress. A401without this message means that the platform refused the key, for example because it expired or was rotated without updating the secret. A403means 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
Run before publishing
Run before publishing
Always run your full test suite before publishing changes. Catch regressions before users do.
Add tests for bugs
Add tests for bugs
When you find and fix a bug, add a test case to prevent it from returning.
Review failures carefully
Review failures carefully
A failing test might mean the agent is wrong, or it might mean the test expectation needs updating.
Keep tests maintainable
Keep tests maintainable
Overly specific expectations break easily. Focus on what matters, not exact wording.
Test tool usage
Test tool usage
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:- 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