…example
Adds a script-based integration example demonstrating how to use
VAREK Guardrails (open-source seccomp-bpf + cgroup runtime sandbox)
with W&B Runs, Artifacts, Tables, and Weave for verifiable execution
of untrusted ML pipeline code.
Three demonstration scripts under examples/varek-guardrails/:
- verification_artifact.py: 5-test verification battery, logs result
as a W&B Artifact for downstream consumption.
- telemetry_stream.py: bridges varek_guardrails subscribe_telemetry
audit-hook events into W&B run logs, with PID-guarded callback for
fork-safety.
- benchmark_suite.py: 8-payload regression suite (benign, malicious,
resource, edge, known_allowance) with W&B Table for sortable
comparison of expectation vs. observed outcome.
Tested end-to-end against varek_guardrails 1.1.1, wandb 0.26.1,
weave 0.50+ on Ubuntu 24.04 (cgroups v2). Live runs linked in PR
description.
What this example demonstrates
This example shows how to verify that AI/ML pipeline code is being executed under deterministic kernel-level isolation (seccomp-bpf + cgroups + wallclock), with all results logged to W&B for audit and reproducibility.
VAREK Guardrails is an open-source runtime sandbox that wraps subprocess.Popen with a seccomp-bpf filter, a cgroups v2 subtree (memory/CPU/PIDs), and a wallclock killer. This integration demonstrates three patterns that map directly to W&B-supported workflows.
What's included
examples/varek-guardrails/
├── README.md
├── requirements.txt
├── verification_artifact.py # 5-test verification battery → W&B Artifact
├── telemetry_stream.py # subscribe_telemetry → W&B run logs
├── benchmark_suite.py # 8-payload regression suite → W&B Table
└── scripts/
└── with-cgroup.sh # idempotent cgroup subtree wrapper
Why W&B users benefit
For teams running untrusted-code execution (LLM agents, eval harnesses, code-as-data pipelines), this provides a verifiable audit trail: every claim about isolation is backed by a logged run, and the runs are reproducible by any reviewer with the same versions installed. The Artifact pattern lets downstream stages depend on the verification result; the Table pattern catches policy regressions automatically.
Tested against
Live verification runs
End-to-end runs from the development environment (sober-agents entity):
Notes for reviewers
Happy to iterate on naming, scope, or any of the patterns.