SOPVM
A runtime layer beneath agent frameworks — not another one.
SOPVM compiles Standard Operating Procedures into executable programs and runs them on a capability-gated stack machine. It sits underneath LangGraph, CrewAI, or any tool-calling loop — the same way LLVM sits underneath Clang, Rust, and Swift rather than competing with any single language.
Why Compilation Matters
Most "follow the SOP" approaches today mean "paste the SOP text into a system prompt and hope." The LLM re-plans every step, inconsistently. SOPVM compiles the SOP once into a deterministic, auditable program. The LLM only does the semantic work (interpreting what a step means); the runtime handles state tracking, capability enforcement, and execution flow. This is measurably better — the research paper behind SOPVM shows up to 16-point accuracy gains over raw prose.
Quickstart
# Install
pip install -e ".[dev]"
# Compile a SOP against a policy
sopvm compile examples/sops/refund-request-handling.sop.yaml \
--policy policies/support-agent.policy.yaml \
-o compiled.ir.json
# Check for policy violations (pre-commit mode)
sopvm check compiled.ir.json --policy policies/support-agent.policy.yaml
# exit 0 = all capabilities within policy
# exit 1 = violations found
# Execute the compiled SOP
sopvm run compiled.ir.json
Example: compile and check
$ sopvm compile tests/fixtures/refund-request-handling.sop.yaml \
--policy policies/support-agent.policy.yaml \
-o compiled.ir.json
Compiled to compiled.ir.json
$ sopvm check compiled.ir.json --policy policies/support-agent.policy.yaml
All capabilities within policy.
Example: policy violation caught at check time
$ sopvm check violating.ir.json --policy policies/support-agent.policy.yaml
VIOLATION step=a requested='payments:refund(max_amount=250.00)' reason=exceeds policy ceiling payments:refund(max_amount<=100.00)
Example: runtime execution
$ sopvm run compiled.ir.json
Final state: DONE
Path: verify_identity -> check_eligibility -> issue_refund -> notify_user
Architecture
SOP YAML ──► Parser ──► AST ──► Compiler ──► IR ──► Runtime ──► Result
(M2) (M2) (M3+M5) (M3) (M6-M8)
┌──────┴──────┐
│ Gate │Plugins│
│ (M7) │ (M8) │
└──────┴──────┘
| Box | Module | Milestone |
|---|---|---|
| Parser | sopvm.parser |
M2 |
| AST | sopvm.parser.ast |
M2 |
| Compiler (lower+page) | sopvm.compiler |
M3, M5 |
| IR | sopvm.ir |
M3 |
| Runtime (gate+providers) | sopvm.runtime |
M6-M8 |
| Static Checker | sopvm.checker |
M4 |
| Telemetry | sopvm.telemetry |
M10 |
| CLI | sopvm.cli |
M11 |
| LangGraph Adapter | sopvm.integrations.langgraph |
M9 |
See ARCHITECTURE.md for detailed design rationale.
Documentation
- ARCHITECTURE.md — component design and rationale
- INTERFACES.md — canonical contract schemas (M2-M13)
- VERSIONING_POLICY.md — SemVer rules
- CHANGELOG.md — release history
- CONTRIBUTING.md — development setup
Examples
examples/sops/— example SOP YAML filesexamples/providers/— reference tool provider implementationsexamples/langgraph_integration.py— LangGraph StateGraph wrapperexamples/adversarial_walkthrough.md— step-by-step escalation attempt
Metadata
Release files for sopvm 0.2.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 |
|---|---|---|---|---|
| sopvm-0.2.0.tar.gz | 87.9 kB | With provenance | Details for sopvm-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sopvm-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for sopvm-0.2.0-py3-none-any.whl |
Total release size: 124.4 kB
Release files / sopvm-0.2.0.tar.gz
| Download URL | sopvm-0.2.0.tar.gz |
|---|---|
| Size | 87.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0356b87992f0895d67e8ab41ed5a5f01e0cee25a24d1bad9f2f22cb6f88ab8f1
|
|
BLAKE2b-256 checksum How to use checksums |
8bfbe07d80ae379c885e5aa3653aa82fdd1f21857c4ca21bea7ad4b919cadfea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jul 19, 2026.
Transparency logRelease files / sopvm-0.2.0-py3-none-any.whl
| Download URL | sopvm-0.2.0-py3-none-any.whl |
|---|---|
| Size | 36.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dadac175f6d0d3ef50c1fb3a3264351bf2ead4a114f29bb5a34c8fc58affb9f3
|
|
BLAKE2b-256 checksum How to use checksums |
3d4ab3adc58832eabdfae045d415e0f950ca167dc7590794380d3377e8337470
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jul 19, 2026.
Transparency logSecurity for sopvm 0.2.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
Both files in this release have been uploaded with provenance metadata.
Attestation for sopvm-0.2.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 Jul 19, 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.