VEX Protocol Architecture#
Overview#
VEX (Verified Evolutionary Xenogenesis) is the Cognitive Layer of the ProvnAI "Immune System for AI". It is a multi-layered Rust framework for building adversarial, temporal, and cryptographically-verified AI agents.
Code
Data Flow#
Code
Key Components#
Agent (vex-core)
Rust
Genome#
Five behavioral traits that map to LLM parameters:
| Trait | LLM Parameter | Range |
|---|---|---|
| exploration | temperature | 0.1 - 1.5 |
| precision | top_p | 0.5 - 1.0 |
| creativity | presence_penalty | 0.0 - 1.0 |
| skepticism | frequency_penalty | 0.0 - 0.5 |
| verbosity | max_tokens | 0.5x - 2.0x |
Consensus Protocols#
| Protocol | Threshold | Use Case |
|---|---|---|
| Majority | >50% | Quick decisions |
| SuperMajority | ≥67% | Important decisions |
| Unanimous | 100% | Critical decisions |
| WeightedConfidence | Weighted avg ≥0.7 | Nuanced decisions |
Memory Horizons#
| Horizon | Duration | max_entries |
|---|---|---|
| Immediate | 5 min | 10 |
| ShortTerm | 1 hour | 25 |
| MediumTerm | 24 hours | 50 |
| LongTerm | 1 week | 100 |
| Permanent | ∞ | 500 |
Self-Correcting Evolution (New)#
Code
| Component | Purpose |
|---|---|
| EvolutionMemory | Stores experiments with importance decay |
| ReflectionAgent | LLM + statistical analysis for suggestions |
| OptimizationRule | Semantic lessons extracted from experiments |
| EvolutionStore | Persistent storage for cross-session learning |
Security Model#
-
Authentication:
- JWT tokens with role-based claims (
vex-api) - Secure secret handling with
zeroizememory clearing - API keys hashed with Argon2id (salted)
- JWT tokens with role-based claims (
-
Input Sanitization:
- 50+ Prompt Injection Patterns blocked (DAN, Policy Puppetry, etc.)
- Unicode normalization (homoglyph attack prevention)
- JSON depth limiting (DoS prevention)
-
Resilience:
- 3-state Circuit Breaker (Closed → Open → HalfOpen)
- Rate Limiting: Per-user tier-based limits
- Integer Overflow Checks: Enabled in release profile
-
Audit Trail:
- Cryptographic hash chaining (SHA-256)
- Sensitive field redaction (logs sanitized of secrets)
-
Network:
- HSTS allowed (Strict-Transport-Security)
- Strict CORS configuration via environment
Tool System (vex-llm)
Cryptographically-verified tool execution with Merkle audit integration.
Code
Capability System (for future WASM sandboxing):
| Capability | Description |
|---|---|
PureComputation | No I/O, safe for WASM isolation |
Network | Requires HTTP/WebSocket access |
FileSystem | Requires local file access |
Cryptography | Uses crypto operations |
Subprocess | Can spawn child processes |
MCP Client (vex-llm)
Model Context Protocol integration for external tool servers.
Code
A2A Protocol (vex-api)
Agent-to-Agent protocol for cross-framework agent collaboration.
Code
Directory Structure#
Code