# AXON OS > Formerly **Aegis** — internal crate/binary prefix `aegis-` is kept for compatibility. A local-first, policy-governed authority layer for an AI-driven Linux desktop. Every action an agent proposes goes through the same path: **preview → approve → execute → verify → audit → undo**. Fail-closed by default, least privilege by construction, and zero third-party runtime dependencies. Target environment: EndeavourOS + [Niri](https://github.com/YaLTeR/niri) (Wayland). --- ## Architecture ``` Niri $NIRI_SOCKET (JSON IPC event stream, read-only) └── aegis-bridge reduces events to redacted state; reconnects on drop └── %t/aegis/hud.sock local Unix socket, mode 0600, no network └── aegis-overlay 127.0.0.1 preview surface — state + action previews └── typed action preview └── aegis-policy allowlisted action grammar, fail-closed └── aegis-action-firewall final gate before execution ``` Four decisions the code holds to: 1. **The bridge never parses formatted CLI output.** It consumes Niri's documented JSON event stream and treats events as reducer inputs, because Niri warns that related changes can arrive in a transient order — so state is derived, never assumed. 2. **State leaves the bridge redacted.** The overlay receives orientation signals, not window titles or content, and reaches them over a `0600` Unix socket rather than a port. 3. **Policy is an allowlist, not a denylist.** Anything not in the action grammar is refused. Arbitrary shell, root actions and money-moving operations (payments, invoices, outbound email) are outside the grammar and cannot be reached by widening a prompt. 4. **Capabilities are versioned manifests.** Tools live in a schema-validated registry with an explicit lifecycle; nothing self-installs and nothing auto-promotes its own scope. ## Tech stack Node.js 22+ (standard library only — no npm dependencies at runtime) · npm workspaces · `node:test` · JSON Schema manifests · systemd user units · Niri KDL config fragment · Rust and GTK4 layer-shell planned for the native HUD. | Package | Responsibility | |---|---| | `packages/aegis-protocol` | Wire format and typed action envelopes | | `packages/aegis-policy` | Action grammar, allowlist evaluation, approval previews | | `packages/aegis-action-firewall` | Last-line enforcement before any execution | | `packages/aegis-model-policy` | Which model may be asked what, and with which data | | `apps/aegis-bridge` | Niri event-stream reader and state reducer | | `apps/aegis-overlay` | Local preview surface and action-preview endpoint | | `apps/aegis-provider-broker` | Provider credential brokering, kept out of app processes | ## Quickstart ```bash git clone https://github.com/Frezzaroukos/aegis && cd aegis npm run check # schema + format validation, no network npm test # 14 assertions across policy, firewall, model-policy, broker ``` To run it against a live Niri session, review `config/niri/fragments/guanaco-aegis.kdl` against your own keybindings **first**, then: ```bash cp config/niri/fragments/guanaco-aegis.kdl ~/.config/niri/ # add `include "~/.config/niri/guanaco-aegis.kdl"` at top level in config.kdl ./scripts/install/install-user-services.sh systemctl --user start aegis-niri-bridge.service aegis-overlay.service ``` `Mod+Shift+A` opens the local preview. ## Scope — what is deliberately absent This is a starter slice, and the boundary is part of the design. Not included: screen capture, raw shell execution, desktop mutation, cloud calls from the bridge, authentication on the overlay, a native layer-shell surface, or any automatic marketplace install. Those are follow-on slices, and the README will say so until they exist. ## License MIT