← Back to Architecture & Engineering Studies
Study 03 · Defense-in-Depth · 7 min visual read · By Rasnu Security Engineering

Defense-in-Depth for AI Infrastructure: Inside the Dual-Layer Guardrail Pipeline

Relying on a single prompt filter in the cloud is never sufficient when managing production servers. RasnuOS enforces command safety across two physically separated boundaries: a multi-phase Cloud Safety Pipeline before an Approval Card is ever created, and compiled OS protection rules inside the host agent right before execution.

Flowchart 01 · Dual-Boundary Command Inspection Funnel

Four Independent Gates Between Proposal and Host Execution

Cloud + Host Enforcement
GATE 01 (Cloud) · Obfuscation & Remote-Script Filter

Strips shell comments and immediately blocks Base64/Hex-encoded command pipes, remote `curl | sh` or `wget | bash` execution, and disguised subshells.

Blocks Disguised Payloads
GATE 02 (Cloud) · Semantic Intent & Blast-Radius Classifier

Evaluates what the command actually intends to mutate—scoring impact across active network interfaces, firewall rules, database volumes, and running services.

Scores Risk & Rollback
GATE 03 (Cloud) · Multi-OS Policy Rules, Custom Blocklists & RBAC

Matches against Linux, macOS, and Windows protection rules, your organization's custom blocked command patterns, and the operator's role clearance.

Enforces Team Policy
GATE 04 (Server Host Agent) · Compiled-In OS Protection Guards

Compiled directly into the open-source agent binary on your server. Re-verifies every command locally right before process creation—even if an account in the cloud were ever compromised.

Final Host Brake
Chart 02 · Threat & Accident Interception Matrix

How Destructive Vectors Are Stopped Across Both Layers

Deterministic Enforcement
Threat / Failure Vector Example Pattern Primary Gate Secondary Brake Outcome
Root Filesystem Deletion rm -rf / or /* Gate 03 (Cloud) Gate 04 (Host Guard) HARD BLOCKED
Raw Block Disk Formatting mkfs.* / dd of=/dev/sda Gate 03 (Cloud) Gate 04 (Host Guard) HARD BLOCKED
Log Prompt-Injection Pipe base64 -d | sh / curl | sh Gate 01 (Cloud) Gate 04 (Host Guard) HARD BLOCKED
Auth & Sudoers Destruction > /etc/shadow or /etc/sudoers Gate 02 & 03 Gate 04 (Host Guard) HARD BLOCKED
Recursive Permission Wipe chmod -R 777 /etc or /usr Gate 03 (Cloud) Gate 04 (Host Guard) HARD BLOCKED
Flowchart 03 · Surgical Configuration Editing & Automatic Undo

How Config Files Are Backed Up and Diffed Before Any Write

01. Visual Diff Preview

Before touching `/etc/nginx/nginx.conf`, RasnuOS renders a line-by-line before/after diff on the Approval Card.

02. Automatic `.bak` Copy

Upon approval, the host agent creates a timestamped `.bak` backup of the original file with matching permissions.

03. Syntax & Service Check

Applies the patch and verifies service health (`nginx -t`) to ensure the new configuration is valid.

04. 1-Click Instant Undo

Every file edit card in your workspace retains a 1-click **Undo** button to restore the exact `.bak` snapshot immediately.

Zero Blind Sed/Awk Substitutions: Instead of fragile stream replacements that can corrupt multi-line blocks, RasnuOS snapshots the target file first and records the exact checksum in the audit ledger.
Open-Source Verification: All host-level guardrail rules and their automated test suites are publicly inspectable at github.com/rasnu/os-agent.

Ready to manage your servers in plain language?

Start free with 1 server and $5.00 in welcome credit. Connect your server in 30 seconds and run your first safe health check right away.

1. Create your free account (1 server + $5.00 usage credit included immediately).
2. Paste the one-line install command on your Linux, macOS, or Windows server.
3. Ask any question in plain language or open a live browser terminal.
No credit card required Prepaid wallet prevents surprise bills Cancel or switch plans anytime