Reference
Rules
Rules bend individual responses so you can prove your integration survives the failures real vendors produce and sandboxes never do.
Matching
Each rule has a method (or *) and a pathPattern. The pattern matches the request path with * wildcards, or equals the spec path template exactly (for example /tasks/{task_gid}). Rules are evaluated in priority order; latency rules accumulate, and the first fixed, error, conditional or chaos rule that applies decides the response.
| Config field | Used by | Meaning |
|---|---|---|
status | fixed, error, conditional, chaos | HTTP status to return. |
body | fixed, error, conditional, chaos | JSON body. Optional for errors. |
headers | all | Extra response headers. Content-Type, Set-Cookie, Location and CSP cannot be overridden. |
probability | any | 0 to 1. The rule only applies to this share of requests. |
latencyMs | latency | Added delay in milliseconds (total capped at 30 seconds). |
latencyJitterMs | latency | Random extra delay between 0 and this value. |
when | any | Condition on query, header or body: key plus equals or exists. |
POST /v1/simulations/{id}/rules, the MCP add_rule tool, or the Rules tab in the dashboard. Responses always stay JSON, whatever a rule says.Kinds
fixed
Always return this status and body. Useful for pinning an awkward edge case, such as an empty page or a deprecated field.
{
"name": "Empty project list",
"kind": "fixed",
"method": "GET",
"pathPattern": "/projects",
"config": { "status": 200, "body": { "data": [], "next_page": null } }
}error
Fail with a status, some of the time. Leave out body and Slurry builds an error in the API's own error shape. A 429 adds Retry-After: 30 unless you set headers.
{
"name": "Rate limited writes",
"kind": "error",
"method": "POST",
"pathPattern": "/tasks",
"config": { "status": 429, "probability": 0.2 }
}latency
Add delay, with random jitter on top. Latency rules stack with each other and with other rules, so you can combine a slow response with an error.
{
"name": "Slow search",
"kind": "latency",
"method": "GET",
"pathPattern": "/workspaces/*/tasks/search",
"config": { "latencyMs": 2500, "latencyJitterMs": 1500 }
}conditional
Return a fixed response only when the request matches. when.source is query, header or body; match with equals or exists.
{
"name": "Archived projects are forbidden",
"kind": "conditional",
"method": "GET",
"pathPattern": "/projects",
"config": {
"when": { "source": "query", "key": "archived", "equals": "true" },
"status": 403,
"body": { "errors": [{ "message": "Not authorised to view archived projects" }] }
}
}chaos
A low-probability failure across a wide pattern, for soak tests. Behaves like error, intended for broad paths and small probabilities.
{
"name": "Background turbulence",
"kind": "chaos",
"method": "*",
"pathPattern": "*",
"config": { "status": 502, "probability": 0.02 }
}