Individual skill
scenarios
Test your AI agent with simulation-based scenarios. Covers writing scenario test code (Scenario SDK), creating platform scenarios via the `langwatch` CLI against a connected agent, reading the run parameters that agent declares so the scenarios and comparison runs turn its real levers, and red teaming for security vulnerabilities. Auto-detects whether to use code or platform approach based on context.
skills/_compiled/native/scenarios/SKILL.md
Source commit e5e4a1741ba26492ebf8865b24b05e0ef39b750e
What was checked
- Matches the observed repository HEAD
- Yes
- Scanner rules are current
- Yes
- Repository scan complete
- No
- Skill scan complete
- No
- Observed behavior
- Network or broad shell
- Last checked
- Nov 9, 2026
These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.
Install this skill
Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.
An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.
Repository context
- Repository stars (not skill ratings)
- 5,020
- Repository last updated
- Nov 10, 2026
- License
- Apache-2.0
Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.
- ai Repository topic
- analytics Repository topic
- datasets Repository topic
- evaluation Repository topic
- gpt Repository topic
- llm Repository topic
- observability Repository topic
- openai Repository topic
- prompt-engineering Repository topic
- dspy Repository topic
- writing Derived category
- security Derived category
- testing Derived category
Files and excerpt
File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.
Browse files
SKILL.mdcore · 74,338 bytesSKILL.mdcore · 74,338 bytesSKILL.mdcore · 74,338 bytesSKILL.mdcore · 74,338 bytesSKILL.mdcore · 74,338 bytesSKILL.mdcore · 74,338 bytesSKILL.mdcore · 74,338 bytesSKILL.mdcore · 74,338 bytesSKILL.mdcore · 74,338 bytesSKILL.mdcore · 74,338 bytesSKILL.mdcore · 74,338 bytesSKILL.mdcore · 74,338 bytesSKILL.mdcore · 74,338 bytesSKILL.mdcore · 74,338 bytesSKILL.mdcore · 74,338 bytesSKILL.mdcore · 74,338 bytesSKILL.mdcore · 74,338 bytesSKILL.mdcore · 74,338 bytesSKILL.mdcore · 74,338 bytesSKILL.mdcore · 74,338 bytesSKILL.mdcore · 74,338 bytesSKILL.mdcore · 74,338 bytesSKILL.mdcore · 74,338 bytesSKILL.mdcore · 74,338 bytesSKILL.mdcore · 74,338 bytesSKILL.mdcore · 74,338 bytes
Read excerpt
# Test Your Agent with Scenarios
NEVER invent your own agent testing framework. Use `@langwatch/scenario` (Python: `langwatch-scenario`) for code-based tests, or the `langwatch` CLI for no-code platform scenarios. The Scenario framework provides user simulation, judge-based evaluation, multi-turn conversation testing, and adversarial red teaming out of the box.
## Determine Scope
If the user's request is **general** ("add scenarios", "test my agent"):
- Read the codebase to understand the agent's architecture
- Study git history to understand what changed and why: focus on agent behavior changes, prompt tweaks, bug fixes. Read commit messages for context.
- Generate comprehensive coverage (happy path, edge cases, error handling)
- When the agent is connected to the platform, read the run parameters it declares before you propose anything (`langwatch agent get <id> --format json`, under `parameters`). Each one is a lever the team built into the agent: cover it with one scenario per value that changes the expected behavior, and offer a comparison run across an option list (see Read the agent's levers in the Platform Approach)
- For conversational agents, include multi-turn scenarios, because that's where the interesting edge cases live (context retention, topic switching, recovery from misunderstandings)
- ALWAYS run the tests after writing them, and report the result in the same answer. With the Code approach, that means waiting: run `pytest` or `vitest` in the foreground with a timeout that covers every simulation, and never hand it to a background task or end the answer with "I will report when it finishes". A code run you did not wait for is not a run: the turn ends, the report never arrives, and the user is left with test files nobody has seen pass. With the Platform approach, a run is scheduled rather than executed in your process, so do not block on `--wait` in an interactive turn: trigger it, hand over the link, and say what the page will show (see step 5 of the Platform Approach). Report the result: how many scenarios ran, which passed, and what the failures said. Stop after two rounds of fixes and report what still fails, with what you tried. A loop that keeps rerunning the suite spends the time of the user and tells them nothing until it ends. If they fail, first decide which side is wrong. Change the test only when you have evidence that its criteria or its fixture are wrong; otherwise the agent is what needs the fix (see Improving the Agent When a Scenario Fails below). A scenario that goes green because its assertions got weaker has tested nothing.