A Hardened, LLM-Native OS Kernel for Autonomous Agent Swarms
Vision β’ Security Kernel β’ Core Modules β’ VS Code Extension β’ Quick Start β’ CLI β’ Roadmap
R-AI-OS is not just a CLI tool β it is a Kernel. While traditional operating systems manage hardware, R-AI-OS manages the AI layer: a decentralized swarm of 90+ autonomous specialists running across Claude Code, Gemini CLI, and any MCP-compatible agent.
It solves the fundamental problem of unsupervised agent execution: agents that run unchecked can leak secrets, corrupt files, and make network calls they shouldn't. R-AI-OS sits between the human and the swarm as a hardened control plane β enforcing policies, auditing every action, and managing context economics.
Human β [ R-AI-OS Kernel ] β Agent Swarm (Claude / Gemini / MCP)
β
[Security Kernel] [Context Manager] [Swarm Mesh] [Hybrid UI]
The Security Kernel is the core of R-AI-OS. It enforces a zero-trust model for all agent tool calls: every action is policy-gated, logged, and auditable. All 4 phases are complete and tested (239/239 tests green).
src/security/
βββ sandbox.rs # Filesystem Jail β canonicalize + boundary enforcement
βββ policy.rs # Policy Manager β TOML-based allow/deny/confirm engine
βββ verify_chain.rs # Audit Chain β SHA-256 hash-chained SQLite ledger
βββ egress.rs # Egress Filter β domain allowlist/blocklist, fail-closed
Prevents agents from reading or writing outside their designated workspace boundary. Uses path canonicalization to defeat traversal attacks.
# raios-policy.toml
[sandbox]
enabled = true
workspace_root = "/home/user/projects/my-app"Every MCP tool call passes through a policy gate before execution. Rules are defined in raios-policy.toml and evaluated in order.
[tools]
default = "allow"
[[tools.rules]]
tool = "bash"
action = "confirm" # requires human approval
[[tools.rules]]
tool = "write_file"
path_glob = "/etc/**"
action = "deny"Fail-closed by design: confirm rules in daemon/stdio mode deny by default β no interactive prompt means no silent execution.
Every allow/deny decision is written to a tamper-evident, SHA-256 hash-chained SQLite ledger. Each entry links to the previous entry's hash β any tampering is immediately detectable.
raios verify-chain # verify full chain integrity
raios verify-chain -n 50 # show last 50 entries then verifyDomain-level allowlist/blocklist for any HTTP/HTTPS calls made via MCP tools. Fail-closed: unrecognized domains are denied unless explicitly allowed.
[egress]
mode = "allowlist"
allowed = ["api.anthropic.com", "api.openai.com", "*.github.com"]Automatically masks sensitive values (API keys, GCP secrets, PII patterns) before they appear in logs or are forwarded to Sentry. Built on regex with 20+ detection patterns.
Production-grade error tracking with contextual breadcrumbs and automatic panic capture. Every unhandled crash sends a structured report with session context.
Maps natural-language task descriptions to the right specialist using local BM25 + vector hybrid indexing. Bridges Maestro (39 agents) and ECC (48 agents) ecosystems natively.
- Sigmap: Up to 97% token reduction via high-density signature mapping (
SIGMAP.md) - BM25 persistence: Index survives restarts via mtime-based invalidation
- Vector store: Binary SQLite BLOBs β transaction-safe, no JSON drift
- Session memory: Per-agent
memory.mdauto-append
Parallel worktree-based agent execution with coordination primitives:
- Lock Manager: File and task-level locks with priority levels (User > Agent > Automation)
- Radar Whispers: Real-time context hints pushed to all connected agents (compile errors, security alerts, architectural violations)
- Factory Mode: Submit heavy jobs async; completion fires broadcast + optional webhook
All three protocols share one event bus:
TCP :42069β Daemon IPC (UUID token auth, mandatory handshake)TCP :42070β MCP-over-TCP (agent tool calls, policy-gated)CLIβ Direct commands (raios <command>)
- Neural Search: Semantic search across 140+ projects with BM25 + embeddings
- Health Scanner: Background scan for
memory.mdcompliance, security leaks, git drift - GitHub Sync: Live star counts and last-commit timestamps
- Auto-Discovery: Detects new workspace directories and updates
entities.jsonautomatically
R-AI-OS ships a native VS Code extension that turns the IDE into a Hybrid UI β combining the real-time power of the TUI with the rich surface of the IDE.
vscode-extension/
βββ src/extension.ts # Extension host + TokenBridge proxy
βββ src/sidebar/ # Webview Kanban dashboard (Geist Sans + glassmorphism)
βββ raios-0.4.0.vsix # Packaged extension
Features:
- Activity Bar icon β
raios-sidebar-viewpanel always visible - Kanban Dashboard β Read-only project status, health scores, active tasks
- TokenBridge Proxy β Extension host proxies all daemon requests with Bearer token; the session token never touches the Webview context (XSS-safe)
- Status Bar β Live daemon connection indicator
Install:
code --install-extension vscode-extension/raios-0.4.0.vsixgit clone https://github.com/alazndy/R-AI-OS.git
cd R-AI-OS
cargo install --path . --forceStart the daemon (background process that powers the TUI and MCP server):
aiosdLaunch the TUI:
raiosBootstrap your AI factory (replicates 90+ agents and 180+ skills):
raios bootstrap| Command | Description |
|---|---|
raios health |
Portfolio health dashboard β scans all projects |
raios health <project> |
Single-project health scan |
raios search "<query>" |
Semantic search across portfolio |
raios new "ProjectName" |
Scaffold a new project (follows MASTER rules) |
raios task "<description>" |
Route to best agent or specific one |
raios bootstrap |
Replicate AI factory on a new machine |
| Command | Description |
|---|---|
raios git status |
Git status across portfolio |
raios git log |
Recent commits |
raios git diff |
Staged/unstaged diff |
raios git commit |
Intelligent bulk commit |
| Command | Description |
|---|---|
raios verify-chain |
Verify audit log hash-chain integrity |
raios verify-chain -n <N> |
Show last N entries then verify |
raios security |
OWASP security scan |
| Command | Description |
|---|---|
raios build |
Build current project |
raios test |
Run test suite |
raios deps |
Dependency audit |
raios env |
Environment variable scan |
| Command | Description |
|---|---|
raios swarm start |
Start a parallel agent worktree |
raios swarm list |
List active swarm tasks |
raios swarm approve <id> |
Approve a pending swarm diff |
| Command | Description |
|---|---|
raios rbj --project <name> |
Red-Blue-Judge audit cycle |
src/
βββ bin/
β βββ raios.rs # CLI entrypoint
β βββ aiosd.rs # Daemon entrypoint
βββ app/
β βββ events/ # Event handling (actions, keyboard, commands)
β βββ keyboard/ # Keyboard module (6 sub-modules)
βββ cli/ # CLI command implementations
βββ core/
β βββ build/ # Build logic (10 sub-modules, language-specific)
β βββ deps/ # Dependency management (10 sub-modules)
βββ cortex/ # Vector store, BM25 index, session memory
βββ daemon/ # aiosd background daemon
βββ intelligence/ # Agent routing, instinct engine, RBJ
βββ mcp/ # MCP server β policy-gated tool call handler
βββ search/ # Neural search (BM25 + vector hybrid)
βββ security/ # Security Kernel (sandbox, policy, chain, egress)
βββ sentinel/ # Redaction engine, Sentry integration
βββ server/ # HTTP/WebSocket server (Axum)
βββ swarm/ # Parallel worktree agent management
βββ ui/
βββ panels/ # TUI panels (13 modules β dashboard, security, etc.)
- Phase 1β7: Core TUI, workspace mapping, health dashboard, BM25 search
- Phase 8: Universal Kernel β Tri-protocol, Lock Manager, Radar Whispers, Factory Mode
- Phase 9: Refactor & Modularization β all large files split into focused modules
- Phase 10: Hardened Kernel Alpha β Sentry, Redaction Engine, Audit Ledger
- Phase 10B: Security Kernel (Faz 1β4) β Sandbox + Policy + Audit Chain + Egress β
- Phase IDE: Hybrid UI β VS Code Sidebar WebView + TokenBridge Proxy β
- Phase 11: Tool Pinning & Drift Detection β MCP tool manifest hashing, supply chain tamper detection
- Phase 12: Secret Leasing β
raios secret grant <tool> <ENV_VAR>with TTL-based auto-revoke - Phase 13: Rate Limiting β Tool call frequency limiter for AI loop spam protection
- Phase 14: Quarantine Mode β Isolate suspicious agent calls, require human approval
- Phase 15: Write-Back Bridge β Sidebar Kanban β memory.md task state sync
- vigils β Agent control plane (Filesystem Jail, Egress Filter, Policy Manager, Hash-Chain)
- ruvos β Agentic OS memory architecture reference
- bash-agent β Lightweight agent worker patterns
- agent-skills β Engineering discipline and agent verification
- needle β Ultra-fast local function calling
R-AI-OS is the bridge between human creativity and autonomous execution. π¦Ύπ‘οΈβοΈ
