Rightshold™ Sign up

Answers · AI evidence

How do I make an AI agent run deterministically replayable from a recorded call order, with the seed kept as provenance and a versioned schedule format?

Last updated

TL;DR: Don't try to make the model deterministic; make the run replayable. Record every non-deterministic input in the order it happened: each model response, each tool result, clock reads, random draws and the order in which concurrent calls completed. That ordered record (the schedule) is what replay consumes: on replay, the harness returns recorded results instead of calling the model or tools, so the same code takes the same path. Keep the seed, model snapshot, system_fingerprint and sampling settings in the record as provenance, because provider seeds are best effort and a re-run with the same seed can still differ. Give the schedule format a version field and record the generator (harness name, version and commit) that wrote it, so a replayer can refuse a schedule it doesn't understand instead of misreading it. Then hash-chain the schedule entries and commit the head somewhere you can't edit, so a replay can be shown to use the run that actually happened.

What should I check, step by step?

1. Route every source of non-determinism through one recorder: model calls, tool calls, HTTP fetches, time.now(), random(), UUID generation, environment reads, and the completion order of parallel calls.

  1. Write one schedule entry per event in the order it was observed: seq, kind (model, tool, clock, random, join), a call id, a hash of the request, the response (or its hash plus a pointer to stored content), and the previous entry's hash.
  2. Put the schedule format version and the generator (harness name, version, git commit) in a header, and refuse to replay a version the replayer doesn't support.
  3. Record provenance alongside, not instead of, the results: model snapshot id, the model value the API returned, system_fingerprint where offered, temperature, top_p, seed, tool definitions hash and prompt hashes.
  4. In replay mode, match each call by seq and request hash and return the recorded response. A mismatch (the code asked for something different) is a divergence: stop and report the first differing seq rather than calling the live model.
  5. For parallel tool calls, record the order results were consumed and replay in that order, even if the original calls completed out of order.
  6. Hash-chain entries (prev = hash of the previous entry) and commit the head when the run ends, so a later edit to any entry breaks the chain.
  7. Keep schedules alongside the code version that produced them. A replay against changed agent code is a test of the new code, not a reproduction of the old run.

Why is the seed provenance and not a guarantee of reproducibility?

Providers describe seeds as best effort. OpenAI documents seed together with system_fingerprint, which changes when the backend configuration changes; the same seed on a different backend may give different output.

How do I record the call order and replay an agent run from it?

This is how durable-execution engines work. Temporal records an event history for each workflow and replays the workflow code against it after a crash; its docs require workflow code to be deterministic and to get time, randomness and I/O through the SDK or activities so replay sees the recorded values.

How do I version the schedule format and its generator?

Give the file a format id and version (for example schedule/1) and bump it when entry fields change meaning. A replayer that silently accepts a newer format can misread entries and report a false reproduction.

How do I make the run record tamper-evident?

Chain each entry to the previous one by hash and sign entries with the agent's key, so a disclosed stretch can be checked for gaps and edits.

Where do agent replays go wrong?

A direct time.now() or random() call bypasses the recorder; the replay takes a different branch on the first run after midnight.

How do I ask Rightshold about this (free, no key)?

Add the MCP server https://www.rightshold.com/mcp to Claude, Cursor, ChatGPT, Grok or VS Code, then ask: “Record a signed receipt for this agent run: the model snapshot, the seed and sampling settings as provenance, the schedule format version and generator, and the hashes of the prompt and of the final schedule file.”

One-click setup

{
  "tool": "record_ai_run",
  "arguments": {
    "model": "gpt-4o-2024-08-06",
    "provider": "openai",
    "prompt_sha256": "<sha256 of the system prompt + task input>",
    "output_sha256": "<sha256 of the final schedule file>",
    "params": {
      "seed": 42,
      "temperature": 0,
      "system_fingerprint": "<from the response>",
      "schedule_format": "schedule/1",
      "generator": "my-harness 0.4.2 (<git sha>)",
      "entries": 128
    },
    "ran_at": "2026-11-07T06:00:00Z"
  }
}

Rightshold doesn't record, run or replay your agent. It signs and timestamps the hashes and settings you send and checks disclosed log stretches against heads you committed. Not legal advice.

What are the sources?

Related

Not legal advice. JSON · Markdown · All answers

Get a free API key in one call

No card and no email needed. 100 free credits; the license and policy checks stay free without a key.

curl -s -X POST https://www.rightshold.com/v1/accounts/signup -H "Content-Type: application/json" -d '{"accept_terms":true}'
export RIGHTSHOLD_API_KEY=rs_...   # the api_key from the reply (shown once)
curl -s https://www.rightshold.com/v1/licenses/check -H "Authorization: Bearer $RIGHTSHOLD_API_KEY" \
  -H "Content-Type: application/json" -d '{"license":"MIT","intended_use":{"commercial_use":true}}'