Commit Graph
3 Commits
Author SHA1 Message Date
sam 96e5d7b84b refactor: strip doc and issue narration from code comments
Remove PRD/doc paths, bead IDs, phase notes and deleted-test references
from comments; drop test-only hooks left by the test deletion. Includes
in-progress archied bootstrap, gateway and query changes.
2026-10-03 21:47:46 +10:00
sam 6be754787d polish: add install.sh, XDG setup, deployments/ examples, and github-token docs\n\n- Add install.sh following XDG Base Directory specification (~/.config/archie, ~/.local/share/archie, ~/.local/bin)\n- Add interactive setup for code forge (GitHub / Gitea / Standalone) and LLM provider selection (Ollama model picker / Cloud keys)\n- Implement NoopForge in internal/forge/noop.go for running Archie in standalone mode without a forge\n- Enable loginctl user linger and systemd user unit setup in install.sh\n- Add docs/github-token.md with step-by-step guidance for Classic PAT generation\n- Add top-level deployments/ directory with scenario templates (single-forge GitHub, multi-forge GitHub+Gitea, local Ollama standalone, systemd runbook) 2026-07-30 01:25:46 +10:00
sam bb7b779b35 feat: refuse unrecoverable shell commands
Add internal/tools/command: an always-on floor under the shell tool,
enforced in the provider adapter so the lifted tau files stay diffable.

This is not a security boundary and does not pretend to be one. Anything
with a shell has countless ways past a rule list. What it buys is that
the failures with no recovery -- where you cannot intervene afterwards
because the machine, the filesystem, or the gateway itself is gone --
are not reachable by an ordinary mistake.

Rules: recursive delete of / and system directories, mkfs, raw block
device writes, fork bombs, kill -1, shutdown/reboot/init/systemctl
power, and sudo -S with no SUDO_PASSWORD configured. Two more are
archie's own: an agent must not stop the daemon that hosts /stop
(pkill/systemctl/docker), nor start a second one outside the supervisor.

The parsing is the actual work. Patterns are anchored to command
position, so `git commit -m "revert the rm -rf / change"` and
`echo "rm -rf /"` are ordinary commands, while `echo x; rm -rf /` and
`$(rm -rf /)` are not. Quoting, separators, ${VAR} braces, environment
assignments and privilege wrappers are all parsed rather than matched.

Probing the first version found two bypasses that made every rule
optional, both of which a model writes unprompted rather than only an
attacker: `bash -c "rm -rf /"` and `xargs rm -rf /` hide the command in
an argument. Segments are now followed into shell -c payloads, eval, and
command wrappers (xargs, timeout, nice, env, nohup, ...), bounded by a
nesting limit. Tests cover both directions -- the refusals and, at equal
length, the ordinary commands that must not trip them.
2026-07-29 18:45:43 +10:00