diff --git a/docs/NETWORK_POLICY.md b/docs/NETWORK_POLICY.md new file mode 100644 index 00000000..37132d87 --- /dev/null +++ b/docs/NETWORK_POLICY.md @@ -0,0 +1,50 @@ +# AIEN Network Policy & Egress Governance + +This document defines the normative network architecture, egress classification, and offline operation contracts for AIEN core services. + +--- + +## 1. Explicit Network Purpose Classification + +Every outbound network socket or HTTP request initiated by AIEN components must declare an explicit `NetworkPurpose`: + +```rust +pub enum NetworkPurpose { + /// Outbound call to a user-configured model inference API or proxy. + UserRequestedApi, + /// Explicit repository or state synchronization with configured peers. + PeerSynchronization, + /// Operator-directed download of model weights or tokenizer assets. + ModelDownload, + /// Optional check for signed software release updates. + UpdateCheck, + /// Unsolicited usage metrics, analytics, or behavioral tracking. + Telemetry, +} +``` + +--- + +## 2. Policy Enforcement & Deny Rules + +AIEN network gateways and transport layers enforce strict destination and purpose checking: + +| Network Purpose | Default Policy | Condition | +| :--- | :--- | :--- | +| `UserRequestedApi` | **Allow** | Target matches operator-configured endpoint whitelist. | +| `PeerSynchronization` | **Allow** | Explicitly configured peer identity or Radicle URI. | +| `ModelDownload` | **Allow** | Operator-initiated CLI command with verified hash. | +| `UpdateCheck` | **Operator Controlled** | Disabled by default in offline profiles. | +| `Telemetry` | **Deny (Hard Block)** | Unsolicited outbound telemetry is rejected at the transport layer. | + +Any network connection attempting transmission under `NetworkPurpose::Telemetry` results in an immediate connection failure and security audit alert. + +--- + +## 3. Air-Gap-Capable Deployment Profile + +AIEN is engineered for deployment in high-security, sovereign, and disconnected environments: + +1. **Zero External Service Dependencies**: Core runtime execution, physical KV cache allocation, sequence batching, Cortex epistemic storage, and hardware secret resolution function fully without active internet connectivity. +2. **Local Model Provisioning**: All required model architectures, safetensors weights, and tokenizers are resolved from local filesystem paths or hardware-attached storage. +3. **Egress-Disabled Testing**: Integration test suites are validated inside network namespaces with default-route egress disabled to verify that no code path panics or deadlocks in the absence of internet access. diff --git a/docs/PLATFORM_MATRIX.md b/docs/PLATFORM_MATRIX.md new file mode 100644 index 00000000..bf53280c --- /dev/null +++ b/docs/PLATFORM_MATRIX.md @@ -0,0 +1,49 @@ +# AIEN Platform Compatibility Matrix + +This document maintains the empirical verification status of AIEN components across target hardware architectures and operating systems. + +AIEN follows an evidence-based verification standard. Platforms are labeled according to physical test artifacts rather than theoretical compatibility. + +--- + +## 1. Maturity Level Definitions + +| Maturity Tier | Definition | +| :--- | :--- | +| **Architected** | Code path and platform abstraction exist in the repository by design. | +| **Build Verified** | Source code compiles successfully on the target toolchain with zero warnings or errors. | +| **Test Verified** | Unit and integration test suites pass on physical or virtual target machines. | +| **Runtime Verified** | The component has been deployed and executed against live physical silicon. | +| **Benchmark Verified** | Reproducible empirical performance datasets exist in `benchmarks/data/` for this target. | +| **CI Protected** | Automated continuous integration pipelines test the target on every pull request. | + +--- + +## 2. Component Verification Matrix + +| Target Architecture / Platform | Kernel & Environment | Build | Runtime | Benchmark | CI Protected | Status | +| :--- | :--- | :---: | :---: | :---: | :---: | :--- | +| **NVIDIA DGX Spark (GB10)** | Linux 6.8+ / Grace Blackwell LPDDR5X | **Yes** | **Yes** | **Yes** | **Yes** | **Primary Reference Platform** | +| **Apple Silicon (macOS aarch64)** | macOS 15+ / M1, M2, M3, M4 | **Yes** | **Yes** | **Partial** | **Yes** | **Validated Runtime Target** | +| **Linux x86_64 (Generic)** | Ubuntu 22.04+, Debian 12+, Fedora | **Yes** | **Yes** | **Partial** | **Yes** | **Validated Runtime Target** | +| **AMD ROCm (Instinct / CDNA)** | ROCm 6.0+ / HIP Compute | **Yes** | **Pending** | **No** | **Pending** | **Architected & Implemented** | +| **Windows x86_64** | Windows 11 / MSVC Toolchain | **Yes** | **Pending** | **No** | **Yes** | **Build Verified** | + +--- + +## 3. Subsystem Breakdown by Platform + +### NVIDIA DGX Spark (Grace Blackwell GB10) +- `aien-kv-cache`: Pinned contiguous page-locked unified memory (GB10 LPDDR5X): **Runtime Verified** +- `aien-scheduler`: Continuous batching and chunked prefill: **Runtime Verified** +- `spark-max-cabi`: Modular MAX C-ABI dynamic bridge (`libspark_max.so`): **Runtime Verified** (Tested against MAX 26.5) +- `spark-cockpit-rs`: Axum web gateway and health endpoints: **Runtime & Benchmark Verified** + +### Apple Silicon (macOS aarch64) +- `cortex-rs` & `openclaw-rs`: Native binary execution: **Runtime Verified** +- `spark-inquisitor`: Gatekeeper and diff auditor: **Test & Runtime Verified** +- Local hardware secret protection: Supported via Secure Enclave and Keychain APIs. + +### AMD ROCm +- Native Rust execution path compiles with HIP bindings. +- Dedicated multi-GPU validation runs on physical cluster hardware are scheduled before upgrading to Runtime Verified. diff --git a/docs/SECURITY_MODEL.md b/docs/SECURITY_MODEL.md new file mode 100644 index 00000000..b3f358ad --- /dev/null +++ b/docs/SECURITY_MODEL.md @@ -0,0 +1,66 @@ +# AIEN Security & Telemetry Model + +This document establishes the normative security architecture, terminology, and invariants for the AIEN ecosystem. + +--- + +## 1. Core Security Invariant + +AIEN provides no unsolicited outbound telemetry, avoids persistent plaintext secret storage, and uses the strongest available platform-backed secret provider where supported. + +--- + +## 2. Telemetry and Observability Definitions + +To maintain linguistic and technical precision: + +### Local Observability +Metrics, traces, structured logs, benchmark counters, hardware telemetry (such as GPU temperature and power draw), and diagnostic health endpoints (`/api/pulse`, `/healthz`) retained strictly on the local machine or served to local administrative consoles. Local observability is essential for systems engineering, performance verification, and operational reliability. + +### Explicit Network Activity +Network communication directly initiated by an operator or required by a user-configured feature, including dispatching prompts to configured model API endpoints, downloading verified model weights from public hubs, or synchronizing repositories across designated peer nodes. + +### Outbound Telemetry +Automatically transmitted usage analytics, diagnostic beacons, behavioral tracking, user profiling, or background heartbeat telemetry transmitted to third-party endpoints. + +### The Invariant +**AIEN core components MUST NOT transmit unsolicited outbound telemetry.** Local observability data remains local unless the operator explicitly exports it. + +--- + +## 3. Secret Protection at Rest and In-Flight + +### No Persistent Plaintext Storage +AIEN software does not persist unencrypted API keys, cryptographic tokens, or private credentials to disk files. Configuration templates, source repositories, and persistent working trees maintain a strict zero-plaintext-credentials standard. + +### Materialization Policy +Persisted credentials are encrypted or hardware-bound at rest and are materialized into process memory only when required for authorized operations. Ephemeral buffers holding decrypted secret material are zeroized upon deallocation. + +--- + +## 4. Platform Secret Provider Architecture + +Hardware security primitives vary across operating systems. AIEN abstracts credential protection behind a uniform `SecretProvider` capability interface: + +```rust +pub trait SecretProvider: Send + Sync { + fn capabilities(&self) -> SecretCapabilities; + fn protection_level(&self) -> SecretProtectionLevel; + fn seal(&self, name: &str, secret: &[u8]) -> Result; + fn unseal(&self, secret: &SealedSecret) -> Result>, SecretError>; + fn delete(&self, name: &str) -> Result<(), SecretError>; +} +``` + +### Protection Levels + +1. **`HardwareBackedNonExportable`**: Asymmetric private keys generated inside secure hardware silicon that cannot be extracted, where cryptographic operations occur directly within the hardware boundary. +2. **`HardwareBackedSealed`**: Secrets encrypted at rest using keys bound to hardware silicon and platform PCR state (such as TPM 2.0 sealed storage). +3. **`OsProtected`**: Credentials protected by operating-system keyring facilities (such as Linux kernel keyrings or macOS Keychain access). +4. **`MemoryOnly`**: Volatile in-process credential store for ephemeral test environments, wiped immediately on process exit. + +### Platform Implementations + +- **NVIDIA DGX Spark / Linux Systems**: Implemented via hardware TPM 2.0 (`/dev/tpmrm0`) with dynamic in-memory unsealing. +- **Apple Silicon (macOS)**: Implemented via Secure Enclave and hardware-backed Keychain APIs. +- **Air-Gapped & Offline Hosts**: Implemented using local hardware silicon roots of trust with zero external network verification dependencies.