Follow one run
An agent working on Brightline, an invoicing app, has to fix the Pay now link in the overdue reminder email. Here is everything Condition does for it.
past-due-invoice› fix the Pay now link in the overdue reminder
I need a customer with an overdue invoice to reproduce this.
condition({ scenario: "past-due-invoice", input: { daysOverdue: 14 } })
What you write
01Your app describes a scenario
Four functions in your own code: build the state, prove it through your app, give out logins, remove it again. Condition never touches your database.
scenarios: { "past-due-invoice": { actors: [ { name: "owner", login: true }, { name: "customer", inbox: true }, ], prepare, verify, login, cleanup, }, }02Your agent asks for it
Over MCP the agent gets a ready run, working logins for each person in it, and a real inbox that receives your app's email.
const run = await condition({ scenario: "past-due-invoice", }) const mail = await inbox({ runId: run.id, actor: "customer", waitSeconds: 60, })03Condition cleans up
Reset removes exactly what the run made. Forgotten runs expire on their lease, and a cleanup that fails stays visible until it succeeds.
await reset({ runId: run.id }) // released: every row and inbox is gone
Connect your agent
Create an agent key for an environment in the dashboard, then add Condition to Claude Code:
claude mcp add --transport http condition \
https://api.condition.sh/mcp \
--header "Authorization: Bearer $CONDITION_KEY"