-
Notifications
You must be signed in to change notification settings - Fork 0
02 Security Model
R-AI-OS is built with a "Security-First" philosophy, recognizing that autonomous AI agents require robust guardrails to prevent accidental or malicious damage to the host system and codebase. This document outlines the multi-layered security architecture of R-AI-OS.
The core principle of R-AI-OS is Zero-Trust. No agent, regardless of its source or purpose, is granted implicit trust.
- Process Isolation: Agents do not run within the daemon's memory space. They are spawned as isolated child processes with restricted environments.
-
Human-in-the-Loop (HITL): Critical actions—such as modifying source code, deleting files, or handing over tasks to other agents—are intercepted by the daemon and queued for human approval via the
raiosTUI. -
Stateful Monitoring: The daemon (
aiosd) maintains a real-time state of all active agents, tracking their resource usage and command history.
The AgentShield is a specialized security layer that acts as a firewall between the agent and the operating system.
Every shell command an agent attempts to execute is passed through the Shield's regex-based interception engine.
-
Dangerous Command Blacklist: Commands like
rm -rf /,mkfs,dd, andcurl | share blocked instantly. - Pattern Matching: The Shield uses high-performance regex to detect obfuscated or dangerous command sequences before they reach the shell.
To prevent the accidental exposure of credentials, AgentShield performs:
-
Pre-flight Checks: Before an agent starts, the Shield scans the target directory for sensitive files like
.env,.pem, orid_rsa. - OWASP Static Analysis: A comprehensive suite of patterns (aligned with OWASP Top 10) scans for hardcoded API keys (e.g., OpenAI, AWS), passwords, and authentication tokens in the codebase.
-
Git Integration: Checks if sensitive files are being tracked by Git or missing from
.gitignore.
Communication between the client (raios) and the daemon (aiosd) is secured using the Aura Hardened protocol.
- Upon every startup,
aiosdgenerates a unique UUID v4 token. - This token is stored in a secure, local configuration file (
~/.config/raios/.ipc_token) with restricted filesystem permissions.
-
Connection: The client opens a TCP connection to
127.0.0.1:42069. -
Challenge: The client must immediately send an
AUTH <UUID_TOKEN>command. - Validation: The daemon compares the provided token with the session token.
-
Enforcement: If the first message is not a valid
AUTHcommand, or if the token is incorrect, the daemon immediately drops the connection and logs a security alert.
R-AI-OS enforces strict boundaries on how agents interact with the filesystem.
-
SafeIO Interception: The
SafeIOmodule intercepts file write operations. If the daemon is active,safe_writeautomatically converts a direct disk write into aRequestFileChangeevent, sending the diff to the user for approval. -
Workspace Anchoring: Agents are logically anchored to the workspace root. Any attempt to access paths outside the project scope (e.g.,
/etc/passwd,~/.ssh) is flagged by the Shield. -
Sentinel Guard: A background worker continuously monitors critical project files (like
Cargo.toml,package.json, ormemory.md). Any unauthorized modification triggers an immediate system-wide alert and pauses active agents.
R-AI-OS: Hardening the future of autonomous development.