Skip to content

Replay Evaluations with the VB-OS Python SDK

Replay re-executes a past evaluation using the original boundary snapshot and evidence artifacts. If the artifacts are intact and the binary is unchanged, replay produces identical results – this is an architectural guarantee.

The preferred method for replaying evaluations.

client.evaluations.replay(
project_id: str,
evaluation_id: str,
) -> ReplayResult
Parameter Type Required Description
project_id str Yes Project ID
evaluation_id str Yes ID of the evaluation to replay

A ReplayResult typed model containing the replayed decision, original decision, and match status.

from vbos import VBOSClient
with VBOSClient(api_key="vbos_your_key_here") as client:
replay = client.evaluations.replay(
project_id="proj_abc123",
evaluation_id="eval_def456",
)
print(replay.decision) # "ASSERT" or "DEFER"
print(replay.result_match) # True if decisions match

The top-level replay method is deprecated. Use client.evaluations.replay() instead.

client.replay(
project_id: str,
evaluation_id: str,
) -> ReplayResult

The signature and return type are identical to evaluations.replay. This method exists for backward compatibility and will be removed in a future release.

# Deprecated -- avoid in new code
result = client.replay("proj_abc123", "eval_def456")
# Preferred
result = client.evaluations.replay("proj_abc123", "eval_def456")

To find evaluation IDs for replay, use evaluations.list or evaluations.get:

# List recent evaluations
evals = client.evaluations.list(project_id="proj_abc123", limit=5)
for item in evals.items:
print(item.id, item.decision)
# Get full detail for a specific evaluation
detail = client.evaluations.get(
project_id="proj_abc123",
evaluation_id="eval_def456",
)

Generate a shareable link for an evaluation:

share = client.evaluations.share(
project_id="proj_abc123",
evaluation_id="eval_def456",
)
print(share["url"])
# Retrieve a shared evaluation by token
shared = client.evaluations.get_shared(token="tok_xyz789")