/api/v1/simulator/run/{runId}/replayReplay a simulator run
Forks an existing simulator run from step N. Body: `fromStep` (required positive integer, must be ≤ parent turn_count + 1) and `maxTurns` (integer 1-50, default 10). Creates a new `simulation_runs` row that INHERITS the parent's target verbatim — same persona, endpoint, auth/headers, generator model, adversarial mode and attack target; there is no way to point the fork at a different model, prompt or endpoint. The link is recorded as replayed_from_run_id / replayed_from_step, and the worker copies turns 1..fromStep-1 as is_replayed=true before regenerating from fromStep onward. ASYNCHRONOUS: the job is enqueued and 201 is returned immediately with the forked run in `pending`; poll the run for progress. The gating org is derived from the parent run row, so a member of another org cannot fork it (which would also copy the target's credentials). Requires evals:create.
Authentication
Send Authorization: Bearer YOUR_API_KEY on every request. Generate API keys at /dashboard/settings/api-keys.
Parameters
runId in pathrequiredstringResponse
202 example
{
"run_id": "00000000-0000-0000-0000-000000000000"
}All status codes
Code samples
cURL
# {runId} is shown with an EXAMPLE value — replace it with real values.
curl -X POST \
https://evalguard.ai/api/v1/simulator/run/00000000-0000-0000-0000-000000000000/replay \
-H "Authorization: Bearer $EVALGUARD_API_KEY"TypeScript
// The TypeScript SDK (@evalguard/sdk) exposes TYPED methods — runEval,
// getEval, runSecurityScan, checkFirewall, … — not a generic request().
// For an arbitrary endpoint, call it directly:
// {runId} is shown with an EXAMPLE value — replace it with real values.
const res = await fetch("https://evalguard.ai/api/v1/simulator/run/00000000-0000-0000-0000-000000000000/replay", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.EVALGUARD_API_KEY}` },
});
console.log(res.status, await res.json());Python
# The Python SDK (pip install evalguardai) exposes TYPED methods on
# EvalGuardClient — run_eval, get_eval, … — not a generic request().
# For an arbitrary endpoint, call it directly:
# {runId} is shown with an EXAMPLE value — replace it with real values.
import os
import requests
headers = {"Authorization": f"Bearer {os.environ['EVALGUARD_API_KEY']}"}
response = requests.request("POST", "https://evalguard.ai/api/v1/simulator/run/00000000-0000-0000-0000-000000000000/replay", headers=headers)
print(response.status_code, response.json())Go
package main
import (
"context"
"fmt"
"net/http"
"os"
)
// {runId} is shown with an EXAMPLE value — replace it with real values.
func main() {
req, _ := http.NewRequestWithContext(context.Background(), "POST", "https://evalguard.ai/api/v1/simulator/run/00000000-0000-0000-0000-000000000000/replay", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("EVALGUARD_API_KEY"))
resp, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
fmt.Println(resp.Status)
}