Skip to main content

Validation and Drift Engine — runtime execution integrity observer for distributed AI agent systems

Project description

VDE — Validation and Drift Engine (Observer Tier)

Reference implementation of the VDE software observability layer for runtime execution integrity in distributed AI agent systems.

What This Is

This repo implements the software observer tier (Tier 2) of the VDE mitigation architecture. It instruments agent workflows to capture intent declarations and execution traces, reconstructs execution graphs per trace, and computes a drift score reflecting divergence between declared intent and actual execution. It is not a standalone security tool — it is the observability foundation for the VDE enforcement architecture described in the research paper.

Research Background

Reference: "Structural TOCTOU Vulnerabilities in AI Agent Frameworks: Analysis, Formalization, and a Hardware-Enforced Mitigation Architecture" (Equinibrium, 2026). The paper describes a three-tier mitigation taxonomy: Tier 1 (application-layer controls), Tier 2 (SW-only ASR), and Tier 3 (HW-enforced ASR). This repository implements instrumentation and drift detection aligned with Tier 2.

Architecture

Agent (instrumented with SDK)
        ↓
VDE API  POST /ingest
        ↓
PostgreSQL (JSONB event store)
        ↓
Drift Engine  reconstruct_graph() / calculate_drift()
        ↓
Streamlit Dashboard

VDE/schema.py — Pydantic models for event types (IntentEvent, ExecutionEvent, StateTransitionEvent) VDE/sdk.py — VDECollector class with async HTTP logging and @vde_trace decorator VDE/api.py — FastAPI ingestion endpoint with PostgreSQL storage VDE/engine.py — DriftDetectionEngine for graph reconstruction and drift calculation VDE/dashboard.py — Streamlit dashboard for visualizing intent vs execution drift

Quickstart

git clone https://github.com/LelloOmwei/VDE.git
cd VDE
pip install -r requirements.txt
export DATABASE_URL=postgresql://user:password@localhost/vde
uvicorn VDE.api:app --reload
streamlit run VDE/dashboard.py

SDK Usage

from VDE import VDECollector, vde_trace, IntentEvent
import asyncio

# Initialize collector
collector = VDECollector(endpoint_url="http://localhost:8000/ingest")
await collector.start()

# Use decorator for automatic logging
@vde_trace("fetch_weather_step")
async def fetch_weather(location: str):
    # Agent step that calls external API
    response = await http_client.get(f"/weather?loc={location}")
    return response.json()

# Manual intent logging
intent = IntentEvent(
    trace_id="trace-123",
    step_id="manual_step",
    expected_action="process_data",
    inputs={"source": "external_api"}
)
await collector.log_intent(intent)

Drift Detection

  • Missing steps: Steps declared in intent but not present in execution trace
  • Extra steps: Steps executed without corresponding intent declaration
  • Reordering: Same steps executed in different sequence order than declared
  • Status mismatches: Execution steps that failed or encountered errors

The drift score is a weighted 0–100 metric where higher values indicate greater divergence between intent and execution.

Scope and Limitations

This tier provides observability and drift detection but does not enforce execution blocking. Enforcement requires the ASR (Authorized State Representation) layer. SW-only ASR (TPM/HSM-backed) and hardware-enforced tiers are not included in this repository.

IP Notice

The VDE architecture, including the Authorized State Representation (ASR) model, Scoped System State Version ID (S-SSVID), and associated enforcement mechanisms, is covered by a patent pending filing by Equinibrium s.r.o. This repository contains the open-source observer tier only. Commercial licensing inquiries: stan@equinibrium.eu

Citation

@techreport{equinibrium2026toctou,
  title     = {Structural TOCTOU Vulnerabilities in AI Agent Frameworks: Analysis, Formalization, and a Hardware-Enforced Mitigation Architecture},
  author    = {Equinibrium s.r.o.},
  year      = {2026},
  institution = {Equinibrium s.r.o.},
  url       = {https://equinibrium.eu}
}

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

vde-0.1.0.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

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

vde-0.1.0-py3-none-any.whl (23.9 kB view details)

Uploaded Python 3

File details

Details for the file vde-0.1.0.tar.gz.

File metadata

  • Download URL: vde-0.1.0.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for vde-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4445765cfe76a3d571ce7d5f6afe2c2778a9471726633bba96b62b8dd04725c3
MD5 5c84bb9eed7d3e2feb88c3a91d039526
BLAKE2b-256 eca5be8f9ca41e733a9b01b04988bfa40a9ba49bcee21b28e5e53ecc0731a460

See more details on using hashes here.

File details

Details for the file vde-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: vde-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 23.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for vde-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 87909f3fe2e1c08b7946aa3bebb22ca85a0c33bbfb7dc207cd5d55bd6f73a147
MD5 7b3969c7f80992613946362f437d83b2
BLAKE2b-256 a700f59506ac840f1c59daf4f32ca42ddb158c7ee1492d4de21d70f2990d08ac

See more details on using hashes here.

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