vetbox
Agentic validation sandbox — validate agent outputs in safety-critical domains against reviewable policy files, with hash-chained traces and deterministic replay.
Agents now draft construction schedules, safety audits, and budget
forecasts. Nobody should act on those outputs just because the model
sounded confident. vetbox is the gate between "the agent produced it"
and "a human or system acts on it":
- Policy files (TOML) — the acceptance contract is data: reviewable, diffable, versionable. No validation logic hidden in prompt text.
- Declarative checks + domain auditors — structural rules
(
required,date_order,sum_equals,acyclic, …) plus domain semantics (a task can't start before its dependency finishes; an open critical safety finding without a corrective action blocks the audit). - Hash-chained trace — every rule evaluation is a link in a SHA-256 chain with the document and policy embedded. Tampering breaks the chain.
- Deterministic replay —
vetbox replay trace.jsonlre-runs the engine on the embedded inputs and demands byte-identical findings. Even a forger who rebuilds the whole chain can't fake the verdict, because the verdict is recomputable. - Fail-closed — an empty selection fails by default; an unevaluable rule is a hard error, never a silent pass.
Stdlib-only, Python ≥ 3.11. Sibling of agentbox (process-level containment) and agent-trust-layer (tool-call governance) — vetbox governs the outputs.
Quickstart
pip install vetbox
vetbox validate schedule.json --policy policies/schedule.toml --trace run.jsonl
vetbox replay run.jsonl
FAIL SCH-003 $.tasks[0] start=2026-09-10 not <= end=2026-09-01
FAIL SCH-005 $ dependency cycle: T1 -> T4 -> T1
FAIL AUD-SCH-001 $.tasks[2] task 'T2' depends on unknown task 'T9'
verdict: fail (18 checks, 5 failed, 3 warnings)
replay OK: chain intact, verdict 'fail' reproduced deterministically
Exit codes: 0 pass, 1 fail/diverged, 2 error (bad policy, bad doc,
unevaluable rule).
Policy syntax
[policy]
name = "construction-schedule-v1"
domain = "schedule" # selects the domain auditors
gate = "no_fail" # or "strict" (warnings also block)
[auditor] # params passed to the domain auditors
max_task_days = 120
[[rule]]
id = "SCH-003"
description = "Task start is on or before task end"
severity = "fail" # fail | warn | info
check = "date_order"
params = { scope = "tasks[]", earlier = "start", later = "end" }
scope addresses nodes: "" = root, tasks[] = each task,
budget.items[] = nested lists. A scope that matches nothing fails
unless the rule sets allow_empty = true.
Built-in checks: required, nonempty, range, enum, regex,
date_order, sum_equals, max_delta_pct, unique, acyclic.
Bundled domains and policies: schedule, budget, safety_audit
(see policies/ and examples/).
Python API
from vetbox import load_policy, run, write_trace, replay
policy = load_policy("policies/budget.toml")
report = run(doc, policy) # -> Report
report.verdict # "pass" | "fail"
write_trace("run.jsonl", doc, policy, report)
replay("run.jsonl").ok # chain intact AND re-run identical
Plugins
Register a check or a domain auditor from any module, then load it with
vetbox --plugins your_module …:
from vetbox import Finding, register_auditor, register_check
@register_check("iso_currency")
def iso_currency(node, params, doc):
ok = node.get(params["field"]) in {"VND", "USD", "EUR"}
return ok, "currency code check"
@register_auditor("schedule")
def no_weekend_pours(doc, params):
return [Finding("PLG-001", "warn", False, "$", "...")] if ... else []
Determinism
The engine never reads the clock, RNG, network, or filesystem while evaluating. Rule order follows the policy, selection order follows the document, auditors run in registration order. Same doc + same policy ⇒ byte-identical findings — which is what makes replay a proof rather than a spot check.
Contributing
One PR = one of: a check type, a domain auditor pack (QA/QC punch lists, med-dosage plans, financial close checklists, …), or a policy for a real domain. See CONTRIBUTING.md.
License
MIT
Metadata
Release files for vetbox 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| vetbox-0.1.0.tar.gz | 22.6 kB | With provenance | Details for vetbox-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vetbox-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for vetbox-0.1.0-py3-none-any.whl |
Total release size: 41.8 kB
Release files / vetbox-0.1.0.tar.gz
| Download URL | vetbox-0.1.0.tar.gz |
|---|---|
| Size | 22.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
32f2192f9b81153a3a68e9eb932a6988a97b5bc44d7d5c2c10ba816e0fb4ed7b
|
|
BLAKE2b-256 checksum How to use checksums |
10a6fce3e8f94319ab87519624255a001f4397faccfebe27340ea0314349c9ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 10, 2026.
Transparency logRelease files / vetbox-0.1.0-py3-none-any.whl
| Download URL | vetbox-0.1.0-py3-none-any.whl |
|---|---|
| Size | 19.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b5bbb934fe2b7c93d46d945fcae1a5b07383b298337210377212adaf43f13892
|
|
BLAKE2b-256 checksum How to use checksums |
89c1255b8f014292c2ddfc46d18b3c5188b6b5758dc5ec5c11682cab6287ce50
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 10, 2026.
Transparency logSecurity for vetbox 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for vetbox-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 10, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.