Skip to main content

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 replayvetbox replay trace.jsonl re-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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vetbox-0.1.0.tar.gz (22.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vetbox-0.1.0-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file vetbox-0.1.0.tar.gz.

File metadata

  • Download URL: vetbox-0.1.0.tar.gz
  • Upload date:
  • Size: 22.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for vetbox-0.1.0.tar.gz
Algorithm Hash digest
SHA256 32f2192f9b81153a3a68e9eb932a6988a97b5bc44d7d5c2c10ba816e0fb4ed7b
MD5 ff611f0c835aef0466e4f6e46dff4c5d
BLAKE2b-256 10a6fce3e8f94319ab87519624255a001f4397faccfebe27340ea0314349c9ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for vetbox-0.1.0.tar.gz:

Publisher: release.yml on sophie-nguyenthuthuy/vetbox

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vetbox-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: vetbox-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for vetbox-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b5bbb934fe2b7c93d46d945fcae1a5b07383b298337210377212adaf43f13892
MD5 af5cd759287b0fc17016d9af6bd8dd67
BLAKE2b-256 89c1255b8f014292c2ddfc46d18b3c5188b6b5758dc5ec5c11682cab6287ce50

See more details on using hashes here.

Provenance

The following attestation bundles were made for vetbox-0.1.0-py3-none-any.whl:

Publisher: release.yml on sophie-nguyenthuthuy/vetbox

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page