Skip to main content
Your agent answers finance questions from NetSuite and does the work: what is past due, which bills wait for approval, which payment to apply. You can test it before it has production traces. For an agent that calls NetSuite directly, ancha init writes a NetSuite world, the books of a private-equity portfolio company, and 25 tests: 10 questions an operator asks and 15 workflows that change the books. A question checks the agent’s answer, and that it changed no record. A workflow checks the records the agent leaves.

Before you start

  • Node.js 24 or later, and the CLI: npm install -g @ancha-labs/cli.
  • A workspace at app.ancha.io. Run ancha login once and approve this computer in the browser.
  • An agent that reads NetSuite’s URLs and credentials from its environment, such as NETSUITE_SUITEQL_URL and NETSUITE_ACCESS_TOKEN. See NetSuite.

Set up the project

Run init in the agent’s project:
Output
  • tools names the tools init found, and where. When it finds others or none, name them: ancha init --tools netsuite.
  • An agent that reads NetSuite under its own names, such as NS_ACCOUNT_ID, gets them mapped in ancha.yaml, and a netsuite: line lists them.
  • answer says where the tests read the agent’s final answer.
  • data names the world and the tests:
The books hold what an operator finds at close: overdue receivables, duplicate bills, unapplied payments and credits, three-way-match exceptions and journal entries waiting for approval. --data netsuite-pe:s writes a smaller company, with 1,522 transactions, and --data netsuite-pe:l a larger one, with 22,268. --data none leaves them out. An agent that reaches NetSuite through Composio gets the same books and the 10 read tasks, and runs them in the cloud; see Detect Composio agents. Each test asks one question. ancha/tests/pe-11-ap-over-60-days.yaml asks this, and checks the answer:
ancha/tests/pe-11-ap-over-60-days.yaml
The answer check passes when the agent’s final answer states USD 207,832.73 to the cent and 19 bills. No model grades it. The second check, read-only, is netsuite.unchanged over every record type. The file’s header keeps the expected answer and the SuiteQL query that computes it. See Answer checks. Each workflow gives the agent a job and checks NetSuite afterwards. ancha/tests/pe-write-01-approve-bill.yaml asks for an approval within policy, with the list of every NetSuite record type shortened here:
ancha/tests/pe-write-01-approve-bill.yaml
The bill must end up approved, no other record may change, and the books must still hold 1,800 vendor bills. The other workflows refuse a bill over the limit and a duplicate bill, apply a payment and a credit memo, create a vendor bill, a customer and an accrual that balances, update terms and a credit limit, pay an approved bill, refuse a bank-detail change requested by email, retry a bill a previous run already entered, and finish a payment left unapplied. Each expected record is computed from the books. See NetSuite checks.

Upload the agent

Store the agent’s model key in your workspace, then upload the agent. A fresh machine in the cloud installs it and asks it to find one customer in NetSuite.
Output
When the agent does something else, the agent line says what happened in one sentence, and fix: gives the change to make. See ancha agent upload.

Run the tests in the cloud

Each attempt runs on a fresh machine of its own, with a fresh copy of the books. The run ends with the link to its result, Result: https://app.ancha.io/runs/run_cloud_<uuid>, and the command that explains it.
Output
This agent counted the bills that still wait for approval. While you fix it, run that test on this computer:

Read the report

The command reads the run from your workspace once, keeps it in .ancha/runs/<run id>/, and writes report.html there. It prints the page’s path and opens it. The page is one file that works offline:
  • The verdict, with four numbers: the attempt pass rate, the tests, the attempts per test and the total attempts.
  • Tests: one row per test, one cell per attempt.
  • Machines: each attempt’s machine, on one clock.
  • Evidence: for each attempt, the expected answer next to the agent’s, each check, the NetSuite calls with their SuiteQL, the records the attempt changed, and the end of the agent’s log.

Add your own evals

Your team’s questions with expected answers become tests on the same world. Keep the file under ancha/evals/: the agent gets its project’s files in a cloud run, and ancha/ stays with the grader.
ancha/evals/month-end.csv
Output
The numbers in an expected answer, its quoted text and its document numbers such as INV-1043 become the answer check. furthest-over-limit gets this one:
ancha/tests/furthest-over-limit.yaml
Other columns, such as Owner, stay in the test’s header as comments. The import also reads JSON lines, JSON and YAML, and the files of eval tools such as promptfoo, LangSmith and Braintrust. Importing again keeps the tests you edited. See ancha test import. An eval can check a write too. records names the NetSuite record the agent must leave behind:
ancha/evals/approvals.jsonl
It becomes a netsuite.record check:
ancha/tests/approve-sac-2384.yaml

Use your own books

Your own NetSuite data goes in a world file of its own, ancha/worlds/<id>.yaml. ancha world import netsuite writes it from your NetSuite exports as NetSuite writes them: REST record JSON, SuiteQL results and saved search CSV.
Output
Customers, vendors, items, the chart of accounts and the main transactions become the books, each record in its own subsidiary and currency. Custom record types and every other record are kept as given, and so is each field beyond the modeled ones. The agent reads all of them through REST and SuiteQL. The import checks that the books add up and names each record that does not, with its file:
Output
It exits 1 until the export adds up. See ancha world import netsuite for every format and option. To write the seed by hand instead, ancha twins seed netsuite lists its fields. After you edit the file by hand, ancha world validate checks it again. It reads the file as a test loads it and runs the same books check:
Output
It exits 1 while a problem remains and 0 once the books add up. Then point tests at the world with world: our-books, or import your evals onto it: ancha test import <evals file> --world our-books.

Next steps

Answer checks

Text and numbers the final answer must state.

ancha test import

Every format and field it reads.

NetSuite

REST records, SuiteQL, MCP tools and the built-in dataset.

The run report

One page per run, for runs in the cloud and on this computer.