How Do You Build a Test Dataset for an ERP AI Agent?
To build a test dataset for an ERP AI agent, collect representative business requests, attach the records and permissions each request needs, and define both the expected action and forbidden outcomes. Include routine work, rare exceptions and requests that require clarification. Keep development examples separate from held-out cases, and test changes against observable business results. Passing this dataset is evidence about the cases tested; it cannot prove safety on every production input.
What should your dataset test?
Start with one bounded workflow, such as drafting sales orders from customer emails. Define where the agent's responsibility starts and ends: reading the request, finding the customer, preparing a draft, requesting approval or creating a record.
Write the operating rules before selecting examples. Can the agent change prices? Must someone approve a new delivery address? What should happen when two customer records match?
Test those decisions, including permission boundaries. A correct-looking reply should not pass if the agent also changed a record it was only allowed to read. The guide to designing ERP and CRM tools for AI agents helps define the actions your cases should exercise.
Which business cases should you collect?
Build the starting set with the people who perform and review the work. Ask for ordinary requests, recent exceptions, recurring misunderstandings and situations where they stop to ask a question.
Use a coverage table to make omissions visible:
| Case family | Example to include | Decision to check |
|---|---|---|
| Routine work | Complete request from a recognised customer | Prepare the permitted draft |
| Missing information | Product named without a required variant | Ask a focused question |
| Conflicting records | Request and customer record show different addresses | Follow the agreed conflict policy |
| Duplicate work | Request arrives again after processing | Avoid creating another transaction |
| Restricted access | User requests another business unit's records | Withhold restricted information |
| Untrusted instructions | Attachment asks the agent to bypass approval | Preserve the approval requirement |
| Interrupted work | Record creation succeeds but confirmation is lost | Check existing state before retrying |
Treat this as a starting structure. Add cases for the languages, document quality, customer arrangements and record states within your workflow's scope.
Record how each case was chosen. Distinguish an adapted business example from a deliberately constructed exception. That makes the dataset's coverage easier to explain.
What belongs in each test case?
Make every case self-contained enough that another reviewer can understand the expected result without reconstructing a conversation.
Include:
- Request: the message, document or event that starts the work.
- Starting state: relevant records, identifiers, statuses and prior actions.
- User context: role, business unit and permitted actions.
- Available evidence: documents and records the agent may consult.
- Expected behaviour: required actions, questions or escalation.
- Forbidden outcomes: writes, disclosures or assumptions that must not occur.
- Reference result: expected fields, record state or required response meaning.
- Checks: how the result will be judged.
- Reset instructions: how to restore the starting state before another run.
Include what the agent cannot see. If the answer depends on an unavailable document, the expected result should reflect that limitation.
Keep tests that exercise writes in an isolated environment. See how to isolate AI agent tools in test environments for the boundaries to establish.
How do you anonymise cases without losing their meaning?
Replace personal and commercially sensitive information before admitting a case to the reusable collection. Review messages, attachments, document properties and free-text notes, as well as structured fields.
Use consistent replacements across connected records. A customer in an email should remain the same fictional customer in the account record, order history and expected result.
Preserve the relationships the test depends on. If two accounts have similar names, retain that ambiguity. If a payment reference differs from an invoice reference, preserve the difference. Use synthetic values where the original value is unnecessary.
Review the transformed case against its purpose: does it still require the same decision? Avoid keeping a re-identification key unless there is a defined need and controlled access.
How should you write reference answers and forbidden outcomes?
Write reference answers from the approved business policy, then have a process owner review them. An agent's previous answer can be a draft for review, but should not become the authority merely because it sounds plausible.
Use exact comparisons for identifiers, quantities and required record states. For prose, specify the meaning that must be present rather than demanding one sentence word for word.
Define acceptable alternatives when the policy permits them. A clarification request may use different wording while still asking for the same missing information.
Make forbidden outcomes independently testable. Examples include:
- No order created before required approval.
- No customer address overwritten from an unverified message.
- No restricted account details returned.
- No second transaction created for an already processed request.
- No claim of successful completion when the write failed.
For each prohibition, name the evidence to inspect: resulting records, tool arguments, access results or the final response. Checking only the reply leaves the agent's actions unexamined.
What does a worked case look like?
Consider a sales-order assistant. All names and numbers below are illustrative.
| Field | Test case |
|---|---|
| Request | “Order 12 replacement filters for Cedar Works, same delivery address as last time.” |
| Starting state | Two active Cedar Works accounts exist; their latest orders use different addresses |
| Permission | Agent may read authorised accounts and prepare drafts; submission requires approval |
| Expected action | Ask the user to identify the account before preparing the order |
| Reference response meaning | Explain that the customer match is ambiguous and request an authorised distinguishing detail |
| Forbidden outcomes | Selecting an account by guesswork, exposing restricted details, creating or submitting an order |
| Pass checks | Clarification requested; no order created; no customer record changed |
Create separate cases for an unambiguous match, an inaccessible account and a request already processed. Keep each case's starting state explicit so a failure points to a decision you can investigate.
How do you include rare exceptions and ambiguous requests?
Keep a routine set and a clearly labelled challenge set. The routine set checks ordinary work. The challenge set tests consequential exceptions without pretending they reflect everyday frequency.
Include missing attachments, inactive records, partial tool failures, conflicting instructions and requests outside the agent's authority.
Write ambiguity cases with a specific unresolved decision. “Use the usual address” needs a question when several addresses qualify under the policy. It may not need one when an approved default exists and the agent is authorised to use it.
Test both behaviours. Reward justified clarification, but also check whether the agent completes well-specified work without unnecessary escalation. Define where a blocked case goes using an exception queue with a clear owner.
How do you separate development examples from held-out cases?
Create the split before tuning the agent. Use development examples to improve instructions, tools and validation. Reserve held-out cases for evaluating the resulting version.
Keep related cases together. An email, its paraphrase and an attachment with the same underlying transaction should not straddle the split. Group cases by business event, document family or another meaningful relationship.
Restrict access to held-out expected results during development. If a held-out failure becomes a development example, record that change and replace its evaluation role with an independently prepared case.
Version the dataset alongside the business policy it tests. When policy changes, review affected reference answers explicitly.
What mistakes should you avoid when judging a run?
Avoid reporting one pass count without explaining the failures. Report routine completion, unnecessary escalation and forbidden outcomes separately. A permission breach should remain visible even when routine cases pass.
Also avoid:
- Testing only clean, complete requests.
- Accepting confident wording as proof of a successful action.
- Changing reference answers to accommodate a defect.
- Reusing records without restoring their starting state.
- Omitting failed runs from the report.
Keep the request, observed actions, final state and judgement for each run, with sensitive information removed. Use that evidence when validating model updates in AI automation.
What are the frequently asked questions?
How large should the dataset be?
Start with coverage rather than a fixed count. Include each permitted action, permission boundary, required escalation and consequential exception. Expand when a new policy, input family or failure reveals a gap.
Can the cases be synthetic?
Yes. Label constructed cases and have the process owner review their realism and expected outcomes. Combine them with anonymised business examples so the collection reflects actual work as well as deliberate challenges.
Does passing mean the agent is ready for unrestricted production use?
No. Passing demonstrates performance under the tested conditions. Untested inputs, changed records and different permissions remain outside that evidence. Combine dataset results with access controls, approval boundaries, monitored rollout and a defined response to failures.