Skip to content

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 fieldUsed byMeaning
statusfixed, error, conditional, chaosHTTP status to return.
bodyfixed, error, conditional, chaosJSON body. Optional for errors.
headersallExtra response headers. Content-Type, Set-Cookie, Location and CSP cannot be overridden.
probabilityany0 to 1. The rule only applies to this share of requests.
latencyMslatencyAdded delay in milliseconds (total capped at 30 seconds).
latencyJitterMslatencyRandom extra delay between 0 and this value.
whenanyCondition on query, header or body: key plus equals or exists.
Rules are created with 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.

POST /v1/simulations/{id}/rules
{
  "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.

POST /v1/simulations/{id}/rules
{
  "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.

POST /v1/simulations/{id}/rules
{
  "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.

POST /v1/simulations/{id}/rules
{
  "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.

POST /v1/simulations/{id}/rules
{
  "name": "Background turbulence",
  "kind": "chaos",
  "method": "*",
  "pathPattern": "*",
  "config": { "status": 502, "probability": 0.02 }
}