Catalog PyPI
PACKAGE EXPLORERView in registry

agent-rerun

PyPI

Portable reproducibility seed bundle for AI-agent steps (Python port of @p-vbordei/agent-rerun)

agentdeterminismed25519jcsllmreplayreproducibilityslsa
Versions collected1
Direct dependencies4From release 0.1.0
Last observed20 Oct, 23:12 UTC

README

Version 0.1.0 documentation

agent-rerun (Python)

Portable reproducibility seed bundle for AI-agent steps. Python port of @p-vbordei/agent-rerun — passes the same C1–C4 conformance vectors.

CI spec: v0.1 stable license: Apache 2.0

A rerun.json v0.1 bundle pins the inputs, sampling parameters, and expected output of one LLM step so any compatible runtime can reproduce it within a declared tolerance. The bundle is one JSON file, JCS-canonical bytes in, Ed25519-signed out.

from agent_rerun import capture, verify, CaptureOptions, generate_key_pair

kp = generate_key_pair()

step = {
    "model": {"vendor": "anthropic", "id": "claude-opus-4-7"},
    "sampling": {"temperature": 0, "top_p": 1, "seed": 42},
    "inputs": {
        "system_prompt": "you are a helpful assistant",
        "messages": [{"role": "user", "content": "say hi"}],
    },
    "runtime": {"class": "cloud"},
    "expected": {"transcript": {"messages": [{"role": "assistant", "content": "hi"}]}},
    "tolerance": {"level": "byte"},
}

bundle = capture(step, CaptureOptions(signing_key=kp.private_key))

actual = {
    "inputs": {"system_prompt": step["inputs"]["system_prompt"], "messages": step["inputs"]["messages"]},
    "output": {"transcript": step["expected"]["transcript"]},
}
result = verify(bundle, actual)
print("match" if result.verified else result.errors)

Install

pip install agent-rerun

CLI

rerun capture step.json -o bundle.rr [--key key.json]
rerun verify bundle.rr actual.json

Exit 0 on pass, 1 on fail. Result is { "verified", "errors", "warnings" } JSON on stdout.

Why this exists

OpenAI's seed is best-effort. vLLM determinism is runtime-specific. SLSA proves builds, not LLM outputs. There was no vendor-agnostic envelope for an LLM step's inputs, params, and expected output you can sign, share, and verify on a different runtime within a declared tolerance. agent-rerun is that envelope. See the TS reference README for the full landscape.

Conformance

This port is verified against the same fixture set as the TypeScript reference. Each vectors/<name>/ directory carries a bundle.rr (JCS-canonical bytes), an actual.json, and an expected.json. The Python verify() output must match expected.json (verified flag plus every substring in errorContains[] / warningContains[]).

uv sync --extra dev
uv run pytest -v
ClauseVectorBehavior
C1c1-byte-replay-passesSigned bundle + matching actual + byte tolerance → pass.
C2c2-semantic-replay-passesSigned bundle + cosine ≥ threshold → pass.
C3c3-mutated-bundle-rejectedEdited bundle after signing → fail with BadSignature.
C4c4-messages-mismatch-rejectedActual carries different messages → fail with InputHashMismatch.

Plus seven bonus vectors covering schema strictness, embedding dim mismatch, structural-unsupported, and fingerprint drift.

Where it fits

License

Apache 2.0 — see LICENSE.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.019 May 20264

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
p-vbordei/agent-rerun

Shared repository data · GitHub

License detected in repository
Not collected

Repository

PENDING
p-vbordei/agent-rerun-py

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 23:12 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:0bc591c3b754f10d64b95e9d2275fd17bed1eab4430e4357948f5f5683c1765a