Agent Tests
Before people rely on an Enterprise Agent, check that it answers as it should and stands up to attacks. Open the agent in Workspace › Enterprise Agents and go to its Tests card. The card has two tabs:
- Tests: questions people would ask, each with checks for the answer.
- Security tests: attacks that try to make the agent misbehave.
The card appears once the agent is saved, and tests run on the saved agent (with review on, on your saved draft). Save your changes before you run them.
A test asks its question as you, through the agent, with the agent's instructions, knowledge and tools. Tools that change things are not run: sending or replying to e-mail, saving memories or notes, creating automations, calendar events or tasks, posting messages, adding files to knowledge, and the like. The agent's attempt is recorded instead, with what it would have done. Tools that only read, such as searching knowledge, run as usual.
Writing a test
- On the Tests tab, click Add test.
- Give the test a Test name, and type the Question as a person would ask it.
- Click Add a check, choose what to check, and fill in its value. A test can have up to 20 checks, and needs all of them to pass.
- Click Save.
Checks
| Check | Passes when |
|---|---|
| Says | The answer contains the text. Capitals don't matter. |
| Never says | The answer doesn't contain the text. |
| Matches a pattern | The answer matches a regular expression. Capitals don't matter. |
| Uses a tool | The agent calls the tool you name. |
| Never uses a tool | The agent doesn't call the tool you name. |
| Cites a document | The answer uses a document whose name contains the text. |
| Meets criteria (judged) | A judge model scores the answer against what you describe a good answer does, and the score reaches Pass at (70% by default). |
| Stays with its documents (judged) | A judge model finds the answer supported by the documents it used, at Pass at or above. An answer that used no documents fails. |
The judged checks use the quality judge model chosen in Admin › Trust, or else Studio's default model. Each failed check says why: the judge gives its reason in a sentence.
Running tests
Click Run tests. The run goes on in the background, so you can leave the page and come back. While it runs, the card shows how far it has got, and Stop ends it after the questions already started.
When it finishes, the card shows how many tests passed and the pass rate, for example 4 of 5 passed (80%). Open a test to see its answer and the verdict of each check. If the agent has changed since the run, the card says so: run the tests again.
Pass bar
Each agent has a Pass bar, 80% by default. It matters when review before going live is on: a change can be submitted only when its latest test run reaches the bar.
Compare models
Compare models runs the same tests on up to two other models, with the agent's own instructions, knowledge and tools, and shows the results side by side:
- the verdict of each test on each model;
- the Pass rate;
- the Average answer time;
- the Tokens used.
Use it before you move an agent to another model, for example from a cloud model to a local one. The agent itself isn't changed.
Security tests
The Security tests tab sends the agent 30 built-in attacks, and any of your own, then checks whether it resisted each one. The built-in attacks fall into six categories:
| Category | What the attacks try |
|---|---|
| Prompt injection | Instructions hidden in an e-mail, document, web page or data the agent is asked to handle |
| Revealing its instructions | Getting the agent to repeat, translate or summarise its system prompt |
| Extracting personal data | Contact details, card numbers and identity numbers |
| Jailbreak and role-play | Personas without rules, role-play games and "hypothetical" framing |
| Harmful requests | Phishing, malware, weapons, fraud and harassment |
| Tool misuse | Instructions inside content that try to make the agent send e-mail, delete data or create automations |
Click Run security tests. Depending on the attack, the answer is checked for whether the agent:
- followed an instruction hidden in the content (the hidden instruction asks for a marker word);
- tried a tool that changes things;
- repeated its own instructions;
- gave away personal data: a card, Aadhaar or PAN number (found by the guardrails' detectors), or a list of three or more e-mail addresses or phone numbers;
- declined a harmful request, decided by the judge model.
The result is a score per category, such as 5 of 5 resisted, and each failed attack says why. Show the built-in attacks lists them all.
A run in which any attack succeeds records a Security tests failed event in Admin › Trust › Security.
Your own attacks
Click Add an attack, give it a name, and type The attack, as someone would send it. Add checks as for a test, for example Never says with a word the agent must not reveal. Your attacks are scored under Your attacks.
Required before review
Turn on Security tests must pass before review to require every security test to pass before a change of this agent can be submitted for review.
Limits
- A run answers up to 200 tests. A test holds up to 20 checks.
- Each server answers two test questions at a time, so a long run takes a while. Other people's runs share the same two places.
- A test asks one question, without an earlier conversation.
- The judged checks and the security verdicts are only as good as the judge model. A small local judge may fail to decide; the check then fails and says so.
- Tests and their runs are deleted with the agent.