Cortex is a spatiotemporal authority and semantic verification framework designed to enforce execution integrity, capability-negotiated sandboxing, and post-facto deterministic verification across autonomous software runtimes and AI agent architectures.
- Current Milestone:
v1.0.0-RC1(Release Candidate 1 β Active Architecture Freeze). - External Security Gate: Governed by Issue #23 (External Security Review & Audit Sign-off).
- Verification Status: 566/566 tests pass cleanly; Phase 8.0 Coq formal proofs machine-checked with 0 Axioms / 0 Admits.
| Release Version | Release Status | Primary Milestone Deliverables | Release Documentation |
|---|---|---|---|
v1.0.0-RC1 |
Release Candidate | Frozen baseline prepared for external security audit gate (Issue #23) | cortex_open_work_register.md |
v0.6.0 |
Formal Proof Milestone | Phase 8.0 Machine-Checked Refinement Proofs & WASM Profile B | coq_formal_proof_inventory_delta.md |
v0.5.0 |
Durable Authority Baseline | Dynamic Load Balancing, Write-Ahead Logging & Placement Subsystem | replica_scaling_specification.md |
v0.4.0-experimental |
Experimental Baseline | Multi-tier IPC channels and streaming message codec | v0.3.0-experimental.md |
v0.2.1 |
Production Release | Host gateway admission control & execution state machine | cortex_completed_work_register.md |
v0.2.0 |
Initial Release | Core Python control plane and capability context baseline | cortex_system_architecture_current.md |
Traditional security architectures rely on static user identity roles (POSIX permissions, IAM roles, cgroups) which fail under non-deterministic AI agent workloads and dynamic plugin executions:
- Ambient Authority Leakage: Agents executing inside shell environments inherit full ambient process permissions, allowing unmediated filesystem or network access.
- Subshell Script Bypasses: Malicious or miscalibrated plugins invoke shell scripts (
.sh), subprocesses, or eval blocks to bypass application-level checks. - Trace Non-Repudiation: Without cryptographic trace verification, auditing why an autonomous agent performed a destructive side-effect is impossible.
Cortex replaces ambient authority with a Hardware/Kernel-Enforced Security Boundary:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 1. STATIC CAPABILITY NEGOTIATION & STCR MAPPING (ConfigResolver) β
β Manifests declare required permissions before plugins access the kernel bus. β
ββββββββββββββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββ
β SignedIntent Payload (CBE Format)
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 2. RESOURCE AUTHORITY & PHYSICAL CONTAINMENT GATE (ResourceAuthority / Cgroups v2) β
β Attenuated resource vectors enforce R_task <= R_plugin <= R_system limits. β
ββββββββββββββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββ
β Governed Side-Effect Execution
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 3. ROLLING CAUSAL WITNESS JOURNALING & WAL (Durable Write-Ahead Logging) β
β Emits tamper-evident rolling hash commitments: W_{t+1} = SHA256(W_t || D_E || D_I) β
ββββββββββββββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββ
β Raw Evidence Traces (R, E)
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 4. ZERO-DEPENDENCY INDEPENDENT UNTRUSTED VERIFIER (tools/cortex_verifier.py) β
β Standalone CLI tools/cortex-verifier evaluates traces β VALID (0), INVALID (1), INDETERMINATE β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The repository follows a strict Separation of Concerns taxonomy across security, formal verification, protocol specs, governance, and release records:
Cortex Platform Repository Map
βββ docs/ # Master Documentation Portal
β βββ architecture/ # Architectural Audits & Verification Matrices
β β βββ cortex_open_work_register.md # Master Issue & Engineering Obligation Register
β β βββ coq_formal_proof_inventory_delta.md # Phase 8.0 Machine-Checked Proof Inventory
β β βββ coq_print_assumptions_audit.json # Audit JSON Artifact (0 Axioms / 0 Admits)
β β βββ configuration_and_control_plane_specification.md # Control Plane Spec
β β βββ phase_4_routing_and_dispatch_specification.md # Routing Protocol Spec
β β
β βββ spec/ # Normative Protocol Specifications
β β βββ gate_g_remediation_specification.md # Worker Sandbox Architecture
β β βββ gate_h_execution_token_specification.md # ExecutionToken Spec (P2)
β β βββ evidence_profile_v1.schema.json # Evidence Profile JSON Schema
β β
β βββ release/ # Historical & Milestone Release Records
β β βββ v0.3.0-experimental.md # Experimental Baseline Record
β β
β βββ history/ # Historical Audits & Post-Implementation Logs
β
βββ .github/ # GitHub Actions Workflows & Templates
βββ cortex/ # Python Control Plane & Kernel Subsystem
βββ verification/ # Coq Formal Verification Source (.v files)
βββ tests/ # Full Test Suite (566 Unit & Conformance Tests)
βββ scripts/ # Verification & Build Automation Scripts
β βββ verify.sh # Master 7-Gate Canonical Verification Pipeline
β βββ verify_coq_assumptions.py # Coq Proof Assumptions Audit Script
βββ tools/ # Verification & Audit CLI Tools
βββ cortex_verifier.py # Zero-Dependency Verifier CLI
βββ tools/assurance/docs_audit.py # Repository Documentation Coherence Audit
| Security Invariant | Mathematical / Normative Definition | Status | Verification Engine & Test Harness |
|---|---|---|---|
| $\Lambda_{t+1} \subseteq \Lambda_t \land \vec{R}{\text{task}} \le \vec{R}{\text{plugin}} \le \vec{R}_{\text{system}}$ | IMPLEMENTED |
ConfigResolver & ResourceAuthority cgroups v2 |
|
| VERIFIED | Gate H Conformance Suite (test_gate_h_adversarial.py) |
||
| VERIFIED | Gate I Tamper-Evident Suite (test_gate_i_causal_witness.py) |
||
| VERIFIED | Untrusted Verifier Engine (tools/cortex_verifier.py) |
Clone the repository and synchronize the isolated virtual environment:
git clone https://github.com/Iradukunda-Fils/Cortex.git
cd Cortex
uv venv && source .venv/bin/activate
uv sync --all-extrasExecute the full master quality, linting, type-checking, test, and documentation audit pipeline:
./scripts/verify.sh# Code quality check
uv run ruff check .
# Strict static type checking
uv run pyright
# Documentation coherence audit
uv run python3 tools/assurance/docs_audit.pyConstruct wheel and source distribution artifacts for PyPI release:
uv buildHere is how an application creates a task context, resolves configuration ceilings, and enforces resource attenuation:
from cortex.tools.kernel.config_resolver import ConfigResolver
# 1. Initialize Resolver with Declared Security Profile
resolver = ConfigResolver()
# 2. Resolve Configuration with Strict Security Ceiling
config = resolver.resolve(
profile_name="Profile_A_Linux_Strict",
declared_manifest={
"plugin_id": "com.cortex.analytics",
"capabilities": ["STORAGE_READ", "COMPUTE_EXEC"],
"resources": {"cpu_cores": 2.0, "memory_mib": 2048}
}
)
# 3. Assert Attenuation Limits (R_task <= R_plugin <= R_system)
print(f"β
Configuration Resolved: {config.snapshot_id}")
print(f"π Enforced RAM Limit: {config.resources['memory_mib']} MiB")Licensed under the Apache License, Version 2.0. See LICENSE for details. See Contributor Guide for contribution policies.
