Test an agent
Check that an agent answers correctly before your colleagues rely on it, and keep an eye on it after you publish. You need edit rights: you created the agent, or its owner added you as a Co-editor. Instance administrators have the same rights on every agent they can see. Until the agent is finished, though, only its owner can open it in the builder and test it; co-editors and administrators get access once it is finished. Agents your provider manages centrally are read-only and cannot be tested here. For a tour of the builder itself, see Build an agent.
Which check to use
| Where | What it checks |
|---|---|
| Builder preview (Open preview) | Your current settings, including unsaved ones. Good for a quick question while you work. In Proposal mode the agent writes nothing to other systems. |
| Testing step (expert mode) | The saved version, measured against fixed test cases. You can repeat it after every change. |
| Operations tab | Real use of the agent: how many answers it gave (turns), errors and cost, without any conversation text. |
Add test cases
A test case is a sample question plus the words or numbers that must appear in the answer.
-
Open the agent in the builder: under Agents, select its card, then Edit in the agent's details.
-
Turn on Expert mode at the top of the builder. Workflow and Testing appear in the step bar.
-
Open Testing. If the step says "This step needs a saved agent", go back to the first step, give the agent a name and select Next.
-
Select Add test case. A new case opens with the title "Test case 1".
-
Change Title of the test case so you can tell the cases apart in the list.
-
Under What does someone ask?, type the question the way a colleague would ask it. This field is required.
-
Under What must appear in the answer?, enter one word, phrase or number that must appear (an expectation) and select Add. Repeat for each further expectation. The case only passes if every expectation appears in the answer.
Enlarge figure
If an expectation is a number or an amount, such as 18.50 or €1,200, a second button, as a number, appears next to Add. A number expectation matches the value however the answer writes it, so "12,50 €" and "12.50 EUR" both count. An expectation added with Add has to appear word for word in the answer, though upper and lower case do not matter. Each case takes up to ten text expectations and ten number expectations.
Three cases are a good start: a plain one, one where details are missing, and one the agent should turn down. Use questions from real work. You can have up to 50 cases; the counter next to Test cases shows how many there are, including cases Intra AI adds automatically (see below). Every case you add here is a Plain case, and by default that is the only kind a green run needs ("Needed for a green run: Plain case"). A green run is a run in which every case passes, see Run tests and read the results. Cases that were not added here, such as ones you captured from the preview or ones that came with an imported agent, cannot be edited in this list. You can only delete them: select the X on the case's row.
Files for your tests, such as a sample invoice, go under Example documents further down: select Add example document or drag files onto the box. They belong to no conversation and don't become part of the agent's knowledge.
Run tests and read the results
-
Save your changes. Tests run on the saved version, so while anything is unsaved, you see "Save your changes first. Tests run on the saved version."
-
Select Run tests. The agent gets each question once, and a table appears under Test runs with the columns Test case, Expected, The agent's answer and Result.
-
Expand What was checked in a row to see which expectation was found and which was missing.
Enlarge figure -
After a fix, select the checkboxes of the cases you want to repeat and select Run only the selected test cases.
Each case is a real request to the agent and uses your own token balance. If your balance runs out, the case ends as Failed.
If the agent has a procedure that creates something, Intra AI adds up to three cases of its own to every run, for example one where the record already exists. They don't appear in the list of test cases, only in the results table, marked added automatically. Their titles are in German, for example "Duplikat vorhanden (…)" or "Pflichtfeld fehlt (…)", even in the English interface. You cannot edit or remove them, and they count toward a green run. They are included in the counter next to Test cases, so such an agent shows, for example, "3/50" with an empty list, and Run tests works before you add a case of your own.
| Result | Meaning |
|---|---|
| passed | Every expectation appears in the answer. |
| failed | The agent answered, but at least one check failed, usually a missing expectation. |
| Asked first | The agent stopped to ask for something, such as a confirmation. Nobody answers during a test run. |
| Stopped | The case expected a write, but the procedure halted before it got there. |
| Please judge yourself | The case has nothing that can be checked automatically. Mark it passed or failed yourself; the row then shows "checked by you". |
| Failed (capital F) | The answer broke off with an error, so nothing could be checked. This is different from failed, where the agent answered but missed an expectation. |
The line under Test runs tells you whether you have a green run. Before the first one it reads "No green run yet." A run is green when every case passed (or you marked it as passed) and every required kind of case was included. The line then reads "The green run matches the current version". If you change the agent afterward, it reads "The green run is out of date. You have changed the agent since." Run the tests again. A run of only the selected cases counts as green if the selected cases pass and cover the required kinds, even though the other cases did not run. Run all cases before you rely on a green run. A green run is not required to Finish or Publish an agent.
Note: Once an agent has had a green run, Intra AI checks once a day whether its configuration has changed since, for example after a publish, a model change by your provider or a plugin update. If it has, Intra AI runs all test cases, including the automatic ones, once in Proposal mode. This run uses the agent owner's token balance and then appears under Test runs, without a mark showing who started it. The step only shows the most recent run.
Test an agent that writes to other systems
If the agent has access to a system (Tools step), choose a mode under What a run actually does. It only matters when the agent may create or send something there:
- Proposal: the agent only shows what it would create or send. None of it happens. The results table then says, for example, "would create:" followed by the tool name.
- Live run: whatever the agent creates or sends goes to the system you picked as the Test environment.
The builder preview has the same two options above the conversation.
Enlarge figureThe test environment is one of your connected systems, not a separate sandbox that Intra AI provides. Target system only offers systems that one of the agent's tools can reach, so for many people the only choice is their own real account. If you have no separate test account or test instance, use only Proposal.
For a live run, pick the Target system under Test environment. Depending on the system, Account and Instance fields appear as well; choose the test account or test instance there. Label is filled in with the system's name; change it if you like, but don't leave it empty, otherwise the test environment is not saved. Then select Save at the top of the builder (an unfinished agent saves automatically). The mode itself is not saved, so the next time you open the step it is back on Proposal.
After a live run, What the test really created lists the records the agent created in a record system, such as document management records and uploaded documents. Undo everything deletes them and strikes them through in the list. A record stays in place if it has picked up entries the test did not create, or if Intra AI can no longer tell for sure that it is the one the test created. Anything else the agent creates or sends, such as emails, email drafts or calendar entries, is not in the list and cannot be undone; check the target system by hand. Afterward, look for records that are not struck through. They are still in the target system; delete them there if you don't need them.
Warning: Never pick the system that holds your real data as the test environment. In a live run the agent writes there.
Capture cases from the preview
In expert mode you can turn what you see in the preview straight into test material. This only works in the side preview on a computer. Observations are missing from the preview on a phone, from the Try it tab of AI help, and for agents that take a Form.
- Open the preview with Open preview. On wide screens it is already open from the Behaviour step on.
- Ask something that makes the agent use a tool.
- Below the conversation, Observations lists each tool call, marked OK or Failed.
- Select Capture… in a row, then Save as case, Save as failure rule or Add to AGENT.md. Save as failure rule is greyed out with the hint "Only for an error result" on a successful call, and Add to AGENT.md with "Create an AGENT.md first" if the agent has none yet.
Captured cases and failure rules go into the builder and are stored the next time you save (automatically while the agent is unfinished). The line for AGENT.md (the agent's context document, see Build an agent) is saved as soon as you select Save in its dialog. New preview starts the preview over.
Try changes in a draft first
Once an agent is finished, every change you save goes straight to everyone who uses it. That is why saving a finished agent that others use asks "This agent is live — edit as a draft instead?". Choose Edit as draft, or Save live anyway to change the agent for everyone immediately. Drafts are not available while the agent is still unfinished.
- Select Edit as draft in that dialog, or Save as draft at the top of the builder on the Release step. A yellow banner says "Editing a draft — everyone else still sees the published agent."
- Make your changes and select Save draft.
- In the banner, select the Use this draft in my chats checkbox.
- Run the tests in the Testing step and try the draft in your own conversations.
- To let colleagues try it as well, select the Let other users opt into testing it checkbox. In a conversation with the agent they then see Test draft? and can switch the draft on for themselves.
- When the draft works as intended, select Publish and describe the change under What changed?. For a shared agent that now behaves differently, the note is required (at least 10 characters).
Note: A test run only checks the draft while Use this draft in my chats is selected. Otherwise it checks the published version.
After publishing, testers are switched back to the published version. To throw a draft away, select Discard draft in the banner. Drafts, versions and roles are covered in Sharing and publishing agents.
Read the Operations tab
Operations shows how the agent is used in real conversations. Only the agent's owner, its co-editors and the instance's administrators see the tab. Members who may only use the agent don't. The tab shows tool names, error codes and identifiers, never conversation text. Conversations in the builder preview and test runs don't count.
-
Select Operations at the top of the builder.
-
Choose 7 days, 30 days (the default) or 90 days at the top.
-
Above the figures, health chips show the state of the model, the tools and the prompt, for example "Model: ok", "2 ok" or "0 % used".
-
Read the four figures Turns, Users, Error rate and Cost per turn. Below them, Turns per day shows the trend, split into live and draft.
Enlarge figure -
Compare versions under By version to see whether the error rate went up after your last publish. Turns from before the agent's first release are listed as "No release".
-
If tool calls failed, Failed tool calls comes next, with the tool, the code, a count and a Sample (redacted). Save as failure rule on a row opens the Behaviour step.
Further down:
- Procedures counts the agent's procedure runs, the confirmations it asked for and the records it wrote or would have written.
- Prompt composition shows what the agent's prompt is made of. Depending on the instance, it reads "Prompt composition is switched off for this instance" instead.
- Feedback counts how often people rated an answer with thumbs up or thumbs down. Below that, Your own reasons lists the reasons you gave yourself with a thumbs down; other people's reasons are not shown.
- Recent issues appears if there were problems, with the time, kind, tool and error code of each. Save as case in a row opens the Testing step, and Save as failure rule opens the Behaviour step. Neither fills anything in, so add the case or rule there yourself.
- My agents, at the very bottom, compares every agent you are responsible for.
If most answers come from a single person, a yellow notice appears above the figures. The rates then mainly describe that one person's experience. Until someone has used the agent, the tab reads "No conversations yet".
Troubleshooting
- Testing is missing from the step bar: Expert mode is off. Turn it on at the top of the builder.
- "This step needs a saved agent": give the agent a name on the first step and select Next.
- Run tests is disabled with "Add a test case first" or "Test case 2 has no question yet": a case without a question cannot run. Fill in What does someone ask?.
- Live run cannot be selected and the hint says "Pick a test environment below first." or "The test environment is picked but not saved yet. Save it first.": pick a Target system under Test environment, make sure Label is not empty and select Save at the top of the builder.
- "No system available yet": none of the agent's tools reaches a system. Select Add tools, grant something in the Tools step and save.
- The run never turns green: look for rows marked Please judge yourself and decide them. If your last run covered only selected cases, run all of them. If a required kind of case is missing, such as a Plain case, add one. If a case marked added automatically fails, change the agent; you cannot remove that case.
- There is no Operations tab: you can use the agent but you are not its owner, a co-editor or an instance administrator. The tab also appears only once the agent has been saved.