9 Commits
Author SHA1 Message Date
jackos1998andClaude Opus 5.5 4b2c32636e broker: Containers as targets
CI / Check (pull_request) Successful in 5m17s
CI / Check (push) Canceled after 0s
`slop status`, `logs`, `failed` and `ssh` take `node.container-<name>`,
the name `slop deploy` already takes, so agents can check a container
without asking for `slop ssh` on its host.

- The builder evaluates each node's profile names; its
  `container-<name>` profiles are the containers requests can name.
- Commands run on the node as root through its `sudo`:
  `systemctl --machine`, `journalctl --machine` and, for `ssh`,
  `systemd-run --machine --pipe --wait` with `/bin/sh -l`.
- A container's scope is its node as `target` plus `container`, so
  node rules apply to it while leases stay per target. Rules can
  match `container`.
- Remote commands are now quoted so `fish` reads them as POSIX shells
  do: it treats `\\` and `\'` as escapes inside single quotes.

`PROTOCOL_VERSION` 3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 17:28:57 +00:00
jackos1998andClaude Opus 5.5 ef53a39597 slop: Say how long approvers have to answer
CI / Check (pull_request) Successful in 4m58s
CI / Check (push) Successful in 4m36s
The agent guide said requests wait up to five minutes, the default,
but a broker can allow much longer, so agents gave up on requests that
were still waiting. The broker now says how long approvers have when a
request starts waiting, and the guide tells agents to wait that long.

Bumps to 0.2.2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 19:18:39 +00:00
jackos1998andClaude Opus 5.5 2df7cd3dee ssh: Show approvers the stdin a command runs with
CI / Check (pull_request) Successful in 5m14s
CI / Check (push) Successful in 5m15s
`slop ssh` forwarded stdin only after approval, so a script piped to
`bash -s` reached the box without an approver or the audit log ever
seeing it. `slop` now reads all of stdin (unless it's a terminal)
and sends it with the request. Approvers see it in full, the audit
log keeps it, and the command gets exactly those bytes. Stdin that
isn't UTF-8, or a command and stdin too long to show whole, is
refused.

The command is shown as the line the remote shell runs (the words
joined with spaces, as `ssh` sends them) rather than shell-quoted,
which suggested quoting the remote shell never sees; multi-line
commands are shown as text.

`Operation::Ssh` gains `stdin`, so the protocol version goes to 2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 00:51:12 +00:00
jackos1998andClaude Opus 5.5 005e3d32df ops: Add age secrets
`slop secret keys|set|generate|rekey|read` work with an agenix secret
in the requester's checkout: it sends the ciphertext, and the broker
decrypts it with its own age identity and returns new ciphertext.
Field edits work on env and JSON secrets.

The path and recipients are the requester's, so before approval the
builder reads the protected main branch: it looks the ciphertext's
blob up there, so approvers see which file it really is, and
evaluates that branch's rules file to compare the recipients.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 00:56:17 +00:00
jackos1998andClaude Opus 5.5 5a4cdddd7f builder: Approve builder use before building
Before the builder evaluates anything, an approver sees the requester's
commits relative to the branch and their diff, and approves using the
builder. A lease from an earlier request can cover it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:39:37 +00:00
jackos1998andClaude Opus 5.5 eeaf22a7b5 ops: Add builds
`slop build <attr>…` builds flake attributes of a pushed commit on the
builder and, once approved, copies them to a binary cache's store and
roots them there. `services.slop-broker-cache` gives the cache store
owner's key a forced command that only allows the store protocol and
GC roots, and expires the roots.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:39:35 +00:00
jackos1998andClaude Opus 5.5 6305228e7e ops: Add deploys
`slop deploy <node>…` builds a pushed commit and, once approved,
activates it on every target at once. A builder, reached over SSH as
a user that only holds a read-only Git key, fetches the commit from
the Git server and evaluates and builds the deploy-rs profiles, so
agent-written Nix never runs in the broker. Before asking, the broker
copies the closures to the nodes and compares them there with a fixed
read-only script: package changes from `nix store diff-closures`, and
changed units and `/etc` files from the two `etc` trees.

Once approved, `activate-rs` runs on each node in a transient unit,
so it finishes even if the connection drops or the broker restarts.
Policy rules see one scope per target, and the strictest answer
applies. `services.slop-broker-builder` sets up the builder on any box.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:39:35 +00:00
jackos1998andClaude Opus 5.5 d71bbb04db ops: Add box queries
`slop status`, `slop logs` and `slop failed` run fixed read-only
commands that the broker builds and quotes from validated values, so a
policy can let them run without asking.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:39:35 +00:00
jackos1998andClaude Opus 5.5 67b11b0c61 broker: Add approval broker for coding agents
`slop-broker` runs privileged operations for coding agents under named
policies (auto, ask or deny per operation), which requesters can share,
with approvals from `slop-approve` or Home Assistant notifications and
optional leases. The broker and the `slop` client talk over vsock, so
a VM needs no network path to it. Messages are typed enums shared by
both, CBOR-encoded and framed with `LengthDelimitedCodec`; decoding
validates every value, and requests carry a protocol version.

The first operation is `slop ssh`. The `services.slop-broker` NixOS
module runs the broker as a hardened service from generated TOML, and
a VM test exercises it over vsock loopback. devenv provides the
development environment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:39:36 +00:00