Skip to content

Commit 084a8b5

Browse files
ZD Studiosclaude
andcommitted
feat: full machine control for every agent + the OpenClaw/Hermes feature set, gated and audited
FULL CONTROL — every agent controls the host (shell, files, network), each via its project's own supported switch: opencode OPENCODE_PERMISSION={"*":"allow"}, claude-code --dangerously-skip-permissions, OpenClaw `exec-policy preset yolo`, Hermes unattended auto-approve, and a RUN: tool-loop the Brain drives on any OpenAI-compatible model. CrewAI crews get a run_shell tool. Injected into every service via full_control_env(); config: security.full_control / guardrails. The installer now asks for root ONCE up front (sudo keep-alive on Linux/macOS, UAC self-elevation on Windows), installs system packages + the global aios command + a boot service, but keeps toolchains user-owned and hands ownership back. SECURITY (aios_sec.py) — full control + an open control plane is exactly CVE-2026-25253, so it's paired with a real gate: loopback trusted, every other request needs AIOS_HUB_TOKEN; CSRF closed (cross-origin always needs the token, CORS never echoes *); DNS-rebinding closed (Host must be IP/known-local); exec guardrails refuse rm -rf /, mkfs, dd to block devices, fork bombs, shutdown (tokenized, not regex — catches --no-preserve-root); everything audited. DURABLE STATE (aios_brain.py) — one SQLite db (WAL, profile-aware) backing: Task Brain cron + interval + agent + shell on one scheduler, every run logged TaskFlow durable multi-step flows; state commits per step, resumes on restart Active Memory FTS5 recall on EVERY turn + async fact extraction (learns your workflow) Skills self-improving Curator writes skills/learned/*/SKILL.md after real tasks Audit every command any agent ran Old memory.json / schedules.json migrate in automatically. TOOLS (aios_tools.py) — the one choke point for shell (guardrailed + audited), the 28-channel catalog read from OpenClaw's own dist/channel-catalog.json, and skill install/learn. CLI: aios exec, channels, attach (jump into a live OpenClaw session), migrate (import from OpenClaw), profile (isolated per-client agents), token [--rotate]. HUB: Brain now has a body (RUN: loop, capped, guarded). New endpoints /api/exec, channels, tasks, flows, skills, audit, security. Dashboard gains Channels, Task Brain, TaskFlow, Skills, and Control & Audit views; a fetch wrapper attaches the token so WSL-over-IP works. Fixed a latent bug: /?token=… (and any ?query) 404'd the dashboard because the root match didn't strip the query string. Fixed install.ps1: it never parsed under PowerShell 5.1 -File (em-dashes decoded as ANSI) — now pure ASCII. Verified on Windows: guardrails (32 cases), auth gate (14 cases incl. CSRF + rebinding), cron matcher (15 cases), FTS recall, durable flow revisions, all new endpoints live, dashboard views render with zero console errors, exec round-trips to the audit log, and aios start hub enforces the token end-to-end. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 7854315 commit 084a8b5

12 files changed

Lines changed: 1952 additions & 77 deletions

README.md

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,11 @@ curl -fsSL https://raw.githubusercontent.com/ZDStudios/AIOS/main/install.sh | ba
6262
irm https://raw.githubusercontent.com/ZDStudios/AIOS/main/install.ps1 | iex
6363
```
6464

65-
The installer clones the repo to `~/AIOS`, installs the toolchains (**uv, bun, pnpm, Node**), and runs
66-
`aios setup` — installing every agent's deps, building, and wiring the Control Room. Then add your key:
65+
The installer **asks for root once, up front** (sudo on Linux/macOS, a UAC prompt on Windows) — because
66+
the agents get full control of the machine and setup registers a start-on-boot service and a global
67+
`aios` command. It then clones the repo to `~/AIOS`, installs the toolchains (**uv, bun, pnpm, Node**)
68+
into your user profile, and runs `aios setup` — installing every agent's deps, building, wiring the
69+
Control Room, and applying the full-control exec policy. Then add your key:
6770

6871
```bash
6972
cd ~/AIOS
@@ -158,9 +161,15 @@ Plus two integrations that glue it together:
158161
| `aios doctor` | Diagnose tools, config, deps and ports — with the exact fix for each. |
159162
| `aios update [--check]` | `git pull` + reinstall changed deps + re-render. `--check` just reports if updates exist (also auto-checked on start). |
160163
| `aios autostart enable\|disable` | Run The AI OS on login/boot (Startup shortcut on Windows, systemd/`.bashrc` on Linux/WSL). |
164+
| `aios exec <cmd>` | Run a command through the agents' own **guardrailed, audited** shell. |
165+
| `aios channels` | List the **28 messaging channels** the gateway can bridge, and which are configured. |
166+
| `aios attach [args]` | Jump into a running **OpenClaw gateway session** with an external harness, mid-run. |
167+
| `aios migrate [--source]` | Import settings, memory, skills and keys from an existing **OpenClaw** install. |
168+
| `aios profile [name]` | Isolated agents per client/project — each with its own memory, tasks, and flows. |
169+
| `aios token [--rotate]` | Print (or rotate) the hub token that gates non-loopback access. |
161170
| `aios test --smoke` | Run test suites, or drive the whole stack end-to-end. |
162171
| `aios logs [svc]` | Tail a service log from `.aios/logs/`. |
163-
| `aios url` | Print the Control Room + service URLs. |
172+
| `aios url` | Print the Control Room + service URLs (with the token link for WSL). |
164173

165174
**In the Control Room** (`http://127.0.0.1:8787/`) you can:
166175
- **Chat** with any agent (Brain, CrewAI, opencode, claude-code) or broadcast to **All**.
@@ -169,8 +178,13 @@ Plus two integrations that glue it together:
169178
- **Automations** — schedule prompts to run against any agent every N minutes (daily digests, checks).
170179
- **Log in to Claude from the dashboard****Settings → "1 · Log in to Claude"** runs the Claude CLI login *through the hub*: it shows the authorize link, you approve in the browser and paste the code back, all in the UI. Then **"2 · Use my Claude subscription"** routes the Brain/Team/crews through **claude-code** (no API key, no per-token cost). A live status line shows whether claude-code is up and actually authenticated. (Terminal equivalent: `aios claude-login`.)
171180
- **🛡️ Self-healing agents** — a watchdog in the hub health-checks every agent. If one stops responding it's **automatically restarted**; if the restart fails, a **healthy agent reads its logs and diagnoses the cause**. See the incident log in **Status → Self-healing log** (`watchdog.enabled` in `aios.config.yaml`).
181+
- **📡 Channels** — a grid of every messaging app OpenClaw can bridge (WhatsApp, Telegram, Discord, Slack, Signal, Matrix, Teams, iMessage, …). Paste a channel's token and it goes live on the one gateway daemon.
182+
- **⚙ Task Brain** — one SQLite-backed scheduler for cron jobs, interval prompts, and background shell commands. Every run is recorded; tasks survive restarts.
183+
- **🔀 TaskFlow** — durable multi-step flows that chain agents. State is committed after every step, so a crash or restart **resumes where it left off** instead of replaying work.
184+
- **🎓 Skills** — install ClawHub-style skills, and watch the **self-improving loop**: after a task that ran commands, a Curator judges whether it taught a reusable procedure and writes a `SKILL.md` every agent then mounts.
185+
- **🛡️ Control & Audit** — see full-control status, run a guardrailed command, and read the **audit log** of every command any agent ran on this machine.
172186
- **Settings** — edit provider/key/model, channel tokens, and `aios.config.yaml`; it re-renders into every agent, no terminal needed.
173-
- **Themes**Light, Dark, Midnight, Slate, Rose. Chat renders markdown (headers, bullets, code blocks).
187+
- **Themes**Hermes (gold), OpenClaw (coral), plus light/dark variants and a theme store. Chat renders markdown and live **OpenUI** widgets.
174188

175189
**Auto-updates:** `aios start` now auto-runs `git pull` + reinstalls changed deps when the repo has updates (`updates.auto_update: true`). Turn it off in `aios.config.yaml`.
176190

@@ -209,6 +223,20 @@ curl http://127.0.0.1:8787/v1/models # list targets
209223

210224
**Skills & system prompt:** 10 skills ship built-in (skill-maker, mcp-maker, web-search, web-browse, image-gen, code-review, summarize, research, data-analyst, task-scheduler) and mount into every agent. Edit the Brain/Team **system prompt** live in the hub → **Settings**.
211225

226+
## 🖥️ Full machine control (and how it's kept safe)
227+
228+
Every agent controls the computer The AI OS is installed on — shell, filesystem, network — through each project's own supported switch (opencode `OPENCODE_PERMISSION`, claude-code `--dangerously-skip-permissions`, OpenClaw `exec-policy preset yolo`, Hermes unattended-approval, plus a `RUN:` tool-loop the Brain drives). The installer asks for **root once, up front** to set the system pieces up in one pass. Turn it all off with `security.full_control: false`.
229+
230+
That is deliberately the "ambient authority" posture that made **OpenClaw's CVE-2026-25253** a critical RCE — so full control is paired with a real gate, not left open:
231+
232+
- **Loopback is trusted; everyone else needs a token.** The hub mints `AIOS_HUB_TOKEN` at setup. Binding to `0.0.0.0` (needed for WSL) is only safe because every non-loopback request must carry it — `aios url` prints the token link.
233+
- **CSRF is closed.** A page on the internet can reach `http://127.0.0.1:8787` from your browser, so cross-origin requests are rejected unless they carry the token, and CORS never echoes `*`.
234+
- **DNS-rebinding is closed.** The `Host` header must be an IP literal or a known-local name.
235+
- **Guardrails** still refuse the handful of commands that wreck the host rather than do the task — `rm -rf /`, `mkfs`, `dd` to a block device, fork bombs, `shutdown` (`security.guardrails: false` to disable).
236+
- **Everything is audited.** Every command any agent runs is written to `.aios/aios.db` and shown in **Control & Audit**.
237+
238+
**Active Memory:** a memory sub-agent runs on **every** turn — recall is a free FTS5 query, fact-extraction is one small async call — so the agents actually learn your workflow over time instead of only reading memory at session start (`memory.active`).
239+
212240
**On WSL?** `127.0.0.1:8787` often won't reach WSL from your Windows browser (localhost-forwarding is flaky). `aios start`/`aios url` now print your **WSL IP** URL — use that (e.g. `http://172.31.x.x:8787/`). The hub binds `0.0.0.0` so the WSL IP always works.
213241

214242
## ⚙️ Configuration

aios.config.example.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,23 @@ services:
4141
openclaw_os: # openclaw's own dashboard (a plugin, not an agent)
4242
enabled: true
4343

44+
# Every agent controls the computer AIOS is installed on: shell, filesystem, network.
45+
# That is the point of an agent OS — and it is why the hub authenticates. Full control
46+
# plus an open control plane is exactly the bug that made OpenClaw's CVE-2026-25253
47+
# critical, so non-loopback and cross-origin requests must carry AIOS_HUB_TOKEN (.env).
48+
security:
49+
full_control: true # agents may run shell commands. false = read-only agents.
50+
guardrails: true # still refuse `rm -rf /`, mkfs, fork bombs, shutdown, dd to /dev/sd*
51+
exec_timeout: 120 # seconds before a runaway command is killed
52+
allowed_hosts: "" # extra Host: values to accept, comma-separated (DNS-rebinding guard)
53+
54+
memory:
55+
active: true # Active Memory: a memory sub-agent runs on EVERY turn.
56+
# Recall is a free FTS5 query; fact-extraction is one small
57+
# async LLM call, so it never slows the turn you're waiting on.
58+
59+
profile: default # isolated agents per client/project: AIOS_PROFILE=work aios start
60+
4461
lifeos:
4562
mount_skills: true # copy LifeOS skills into openclaw + hermes skill dirs
4663

@@ -49,6 +66,9 @@ openui:
4966

5067
skills:
5168
mount: true # mount the bundled skills/ (skill-maker, mcp-maker, …) into agents
69+
learn: true # self-improving loop: after a task that ran commands, the Curator
70+
# judges whether it taught a reusable procedure and writes
71+
# skills/learned/<name>/SKILL.md, which every agent then mounts
5272

5373
updates:
5474
check_on_start: true # on `aios start`, check the repo for updates and notify

0 commit comments

Comments
 (0)