These pages tell one story. A refund-support agent answers customers who want their money back. Anna is a gold customer with a delivered order, and she asks for a refund. We want a test that proves the agent finds her order and quotes the right amount, every time, against data that exists only for that test.
Each page takes the story one step further:
- Writing scenarios: the situation, the world it needs and criteria a judge can check.
- Test data: fixtures that build Anna's world before the first turn and remove it after the last. Its five rules, one section each, apply on every path.
- Parameters and suites: what varies between runs, and how scenarios group.
- Running and CI: repeats, comparisons, gating a release, and Not scored versus failed.
Which path fits your team
The practices are the same on every path. What changes is where the scenario, the test data and the run live. Each cookbook builds Anna's scenario end to end.
| You want | Path | Scenario lives in | Test data is made by | What you need | Start with |
|---|---|---|---|---|---|
| Tests in your repository, run by pytest or vitest | Code | Your test files | A pytest fixture, or vitest beforeEach and afterEach | A developer who writes the tests, and the Scenario SDK release after 1.7.1 (Python) or 1.8.2 (TypeScript) | Test an agent fully in code |
| Engineers own the agent and its data, product owns the scenarios | Hybrid | The platform | Setup and teardown hooks on a connected agent, in your process | A developer who connects the agent with the LangWatch SDK and keeps its process running, and the langwatch SDK release after 2.5.0 (TypeScript) or 2.0.1 (Python) | Test an agent with code and the platform |
| No process of your own running, the agent reachable through an API | App | The platform | The setup and teardown blocks of a Scenario Connector | An API LangWatch can reach, and a developer to paste the blocks: about half an hour if your API matches the example. Ask your developer early whether it does, with the hand-off message | Test an agent in the app |
Pick the code path when every scenario change goes through code review anyway. Pick the hybrid path when the data needs your database, private network or internal secrets. Pick the app path when your API is reachable from the internet and no one wants to run a process. On every path, fixtures are plain data: in the test file on the code path, and in the scenario editor or the API on the other two.
The code path needs the Scenario SDK release after langwatch-scenario 1.7.1 and @langwatch/scenario 1.8.2, with vitest 4.1 or later. The hybrid path needs the langwatch SDK release after 2.5.0 (TypeScript) or 2.0.1 (Python). Until those releases ship, only the app path runs on published versions.
Why fixtures make results repeatable
A verdict means something only when the agent saw the world the scenario describes. Setup creates that world from fixtures before the first turn, and teardown removes it, in reverse order, after the last. Every run starts from the same data, so a failed run points at the agent, not at leftovers from the run before.
Next: Writing scenarios.