Before you start
Every sample needs:- Git, Bash,
uv, and Docker with Docker Compose - A running Docker daemon that can run Linux containers
- Either
OPENAI_API_KEYorANTHROPIC_API_KEYfor the sample agent and simulations - RELAI installed, or permission to install it during the machine-setup step below
Choose a sample
Python sample
TypeScript sample
Go sample
Clone the sample
Choose one runtime, then open the cloned repository in your coding agent.- Ask your coding agent
- Run in terminal
Follow https://cli-docs.relai.ai/sample-agent to help me choose and clone one RELAI airline-support sample. Check its prerequisites, but stop before setup or initialization. Never ask me to paste a provider key into chat.
Set up RELAI once on this machine
If this machine is already signed in to RELAI and the integration for your coding agent is active, skip this section. Setup is machine-level; it is not repeated for every repository.- Ask your coding agent
- Run in terminal
Follow https://cli-docs.relai.ai/installation to install and set up RELAI for this coding agent. Check prerequisites, guide me through OAuth sign-in, and stop before initializing the repository. Keep provider keys out of chat.
/reload-plugins in Claude Code, or start a new interactive Copilot session.
Run one learning loop
Open your coding agent in the sample repository. Initialization creates the project runtime; the risk-to-test-to-improvement loop is what you repeat. Paste one prompt, wait for it to finish, and review the result before continuing.Initialize this repository
Use RELAI to initialize this sample. Keep provider keys out of chat.
KEY=value directly to .relai/simulator.env.Create a high-impact agent test
Use RELAI to identify the highest-impact potential failure in this sample agent and build one agent test for it.
Measure the current behavior
Use RELAI to simulate the agent test you just created and show me the readable result.
Optimize and review
Use RELAI Agent Optimizer on that test in Balanced quality/cost mode. Keep changes local and show before-and-after results.
- Coding-agent path
- Terminal summary
--no-pr keeps accepted changes on a local relai/optimizer/… branch, so this sample does not require GitHub authentication. On your own repository, an authenticated GitHub CLI can publish the branch and open a pull request.
Optional: challenge the agent further
After the first loop, choose the prompt that matches your next goal. These are optional paths, not required steps.Make the scenario harder
Make the scenario harder
Use RELAI to make that test harder with a multi-turn scenario. Reuse or update existing coverage instead of duplicating it.
Add adversarial pressure
Add adversarial pressure
Use RELAI to create a five-turn adversarial test for the most important uncovered risk. Increase the pressure realistically on each turn.
Optimize against the suite
Optimize against the suite
Use RELAI Agent Optimizer on the failing tests in Balanced quality/cost mode. Keep changes local and compare before-and-after results.