VAREK
A statically-typed, LLVM-compiled gateway for deterministic AI execution.
What is VAREK?
VAREK is an open-source, strictly-typed AI infrastructure gateway compiled via LLVM. It is designed to physically prevent rogue AI execution and hallucinated payloads at the consequence boundary.
Where today's AI/ML workflows require stitching together probabilistic Python scripts, YAML configs, and dynamically-typed JSON payloads that fundamentally fail open, VAREK replaces them with a deterministic physics engine.
The Consequence Boundary Problem
Modern enterprise pipelines execute high-stakes actions (database writes, financial trades, medical telemetry) using probabilistic LLM outputs serialized into JSON. This is an engineering dead end. You cannot secure probabilistic models with more probabilistic "LLM-as-a-judge" wrapper scripts.
VAREK was built to enforce consequence boundaries. By utilizing strict Hindley-Milner type inference before the LLVM compilation step, VAREK mathematically validates AI payloads at the machine-code level. If an autonomous agent hallucinates a schema or a tensor shape, the circuit breaks.
Physics, not probabilities.
Core Design Principles
1. Speed by Default (Sub-50ms Latency)
VAREK compiles to native machine code via LLVM. Interpreted mode is available for rapid prototyping, but production pipelines run compiled. Benchmarks show 10–40x speedups over equivalent Python for data-heavy operations, ensuring boundary checks do not create pipeline bottlenecks.
2. Hindley-Milner Type Inference
Mathematically provable static typing without the syntactic bloat. Shape validation and memory safety are enforced before execution.
- Memory safety enforced at compile time — no null pointer exceptions, no buffer overflows.
- Immutability by default; mutability is explicit and intentional.
- Checked error handling — errors cannot be silently ignored or dynamically bypassed.
3. Unified Boundary Syntax
VAREK syntax reads like structured English but compiles like C. The same file defines strict data schemas, pipeline logic, API contracts, and configuration. No context switching, no format translation, no JSON serialization vulnerabilities.
4. AI-Native Primitives
VAREK is the first compiled language designed with deterministic LLM collaboration in mind:
- Unambiguous grammar (no parsing edge cases for agent generation).
- Built-in tensor and matrix primitives.
- Native async/await for model inference backpressure.
- Pipeline operators (
|>) for composing safe model chains.
Syntax at a Glance
-- VAREK Sample: Safe Image Classification Pipeline
schema ImageInput {
path: str,
label: str?,
resolution: (int, int)
}
pipeline classify_images {
source: ImageInput[]
steps: [
preprocess -> normalize -> infer -> postprocess
]
output: ClassificationResult[]
}
fn preprocess(img: ImageInput) -> Tensor {
load_image(img.path)
|> resize(224, 224)
|> normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
}
fn infer(tensor: Tensor) -> RawOutput {
model := load_model("resnet50.var")
model.forward(tensor)
}
fn postprocess(raw: RawOutput) -> ClassificationResult {
ClassificationResult {
label: raw.top_class(),
confidence: raw.softmax().max()
}
}
Compare this to the equivalent: a Python script, a YAML config, a JSON schema, and a shell script — VAREK replaces all four with mathematically provable boundaries.
Key Features
| Feature | Description |
|---|---|
pipeline blocks |
First-class pipeline definitions with statically-typed stages |
schema types |
Built-in data schema definitions (replaces JSON Schema, Pydantic) |
|> operator |
Unix-style pipe chaining for data transformations |
async inference |
Native async model calls with strict backpressure support |
tensor primitives |
Built-in n-dimensional array type with shape validation |
safe blocks |
Explicit unsafe escape hatches (like Rust) |
| Interop | Import Python, C, and Rust libraries natively |
| REPL | Full interactive shell for pipeline exploration |
Why Now?
The AI/ML tooling landscape is paralyzed by design debt. Tools built before the deep learning era were retrofitted to handle autonomous model pipelines. We are trusting trillion-parameter models to dynamically-typed glue code.
JSON won because XML was bloated. Python won because C was inaccessible. VAREK wins because the current stack is a fail-open liability.
Roadmap & Status
659 tests passing • 13,006 lines of code • MIT License
- v0.1 — Formal grammar spec + reference parser
- v0.2 — Type system + Hindley-Milner inference engine
- v0.3 — LLVM compilation backend + native code generation
- v0.4 — Standard library (
var::io,var::tensor,var::http,var::async,var::pipeline) - v1.0.0 — Stable release +
varekpackage manager CLI + RFC governance process
Community
GitHub Discussions is the official space for VAREK conversation.
VAREK Security Command
🛡️ VAREK Guardrails (PyPI Package)
VAREK provides a defense-in-depth architecture for AI agents, utilizing both static AST boundaries and PEP 578 Runtime Audit Hooks to prevent Remote Code Execution (RCE).
Installation
Install the core engine directly via pip: ```bash pip install varek-guardrails ```
Quick Start
Wrap your agent's code execution in the VAREK boundary:
```python from varek import secure_exec import sys
1. (Optional) Arm the global runtime warden
from varek.engine import varek_runtime_monitor sys.addaudithook(varek_runtime_monitor)
2. Execute agent payloads through the AST Gate
agent_payload = "import os\nos.system('echo Vulnerable')"
try: secure_exec(agent_payload) except RuntimeError as e: print(f"Threat Neutralized: {e}") ```
Metadata
Release files for varek-guardrails 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 |
|---|---|---|---|---|
| varek_guardrails-0.1.0.tar.gz | 6.0 kB | Without provenance | Details for varek_guardrails-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| varek_guardrails-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for varek_guardrails-0.1.0-py3-none-any.whl |
Total release size: 12.4 kB
Release files / varek_guardrails-0.1.0.tar.gz
| Download URL | varek_guardrails-0.1.0.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9844a9505d4f8ea0b3df391c60652dcb6275d408e17d29e414709a67cf93fa88
|
|
BLAKE2b-256 checksum How to use checksums |
83dda6e3438f2d24142e3f7731fe4389553b6d3d960f9fe64f3c5132ab2f70e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Release files / varek_guardrails-0.1.0-py3-none-any.whl
| Download URL | varek_guardrails-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7681530b964d327ede7ffae8141f7799784748b70b7b350fd5b1cc1fb36e2358
|
|
BLAKE2b-256 checksum How to use checksums |
87252a2dc0fc6931c75b5f5743ff45ebc27261f2d692ee7c4261b0cdd0a55065
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Security for varek-guardrails 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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.