Metadata-Version: 2.4
Name: vaig
Version: 0.1.0
Summary: GCAIaaS Governance Client for secure AI infrastructure
Author-email: Njål <nsolland@valo.as>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/nsolland/VAIG
Project-URL: Repository, https://github.com/nsolland/VAIG
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# VAIG — VALO AI Integrity Gateway

**Runtime governance layer for LLM inference. Apache 2.0.**

VAIG sits architecturally outside the model it monitors — it cannot be influenced, overridden, or manipulated by the system it validates. This is the same design principle that makes Safety Instrumented Systems (IEC 61511) reliable in industrial process control.

---

## What it does

VAIG intercepts every LLM inference and returns a distrust score before the output reaches downstream systems.

```python
from vaig import DistrustEngine

engine = DistrustEngine()
result = engine.evaluate(prompt=prompt, response=response)

# result.level: L0 TRUSTED | L1 MONITOR | L2 WARN | L3 DEGRADE | L4 HALT
# result.score: 0.0 – 1.0
# result.worm_hash: sha256:...
```

---

## Architecture

| Layer | Component | Role |
|---|---|---|
| Runtime | DistrustEngine | 8-instrument ensemble, probabilistic distrust scoring |
| Audit | WORM log | SHA-256 hash-chained, append-only, legally defensible |
| Control | Halt Switch | Binary HALT state, formally verified (TLA+) |
| Policy | Distrust Matrix | L0–L4 thresholds, configurable per deployment |

### Distrust levels

| Level | Label | Action |
|---|---|---|
| L0 | TRUSTED | Pass through |
| L1 | MONITOR | Log and pass |
| L2 | WARN | Flag for review |
| L3 | DEGRADE | Throttle + alert |
| L4 | HALT | Block + WORM entry |

---

## Design principles

**Externally positioned.** VAIG runs outside the AI stack it governs. A model cannot influence its own validator.

**Formally verified halt.** The Halt Switch is verified using TLA+ model checking. When the trigger fires, the system stops — provably, regardless of model output.

**Tamper-proof audit.** Every inference is logged in a SHA-256 hash-chained WORM log. The log cannot be modified retroactively, making it suitable as legal evidence under EU AI Act Article 12.

**Architecturally independent.** VAIG is a proxy, not a plugin. It requires no changes to the model or the application layer.

---

## ACS compatibility

VAIG implements the core principles of the [Agent Control Standard (ACS)](https://agentcontrolstandard.ai):

| ACS principle | VAIG |
|---|---|
| Runtime Interception | Distrust scoring at every inference |
| Proof of Control | SHA-256 hash-chained WORM audit log |
| Mandatory Halt | Binary HALT, TLA+-verified (4.78M states, 0 counterexamples) |
| Contextual Guardrails | Policy-bound distrust matrix per deployment |

---

## Compliance

Designed for:
- **EU AI Act** Annex III (high-risk AI systems) — audit trail, human oversight, logging
- **PLD 2024/2853** — traceable causal chain for product liability
- **Insurance-grade auditability** — WORM log as Loss Prevention Record

---

## Installation

```bash
pip install vaig
```

---

## Benchmarks

| Dataset | Domain | Result |
|---|---|---|
| MedQA (N=170) | Medical | 0% error rate above L0 threshold |
| LEDGAR (N=300) | Legal | 100% of out-of-domain documents flagged |

---

## Status

- [x] DistrustEngine (L0–L4)
- [x] WORM audit log
- [x] Halt Switch (TLA+-verified)
- [x] MedQA / LEDGAR validation
- [ ] PyPI release under `valo-systems` org

---

## Contact

njaal.solland@gmail.com
