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.
evaluations.replay
Section titled “evaluations.replay”The preferred method for replaying evaluations.
client.evaluations.replay( project_id: str, evaluation_id: str,) -> ReplayResultParameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
project_id |
str |
Yes | Project ID |
evaluation_id |
str |
Yes | ID of the evaluation to replay |
Returns
Section titled “Returns”A ReplayResult typed model containing the replayed decision, original decision, and match status.
Example
Section titled “Example”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 matchclient.replay (deprecated)
Section titled “client.replay (deprecated)”The top-level replay method is deprecated. Use client.evaluations.replay() instead.
client.replay( project_id: str, evaluation_id: str,) -> ReplayResultThe 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 coderesult = client.replay("proj_abc123", "eval_def456")
# Preferredresult = client.evaluations.replay("proj_abc123", "eval_def456")Related: listing evaluations
Section titled “Related: listing evaluations”To find evaluation IDs for replay, use evaluations.list or evaluations.get:
# List recent evaluationsevals = 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 evaluationdetail = client.evaluations.get( project_id="proj_abc123", evaluation_id="eval_def456",)Sharing evaluation results
Section titled “Sharing evaluation results”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 tokenshared = client.evaluations.get_shared(token="tok_xyz789")