Skip to main content

MVAR: Information Flow Control for LLM Agent Runtimes — Deterministic prompt injection defense via dual-lattice IFC with cryptographic provenance

Project description

MVAR Banner

MVAR — Deterministic Security for AI Agents

If your AI agent can run shell commands, call APIs, read files, or use credentials, prompt injection can escalate into real execution.

Most defenses attempt to filter malicious prompts. That fails once model output reaches privileged tools.

MVAR prevents this by enforcing deterministic policy between LLM output and execution sinks. It works with modern agent runtimes, including MCP- and OpenClaw-style tool chains. See the governed runtime proof for a reproducible benign-pass / adversarial-block demo.

MVAR is the execution firewall for AI agents.

Invariant: UNTRUSTED input + CRITICAL sink -> BLOCK

50 attack vectors blocked · 200 benign vectors passed · CI-gated launch validation

Try It In 30 Seconds

30-Second Proof · Quick Start · Governed MCP Proof · Adapters Canonical proof runbook: RUN_THE_PROOF.md

Launch Gate OpenSSF Scorecard Validation License: Apache-2.0


30-Second Proof

git clone https://github.com/mvar-security/mvar.git
cd mvar
bash scripts/install.sh
bash scripts/run-agent-testbed.sh --scenario rag_injection

Expected result:

  • Baseline runtime: attacker-influenced command is allowed
  • MVAR runtime: execution is blocked before the tool runs
  • Audit output: deterministic decision + cryptographic witness
Baseline: ALLOW -> executing bash command
MVAR:    BLOCK -> UNTRUSTED input reaching CRITICAL sink

Governed runtime demo (MCP): docs/outreach/GOVERNED_MCP_RUNTIME_PROOF.md

⭐ Star the repo to follow development of execution-time security for AI agents.

Quick Start

from mvar import protect, ExecutionBlocked

safe_tool = protect(my_bash_tool)  # balanced profile by default
try:
    safe_tool("cat /etc/shadow")
except ExecutionBlocked as e:
    print(e.decision["outcome"])  # BLOCK
    print(e.decision["reason"])

Profiles: balanced (default), strict, permissive.

What MVAR Is

MVAR is a deterministic execution security layer for LLM agents.

Most defenses attempt to detect malicious prompts. MVAR enforces policy at execution sinks, where prompt-injection attacks cause real system effects.

Why This Is Different

  • Not a prompt filter
  • Not an LLM judge
  • Deterministic policy at execution time
  • Provenance-aware authorization
  • Cryptographically auditable decisions

Validation

  • 50 prompt-injection attack vectors blocked before tool execution
  • Governed runtime CI gate on every change
  • Reproducibility and launch checks in versioned scripts

Current metrics and snapshots: STATUS.md, TRUST.md

Who This Is For

MVAR is for teams building agents that can:

  • execute shell commands
  • call external APIs
  • read or write files
  • handle credentials or sensitive data

If your agent can turn model output into real-world actions, MVAR constrains that authority at runtime.

Deployment Modes (Current)

Mode Components Status Primary Use Case
Standalone MVAR MVAR only ✅ Shipped Drop-in deterministic execution boundary
MVAR + Verify MVAR + Entry 500 SDK 🚧 Integration path Add trust signals alongside sink enforcement
Full Governed Runtime MVAR + Entry 500 + EOS + Execution Governor 🚧 Scaffold / feature-flagged Unified privileged-action control plane

Works With

  • LangChain
  • OpenAI tool calling
  • OpenAI Agents SDK
  • MCP
  • Claude tool runtimes
  • AutoGen
  • CrewAI
  • OpenClaw

Install first: INSTALL.md#installation

Then pick an adapter quickstart: docs/FIRST_PARTY_ADAPTERS.md

Need source + quickstart per adapter: Adapter Code + Quickstart Map

Architecture At A Glance

LLM reasoning
    |
    v
tool request
    |
    v
MVAR enforcement layer
    |
    v
shell / APIs / filesystem / secrets
flowchart LR
    A[LLM Agent] --> B[MVAR Runtime Boundary]
    B --> C[Policy / Provenance / Capability Checks]
    C --> D[Shell / API / Filesystem / Secrets]

Spec links:

Verify in 60 Seconds

Fast path (works even if you forgot to activate the right venv):

bash scripts/doctor-environment.sh
bash scripts/quick-verify.sh
./run_proof_pack.sh

Manual path (from repo root):

bash scripts/run-python.sh -m pytest -q
bash scripts/launch-gate.sh
bash scripts/run-python.sh scripts/generate_security_scorecard.py
bash scripts/run-python.sh scripts/update_status_md.py

What this proves:

  • Launch gate and full suite are green in CI
  • Attack corpus blocks 50/50 under current policy
  • Benign corpus has zero false blocks
  • Exact current numbers are published in STATUS.md
  • Repro artifact pack is emitted under artifacts/repro/<timestamp>/ with checksums and summary JSON
  • Repro pack command: bash scripts/repro-validation-pack.sh (updates artifacts/repro/latest)

Execution Witness Chain

MVAR can verify signed witness artifacts offline, including signature validity and previous-signature chain integrity.

mvar-verify-witness data/mvar_decisions.jsonl --require-chain

Integration and Demos

What MVAR Is Not

MVAR is not:

  • Not a prompt filter — MVAR does not attempt to detect or block malicious prompts
  • Not an LLM judge — MVAR does not use a secondary model to classify intent
  • Not a replacement for OS sandboxing — MVAR complements Docker/seccomp, does not replace them
  • Not a replacement for network security — Firewalls, host hardening, and network isolation remain necessary
  • Not a malicious-intent detector — MVAR enforces structural constraints, not behavioral anomaly detection

MVAR is a deterministic reference monitor at privileged execution sinks. It assumes untrusted inputs exist and prevents them from reaching critical operations, regardless of detection accuracy.

What MVAR Blocks

MVAR has validated enforcement against these attack classes:

See STATUS.md for exact current validation numbers.

What does MVAR block? 50 attack vectors · 9 categories · CI-gated on every commit

MVAR's sink policy was evaluated against a 50-vector adversarial corpus spanning 9 attack categories:

Category Vectors Result
Direct command injection 6 ✅ 6/6 blocked
Environment variable attacks 5 ✅ 5/5 blocked
Encoding/obfuscation (Base64, Unicode, hex) 8 ✅ 8/8 blocked
Shell manipulation (pipes, eval, substitution) 7 ✅ 7/7 blocked
Multi-stage attacks (download+execute) 6 ✅ 6/6 blocked
Taint laundering (cache, logs, temp files) 5 ✅ 5/5 blocked
Template escaping (JSON, XML, Markdown) 5 ✅ 5/5 blocked
Credential theft (AWS, SSH keys) 4 ✅ 4/4 blocked
Novel corpus variants 4 ✅ 4/4 blocked

Result: Blocked every vector in the current validation corpus under the tested policy and sink configuration.

Scope: This demonstrates consistent enforcement for this validation corpus. Not a proof of completeness against all possible attacks.

Deep Dive Documentation

This README is intentionally front-loaded for fast evaluation. Detailed material is split into focused docs:

Get Involved

Contributing

MVAR is open source by design. We welcome adapter integrations, security hardening, tests, and documentation improvements that preserve security invariants. See CONTRIBUTING.md for contribution lanes, requirements, conformance expectations, and security reporting workflow.


Notices


License

Apache License 2.0 — see LICENSE.md

Patent: US Provisional filed (Feb 24, 2026)


Citation

Machine-readable citation metadata: CITATION.cff

@software{mvar2026,
  author = {Cohen, Shawn},
  title = {MVAR: MIRRA Verified Agent Runtime},
  year = {2026},
  url = {https://github.com/mvar-security/mvar},
  note = {Deterministic prompt injection defense via information flow control}
}

Contact

Shawn Cohen Email: security@mvar.io GitHub: @mvar-security


MVAR: Deterministic sink enforcement against prompt-injection-driven tool misuse via information flow control and cryptographic provenance tracking.

Project details


Download files

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

Source Distribution

mvar_security-1.4.0.tar.gz (131.9 kB view details)

Uploaded Source

Built Distribution

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

mvar_security-1.4.0-py3-none-any.whl (112.1 kB view details)

Uploaded Python 3

File details

Details for the file mvar_security-1.4.0.tar.gz.

File metadata

  • Download URL: mvar_security-1.4.0.tar.gz
  • Upload date:
  • Size: 131.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mvar_security-1.4.0.tar.gz
Algorithm Hash digest
SHA256 9a1b84848c437e02db2323240bd436e080611eb5052ed77593c8a8412528833f
MD5 246e8ee156ea563f5b217d3b547c53f6
BLAKE2b-256 d845c70d352459b782a42b0b13a38e3d406f2576ea3ed2cf4cdb15b19c22fb9c

See more details on using hashes here.

Provenance

The following attestation bundles were made for mvar_security-1.4.0.tar.gz:

Publisher: pypi-publish.yml on mvar-security/mvar

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

File details

Details for the file mvar_security-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: mvar_security-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 112.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mvar_security-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a864c906927016e8df726b9a92881ecb729dfee35049b085baa336a99075d14d
MD5 d27e4e6f6c43202e1a079dbabed21b2e
BLAKE2b-256 2c185f1d62075df4f53aa02bee6ac4525725abe7dae8621354f1d64dda6fa470

See more details on using hashes here.

Provenance

The following attestation bundles were made for mvar_security-1.4.0-py3-none-any.whl:

Publisher: pypi-publish.yml on mvar-security/mvar

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page