Kituwa Network · Our other sites Skip to content
Documentation · v0.1.0-beta.1

Ember docs

Install it, give it a library, choose its power, and know exactly what it can and can't do.

Quick start: testing Ember today

Use a VM or a server you can rebuild. Take a snapshot first.

1. Install

From the release files (the .deb for your CPU):

sudo apt install ./ember_0.1.0~beta1_amd64.deb

Or from the website once it's live:

curl -fsSL https://ember.kituwa.com/install.sh | sudo sh

The package creates the ember system user, installs ember-agent and ember-broker, and starts nothing until you've set it up.

2. Set up

sudo ember init

You'll be asked for:

  • your DeepSeek API key (stored in /etc/ember/secrets.env, root:ember 0640);
  • the power level. Start with observe;
  • temperament: how eagerly to patch and how firmly to handle misbehaving processes;
  • email: your SMTP server (STARTTLS on 587, TLS on 465, or a local relay), who to send to, and when to send the nightly report;
  • paths to lock: anything Ember must never see.

It sends a test email and starts Ember if you say so.

ember status
sudo ember lock verify      # if you locked anything
sudo ember scan                  # a full health and security sweep, right now
sudo ember chat                  # talk to it

3. Give it a library

sudo ember docs ingest /srv/ember-docs /usr/share/man

See RAG-GUIDE.md.

4. Watch it work

journalctl -fu ember-agent          # live log
ember events                        # what it noticed
sudo ember audit tail               # every action it asked for, and the verdict
ember report                        # today's report, now

5. Make trouble on purpose

Each scenario exercises one detector. Raise power to maintain for the self-healing ones: sudo ember power maintain.

Try What Ember should do
sudo systemctl kill -s KILL cron (or any service with Restart=no) notices the failed unit within 5 min; at maintain restarts it (max 3/day)
yes > /dev/null & after cpu_runaway_minutes flags a runaway process; at maintain renices it
the leak script below after the leak window, flags a steady memory leak (+MB/h with fit quality)
fallocate -l 20G /var/tmp/big (size to push past 95%) disk critical; at maintain cleans apt cache and trims the journal, then emails you
python3 -m http.server 8099 & on the next drift check (every 6 h, or now with sudo ember scan) reports a new listening socket
sudo useradd -m testuser -s /bin/bash flags a new login-capable account (high)
echo '* * * * * root true' \| sudo tee /etc/cron.d/test flags new persistence

Leak script (grows ~10 MB every 20 s, about 1.8 GB/h; stop it with Ctrl-C):

python3 - <<'PY'
import time
hog = []
while True:
    hog.append(b'x' * 10_000_000)   # touched memory, so RSS really grows
    time.sleep(20)
PY

For faster tests, shorten the windows temporarily in /etc/ember/ember.toml and run sudo ember reload:

[watch]
cpu_runaway_minutes = 1
leak_window_minutes = 10
leak_mb_per_hour = 20

Clean up afterwards (kill %1, rm /var/tmp/big, sudo userdel -r testuser, sudo rm /etc/cron.d/test).

6. Approvals

At advise (or for destructive actions at admin), Ember queues proposals instead of acting:

ember pending
sudo ember approve 3
sudo ember reject 4

In sudo ember chat, Ember shows a box with the exact command, why it wants it, and the risk, then asks Run it? [y/N].

7. Turning it off

sudo ember stop                # stop both services
sudo apt remove ember          # uninstall (config kept)
sudo apt purge ember           # remove config and state (the audit log in /var/log/ember is kept)

Dev mode (no root, no systemd)

To hack on Ember itself:

make dev                                   # builds and sets up under ./.dev
EMBER_ROOT=$PWD/.dev ./ember scan
EMBER_ROOT=$PWD/.dev ./ember chat

In dev mode, commands run without the sandbox, and Ember says so in the audit log.

Command reference

sudo ember init | start | stop | restart | reload
ember status | chat | ask "…" | scan [--deep]
ember power [LEVEL] · ember tune [KNOB VALUE]
ember lock list | add PATH [--sealed] | remove PATH | verify
ember pending · sudo ember approve|reject ID
ember docs ingest DIR… | search "…" | stats
ember local assess | install [MODEL]
ember events [--today] · ember report [--send] · ember audit tail|verify · ember mail test
ember demo

Every command takes --plain for no colour or animation. NO_COLOR, EMBER_NO_ANIM=1 and EMBER_THEME=light are honoured.

Files

Path What
/etc/ember/ember.toml configuration (documented inline)
/etc/ember/secrets.env DeepSeek key, SMTP password (root:ember 0640)
/etc/ember/locks.conf locked paths
/var/lib/ember/ events, reports, docs library, baseline, proposals
/var/log/ember/audit.jsonl hash-chained audit log

Power, temperament and locks

Ember's behaviour is set by three independent dials:

  • Power: what Ember may change.
  • Temperament: how eagerly it uses that power.
  • Locks: where it may never look.

Power levels in detail

Action observe advise maintain admin full
Read-only commands, logs, files (outside locks) ✓ ✓ ✓ ✓ ✓
Restart / reload / start a service — ask ✓ ✓ ✓
Stop a service — ask ask ✓ ✓
TERM / renice a process (not protected) — ask ✓ ✓ ✓
KILL a process — ask ask ✓ ✓
apt-get clean, journal trim — ask ✓ ✓ ✓
Install security updates — ask ✓¹ ✓¹ ✓¹
Full apt upgrade — ask ask ✓ ✓
Arbitrary changing commands — ask ask ✓ ✓
Destructive commands (rm -r, dd, purge, firewall reset, docker prune…) — ask ask ask ✓
Reboot — ask ask ✓² ✓²
Hard denylist (see SECURITY.md) ✗ ✗ ✗ ✗ ✗
Anything touching a locked path ✗ ✗ ✗ ✗ ✗

ask means the action is queued as a proposal (ember pending) or, in sudo ember chat, shown to you for a yes/no. At observe, nothing is proposed. Changes are refused and explained.

¹ Subject to patch_aggression: conservative always asks. ² Subject to reboot: never asks; window only inside the maintenance window; asap any time.

Protected processes (protected_processes in the config: systemd, sshd, journald, dbus, Ember itself, containerd, dockerd…) are never signalled or reniced.

Temperament in detail

patch_aggression - conservative: lists pending updates in the report; never installs. - balanced: installs security updates once a day inside the maintenance window (uses unattended-upgrade when present). - aggressive: installs security updates within ~2 hours of them appearing. - Ember never upgrades itself. Its own files are read-only inside its sandbox, so it holds the ember package during upgrades. Update Ember yourself with sudo apt upgrade.

remediation applies to Ember's built-in first-aid rules, which run before any AI involvement: - cautious: only failed services are restarted, plus disk clean-up at critical levels. Everything else is alert-only. - balanced: a leaking or memory-exhausting process gets its owning systemd service restarted. Runaway CPU gets reniced. - assertive: as balanced. A process with no service owner may be sent TERM, and a runaway that persists across two checks gets its service restarted (or TERM).

Failed services are restarted at most 3 times in 24 hours. After that, Ember leaves the service for you and says so.

reboot: never · window · asap. Needs power admin or full.

escalate: auto lets the fast model call the senior model when it judges the situation risky or unclear. Critical events always go to the senior model. never and always do what they say.

tone: friendly or terse.

Locks

sudo ember lock add /srv/client-data
sudo ember lock add /srv/vault --sealed
sudo ember lock list
sudo ember lock verify
sudo ember lock remove /srv/client-data
  • Paths are canonicalised (symlinks resolved), so a different spelling can't dodge the lock.
  • System directories that Ember or the OS needs (/, /etc, /usr, /var, /var/lib/ember…) can't be locked. Lock a subdirectory instead.
  • Adding or removing a lock restarts the agent so its mount namespace updates, then runs verify.

Sealed locks (encryption)

For data that must stay unreadable even to full root:

sudo apt install gocryptfs
sudo gocryptfs -init /srv/vault.cipher
sudo mkdir /srv/vault && sudo gocryptfs /srv/vault.cipher /srv/vault   # work with plaintext
sudo fusermount -u /srv/vault                                         # done: unmount
sudo ember lock add /srv/vault.cipher --sealed
sudo ember lock verify          # checks: ciphertext only, plaintext not mounted

Or with a LUKS device: sudo ember lock add /dev/sdb1 --sealed. Verification fails while the device is open. Keep the passphrase or key file off this server.

Teaching Ember Linux: the documentation library (RAG)

First, the right words

You're not training DeepSeek. Training (and its smaller cousin, fine-tuning) changes a model's internal weights. That's expensive and slow, it goes stale, and it can't tell you where an answer came from.

What Ember does is RAG: retrieval-augmented generation. The usual verbs are:

  • ingesting or indexing documents: splitting them into passages and building a search index;
  • retrieval: finding the passages most relevant to the current problem;
  • grounding: handing those passages to the model as context, so its answer is based on your documents. It cites them as [1], [2] with file paths.

So the accurate sentence is: "I indexed a Linux documentation library, and Ember grounds DeepSeek on it with RAG."

Why this beats fine-tuning for a sysadmin:

  • You can update it in seconds (re-ingest), with no training runs.
  • Answers can point to their source, so you can check them.
  • Your own runbooks become first-class knowledge the day you write them.
  • It works the same with DeepSeek or a small local model.

How Ember's library works

  1. ember docs ingest walks your folders and reads .md .txt .rst .adoc .org .html, man pages (.1–.8, including .gz) and extensionless text files. It skips copyright, changelog* and license* noise.
  2. Each document is split at its headings into passages of about 300 words, with a 40-word overlap so nothing is cut mid-thought. Each passage keeps its heading ("man systemd.service › RESTART").
  3. Passages go into a BM25 keyword index. BM25 is the classic search-engine ranking, and it's ideal for sysadmin text, where exact names like StartLimitBurst, /etc/fstab or ss -tlnp matter most. Paths and flags are indexed whole and by their parts.
  4. Optional: if you run a local embedding model (nomic-embed-text through Ollama), each passage also gets a meaning vector. Searches then blend keyword and semantic results (reciprocal rank fusion). This helps with vague questions ("why is my box slow at night?").
  5. The index is saved to /var/lib/ember/docs/index.gob.gz. When the model calls its search_docs tool, Ember returns the top passages (6 by default, rag.top_k) with their source paths.

Step 1: collect

Put everything under one folder, e.g. /srv/ember-docs/, in sub-folders by source:

/srv/ember-docs/
├── runbooks/        ← your own notes. The most valuable thing you can add.
├── ubuntu-server/   ← Ubuntu Server documentation
├── debian-handbook/ ← The Debian Administrator's Handbook (HTML)
├── vendors/         ← nginx, PostgreSQL, Docker, Nextcloud, Plex... whatever you run
└── security/        ← Ubuntu security notices you care about, CIS notes, hardening guides

Good sources:

  • The server's own man pages: /usr/share/man. Ingest them directly. They match the exact versions installed, which beats anything from the web.
  • Ubuntu Server documentation: Canonical publishes it online and keeps its source on GitHub. Clone or mirror it.
  • The Debian Administrator's Handbook: free to download as HTML or EPUB (convert EPUB with pandoc).
  • The Arch Wiki: superb depth, but Arch-specific in places (package names, paths). Use it for concepts like systemd, networking and filesystems.
  • Upstream docs for every service you host. Most are Markdown or HTML in their Git repos.
  • Your runbooks and post-mortems. Ember gets genuinely yours through these: "how we restore Nextcloud", "the Plex transcoder fills /tmp", client-specific quirks.

Respect licences: mirroring docs for private use on your own server is generally fine, but check before you redistribute a bundled library to customers.

Step 2: convert to text

Ember reads text formats directly. For everything else:

sudo apt install poppler-utils pandoc        # pdftotext, pandoc
pdftotext -layout guide.pdf guide.txt        # PDFs
pandoc book.epub -t gfm -o book.md           # EPUB, DOCX → Markdown
wget --mirror --convert-links --no-parent --adjust-extension https://example.org/docs/   # a docs website → HTML

HTML is fine as-is. Ember strips tags, scripts and styles and keeps the headings.

Step 3: ingest

sudo ember docs ingest /srv/ember-docs /usr/share/man

You'll see the ring fill as it scans, reads and saves. A few thousand files take seconds. Ember remembers the folders, so after adding documents you only run:

sudo ember docs ingest          # rebuild from the same folders
ember docs stats

Step 4: test it like a librarian

Write down 20 real questions from your own work and run each one:

ember docs search "limit how often a crashing service restarts"
ember docs search "find what is listening on port 8080"
ember docs search "rotate nginx logs daily keep 14"

If the right passage isn't in the top 3, the fix is nearly always better documents, not a better model:

  • Add the missing doc, or write a two-paragraph runbook that uses the words you use.
  • Give runbook sections specific headings: ## nginx: 502 Bad Gateway after PHP-FPM upgrade.
  • Include exact error messages, unit names, paths and commands. Those are what keyword search matches on.
  • One topic per section. Long mixed pages retrieve poorly.

Then ask Ember directly and check it cites the passage:

sudo ember ask "nginx returns 502 after the PHP upgrade, what should I check?"
ember local assess              # see what this hardware can run
sudo ember local install        # installs Ollama + recommended model + nomic-embed-text
sudo ember docs ingest          # rebuild with embeddings

This needs a few hundred MB of RAM while indexing and searching, so it's worth it on a machine with 8 GB or more. Keyword search alone is already strong for Linux docs.

Keeping it fresh

  • Re-ingest after adding docs. A weekly cron on your own account is fine, e.g. sudo ember docs ingest.
  • When Ember solves something new in sudo ember chat, ask it to write a runbook entry, review it, and save it to runbooks/. That's how the library learns from your servers.

Where fine-tuning would make sense

Only if you need a model to adopt a very specific output style or skill that prompting and retrieval can't produce, and you have hundreds of high-quality examples. For "know Linux and know my systems", RAG is the right tool.

Ember security model

Ember gives an AI the ability to act on a server. This document explains what stops it from doing the wrong thing, and what does not. Read it before raising Ember above observe.

Hope for the best, prepare for the worst. No safeguard here replaces backups you have actually restored from. Start on a VM snapshot, read a few nightly reports, then raise the power level one step at a time.

Design principles

  1. The model is never the security boundary. Every decision about what may run is made by deterministic code (the policy package) in a separate root process (the broker), not by the AI. A confused or manipulated model can only ask.
  2. Least privilege by default. Ember installs at observe (read-only).
  3. The agent cannot promote itself. Its config, its locks, its binary, its units and its audit log are all outside its reach.
  4. Everything is recorded. Every request, allowed, refused or queued, goes into a hash-chained audit log.
  5. Small and dependency-free. Go standard library only, so there is no third-party supply chain to trust.

Components and privileges

Component Runs as Can Cannot
ember-agent user ember, NoNewPrivileges, empty capability set, ProtectSystem=strict read /proc, logs (groups adm, systemd-journal), its own state in /var/lib/ember; talk to the broker write anywhere else, see /root, /etc/shadow or your locked paths, gain privileges
ember-broker root evaluate requests and run allowed ones in a sandbox accept approvals from anyone but root; run anything unsandboxed (it refuses if systemd-run is unavailable)
ember CLI you with sudo: approve proposals, change power, manage locks —

The broker identifies callers with SO_PEERCRED (kernel-supplied uid), and accepts only root and ember. A request's approved flag is honoured only when the caller is root. The broker re-reads /etc/ember/ember.toml and locks.conf on every request, so the agent can't feed it a different policy.

The command sandbox

Every command Ember runs goes through systemd-run as a transient unit:

  • Read-only commands (classified from an allowlist of commands and arguments) get ProtectSystem=strict, ProtectHome=read-only, PrivateDevices, PrivateTmp, ProtectKernelTunables/Modules, ProtectClock, NoNewPrivileges and a capability set reduced to CAP_DAC_READ_SEARCH. A system-call filter blocks mount, reboot, module, swap, raw I/O, clock and signal syscalls. If the classifier is ever wrong about a command being read-only, the kernel still won't let it write.
  • Changing commands see /etc/ember, /usr/bin/ember, /var/lib/ember, /var/log/ember and Ember's unit files read-only. Below full, they also lose CAP_SYS_ADMIN, CAP_SYS_MODULE, CAP_SYS_RAWIO, CAP_SYS_BOOT and friends, and the mount/module/reboot syscalls.
  • All commands have your locked paths (and, by default, /etc/shadow, /etc/gshadow, SSH host keys and Ember's own secrets) replaced by an inaccessible placeholder through InaccessiblePaths=.
  • Every command has a hard runtime limit.

The hard denylist (every power level, approval or not)

Wiping or formatting disks, rm -rf /, fork bombs, editing Ember's config, binary or services, stopping Ember, systemd-run, nsenter, unshare, chroot, raw D-Bus calls, changing the root password, and touching SSH host keys. Commands that write to cron, sudoers, systemd unit directories, authorized_keys or the audit log are also refused. Those are the routes by which code could run outside Ember's sandbox or erase its record. See internal/policy/classify.go.

Locks: what they guarantee

Lock Enforced by Holds against Limits
hide kernel mount namespaces (InaccessiblePaths=) on the agent unit and on every sandboxed command the agent process; every command Ember runs at observe–maintain (they can't run arbitrary commands at all); at admin/full, every command Ember runs directly At admin/full, Ember can change system configuration. The denylist blocks the known ways to get code running outside the sandbox (cron, systemd units, sudoers, systemd-run, at), but a sufficiently creative root-level command could still find another. Treat hide as a strong guardrail, not a mathematical guarantee, at those levels.
sealed encryption everything, including full root The data is only safe while it stays encrypted. Ember verifies that the cipher directory or LUKS device is not unlocked. Keep the key off the server.

sudo ember lock verify proves each lock from independent angles:

  1. Ember's policy refuses commands that name the path.
  2. A probe runs inside the live agent's mount namespace, as the agent's user (via nsenter) and confirms it can't read the real contents.
  3. A probe runs through the real command sandbox, as root, and confirms the same.
  4. For sealed locks, it confirms the data is ciphertext and the plaintext isn't mounted or opened.

The real contents are fingerprinted (SHA-256 of names / first 64 KiB) outside the sandbox and compared with what each probe sees. Results, with fingerprints, are written to the audit log. If a check can't be run live (e.g. the agent is stopped), the lock is reported as configured, not live-tested, never as proven.

The audit log

/var/log/ember/audit.jsonl is written only by root (the broker and CLI). Each entry includes the SHA-256 of the previous entry. ember audit verify recomputes the chain and names the first line that was edited or removed. This makes tampering evident, not impossible. A root attacker could rewrite the entire file consistently. Ship the log off-box (e.g. with rsyslog or your log stack) if you need stronger guarantees.

Prompt injection

Ember reads logs, file contents and command output. All of these can contain text written by an attacker (for example a crafted username in an SSH log line) that tries to instruct the model. Mitigations:

  • Policy enforcement is independent of the model, so injected instructions can't exceed the power level, the denylist or the locks.
  • The system prompt tells the model to treat signs of compromise as evidence to report, not to "clean up".
  • On internet-facing servers, stay at observe, advise or maintain until you've watched Ember's behaviour for a while.

Data leaving the machine

With DeepSeek configured, Ember sends prompts containing command output, log excerpts and process lists to api.deepseek.com. Don't let Ember read data you aren't allowed to send to a third party. Lock those paths, or set prefer_local = true with a local Ollama model so nothing leaves the server. Emails go only to your SMTP server.

Zero-days

No tool can promise protection against unknown vulnerabilities, and Ember doesn't. It shortens your exposure by installing security updates quickly (per patch_aggression). It also raises the alarm on what exploitation usually leaves behind: new accounts, new setuid binaries, new persistence (cron, units, sudo rules), new listening ports, brute-force bursts.

Reporting a vulnerability

Please report privately through GitHub Security Advisories on CrystalRockMarket/ember ("Report a vulnerability"). Don't open a public issue. You'll get an acknowledgement within 72 hours.

Audit record

Ember promises three things about its code:

  1. Open source. Everything is MIT-licensed and public at github.com/CrystalRockMarket/ember.
  2. Inspectable. Go standard library only, no third-party modules, no generated code, no binary blobs. Release binaries are built with -trimpath by scripts/build-release.sh from the tagged source, and SHA256SUMS is published alongside them.
  3. Audited. Before each release, the security-relevant code (internal/policy, internal/broker, internal/locks, internal/audit, the systemd units and the maintainer scripts) is reviewed by an AI-assisted audit using the strongest model the project can afford, and by a human. Findings and fixes are recorded below.

An audit lowers risk. It doesn't remove it. See SECURITY.md.

Status

Version Date Review Result
0.1.0-beta.1 2026-11-28 Built with automated tests for the policy classifier, power levels, audit-chain tamper detection, config editing, leak detection and retrieval. Independent AI-assisted audit: pending. Beta. Use on test machines and servers you can rebuild.

How to reproduce a build

git clone https://github.com/CrystalRockMarket/ember && cd ember
git checkout v0.1.0-beta.1
VERSION=0.1.0-beta.1 ./scripts/build-release.sh
sha256sum dist/ember-linux-amd64     # compare with the published SHA256SUMS

The Go toolchain version changes the output bytes. Record the one you used (go version) with any comparison.

Audit template (copy for each release)

### vX.Y.Z — YYYY-MM-DD
Reviewer(s):      <model + version>, <human>
Scope:            commit <sha>; packages reviewed
Method:           threat model walk-through, denylist bypass attempts, sandbox property review, fuzzing of ClassifyCommand
Findings:         <id> <severity> <summary> → <fix commit>
Residual risks:   …

Getting Ember into apt

The path from "a .deb on our website" to "apt install ember on every Ubuntu" has four stages. Each one builds trust for the next.

Stage 1: our own downloads (now)

scripts/build-release.sh produces ember_<ver>_{amd64,arm64}.deb, tarballs and SHA256SUMS. Host them at https://ember.kituwa.com/releases/<version>/ and point releases/latest/ at the newest. install.sh downloads the right .deb, verifies its checksum and installs it with apt.

Stage 2: our own apt repository

This gives users apt update && apt upgrade for Ember:

  1. Create a signing key: gpg --quick-gen-key "Kituwa Ember Archive <ember@kituwa.com>" rsa4096 sign 3y
  2. Build a repository with reprepro (or aptly) under https://ember.kituwa.com/apt/.
  3. Publish the public key at https://ember.kituwa.com/apt/ember-archive-keyring.gpg.
  4. Users add it the modern way, with the key scoped to this repo only: sh sudo install -d /etc/apt/keyrings curl -fsSL https://ember.kituwa.com/apt/ember-archive-keyring.gpg | sudo tee /etc/apt/keyrings/ember.gpg >/dev/null echo "deb [signed-by=/etc/apt/keyrings/ember.gpg] https://ember.kituwa.com/apt stable main" | sudo tee /etc/apt/sources.list.d/ember.list sudo apt update && sudo apt install ember

Stage 3: a Launchpad PPA

ppa:kituwa/ember. Launchpad builds from source packages, which is good practice for Stage 4. The packaging/debian-source/debian/ directory is a starting point using dh-golang:

cp -r packaging/debian-source/debian .
dch -v 0.1.0~beta1-1~ppa1 --distribution noble "PPA build"
debuild -S -sa
dput ppa:kituwa/ember ../ember_0.1.0~beta1-1~ppa1_source.changes

Stage 4: Debian, then Ubuntu

Ubuntu automatically syncs most packages from Debian, so the route to "in Ubuntu" usually runs through Debian:

  1. File an ITP (Intent To Package) bug against wnpp in the Debian BTS.
  2. Find a sponsor (a Debian Developer). The Debian Go Packaging Team is the natural home: Ember has zero Go dependencies, which removes the usual biggest hurdle (packaging every dependency first).
  3. Upload to unstable. After it migrates to testing, Ubuntu picks it up in its next development release's automatic sync.
  4. Other distributions: Fedora/EPEL (an RPM spec is a short step from the tarball), Arch (AUR PKGBUILD), NixOS.

What reviewers will look for, all of which Ember is set up for:

  • A DFSG-free licence (MIT) ✓
  • Builds from source with no network access ✓
  • No bundled third-party code ✓
  • Lintian-clean packaging (run lintian on the built package, fix the warnings)
  • A man page: generate ember.1 from ember help (e.g. with help2man) before Stage 3
  • Sensible behaviour on install. Ember installs inactive and starts nothing until ember init ✓