Merge main: ntfy removed, first-run messages kept

Resolved docs/install.md, internal/cli/app.go, internal/statusview and
scripts/setup-native.py: no ntfy anywhere (connection, status, installer
constants, troubleshooting ports), keeping the first-run next steps, the
unreachable-server and tool/Docker install hints. README drops the C
compiler (ntfy was its only user). The installer summary's password
wording is now per run (a reinstall in the same process no longer says
"you just chose"), and its test checks the URLs then the next steps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 23:54:57 +00:00
337 changed files with 14221 additions and 5709 deletions
+10 -18
View File
@@ -78,20 +78,15 @@ the sum of the per-run totals `inspect` shows. Only usage rows whose recorded
step still exists are counted, so rows orphaned by an old history wipe are ignored
(not deleted). `pipelines stats --json` exposes these aggregates.
Use `:status` on any TUI page to open server and ntfy information. Scroll with
Use `:status` on any TUI page to open server information. Scroll with
arrows or `j/k`, PgUp/PgDn; `r` refreshes and Esc closes without changing the page.
`pipelines status [--json]` returns the same server data, including hostname,
start/uptime, the connected server endpoint/port, active interface IPs, ntfy
publishing health, public phone URL/topic/port and candidate URLs. It does not
start services or send a notification. The ntfy health probe has a two-second
deadline; it checks the publishing server, not phone reachability.
start/uptime, the connected server endpoint/port, active interface IPs and
candidate URLs. It does not start services or send a notification.
IPs belong to the **server computer or container**, not necessarily the client.
Candidate IP/port combinations are not reachability checks: loopback bindings,
firewalls, container port mapping and TLS can prevent access. ntfy candidates
are only derived when a configured endpoint identifies this computer; remote
ntfy hosts are not misrepresented as local. Publishing URLs and credentials are
never returned. Missing public phone configuration is labeled explicitly.
firewalls, container port mapping and TLS can prevent access.
`pipelines service status` remains the separate OS autostart status command.
## Search
@@ -334,7 +329,7 @@ Submitting activates included schedules, so review them before publishing.
| Resume a run parked for a usage limit | `resume ID --yes --json` |
| Default whole-run budget | `run-budget [USD\|off] --json` |
| Connection and phone settings | `connection --json`, `ping --json` |
| Server/ntfy status popup | `status --json` |
| Server status popup | `status --json` |
| Usage statistics/charts | `stats --json` |
| Run-history retention | `retention report --keep N --json`, `retention apply --keep N --yes` |
| Retire an unused pipeline | `archive NAME --yes`, `unarchive NAME`, `list --archived` |
@@ -359,13 +354,12 @@ optional `kind` and `limit`) and returns a `search_results` response whose ranke
and matched field. `list_runs` also returns all-history `usage`
aggregates. `attention_acks` reads and `ack_attention` adds to the operator's
shared in-app acknowledgements (dismissed Needs-you entries and chat read
watermarks; see [ntfy.md](ntfy.md#clearing-notifications-across-devices)); other
watermarks; see [notifications.md](notifications.md#clearing-notifications-across-devices)); other
connections receive an `attention_acks_changed` push. `subscribe_notifications`
(optional `after` cursor) streams the same notifications the server publishes to
ntfy as `notification` pushes, `clear_notifications` (`ids`) clears them on every
device, and `notifications_cleared` reports clears; `ntfy_enabled` in the
notification settings turns the ntfy publish off without stopping the stream (see
[ntfy.md](ntfy.md#app-notification-stream-no-ntfy-app-needed)).
(optional `after` cursor) streams the operator's notifications as `notification`
pushes, `clear_notifications` (`ids`) clears them on every device, and
`notifications_cleared` reports clears (see
[notifications.md](notifications.md#app-notification-stream-protocol)).
Every run summary (`list_runs` rows, `get_run`, subscribe snapshots and terminal
`run_event` frames) carries `size_bytes`: bytes on disk for the run (artifact tree
@@ -1176,8 +1170,6 @@ or that has no tools block never replays admitted tool work or invalid results.
Budget failures always stop. Cleanup must be confirmed before another attempt.
Existing explicit `retries=0` settings remain unchanged. The old 30-minute run deadline no longer truncates
stage timeouts; the 30-step and five-visits-per-stage limits still apply.
Native ntfy stages also accept `timeout` (default `1h`), but never automatically
retry potentially delivered notifications and do not accept model budgets.
Pinned definitions contain the configured limits. Run transcripts retain limits,
attempt counts and reported budget usage, also shown in the TUI's Evidence pane.
+50 -91
View File
@@ -1,84 +1,72 @@
# Pipeline server + ntfy in one Compose project (Android)
# Pipeline server in a Compose project
## Complete installer (recommended for both services in Docker)
## Complete installer (recommended for Docker)
Run `./install --docker` from an interactive terminal (Docker is the explicit
`--docker`/`docker` mode; `./install.sh` remains a compatibility alias, and a bare
`./install` now performs the native host installation). It handles Compose
configuration, ntfy users/permissions/token, image build, container skill install,
first-time container harness provider login (OpenCode by default; `./install
--docker --harness pi` configures Pi and skips OpenCode login), startup, and an
authenticated test notification. Choose your own provider in the configured
configuration, image build, container skill install, first-time container
harness provider login (OpenCode by default; `./install --docker --harness pi`
configures Pi and skips OpenCode login), startup and a status check. Choose your
own provider in the configured
harness; signup/login credentials stay in the Docker volume, not your host
account. Re-run to update while
preserving `.env`, tokens, histories and volumes. Use `--relogin` to connect another
provider. No fixed OpenCode Go login is required. Health/publishing checks do not
prove model inference or phone reception.
The phone-facing ntfy URL uses the detected LAN IP; both services bind `0.0.0.0` by default.
There are no networking questions. Advanced URL/bind/timezone flags remain optional.
preserving `.env`, histories and volumes. Use `--relogin` to connect another
provider. No fixed OpenCode Go login is required. Health checks do not prove
model inference. The server binds `0.0.0.0` by default. There are no networking
questions; `--timezone` and `--port` remain optional.
The steps below are for manual setup or a developer/legacy local Pipelines server
with Docker ntfy; they are **not** the supported installation and are not needed when
you use `./install`.
Notifications reach the Pipelines apps through the server itself (browser
notifications in the web app, the **Receive notifications in Pipelines**
background service or the open app on Android, the app on iOS and macOS); see
[Notifications](notifications.md). There is no ntfy service any more.
## Manual developer/legacy: local pipeline server, Docker ntfy
Re-running `./install --docker` over an installation from before this change
retires its ntfy: it removes the Compose project's `ntfy` container and
`<project>_ntfy-data` volume (ntfy's caches and accounts, which nothing reads any
more), `secrets/ntfy-token.txt` and the `NTFY_BASE_URL`/`NTFY_BIND_ADDRESS` lines
in `.env`, and recreates the server with `--remove-orphans`. Running it again
finds nothing left to remove. `./uninstall` removes any leftover ntfy container
and volume too.
The steps below are for manual setup or a developer/legacy local Pipelines
server; they are **not** the supported installation and are not needed when you
use `./install`.
## Manual developer/legacy: local pipeline server
To reuse your host OpenCode login without container authentication (manual,
developer/legacy use—not a supported installation):
developer/legacy use, not a supported installation):
```sh
docker compose up -d ntfy
# Bootstrap ntfy users/token as described below, then:
sh scripts/run-local-server.sh
go run ./cmd/pipelines-tui -url ws://127.0.0.1:8080/connect
```
Do not run `docker compose up -d` for this mode: that starts the pipeline container
too. The local launcher uses the existing host database and OpenCode account,
publishes via localhost:8090, and advertises `.env`'s `NTFY_BASE_URL` to the TUI.
The top bar shows **ntfy**, the external server URL, and topic beside the pipeline
server address on every page.
No credentials are included in the public setup data. Stop any existing local
pipeline server before launching another against the same database/port.
The local launcher uses the existing host database and OpenCode account. Stop
any existing local pipeline server before launching another against the same
database/port.
`compose.yaml` runs two services: `pipelines` (Go server + OpenCode V2) and `ntfy`.
The pipeline server publishes internally to `http://ntfy/pipelines`; Android connects
to your host's LAN/VPN URL. No host OpenCode service or credential database is
mounted. Separate volumes persist pipeline history, workspace files, OpenCode
credentials/sessions, and ntfy data. Do not use `docker compose down -v` unless
you intend to delete those volumes.
**Verification:** `docker compose build pipelines` completed, and
`docker compose up -d ntfy` started ntfy. A local authenticated Markdown upload
was accepted with a phone-facing attachment URL. The local server's WebSocket
advertised the public URL/topic and accepted the notification test pipeline.
Go race tests and vet passed. Pipeline-container startup/model authentication
and Android delivery are still **not tested**. Existing host history is preserved;
the local server was restarted with notification configuration. The image now
also includes python3 so the installer regression suite can run inside the
container; a real 40x16/80x24/120x36 terminal UI review remains an independent
step.
`compose.yaml` runs one service, `pipelines` (Go server + OpenCode V2). No host
OpenCode service or credential database is mounted. Separate volumes persist
pipeline history, workspace files and OpenCode credentials/sessions. Do not use
`docker compose down -v` unless you intend to delete those volumes.
## 1. Local settings
Start Docker Desktop/Colima/your Docker daemon first. Choose the host address your
phone can reach. Example (replace the LAN IP):
Start Docker Desktop/Colima/your Docker daemon first.
```sh
python3 scripts/configure-compose.py \
--ntfy-url http://192.168.1.20:8090 \
--bind-address 0.0.0.0
python3 scripts/configure-compose.py
docker compose config --quiet
```
The helper detects the **host's timezone** and writes it to `.env`, so the Linux
containers do not silently schedule in UTC. It refuses to overwrite `.env` or an
existing token. If detection is unavailable, use `--timezone Europe/London` (or
your actual IANA timezone). Rerun/edit settings if you move/change timezones.
containers do not silently schedule in UTC. It refuses to overwrite `.env`. If
detection is unavailable, use `--timezone Europe/London` (or your actual IANA
timezone). Rerun/edit settings if you move/change timezones.
The helper creates an empty, protected token file for bootstrap; no notifications
are sent until it is filled. `.env`, `secrets/`, and `data/` are git-ignored and
excluded from image builds. The container publishes port **8080**; the default
`.env`, `secrets/`, and `data/` are git-ignored and excluded from image builds. The container publishes port **8080**; the default
host mapping is **8081**, bound to host `0.0.0.0`, avoiding the existing native
server on 8080. Query the actual mapped port with
`docker compose port pipelines 8080`. The unauthenticated pipeline WebSocket API
@@ -86,32 +74,11 @@ shares that port, so expose it only on a trusted LAN/VPN and never to the public
internet.
Use HTTP only on a trusted LAN or encrypted VPN. For public access, use HTTPS
with a reverse proxy/VPN; configure the external URL in `NTFY_BASE_URL`. The
container's attachment URLs use that external URL, not the internal service name.
Both host port mappings default to `0.0.0.0`; firewall them appropriately. The
Pipelines API has no authentication and must not be exposed to untrusted networks.
with a reverse proxy/VPN. The host port mapping defaults to `0.0.0.0`; firewall
it appropriately. The Pipelines API has no authentication and must not be
exposed to untrusted networks.
## 2. Bootstrap ntfy users and token
```sh
docker compose up -d ntfy
docker compose exec ntfy ntfy user add pipeline-publisher
docker compose exec ntfy ntfy access pipeline-publisher pipelines write-only
docker compose exec ntfy ntfy user add phone-reader
docker compose exec ntfy ntfy access phone-reader pipelines read-only
docker compose exec -T ntfy ntfy token add pipeline-publisher | python3 scripts/save-ntfy-token.py
```
User creation prompts for passwords. Keep `secrets/` mode **0700** on the host.
The helper extracts only the raw token (the ntfy CLI includes prose in its response)
and makes the final file readable inside the non-root pipeline container: local Compose
file secrets are bind mounts and do not reliably remap uid/mode. Its private parent
directory protects the source file from other host users. Do not commit tokens
or paste them into a chat. Recreating/replacing the secret file requires restarting
the pipeline container. The application accepts `_TOKEN_FILE` or `_TOKEN`, not
both, and never puts the token in model prompts, outputs, or diagnostics.
## 3. Authenticate the harness, then start the server
## 2. Authenticate the harness, then start the server
```sh
python3 scripts/build_metadata.py # resolve releases and stamp revision/dirty identity
@@ -151,18 +118,11 @@ bundled example pipelines, seeded once; an existing database is never changed.
Open `:templates` and use **Submit template** to name/review/publish another copy,
or **Customize** to edit it first. All bundled examples are manual-only.
## 4. Android
## 3. Notifications
Install ntfy, add the custom server `http://192.168.1.20:8090` (or your HTTPS/VPN
URL), sign in as `phone-reader`, and subscribe to **pipelines**. This is the single
system-wide notification topic, shared by every pipeline. Grant notifications
and background operation as required by your Android app/device. Outside your
LAN, enable the VPN or use your HTTPS address. `localhost` on Android is the
phone, not your server. No iOS/APNS upstream is needed for this Android setup.
Use the app to confirm a test notification and download an attachment before
relying on unattended schedules. This phone/background-delivery check has **not
been performed**. Attachments/messages expire after seven days in this config.
Notifications come through the Pipelines apps, connected to this server; see
[Notifications](notifications.md). If you subscribed to the old `pipelines`
topic in the ntfy app, remove that subscription.
## Existing data and rebuilds
@@ -179,8 +139,7 @@ resolves the current releases, use `python3 scripts/build_metadata.py`. A plain
The workspace volume does not automatically replace its existing source tree
on image rebuild; back it up and update it explicitly if you need new source for
Go verification. Do not delete it casually: it may contain user-created artifacts.
`compose.yaml` still uses ntfy's `latest` tag; pin a tested version/digest before
production. OpenCode and Pi are not fixed version pins: `./install` resolves the
OpenCode and Pi are not fixed version pins: `./install` resolves the
current supported OpenCode V2 release from the single documented complete
`GET /repos/{owner}/{repo}/git/matching-refs/tags/v2` response — a complete bounded
array with no page/per_page query and no `Link` pagination (never the moving
+2 -4
View File
@@ -11,7 +11,7 @@ service or a guarantee that a model's answer is correct.
Docker is optional with `./install --docker`.
3. Open the web address reported by setup. For terminal use, put the installation's
`bin` directory on PATH and run `pipelines` from your project directory.
4. Setup also starts the authenticated web proxy, server, and ntfy and enables
4. Setup also starts the authenticated web proxy and server and enables
login startup. See [installation](install.md) for the private web credential
location. The installed CLI's `pipelines service enable` / `service status`
manage that same service; do not start another server manually.
@@ -59,9 +59,7 @@ a new execution can repeat side effects. Never delete data/volumes to fix a run.
Browser alerts require the page to be open; closed-app web push is not supported.
The Android app delivers notifications in the background over its own
connection. ntfy is an optional fallback channel that works without the
Pipelines Android app. Installation verifies publishing, not reception. Check
device reception before relying on it. See [Notifications](notifications.md).
connection. Check device reception before relying on it. See [Notifications](notifications.md).
## Known limits
+69 -28
View File
@@ -17,11 +17,10 @@ them, and it stops naming whatever is missing.
| Tool | Why |
| --- | --- |
| Go (version in `go.mod`, currently 1.27) | builds `pipelines-server`, `pipelines` and ntfy |
| Go (version in `go.mod`, currently 1.27) | builds `pipelines-server` and `pipelines` |
| Node.js 18+ | runs the authenticated web proxy (`web/serve.mjs`) |
| Python 3.9+ | installer and the lifecycle manager (`manage.py`) |
| git, curl | source checkout, updates, release lookup |
| C compiler (`cc`, `clang` or `gcc`) | ntfy's SQLite driver is cgo (Xcode Command Line Tools on macOS) |
| **Docker, running** | builds the Flutter web app and the APK |
| OpenCode on `PATH` | required; default stage and chat harness (`curl -fsSL https://opencode.ai/install \| bash`) |
| Pi, Claude Code, Codex | optional; set up after install with `pipelines harness setup <name>` |
@@ -53,12 +52,14 @@ Linux needs `systemctl --user`. Other platforms are refused.
6. Writes host harness profiles to `~/.config/pipelines/harnesses.json`. If no
usable OpenCode default model is found, it opens the model picker in the
terminal (or fails without a terminal; pass `--model`).
7. Builds ntfy from its pinned Go module, writes its config and creates the
`pipeline-publisher` and `phone-reader` accounts.
8. Migrates data from an earlier Docker installation, if its volumes exist.
7. Migrates data from an earlier Docker installation, if its volumes exist.
8. Retires the ntfy server an older installation ran, if any (see
[Reinstalling over an ntfy installation](#reinstalling-over-an-ntfy-installation)).
9. Registers the login service, writes the manifest
`<prefix>/pipelines-install.json`, saves `ws://127.0.0.1:<port>/connect` as
the CLI default in `~/.config/pipelines/client.json`, and starts everything.
the CLI default in `~/.config/pipelines/client.json`, and starts everything
that is not already running. A running service keeps the previous build
until `pipelines restart`.
10. Retires the legacy standalone web agent `net.awan.pipelines.web` on macOS
(stopped, plist renamed to `.disabled`), so only one web app is served.
11. If `PIPELINES_WEB_PUBLIC_URL` is an `https://…ts.net` address, runs
@@ -79,6 +80,55 @@ Empty lists are normal on a new installation: `pipelines runs` says
"No runs yet" with the command to start one. If the CLI cannot reach the
server it says so and how to start it (`pipelines start`, `pipelines doctor`).
## Notifications
Pipelines sends notifications through its own server to the Pipelines apps;
there is nothing to install or subscribe to:
- **Web app**: browser notifications, once allowed in the browser.
- **Android**: the **Receive notifications in Pipelines** background service,
or in the app while it is open.
- **iOS and macOS**: in the app.
See [Notifications](notifications.md).
### Reinstalling over an ntfy installation
Installations from before this change ran an ntfy server beside Pipelines.
`./install` retires it, once, after the new build is in place and before the
new manifest is written (`Setup.retire_ntfy` in `scripts/setup-native.py`,
using `retire_ntfy` in `scripts/manage.py`):
1. It records the paths it removes and the old ntfy version, from the old
manifest, in `<prefix>/logs/install.log`. No credentials are written there.
2. It stops the old ntfy process from `<prefix>/ntfy.pid`, but only while that
PID's command line is still `<prefix>/bin/ntfy serve …`; any other PID is
left alone and the stale PID file is removed.
3. It deletes `<prefix>/bin/ntfy`, `<prefix>/ntfy.pid`, `<prefix>/logs/ntfy.log`,
`<prefix>/secrets/publisher-token` and the whole `<prefix>/data/ntfy/`
directory.
`<prefix>/data/ntfy/` is deleted rather than kept: it held only ntfy's
configuration, its message and attachment caches, and its account database
(`phone-reader`, `pipeline-publisher`), which nothing reads any more. Pipelines
history lives in `<prefix>/data/pipelines.db` and is untouched.
The new manifest has a top-level `"mode": "native"` and no `ntfy`, `ntfy_port`,
`topic`, `username` or `public_url` entries. Until that reinstall, a manifest
with the older `ntfy.mode: "native"` marker is still treated as native.
`./install` does not restart a service that is already running, so the old
server keeps running (without ntfy) until `pipelines restart`. The restart stops
the old supervisor; the new one starts only the server and web proxy, and stops
an ntfy that is somehow still running from the PID file under the same check.
Running `./install` again finds nothing left to retire. On a phone, remove the
old Pipelines subscription from the ntfy app.
Docker installations (`./install --docker`) retire ntfy the same way: the
installer removes the old `ntfy` container and its `<project>_ntfy-data` volume,
`secrets/ntfy-token.txt` and the `NTFY_*` lines in `.env`, and recreates the
server with `--remove-orphans`.
## Set up harnesses
One command per harness, the same on native and Docker installations:
@@ -105,7 +155,6 @@ one; it does not touch that binary.
| --- | --- | --- |
| Web proxy (sign-in, web app, `/updates/`) | port 8082, loopback + tailnet only | `--web-port`, `--web-host`, `--web-lan` |
| Server API (no auth) | `127.0.0.1:8080` | `--port`, `--bind-address` |
| ntfy | `:8090` | `--ntfy-port`, `--ntfy-url` |
Expose only the web proxy. It listens on loopback and this machine's Tailscale
addresses unless you opt into the LAN; see
@@ -146,8 +195,6 @@ From `arguments()` in `scripts/setup-native.py`:
| `--web-host tailnet\|IP` | web proxy access: `tailnet` (default for new installs: loopback and Tailscale addresses only) or a literal IPv4 bind such as `0.0.0.0`; existing installs keep theirs and get a warning |
| `--web-lan` | also accept plain-HTTP LAN connections; sign-in over them stays refused |
| `--web-lan-plain-login` | allow sign-in over plain-HTTP LAN (unencrypted password and cookie; trusted networks only) |
| `--ntfy-port N` | ntfy port (default 8090) |
| `--ntfy-url URL` | ntfy address given to phones (default `http://<LAN IP>:<ntfy-port>`) |
| `--timezone TZ` | override the detected timezone (fallback UTC) |
| `--model PROVIDER/MODEL` | default model for new starters and missing OpenCode profile fields |
| `--allow-authoring` | allow creating and publishing pipelines (fresh installs default to this) |
@@ -181,7 +228,7 @@ This reset has no confirmation prompt. Do not use it merely to update the app.
```sh
./install --web # rebuild and install only the web app (Docker), then reload the page
./install --apk # build the Android APK (Docker, slower) and offer it to phones
./install --docker # server and ntfy in Docker Compose instead of native
./install --docker # server in Docker Compose instead of native
```
`./install --apk` builds a release APK for this installation's web address,
@@ -267,11 +314,11 @@ another installation.
| Command | Effect |
| --- | --- |
| `pipelines start` | start server, web proxy and ntfy; print the startup report |
| `pipelines stop` | stop all three; harness sessions keep running and the next start reattaches them (see below) |
| `pipelines start` | start server and web proxy; print the startup report |
| `pipelines stop` | stop both; harness sessions keep running and the next start reattaches them (see below) |
| `pipelines restart` | stop then start, keeping data; chat turns and stage sessions continue |
| `pipelines doctor` | startup report, health of server and ntfy, OpenCode API check (no inference) |
| `pipelines status` | server, host and ntfy publishing health, from the running server |
| `pipelines doctor` | startup report, server health, OpenCode API check (no inference) |
| `pipelines status` | server and host health, from the running server |
| `pipelines logs` | follow `logs/server.log` |
| `pipelines update` | pull and reinstall the same way, then restart (see below) |
| `pipelines uninstall [--purge] [--yes]` | remove the service and binaries; `--purge` also deletes data |
@@ -325,7 +372,7 @@ endpoint and the Codex App Server are separate processes anyway.
The login service is `~/Library/LaunchAgents/net.a-wan.pipelines.plist` on
macOS and `~/.config/systemd/user/net.a-wan.pipelines.service` on Linux. It
runs `manage.py supervise`, which owns all three processes. This is login
runs `manage.py supervise`, which owns the server and web proxy processes. This is login
autostart, not boot-without-login.
## Where things live
@@ -333,12 +380,10 @@ autostart, not boot-without-login.
| Path | Contents |
| --- | --- |
| `<prefix>/pipelines-install.json` | manifest (ports, paths, install args, environment) |
| `<prefix>/bin/` | `pipelines`, `pipelines-server`, `pipelines-claude-host`, `pipelines-codex-host`, `ntfy` |
| `<prefix>/bin/` | `pipelines`, `pipelines-server`, `pipelines-claude-host`, `pipelines-codex-host` |
| `<prefix>/data/pipelines.db` | SQLite database (definitions, runs, chats, settings) |
| `<prefix>/data/artifacts/` | run artifacts and session exports |
| `<prefix>/data/ntfy/` | ntfy config, cache and accounts |
| `<prefix>/secrets/publisher-token` | ntfy publishing token |
| `<prefix>/logs/` | `server.log`, `web.log`, `ntfy.log`, `supervisor.log` |
| `<prefix>/logs/` | `server.log`, `web.log`, `supervisor.log`, `install.log` |
| `~/.config/pipelines/web-auth.json` | web password and cookie secret (`PIPELINES_WEB_AUTH_FILE`) |
| `~/.config/pipelines/harnesses.json` | harness profiles (`PIPELINES_HARNESS_CONFIG`) |
| `~/.config/pipelines/client.json` | default server URL for the CLI/TUI |
@@ -358,9 +403,6 @@ in all). Without a terminal, set `PIPELINES_WEB_PASSWORD`. It is stored in
and reused unchanged on every reinstall. An invalid or non-private file stops
the installer rather than being reset.
The same password is given to the ntfy `phone-reader` account when that account
is first created; existing ntfy accounts keep their passwords.
After updating the installation, change the web sign-in password from the
checkout with:
@@ -372,8 +414,7 @@ It prompts twice without echoing the password, applies the same strength rule,
and writes the private password file atomically. The updated web
proxy picks it up on the next request; no service restart is needed, and existing
sessions and running tasks remain connected. SSH is supported with an interactive
TTY. This changes the web/app sign-in password; the ntfy notification account's
password is unchanged. `--prefix PATH` selects another installation, and
TTY. This changes the web/app sign-in password. `--prefix PATH` selects another installation, and
`PIPELINES_WEB_AUTH_FILE` selects an explicitly configured password file.
## Upgrading
@@ -385,8 +426,8 @@ pipelines update
`update` refuses while runs are executing (finish or cancel them first). It
then runs `git pull --ff-only` in the checkout it was installed from (skipped
when the branch has no upstream), re-runs `./install` with the recorded
arguments, restarts, and prints the startup report. Data, passwords, ntfy
accounts and the signing key are kept. If the installer fails, the previous
arguments, restarts, and prints the startup report. Data, passwords and the signing key
are kept. If the installer fails, the previous
version keeps running.
Running `./install` again from the checkout does the same without the pull.
@@ -423,8 +464,8 @@ per-user data directory (`XDG_DATA_HOME`, or Application Support on macOS).
found on PATH"**: install Docker first.
- **"cannot reach the Pipelines server"**: the service is stopped. Run
`pipelines start`; `pipelines doctor` and `pipelines logs` show why it stopped.
- **Ports busy**: a Docker installation or an old server may hold 8080, 8082 or
8090. Stop it, or choose other ports with the flags above.
- **Ports busy**: a Docker installation or an old server may hold 8080 or 8082.
Stop it, or choose other ports with the flags above.
- **"No usable configured harness model"**: rerun `./install` in a terminal to
pick models, or pass `--model PROVIDER/MODEL`.
- **CLI talks to the wrong server**: `PIPELINES_URL` overrides the saved
+173 -43
View File
@@ -1,29 +1,37 @@
# Notifications
The server records every notification once and delivers it two ways:
The server records every notification once, in its `app_notifications` table,
and streams it over the app's own connection (`/connect`) to every signed-in
Pipelines client, which posts it as a system notification:
1. **In the Pipelines app** (Android, and the web page while it is open), over
the app's own connection. No ntfy app is needed.
2. **ntfy** (optional fallback), for devices that still use the ntfy app.
- **Web** (each tab and installed web app window): a browser `Notification`,
while the page is open and the browser allows it. Closed-browser web push is
not implemented.
- **Android**: the **Receive notifications in Pipelines** background service
(keeps its own connection, also with the app closed), or the in-app bridge
while the app runs.
- **iOS and macOS**: the in-app bridge while the app runs.
The same settings decide what is sent on both paths.
No other app, server or account is involved. (Earlier versions also published
to a self-hosted ntfy server; that was removed. See
[Upgrading from ntfy](#upgrading-from-ntfy).)
## What notifies
| Event | When |
| --- | --- |
| Run needs your decision | a run reaches a human decision stage (runs not set to Silent) |
| Run failed / succeeded | runs started with **Notify me** (`--notify on`), or every run when **Notify when any run ends** is on |
| Stage hook | a stage's own `notify` block fires ([ntfy reference](ntfy.md)) |
| Run failed / succeeded | runs started with **Notify me** (`--notify on`), or every run when **Notify when any run ends** is on; unexpected failures always |
| Stage hook | a stage's own `notify` block fires ([below](#stage-notify-hooks)) |
| Chat needs you | a chat asks a question or requests approval |
| Chat replied | an assistant turn ends (off by default) |
| Agent notification | a chat's agent calls its `notify` tool (always on; a turn that notified sends no separate "Chat replied") |
| Schedule delayed / skipped | a scheduled run could not start on time (low priority) |
Each event notifies once, on every device signed in (each web tab or installed
web app window, the Android app, the macOS app) and on ntfy. Opening the chat
or run, tapping the notification, or dismissing it in the app or the Android
notification shade clears it on every device, including the ntfy app for chat
notifications (see [Clearing notifications across devices](ntfy.md#clearing-notifications-across-devices)).
Each event notifies once, on every signed-in device. Opening the chat or run,
tapping the notification, or dismissing it in the app or the Android
notification shade clears it on every device (see
[Clearing notifications across devices](#clearing-notifications-across-devices)).
Chat events do not need the chat to be open. When the last app or browser
leaves a chat whose turn is still running, or which has an unanswered question
@@ -61,48 +69,170 @@ In the app, **Settings**:
- **Allow background delivery**: asks Android to exempt Pipelines from battery
optimisation so delivery stays instant while the phone is idle. Grant it.
**Phone notifications** (stored on the server, shared by every device):
**Notification events** (stored on the server, shared by every device):
| Setting | Default |
| --- | --- |
| Notify when any run ends (otherwise only runs started with **Notify me**) | off |
| Chat needs your answer or approval | on |
| Chat reply finished | off |
| Also send to ntfy (for devices that still use the ntfy app) | on |
| Setting | Key | Default | Effect |
| --- | --- | --- | --- |
| Notify when any run ends | `run_finished` | off | every **auto**-mode run that fails or succeeds notifies; otherwise only runs started with **Notify me** announce their end |
| Chat needs your answer or approval | `chat_needs_you` | on | chat questions/forms and approval requests notify |
| Chat reply finished | `chat_reply_finished` | off | each finished assistant turn notifies |
Turning **Also send to ntfy** off stops publishing to ntfy; the app still
receives everything.
They are stored in the server database (`server_settings`, keys `notify.*`) and
survive restarts. Per-stage `notify` hooks are not affected by them. Over the
websocket protocol, `{"type":"notification_settings"}` reads them and
`{"type":"set_notification_settings","notification_settings":{"chat_reply_finished":true}}`
changes any subset; both reply with type `notification_settings` carrying every
key. Unknown keys and non-boolean values are refused with an `error` reply and
nothing is written. The removed `ntfy_enabled` key is accepted and ignored, so an
older app's switch does not fail; a stored `notify.ntfy_enabled` row is never
read.
`run_finished` changed meaning once: it meant "auto runs announce success" and
defaulted on. It is stored under `notify.any_run_ended`, so a value saved under
the old meaning (`notify.run_finished`) is ignored.
Per run, choose **Notify me**, the default (auto), or **Silent** when starting
it. From the CLI: `pipelines run … --notify on|auto|off`.
## The web app
## Run notifications
The web page shows notifications only while it is open and the browser allows
them. Closed-browser web push is not implemented.
Independently of any `notify` block, the server records one run-level
notification when a run needs a person or ends and was marked to notify:
## ntfy (optional)
| Run notify mode | Enters `waiting` | Fails / succeeds |
| --- | --- | --- |
| **on** ("Notify me", `--notify on`) | `Run needs your decision` | `Run failed` / `Run succeeded` |
| **auto** (default) | `Run needs your decision` | unexpected failure or interruption; success only when **Notify when any run ends** is on |
| **off** ("Silent") | silent | silent |
`./install` builds and runs ntfy on port 8090 with a private `pipelines` topic.
The installer prints the subscription details at the end, and
`pipelines doctor` repeats them (`Phone server … · topic: pipelines ·
username: phone-reader`).
A deliberate route to `#failure` with its reason is an expected failure: it does
not notify in auto mode. Queued, running and canceled runs are silent. The
setting is read in the same transaction that records the run's final state.
To subscribe from the ntfy app:
Run events go through a durable outbox (`run_notifications`): the event is
queued with the run's state change and recorded on the app stream at once; a
crash before it is recorded is recovered after a restart. A run that stays
`waiting` is not announced again on a read or restart, and a stage `notify` hook
that already covered the same event (`on=waiting`, or a failure hook)
suppresses the run-level one, so one event means one notification. A
notification problem is logged and never changes the run.
1. Add a server: the ntfy address (default `http://<LAN IP>:8090`, or the
`--ntfy-url` you installed with). Off your home network, use a VPN such as
Tailscale.
2. Sign in as `phone-reader`. A freshly created account uses the web sign-in
password; an account kept from an earlier install keeps its old password.
3. Subscribe to the topic `pipelines`.
A tap opens `pipelines://run/<id>` in the app (the web app opens the same run).
A tap opens `pipelines://run/<id>` or `pipelines://chat/<id>` in the Android
app; the **Open in browser** action opens the same page on
`PIPELINES_WEB_PUBLIC_URL`.
## Stage notify hooks
Notifications already shown by the ntfy app cannot be retracted by the server;
swipe them away there.
Every stage can have an optional `notify` block:
See [ntfy reference](ntfy.md) for stage `notify` hooks, explicit ntfy stages,
the app notification protocol and network troubleshooting.
````markdown
# stage compose
```notify
on=success,failure
open=*.md
link=standup-link.txt
```
````
- `on` is `success`, `failure`, `waiting`, or a comma list. A failure is an
execution error, the `error` outcome, or a route to `#failure`; any other
completed stage is a success. It reports the stage's result, not the run's.
- For a sequential workflow whose error routes go to `#failure`, add
`on=failure` to intermediate stages and `on=success,failure` to the final
stage: one notification on every normal terminal path, without progress
alerts.
- `open=<pattern>` attaches one file from the run's shared `public/` directory
to the notification (with a short text preview) and makes a tap open it. The
pattern is a relative glob without absolute paths, `..` or hidden segments;
the most recently modified match wins. Without `open=`, exactly one regular
file in `public/` is attached automatically; zero or several attach nothing.
- `link=<pattern>` makes a tap open a URL the stage produced (for example a
published doc): the matched `public/` file's first non-empty line must be an
absolute http(s) URL without credentials or fragment. The run stays reachable
from the notification's run action. A missing file or invalid URL keeps the
usual tap target and is noted on the stage's notification receipt.
- `artifacts=` and `destination=` lines from older definitions still parse but
do nothing: they configured ntfy attachments and connections.
Hooks run after the stage completes and before the run's final status is saved.
They are not a finalizer for cancellation, crashes or runtime limits, and loops
can notify more than once. The receipt (recorded or not) appears in the stage's
**Metadata**; it never changes routing.
The former `type=ntfy` delivery stage was removed. A definition that still uses
it is refused by validation with: "ntfy stages were removed; notifications go
to the Pipelines apps — use the stage notify hook".
## Clearing notifications across devices
The app's attention state is shared through the server: dismissing an entry or
using **Clear all** in the Needs-you sheet, and opening a chat (which clears its
**New** badge), clears it on every connected browser and phone at once, and on a
disconnected device when it next connects. The protocol is
`{"type":"attention_acks"}` (read the whole set) and
`{"type":"ack_attention","attention_acks":{"dismissed":["42:Failed"],"chat_seen":{"ses_x":1730000000000}}}`
(add to it). Both reply `attention_acks`, and every other connection receives an
`attention_acks_changed` frame. Acknowledgements for deleted runs or sessions,
or older than 30 days, are pruned.
Every client removes its system notification when the clear reaches it:
- **Web**: the page closes the browser `Notification` with that tag and tells
the origin's other tabs to close theirs over a `BroadcastChannel`. A click
sends `clear_notifications`. A browser *close* event is not reported back
(browsers raise it for timeouts and same-tag replacements too).
- **Android with Receive notifications in Pipelines**: the background service
cancels it; a tap or a swipe sends `clear_notifications`.
- **Android without the service, iOS and macOS** (the in-app bridge while the
app runs): it is removed by its tag; a tap clears it. A swipe is not reported.
## App notification stream (protocol)
```text
→ {"type":"subscribe_notifications","id":"1","after":"run:7:3:waiting"}
← {"type":"notifications_subscribed","id":"1","notifications":[N...],"ids":["<cleared id>",...]}
← {"type":"notification","notification":N} (push)
← {"type":"notifications_cleared","ids":["run:7:3:waiting"]} (push)
→ {"type":"clear_notifications","id":"2","ids":["run:7:3:waiting"]}
← {"type":"notifications_cleared","id":"2","ids":[<ids it cleared>]}
N = {"id":"run:7:3:waiting","kind":"run_waiting","title":"Run needs your decision",
"message":"Run #7 · release · waiting for a human decision at stage approve",
"click":"pipelines://run/7","priority":3,"tags":[],
"created_at":"2026-11-01T10:00:00Z","group":"run:7"}
```
- `id` is stable: `run:<run>:<step>:<event>` (event `waiting`, `failed`,
`succeeded`, or `success` for a mid-run stage hook),
`chat:<session>:<form|permission|reply|notify|auto-switch>:<id>` or
`schedule:<id>:<due>:<event>`. `kind` is one of `run_waiting`, `run_failed`,
`run_succeeded`, `stage_failed`, `stage_succeeded`, `chat_question`,
`chat_approval`, `chat_reply`, `chat_notify`, `schedule`. `group` is
`run:<id>`, `chat:<id>` or `schedule:<id>`.
- `priority` is 1–5 (3 default). Schedule notices and the Claude account
auto-switch notice are 2; an agent's `notify` uses the tool's priority (`low`
2, `default` 3, `high` 4).
- A stage hook notification may carry `artifact` (the `open=` file) and
`preview`; with a `link=` its `click` is the link and `run_click` the run.
- The subscribe reply holds the active (uncleared) notifications newer than the
`after` cursor, oldest first, at most 100; an empty, unknown or pruned cursor
replays them all. Its `ids` lists notifications cleared within the 7-day
retention (newest first, at most 500) so a reconnecting device can dismiss
ones it still shows. Pushes follow in order; subscribing again replaces the
subscription.
- `clear_notifications` has the same effect as the matching `ack_attention`:
`run_waiting` dismisses `<run>:Decision`, `run_failed`/`stage_failed`
`<run>:Failed`, and a chat notification marks the chat seen (clearing its
other notifications too).
- Notifications are also cleared, with a push, by `ack_attention` from any
client, by a run leaving `waiting`, by deleting a run, and by an answered or
cancelled chat question or approval.
## Upgrading from ntfy
Installs made before the removal ran a bundled ntfy server on port 8090. The
installer retires it on reinstall and `./uninstall` removes any leftover (see
[Install](install.md)). Phones that subscribed in the ntfy app keep the old
subscription but receive nothing further: remove the Pipelines server from the
ntfy app, and turn on **Receive notifications in Pipelines** in the Android app
instead. Old stored settings keep their meaning; the `ntfy_enabled` choice and
the old chat push outbox (`chat_notifications`, dropped at startup) are ignored.
-415
View File
@@ -1,415 +0,0 @@
# Self-hosted ntfy delivery
For the user-facing overview (in-app Android delivery, settings, subscribing)
see [Notifications](notifications.md). This page is the reference for stage
hooks, the app notification protocol and ntfy itself.
Every stage can have an optional `notify` property block. Notifications go to
your own ntfy instance and can attach Markdown and output files. It does not ask
an LLM to handle credentials or run curl. The full Markdown remains in the run
audit as well as the ntfy attachment. A separate HTML report viewer is not included.
## Per-stage notifications (recommended)
### One terminal-path alert without adding stages
For a sequential workflow such as `research → report`, where intermediate
blocked/error routes go straight to `#failure`, add `on=failure` notification
hooks to intermediate stages and `on=success,failure` to the final stage.
Keep the graph and output contracts unchanged; omit `artifacts` for event-only
alerts. This avoids intermediate success alerts while covering early stage
errors and the final success/error result. Putting a hook only on the last stage
misses earlier failures; putting success hooks on every stage sends progress alerts.
These are stage hooks, not a universal run-finalizer: they run before the final
status is saved, and do not guarantee notifications for cancellation, crashes,
persistence failures or runtime step/visit limits. Recovery routes and loops can
notify before termination or more than once. An explicit native publisher stage
is not necessary for ordinary completion alerts and cannot reliably consume the
required `title`/`summary`/`markdown` after an upstream execution error.
The installed authoring skill includes this recipe and native-delivery details in
`references/notifications.md`; authoring does not require a checkout of this project.
````markdown
# stage compose
```notify
on=success,failure
artifacts=markdown,files
```
...stage output, prompt, tools, edges, and configs...
````
- `on` is `success`, `failure`, or `success,failure`. A failure is an execution
error, the `error` outcome, or a route to `#failure`; any other completed stage
is a success. This reports the stage's result, not the final run's result.
- All notification hooks use one system-wide server-to-phone connection. Stages
do not choose topics or addresses. Configure `PIPELINES_NTFY_URL` (publishing
topic URL), `PIPELINES_NTFY_PUBLIC_URL` (phone-facing server base URL), and
`PIPELINES_NTFY_TOKEN` or `PIPELINES_NTFY_TOKEN_FILE` once on the server.
The topic is `pipelines` in the provided setup. No block means no per-stage
notifications; a run that needs a person is still announced automatically (see
below). Legacy `destination` lines remain parseable for immutable-history compatibility
but no longer select a connection for notification hooks. Explicit native
`type=ntfy` stages retain their separate destination configuration.
- `artifacts=markdown` sends the string in `output.markdown` as `digest.md`.
- `artifacts=files` sends paths listed in `output.artifacts`, e.g.
`["reports/result.txt", "screenshots/chart.png"]`. Model stages with this policy
are instructed to list files they actually created/modified. No workspace scan
or file discovery occurs; an invalid model response may leave no artifact list.
- Both artifact kinds can be selected. Each file gets a separate notification
(ntfy supports one attachment per notification). If none were produced, an
event-only notification is still sent, including on failure.
- Files must be workspace-relative regular files, at most 1 MiB each and 10 files
per stage. Traversal, absolute paths, symlinks, hidden paths, known database/key
paths, `secrets/`, and `node_modules/` are rejected. These guards are not a
content scanner/DLP system: only list files you intend to share.
- Notifications have a 30-second total budget, with no automatic retries. Their
receipts/failures appear in the selected run stage's **Metadata**, separately
from output. They do not change routing or convert a successful stage into a
failed run. A crash can leave a `sending` receipt with uncertain delivery;
notifications are not replayed during recovery. Tool access follows the stage's
declared tools; notification settings do not grant additional tools.
## Automatic run-attention notifications
Independently of any `notify` block, the server publishes one run-level
notification to the `system` destination when a run needs a person or ends and
was marked to notify. The run's notify mode decides:
| Run notify mode | Enters `waiting` | Fails / succeeds |
| --- | --- | --- |
| **on** ("Notify me" in the app, `--notify on` in the CLI) | `Run needs your decision` | `Run failed` / `Run succeeded` |
| **auto** (default) | `Run needs your decision` | silent, unless **Notify when any run ends** is on |
| **off** ("Silent") | silent | silent |
Queued, running, canceled and interrupted runs are always silent. The **Notify
when any run ends** setting (`run_finished`, off by default) makes every auto
run's end notify too; it is read in the same transaction that records the run's
final state, so a change applies to runs finishing after it. A stage `notify`
block is the pipeline's own opt-in and still publishes for an auto run; when it
covers the same event the run-level alert is not sent again.
The payload names the run and its pipeline. Run notifications and stage hooks
use the configured web run link described below.
### Open notifications in the web app
Set `PIPELINES_WEB_PUBLIC_URL` on the **Pipelines server** to the authenticated web
proxy's phone-reachable origin, for example `https://pipelines.example.com` or
`http://192.168.1.20:8082` on a trusted LAN. Notifications then carry
`https://pipelines.example.com/runs/<id>`, opening that exact run in the browser
(or installed web app). The existing sign-in gate remains; after login the web
proxy returns to the requested run.
Use the address you actually open on the phone, not localhost, the API port, or
the ntfy address. No credentials, query, fragment or subpath are allowed. This
does not expose a port or add authentication to the underlying control API.
An invalid configured origin omits the click action and logs a configuration
warning rather than leaking credentials. Without this setting, existing
Android-only installations retain `pipelines://run/<id>` for compatibility.
Native installs save a default from the web proxy's advertised LAN address/port.
Override it with `PIPELINES_WEB_PUBLIC_URL=https://pipelines.example.com ./install`;
reinstalls preserve that saved choice unless overridden. Custom services set the
environment variable in their service definition; `pipelines service enable`
preserves it. Docker Compose accepts the same variable, pointing to a separately
reachable authenticated web proxy. Apply service changes only after active work
is finished. Already-delivered notifications keep their original click target;
verify a new notification after configuration is installed.
A genuine event notifies once: a run that stays `waiting` is not republished on a
read or restart, and a stage `notify` policy that already covers the same event
(`on=waiting`, or a failure hook) suppresses the run-level default, so one event
means one notification. A failed delivery is logged, never fails the run, and is
not retried. The Android app shows the same information in one attention surface
ordered by importance — a run waiting for a decision, then a failed run, then a
run that finished since the operator last looked — derived from the run events the
server already pushes, so it needs no refresh and starts nothing.
## Tapping a notification
Run notifications (stage hooks and run-level waiting/failed/succeeded alerts)
set the ntfy `Click` to the app deep link `pipelines://run/<id>`, so a tap on the
phone opens the native Pipelines app at that run. When `PIPELINES_WEB_PUBLIC_URL`
is set to a valid HTTP(S) origin (no credentials, path, query or fragment), each
notification also gets one ntfy `view` action, **Open in browser**, pointing at
`<web>/runs/<id>`. Without it, or with an invalid value, only the app link is
sent. Queued run notifications derive both links from the run id at delivery,
so rows queued by older servers (which stored a web URL) also open the app.
## Chats that need you
When a chat asks the operator something — an unresolved question/form or a
permission (approval) request — the server publishes one notification to the
`system` destination: title `<chat title> needs your answer` (or `... needs your
approval` for permissions; `Chat` when the session has no title), the question or
permission text as the body, `Click` `pipelines://chat/<session id>`, and the
**Open in browser** action to `<web>/chat/<session id>` when
`PIPELINES_WEB_PUBLIC_URL` is set. These are controlled by the **Chat needs your
answer or approval** setting (`chat_needs_you`, on by default).
Finished replies notify only when **Chat reply finished**
(`chat_reply_finished`) is turned on (off by default): when an assistant turn
ends (the authoritative, non-intermediate step end), the server publishes
`<chat title> replied` (`Chat replied` without a title) with the first ~200
characters of the turn's final assistant text as the body, or `The agent
finished its reply.` when no text was retained, plus the same click and browser
action. Each turn notifies once: a repeated or replayed end with no turn
observed in between, or a turn id already announced, publishes nothing, and
reading history never publishes.
- Each form/request id notifies at most once per server process: duplicate
events, reconnects and replays of a still-pending question are deduplicated in
memory, and a form first seen already resolved or cancelled never notifies.
The record is not persisted, so a request still pending across a server
restart can notify once more.
- The server only observes a chat while at least one client is subscribed to
it, so questions raised while no client watches the session are not seen.
- Publishing is asynchronous within the same 30-second budget, never blocks or
fails chat handling, and failures are only logged. Nothing is sent when
`PIPELINES_NTFY_URL` is not configured.
## Notification settings
Global, server-side switches choose which of these events are published.
They are stored in the server database (`server_settings`), survive restarts and
apply to every device subscribed to the topic. Per-stage `notify` hooks and
explicit `type=ntfy` stages are not affected.
| Setting | Default | Effect |
| --- | --- | --- |
| `run_finished` — Notify when any run ends | off | every **auto**-mode run that fails or succeeds notifies; otherwise only runs started with **Notify me** (`on`) announce their end |
| `chat_needs_you` — Chat needs your answer or approval | on | chat question/form and approval requests notify |
| `chat_reply_finished` — Chat reply finished | off | each finished assistant turn in a chat notifies |
| `ntfy_enabled` — Also send to ntfy | on | when off, nothing is published to ntfy; the app notification stream (below) still delivers every notification |
Change them in the app under **Settings → Phone notifications** (checkboxes; a
refused change reverts and shows the server's reason). Over the websocket
protocol, `{"type":"notification_settings"}` reads them and
`{"type":"set_notification_settings","notification_settings":{"chat_reply_finished":true}}`
changes any subset; both reply with type `notification_settings` carrying every
key. Unknown keys and non-boolean values are refused with an `error`
reply and nothing is written.
`run_finished` changed meaning: it once meant "auto runs announce success" and
defaulted on. It is now stored under `notify.any_run_ended`, so a value saved
under the old meaning (`notify.run_finished`) is ignored and every server starts
from the new default (off).
## Clearing notifications across devices
The app's in-app attention state is shared through the server: dismissing an
entry or using **Clear all** in the Needs-you sheet, and opening a chat (which
clears its **New** badge), clears it on every connected browser and phone at
once, and on a disconnected device when it next connects. The protocol is
`{"type":"attention_acks"}` (read the whole set) and
`{"type":"ack_attention","attention_acks":{"dismissed":["42:Failed"],"chat_seen":{"ses_x":1730000000000}}}`
(add to it). Both reply `attention_acks`, and every other connection receives an
`attention_acks_changed` frame with the change. Acknowledgements for deleted runs
or sessions, or older than 30 days, are pruned.
Every client removes its system notification when the clear reaches it:
- **Web** (every tab and installed web app window): the page closes the browser
`Notification` with that tag, and tells the origin's other tabs to close
theirs over a `BroadcastChannel`. A click on a browser notification sends
`clear_notifications` for it. A browser *close* event is not reported back:
browsers raise it for a notification daemon's timeout and for a same-tag
replacement too, so treating it as a dismissal would clear the notification on
every device seconds after it appeared.
- **Android with Receive notifications in Pipelines**: the background service
cancels it; a tap or a swipe (delete intent) sends `clear_notifications`.
- **Android without the service, iOS and macOS** (the in-app
`flutter_local_notifications` bridge while the app runs): it is cancelled /
removed from the notification centre by its tag; a tap clears it. The plugin
reports no dismissal, so a swipe there is not sent back.
- **ntfy**: chat notifications (questions, approvals, replies and agent
`notify`) are published with an ntfy sequence id derived from their app id
(`X-Sequence-ID: pl-<24 hex of sha256(id)>`), and clearing one sends
`PUT /<topic>/<sequence id>/clear`. ntfy (v2.15 or later; verified with
v2.38.1) emits `message_clear` and its Android and web apps dismiss the
notification. Run notifications carry no sequence id and stay in the ntfy app
until swiped away. An older ntfy does not support clearing; a failed clear is
only logged.
## App notification stream (no ntfy app needed)
Every notification the server publishes to ntfy — run waiting/failed/succeeded
alerts from the run outbox, stage `notify` hook events, and chat
question/approval/reply alerts — is first recorded in the `app_notifications`
table (kept 7 days) and streamed over `/connect` to clients that subscribe, so
the Pipelines app can post them itself. The same settings decide what is
recorded, so the stream carries exactly the set ntfy gets, with the same title,
message and `click` deep link. A stage hook with several attachments is one
stream notification per step event; explicit `type=ntfy` stages are not
streamed.
```text
→ {"type":"subscribe_notifications","id":"1","after":"run:7:3:waiting"}
← {"type":"notifications_subscribed","id":"1","notifications":[N...],"ids":["<cleared id>",...]}
← {"type":"notification","notification":N} (push)
← {"type":"notifications_cleared","ids":["run:7:3:waiting"]} (push)
→ {"type":"clear_notifications","id":"2","ids":["run:7:3:waiting"]}
← {"type":"notifications_cleared","id":"2","ids":[<ids it cleared>]}
N = {"id":"run:7:3:waiting","kind":"run_waiting","title":"Run needs your decision",
"message":"Run #7 · release · waiting for a human decision at stage approve",
"click":"pipelines://run/7","priority":3,"tags":[],
"created_at":"2026-11-01T10:00:00Z","group":"run:7"}
```
- `id` is stable: `run:<run>:<step>:<event>` (event `waiting`, `failed`,
`succeeded`, or `success` for a mid-run stage hook) or
`chat:<session>:<form|permission|reply|notify>:<id>`. `kind` is one of `run_waiting`,
`run_failed`, `run_succeeded`, `stage_failed`, `stage_succeeded`,
`chat_question`, `chat_approval`, `chat_reply`, `chat_notify`. `group` is `run:<id>` or
`chat:<id>`. `priority` is 3 and `tags` empty, matching what ntfy receives,
except `chat_notify`: an agent's `notify` tool call, whose priority is the
tool's (`low` 2, `default` 3, `high` 4). Every subscribed client receives it,
whichever chat it shows; each posts it as a system notification, so an
agent's notify reaches the operator without ntfy. A turn that sent one does
not also send its `chat_reply`.
- The subscribe reply holds the active (uncleared) notifications newer than the
`after` cursor (the last id the client holds), oldest first, at most 100;
an empty, unknown or pruned cursor replays them all. Its `ids` lists
notifications cleared within the 7 days (newest first, at most 500) so a
reconnecting device can dismiss ones it still shows. Pushes follow in order;
subscribing again replaces the subscription.
- `clear_notifications` (the app's dismiss or tap) has the same effect as the
matching `ack_attention`: `run_waiting` dismisses `<run>:Decision`,
`run_failed`/`stage_failed` `<run>:Failed`, and a chat notification marks the
chat seen (clearing its other notifications too). Other subscribers receive
`notifications_cleared`; connections receive `attention_acks_changed`.
- Notifications are also cleared, with a push, by `ack_attention` from any
client, by a run leaving `waiting` (its waiting notifications), by deleting a
run, and by an answered or cancelled chat question or approval.
## Explicit delivery stage (optional)
The preceding stage must output three nonempty UTF-8 strings: `title`, `summary`,
and `markdown`. Title/summary must be single-line (256/2048 byte limits); Markdown
is limited to 1 MiB. Native delivery stages do not accept model prompts/tools or
inline credentials. They require `destination` and a `success` edge:
````markdown
# stage notify
```configs
type=ntfy
destination=system
```
```edges
success -> #success
error -> #failure
```
````
Configure the **pipeline server process** outside the pipeline file:
```sh
export PIPELINES_NTFY_URL='https://ntfy.your-domain.example/pipelines'
# Set PIPELINES_NTFY_TOKEN_FILE to the existing publishing token file.
go run ./cmd/pipelines-server
```
The URL includes one topic, without credentials, query parameters, or a fragment.
`destination=system` uses the same connection as hooks. Other destinations use
the named pattern: `destination=reports` reads
`PIPELINES_NTFY_REPORTS_URL` and `PIPELINES_NTFY_REPORTS_TOKEN` (or `_TOKEN_FILE`
pointing to a secret file). Set only one token source. Destination names
use lowercase letters, digits, and underscores. A token is optional only when
the configured server permits anonymous publishing; private deployments need it.
Never put tokens in a prompt, committed file, or chat. Environment credentials
are inherited by subprocesses: do not grant untrusted stages shell/code-execution
access. Prefer a dedicated publishing user with write-only access to this topic.
## Local server
The root `compose.yaml` runs **both the pipeline server and ntfy** with persistent
volumes, internal service networking, and a private topic. See the
[Docker + Android setup](docker.md) for bootstrap, credentials, and timezone
detection. The previous ntfy-only Compose file has been replaced. Isolated real
Docker health and publishing checks have passed; phone reception and the user's
remote Tailscale connectivity remain **not tested** locally.
Use a TLS reverse proxy or a private VPN (e.g. Tailscale). A phone cannot reach
your computer's `127.0.0.1`; that address is only for local publishing/proxying.
To bind the container to a particular LAN/VPN interface, explicitly set
`NTFY_BIND_ADDRESS` to that interface IP. Do not expose an unauthenticated server,
or send access tokens over public plain HTTP. Set `NTFY_BASE_URL` to the same
address your phone uses so attachment URLs resolve correctly. If the pipeline
server is another container, localhost is that container, not the ntfy host.
## Phone
### Tailscale address times out while LAN works
Use `http://<server-Tailscale-IP>:8090`, not port 80; enable Tailscale on both the
server and phone. The default Compose mapping binds ntfy to `0.0.0.0:8090`.
Binding to all interfaces does not bypass tailnet grants/ACLs, host firewalls,
or Docker forwarding rules. A timeout alone cannot identify which is blocking.
Do not disable firewalls or publicly forward this port as a workaround.
On the server, these are read-only diagnostics (the remote checks are not tested
from this development machine):
```sh
tailscale status
docker compose port ntfy 80
curl --connect-timeout 5 http://127.0.0.1:8090/v1/health
curl --connect-timeout 5 "http://$(tailscale ip -4):8090/v1/health"
```
If the host health checks succeed but the phone times out, check that the phone
is in the intended tailnet and that tailnet access rules/firewalls allow this
phone to reach server TCP 8090. Once reachable, log in as `phone-reader` for the
Tailscale server entry, separately from the LAN entry. Set `NTFY_BASE_URL` to a
phone-reachable address if attachment URLs currently point to a LAN-only address;
that setting is not a substitute for fixing a TCP timeout.
Install the ntfy app, add your own server, authenticate with the reader account,
and subscribe to `pipelines`. Ensure notifications and required background operation
are allowed. Outside your home network, both topic subscriptions and attachment
downloads need access to your server through VPN or public HTTPS.
For **iOS instant notifications**, ntfy's current documentation requires
`NTFY_UPSTREAM_BASE_URL=https://ntfy.sh` (or an APNS-connected upstream with a
custom app). The upstream sends wake-up requests; message content is fetched
from your instance. This is not completely independent of third-party push
infrastructure. Without upstream forwarding, delivery can be substantially
delayed. Phone delivery/background behavior has **not been tested** here.
## Execution and failure behavior
- Publishing is bounded to 20 seconds and does not follow redirects.
- No automatic publish retry: timeouts or malformed acknowledgments may mean the
notification was delivered but its acknowledgment was lost. Inspect ntfy
before retrying an ambiguous failure.
- For the optional native `type=ntfy` stage, a confirmed response adds `delivery` metadata (destination name, message ID,
attachment URL, filename) to the existing output. Failures take the error route
and are recorded in normal run/step audits, without remote response bodies or
credentials in diagnostics.
- Repeating the same run request key does not publish again. A new run or a graph
loop visiting delivery again can send another notification; content-level
"only new items" deduplication is not yet implemented. For the initial digest,
keep notification last with no feedback edge.
- Markdown reports remain available in pipeline run history even after ntfy expires its
attachment. Configure ntfy retention for your needs; its attachment directory
must be dedicated to ntfy, not shared with other files.
File-attachment bytes are stored by ntfy, not permanently archived in SQLite;
run metadata stores the delivered filename/URL, and workspace files may later
change. Download attachments before your ntfy retention expires.
Bundled starters need no schedule setup. **Research and report** shows a
`notify` hook on research failure; it only delivers once the system phone
connection is configured. Add a
`notify` block to the stages of your own workflow the same way. Adding a schedule activates it on publication,
so review it explicitly rather than copying a scheduled niche example.
References: [publishing](https://docs.ntfy.sh/publish/),
[server configuration](https://docs.ntfy.sh/config/),
[iOS self-hosting](https://docs.ntfy.sh/config/#ios-instant-notifications).
+1 -1
View File
@@ -245,7 +245,7 @@ so a Docker-era profile is not left Docker-linked. It never installs, upgrades o
downloads a harness. Container and host credentials and accounts remain independent and
are reused on reinstall/reconfigure. `./install` installs natively by default
(`--native` is equivalent); explicit `./install --docker` selects the Docker
server + ntfy installation.
server installation.
Fresh setup accepts `./install --docker --harness pi` to skip OpenCode
login. Existing setup can configure either harness independently. Pi setup does
not run a generation check; `provider-check --harness pi --model PROVIDER/MODEL`
+817
View File
@@ -0,0 +1,817 @@
# Security review: what a new user exposes by installing Pipelines
Date: 2026-12-03. Source reviewed: commit `9436067b` (main).
Scope: a stranger clones the repository and runs `./install` with defaults
(native install, Linux or macOS), then sets up one or more harnesses.
Method: code and configuration reading plus safe local read-only checks. The
installer was not run. No running service was touched. Nothing was sent off this
machine. Severities are the reviewer's judgement. "Likelihood" means likelihood
under a **default** install.
An earlier review (2026-11-10, see `docs/notes/security-boundary.md`,
`docs/notes/auth-hardening.md` and `docs/notes/network-and-update-signing.md`)
already fixed DNS rebinding against the Go API, added the proxy-to-server token
and LAN sign-in refusal, and signed the update feeds. This review builds on that
work and lists what remains open.
**No critical, remotely exploitable, zero-interaction issue was found under
defaults.** The most serious finding (H1) needs a signed-in user to open a
crafted link to a file the attacker has placed in the user's home directory.
---
## 1. What you're exposing your computer to (README text)
> **Security: read this before installing.**
>
> Pipelines lets AI coding agents run commands on your computer as **your user
> account**. There is no container or separate user around them. Agents can read
> and change anything your account can, including SSH keys, cloud credentials,
> browser downloads and other projects. Codex chats in their default mode are the
> only exception: they run in Codex's own workspace sandbox.
>
> - **Your web password is effectively your shell password.** Anyone who signs
> in can start an agent in "bypass permissions" or "full access" mode and have
> it run any command. Choose a strong, unique password, and keep the web app on
> loopback and Tailscale (the default). Don't expose it to the internet.
> - **Agents can be manipulated by what they read.** A README, a web page or an
> issue can contain instructions that an agent follows ("prompt injection").
> Agents with shell access can then leak your secrets or change files. Prefer
> the "ask" permission modes, and give pipeline stages only the tools they need.
> - **Agents can spend money.** Runs have step and time limits but no spending
> cap unless you set one.
> - **Install and update pull code from the internet.** The installer builds the
> newest OpenCode releases. `pipelines update` pulls this repository
> and reinstalls without a signature check.
>
> What is protected by default: the server API is on loopback only and needs a
> secret token; the web app accepts only loopback and Tailscale connections; the
> password is stored as an scrypt hash; sign-in is rate limited; the terminal
> asks for your OS password; and app updates are signature-checked.
---
## 2. Top findings
| ID | Severity | Finding | Default likelihood |
| --- | --- | --- | --- |
| H1 | High | `GET /files` serves HTML/SVG from `$HOME` inline on the app origin with no CSP, a stored-XSS path to code execution | Low to medium (targeted, one click) |
| H2 | High | Web password = arbitrary code execution; step-up elevation is bypassed by agent permission modes | Depends on the password; reachable only from loopback/tailnet |
| H3 | High | Agents run unsandboxed as the user with the server's environment and can read every Pipelines secret (cookie HMAC key, server token, update-signing key) | High once prompt injection reaches a shell-capable agent |
| H4 | High | Pipeline stages get unrestricted shell by default (no `tools` block, or `shell` without a policy) | High for any pipeline that omits a shell policy |
| M1 | Medium | **Resolved (ntfy removed).** ntfy listened on all interfaces over HTTP; the phone account reused the web password (sniffable, and guessable outside the proxy's limiter) | None: no ntfy port is installed |
| M2 | Medium | Supply chain floats: newest OpenCode and Pi resolved at install time (ntfy no longer installed); unpinned base images; unchecked SDK zip; `pipelines update` has no signature check | Low per event, wide impact |
| M3 | Medium | Docker mode (opt-in) exposes the unauthenticated API on 0.0.0.0 | Only with `--docker` |
| M4 | Medium | `show_html` previews load remote images/CSS (exfil beacons) and allow links that escape the sandbox, including to the app's own origin | Medium |
| M5 | Medium | No spending cap by default and no global concurrency cap | Medium |
| M6 | Medium | Chat transcripts and notifications are not redacted | Medium |
| L* | Low | Links open without confirmation; OSC 52 clipboard writes; notification `link=` to any URL; `ws://` peers; TOCTOU in `/files`; debug-keystore APK signing; and more | |
### Status (2026-12-03)
| ID | Status | Change |
| --- | --- | --- |
| H1 | **Fixed** | `e39a9560`: `/files` and `/artifacts/` send the sandbox CSP and `nosniff`; `/files` serves HTML, XHTML, SVG, XML, XSL, JavaScript and `multipart/x-mixed-replace` (including sniffed extensionless files) as attachments. The web proxy adds the same headers to every proxied `/files` and `/artifacts/` response, and the peer relay shares the helper. |
| H3 | **Partially fixed** (layer 1) | `b24fc317`: `internal/agentenv` drops every `PIPELINES_*` token, secret, password, auth or key variable from agent child environments (harness stages and chats, `!` lines, checks, delivery checks, OpenCode serve processes, MCP children through their harness). The secret files stay readable by the same OS user; no sandbox, by decision. |
| M1 | Removed | ntfy is being removed from Pipelines in a separate change. |
| H2, H4, M2, M3, M4, M5, M6, L* | Accepted | By design for a single-user self-hosted tool; see [Decisions](#decisions). |
### Decisions
The operator accepted the remaining findings as by design for a single-user,
self-hosted tool, keeping friction at zero:
- **Agents intentionally have full host access.** There is no OS sandbox
(bubblewrap, `sandbox-exec`, a separate user or a container) and none is
planned. Agents can read every file the user can, including Pipelines'
own secret files; layer 1 only removes the pointers from their environment.
- **The web password is the shell password.** Mode switches into Claude
`bypassPermissions` or Codex `full` are not gated by elevation, and the
elevation lifetime stays as it is (H2).
- **Stage defaults stay as they are** (H4): no `tools` block still grants
read/glob/grep/edit/shell.
- **`show_html` previews are not tightened** (M4): they may legitimately load
CDN scripts and CSS.
- **No supply-chain pinning, default run budget, concurrency cap or
redaction** (M2, M5, M6).
---
## 3. Findings in detail
### 3.1 Network exposure
**Safe check on this machine** (it runs a customised install, so it shows the
shapes, not a pristine default): `ss -ltnH | awk '{print $4}'`
```
127.0.0.1:8080 # Go server API
*:8090 # ntfy (removed since; see M1)
*:8082 # web proxy (wildcard bind, filtered per connection)
```
#### N1. Server API `:8080`: loopback, token, Host and Origin checks (info: good)
- **Default bind:** `127.0.0.1:8080`. This is the `-addr` default in
`cmd/pipelines-server/main.go:29`; the `--bind-address` default is in
`scripts/setup-native.py`.
- **Front door:** every route passes `guardRequests`
(`internal/server/request_boundary.go:42-63`).
- **Host:** a loopback Host is required, otherwise `421`. This defeats DNS
rebinding.
- **Origin:** `/connect` refuses any `Origin` header:
```go
if r.URL.Path == "/connect" && r.Header.Get("Origin") != "" {
http.Error(w, "browser origins may not connect directly; use the web proxy", http.StatusForbidden)
```
- **Token:** `X-Pipelines-Server-Token` is required whenever `-token-file` is
set, which the native installer always does. The token file is 0600.
- **Exempt paths:** `/healthz`, and `/mcp/chat/{token}`, which has its own
64-character per-chat token.
- **WebSocket library:** `coder/websocket` `Accept(w, r, nil)`
(`internal/server/websocket.go:210`), whose default origin policy is
Origin == Host.
- **CORS:** no `Access-Control-Allow-*` header anywhere.
- **Result:** a hostile web page cannot drive `ws://127.0.0.1:8080`. Another
local OS user cannot either, without the token.
- **Residual:** `allowedHost` skips the Host check when the listener is not
loopback (`request_boundary.go:102-104`). That only matters for Docker (M3) or
a custom `--bind-address`.
#### N2. Web proxy `:8082`: loopback plus tailnet only (info: good)
- **Bind:** `--host :: --allow loopback,tailnet`.
- **Filter:** every connection is dropped before any HTTP is read unless both
ends are loopback or both are tailnet (`web/src/listenPolicy.js`;
`docs/notes/network-and-update-signing.md`).
- **LAN:** opt-in (`--web-lan`). Plain-HTTP LAN sign-in needs a second opt-in
(`--web-lan-plain-login`).
- **WebSocket upgrades:** `sameOriginUpgrade` (`web/src/proxySecurity.js`) plus
the cookie.
- **POSTs:** `sameOriginRequest`. Uploads also refuse
`Sec-Fetch-Site: cross-site`.
- **Residual:** a LAN port scan sees the port open and then reset. Tailscale
subnet routes without SNAT are treated as LAN (documented).
- **Tailnet trust:** every device on your tailnet, including shared-in devices,
can reach the sign-in page.
- **Mitigation:** restrict it with Tailscale ACLs. Mention this in the README.
#### M1. ntfy `:8090` on every interface, phone account = web password (Medium) — resolved
- **Resolution (2026-12-03):** ntfy was removed from Pipelines. Notifications
reach every client through the server's own app notification stream over the
authenticated `/connect` connection (see `docs/notifications.md`). The
installer no longer builds, configures or starts ntfy, and creates no phone
account; a reinstall stops and deletes an existing ntfy and its data, and
`./uninstall` removes any leftover. Port 8090 is no longer opened. The
original finding is kept below for the record.
- **Evidence:**
- `scripts/setup-native.py:672`
```python
f'listen-http: ":{ntfy_port}"\n'
```
- `:914` `base_url = args.ntfy_url or f"http://{lan_ip}:{args.ntfy_port}"`
- `:676` `auth-default-access: "deny-all"` is good: anonymous users can read
nothing.
- `:726-730`:
```python
def reader_password(self, web):
"""The phone's ntfy password, which matches the web password: ...
```
- `docs/notifications.md:92-96` tells the user to add `http://<LAN IP>:8090`
and sign in as `phone-reader` with the web password.
- **Default:** on. It ignores `web.host=tailnet`, so it contradicts "expose only
the web proxy".
- **Impact:**
1. The web password crosses the LAN in cleartext HTTP Basic auth every time
the ntfy phone app connects.
2. Anyone on the LAN can guess the web password against ntfy. That bypasses
the proxy's login limiter and the tailnet-only restriction.
3. A second hash of the web password sits in ntfy's `auth.db`.
4. Whoever holds the reader credential can read notification text (run and
chat titles, summaries).
- **Mitigation:**
- Bind ntfy to loopback plus tailnet (or put it behind `tailscale serve`
HTTPS).
- Generate a random reader password or ntfy access token instead of reusing
the web password.
- Make LAN ntfy an opt-in like `--web-lan`.
#### N3. mDNS advertising (Low/info)
- **Default:** on (`PIPELINES_MDNS`; `cmd/pipelines-server/main.go:41`). With
`web.host=tailnet`, `scripts/manage.py:47-58` passes `-mdns-lan=false`, so
the A records are tailnet IPs.
- **What is still announced:** the advert is multicast on the LAN. It announces
the host name, the Pipelines version (`v`), `auth=password`, and the tailnet
and public routes.
- **Impact:** fingerprinting and discovery of a tailnet address and version by
anyone on the same Wi-Fi.
- **Mitigation:** turn mDNS off by default when the LAN route is off (a tailnet
client can be given the address), or at least drop `v=`.
### 3.2 Authentication
#### A1. Password storage, cookies, brute force, lifetime (info: good, minor gaps)
- **Hash:** scrypt N=2^15, r=8, p=1, 32-byte key, constant-time compare
(`scripts/password.py:26`, `docs/notes/auth-hardening.md`).
- **Files:** `web-auth.json` and `server-token` are 0600 in 0700 directories
(`scripts/setup-native.py:385-414`). The password is read with `getpass`,
never from argv.
- **Policy:** at least 16 characters, or a passphrase of 4 or more words
(`web/src/passwordPolicy.js:5`).
- **Cookie** (`web/serve.mjs:193-203`):
```js
const bits = [`${sessionCookieName(req)}=${token}`, "Path=/", "HttpOnly", "SameSite=Lax"];
...
if (isHttps(req)) bits.push("Secure");
```
The `__Host-` prefix is used over HTTPS. A plain `http://127.0.0.1` or
`http://100.x` session has no `Secure` flag; that is acceptable on loopback
and WireGuard.
- **Lifetime:** 12 hours, or 30 days with "Remember me", which is **checked by
default** (`web/serve.mjs:140-141`, `:299`).
- **Mitigation:** default "Remember me" to unchecked, or shorten it to 7 days
with sliding renewal.
- **Revocation:** a password change or `./password --revoke-all` rotates the
HMAC secret and the generation (`web/src/authStore.js:8-10`). This ends every
session, including forged ones.
- **Brute force:** `web/src/loginLimiter.js` gives five free failures per
client, then exponential backoff up to 15 minutes, plus a global 50 failures
per 5 minutes. Good. ntfy is outside this limiter (M1).
- **Plain-HTTP LAN sign-in:** refused unless opted in. `X-Forwarded-Proto` is
not trusted from the LAN.
- **Proxy-to-server token:** a 0600 file whose path is passed through the
environment (`PIPELINES_SERVER_TOKEN_FILE`). It is never on the command line
(`scripts/manage.py:437-445`). The proxy strips it before forwarding to peers
(`web/src/peerRelay.js:74`). But see H3: every agent inherits that
environment variable and can read the file.
- **Test switch:** `PIPELINES_WEB_AUTH=disabled` (`web/serve.mjs:66`) turns off
auth entirely. It is meant for tests.
- **Mitigation:** refuse it unless the bind is loopback.
#### H2. Web password = code execution; elevation is bypassable (High, by design)
- **Evidence:**
- Step-up elevation gates only these operations
(`internal/server/elevation.go:53-59`):
```go
var elevationGated = map[string]bool{
protocol.ChatShellRun: true,
protocol.ChatShellInput: true,
protocol.RenamePath: true,
protocol.MovePath: true,
protocol.DeletePath: true,
}
```
- Not gated: creating a chat in any directory, switching modes, prompting,
answering permission cards, starting runs, `GET /files`.
- Any signed-in client can pick these modes:
- `internal/claude/modes.go:24`
`{ID: "bypassPermissions", ..., Description: "Never ask. Everything runs without checks."}`
- `internal/codex/modes.go:23`
`{"full" ...}, "never", "dangerFullAccess"}`
- Elevation re-asks the **same** web password and lasts 24 hours
(`elevation.go:37` `DefaultElevationTTL = 24 * time.Hour`).
- **Default:** chats start in "ask" mode (Claude `default`, Codex
`workspace-write` + `on-request`), but switching needs nothing more than the
session.
- **What an attacker with the web password (or a session cookie) can do:**
- run any command as you, via a bypass-mode chat or by elevating with the
same password and using `!` lines;
- read any file under `$HOME` through `/files`, including `~/.ssh` and
`~/.claude/.credentials.json`;
- approve agent permission requests;
- start runs that spend model credit;
- plant `schedule_followup` prompts that persist for up to 7 days;
- register peers.
- **The one real second factor:** the terminal uses `su -l` and the OS password
(`internal/server/terminal_login.go:85`). That is a good design.
- **Mitigation, in order:**
1. Gate mode changes into bypass/full, and answers to permission cards, behind
elevation.
2. Make elevation a distinct factor: the OS password via `su`/PAM (as the
terminal does), TOTP, or WebAuthn. Shorten the default TTL to 15-60
minutes.
3. Gate `GET /files` outside the chat's project root, or deny-list secret
paths (see F2).
4. Document plainly that the web password is equivalent to shell access.
### 3.3 Remote code execution by design
#### H3. Agents are unsandboxed and inherit every secret (High)
**Status: partially fixed in `b24fc317`.** Secret-pointer variables are now
scrubbed from agent environments. Being unsandboxed is accepted by design (see
Decisions).
- **Evidence:**
- Every harness runs as the server's UID with `os.Environ()`:
- `internal/stage/claude_stage.go:360`
- `internal/stage/pi.go:408`
- `internal/stage/opencode.go:141-146` (via `workenv.CommandEnv`)
- `internal/claudehost`/`hosted.go:158`
- `internal/server/chat_shell_runner.go:171-172` (`exec.Command(r.shell(), "-lc", command)` with no `cmd.Env`)
- That environment contains `PIPELINES_SERVER_TOKEN_FILE`,
`PIPELINES_NTFY_TOKEN_FILE` and `PIPELINES_WEB_AUTH_FILE`
(`scripts/manage.py:437-445`). `internal/servertoken/servertoken.go:1-10`
acknowledges that the harnesses can read the token.
- The only isolation is a git worktree per run
(`internal/server/run_worktree.go:57-69`), which is a directory, not a
boundary.
- **Default:** on, for every harness. Codex chats in `ask`/`auto` mode are the
exception: Codex's own `workspace-write` sandbox applies
(`internal/codex/chat.go:591`).
- **What a prompt-injected agent with shell can read:**
- `~/.config/pipelines/web-auth.json`, which holds the scrypt hash and the
cookie HMAC `secret` (`web/src/authStore.js:8`). With the secret it can
**forge valid session cookies**.
- the server token, which gives full API control from any local process;
- `~/.config/pipelines/update-signing-key.pem`, which can sign app update
feeds that every installed client trusts (see S2);
- the Android keystore;
- harness OAuth and API credentials, including the saved account slots in
`internal/claudeaccounts/store.go`;
- SSH keys, cloud credentials and browser data.
- **Mitigation:**
1. Scrub `PIPELINES_*` secret paths and tokens from every child environment.
Pass an allow-listed environment.
2. Run harnesses under a separate OS user, or in bubblewrap/`sandbox-exec`,
or in a container with only the workspace (and the harness's own
credentials) mounted.
3. Move the cookie secret, server token and signing key to a location the
agent's user cannot read.
4. Until then, document that any agent can read these files.
#### H4. Stages default to unrestricted shell (High)
- **Evidence:**
- `internal/stage/tools.go:177`
`var legacyTools = []string{"read", "glob", "grep", "edit", "shell"}` is
applied when a stage has no `tools` block.
- Claude: `internal/stage/claude_stage.go:152-156`
```go
case "Bash":
if shell != nil { rules = append(rules, claudeShellRules(shell)...)
} else { rules = append(rules, tool) } // bare "Bash"
```
It runs with `--permission-mode dontAsk` (`:183`). The `Edit(<rundir>/**)`
scope does not limit Bash.
- OpenCode: `tools.go:283-284` `if c.Policy.Shell == nil { allow("shell", "*") }`.
The deny rules on reading `*.env` and `pipelines.db*` (`:354-355`) are
bypassed by `cat` in the shell.
- Pi: `pi_policy.mjs:7-9` puts no restriction on bash without a policy.
- **Related defaults:** `--allow-authoring` is on for fresh installs
(`docs/install.md` flag table), so a signed-in user can also author check
stages that run `sh -c` (`internal/stage/check.go:220-222`). The starter
template's empty `tools` block is text-only (`internal/pipeline/definition.go:36`).
No stage gets `webfetch` unless it declares it.
- **Mitigation:**
- Require an explicit `permissions.shell` allow-list whenever `shell` is
granted, or at least warn loudly in the editor and at run start.
- Warn when a stage combines `webfetch` with unrestricted `shell`.
#### R1. OpenCode chats use OpenCode's own permission defaults (Medium, to confirm)
- **Evidence:** `internal/opencode/chat.go:535-539` deliberately sends no
permission override.
- **Risk:** OpenCode's upstream defaults are permissive (edits and bash allowed
unless the user's `opencode.json` restricts them). This was not confirmed
against the pinned OpenCode version.
- **Mitigation:** create OpenCode chat sessions with an "ask" permission set,
matching Claude and Codex.
- **Protection in place:** the OpenCode server itself binds `127.0.0.1` with a
random password (`internal/opencode/connection.go:394-397`).
#### R2. `!` shell lines (info: gated)
- **What they run:** `exec.Command(shell, "-lc", command)` in the chat
directory, at most 4 at a time per chat (`chat_shell_runner.go:168-172`).
- **Gate:** elevation, but see H2: same password, 24 hours.
#### R3. Terminal (info: good)
- **What it runs:** `su -l <user> -c 'cd <dir> || cd; exec "$SHELL" -l'`
(`internal/server/terminal_login.go:85`). It refuses to run as root.
- **Barrier:** the OS password.
#### R4. MCP chat tools (Low/Medium)
- **Endpoint:** `/mcp/chat/{token}`, loopback only, not proxied, with a
64-character token per chat.
- **Tools** (`internal/chattools/tools.go:5-14`): `show_file`/`show_diff` (any
path in `$HOME`), `show_image` (a home file or https URL; the fetcher blocks
private addresses, `chat_tools_fetch.go:54`), `show_html` (sandboxed),
`notify` (5 per minute), `show_run`, `schedule_followup`/`cancel_followup`.
- **Risk:** `schedule_followup` lets an injected instruction re-prompt the chat
up to 7 days later. That is persistence.
- **Mitigation:** list pending follow-ups prominently. In bypass/full mode,
require confirmation before a follow-up fires.
#### R5. Chat directory can be any absolute path, including `/` (Low)
- **Evidence:** `internal/server/chat_sessions.go:422-434` only checks
`IsAbs` + `IsDir`.
- **Minor bug:** `~/sub` resolves to home, not to `~/sub` (`:424`).
- **Mitigation:** confine to `$HOME` or configured roots, and expand `~/`
correctly.
#### R6. direnv / mise (info: good)
- **Behaviour:** only `.envrc` files already `direnv allow`ed and trusted mise
config are applied (`internal/workenv/workenv.go:6-8`). An edited `.envrc`
is re-blocked by direnv. `PIPELINES_DIRECTORY_ENV=off` disables it.
### 3.4 Prompt injection and rendering
#### H1. `GET /files` serves HTML/SVG inline on the app origin (High)
**Status: fixed in `e39a9560`** (see the status table in section 2). The
evidence below describes the code before the fix.
- **Evidence:**
- `internal/server/home_files.go:68-92`: the type comes from the extension,
the disposition is `inline` by default, and only `nosniff` is set. There is
no CSP:
```go
contentType := mime.TypeByExtension(filepath.Ext(realTarget))
...
disposition := "inline"
if r.URL.Query().Get("download") == "1" { disposition = "attachment" }
```
- `internal/server/websocket.go:196` `mux.HandleFunc("GET /files", serveHomeFile)`
has no elevation.
- `web/serve.mjs:614-616` and `:465-482`: the proxy forwards `/files` and
copies upstream headers verbatim (`res.writeHead(reply.statusCode ?? 502, reply.headers)`).
- The global header is `frame-ancestors 'self'` only
(`web/src/webSecurity.js:69`).
- By contrast, `/artifacts/` sets
`sandbox; default-src 'none'; script-src 'none'; ...`
(`internal/server/artifacts.go:294`), and the peer relay applies the same
policy to a **peer's** `/files` (`web/src/peerRelay.js:13-15`). Only the
local `/files` route lacks it.
- **Scenario:** an HTML or SVG file lands anywhere under `$HOME`, for example:
- a browser download in `~/Downloads`;
- a file in a cloned repository;
- a file written by a prompt-injected agent.
The attacker then gets the user to open
`https://<host>.ts.net:8443/files?path=~/Downloads/x.html`. That is a
top-level GET, so the `SameSite=Lax` cookie is sent. Other ways in are the
Files panel's "Open externally" (`app/lib/features/chat/files/files_viewer.dart:56`)
or a link inside a `show_html` preview (M4).
The page's script runs on the app origin. It can then:
- open `/connect` (same origin, so the proxy's origin check passes);
- create a Claude chat, switch it to `bypassPermissions` and prompt it, which
is **code execution with no elevation**;
- read `/files?path=~/.ssh/id_ed25519`.
- **Default:** on.
- **Likelihood:** needs targeting and one click, so low to medium.
- **Impact:** full compromise of the user account.
- **Mitigation** (small change, highest value in this report):
- In `serveHomeFileFrom`, send the same sandbox CSP as `artifacts.go:294`.
- Force `attachment` (or `text/plain`) for `text/html`, `image/svg+xml`,
`application/xhtml+xml` and XML types.
- Defence in depth: have `proxyArtifact` add the sandbox CSP to every
`/files` and `/artifacts/` response, as `peerRelay` does.
#### M4. `show_html` previews: remote loads and sandbox-escaping links (Medium)
- **Evidence:**
- Web: an `srcdoc` iframe with `sandbox="allow-popups allow-popups-to-escape-sandbox"`
(`app/lib/features/artifacts/ui/artifact_html_view_web.dart:109-110`).
There are no scripts and the origin is opaque, which is good.
- The link filter `artifact_html_links.dart:37-42` allows any http(s) URL,
including the app's own `/files?path=...html`, which chains into H1.
- Remote `<img>` and CSS `url()` loads are not blocked (`web/src/appFiles.js:17-24`).
- The tool description says "no network" (`internal/chattools/tools.go:122`).
That is inaccurate.
- Native: `JavaScriptMode.disabled` (`artifact_html_view_native.dart:78-79`),
but remote subresources still load.
- **Impact:** an injected agent can encode data in image URLs, so the data is
exfiltrated as soon as the preview renders. Links can also open
attacker-chosen pages outside the sandbox.
- **Mitigation:**
- Inject `<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'; img-src data:">`
into the srcdoc and native HTML, as `deliverable.go:48` already does.
- Block links to the app's own origin.
- Confirm before opening external links.
#### P1. Chat markdown and links (Low)
- **Markdown:** a custom parser that renders no raw HTML and no markdown
images (`app/lib/features/chat/ui/transcript/markdown_inline.dart`).
- **Links:** only `http(s)` with a host, plus `mailto`
(`chat_links.dart:35-55`). `javascript:` and `file:` are blocked.
- **Gap:** links open with `LaunchMode.externalApplication` and no confirmation
(`chat_link_launcher.dart:9-10`), and `[text](url)` can hide the target.
- **Remote images:** `show_image` with an https URL loads on its own
(`chat_shown_link_image.dart:51` `Image.network(url)`), which works as a
beacon.
- **Mitigation:** click-to-load remote images; show the target and confirm when
the link text differs from its host.
#### P2. Terminal escape sequences (Low)
- **OSC 52:** writes reach the system clipboard silently, with only a toast
(`app/lib/features/chat/shell/chat_shell_terminal_events.dart:52-55`). Reads
are refused (`third_party/xterm/lib/src/terminal.dart:1135-1145`).
- **Risk:** agent output can swap the clipboard for a malicious command.
- **OSC 8 links:** http(s) only and Ctrl/Cmd+click, but the target is not shown.
- **Mitigation:** confirm OSC 52 writes or put them behind a setting, and show
the link target on hover.
#### P3. Notification `link=` targets to arbitrary URLs (Low)
- **Evidence:** `internal/server/notify_link.go:87-103` accepts any absolute
http(s) `link=` written by the agent into the run's `public/` directory.
- **Risk:** a phishing link delivered as a trusted notification. (ntfy is gone;
the same `link=` is now the app notification's tap target.)
- **Mitigation:** restrict to the configured web origin, or route through an
interstitial page.
### 3.5 Supply chain
#### M2a. Harness and ntfy versions resolve to "newest" at install time (Medium)
- **Update:** ntfy is no longer installed, so its part of this finding is
resolved; the harness part stands.
- **Evidence:**
- `scripts/resolve-releases.py:1-27` picks the newest OpenCode v2 tag (GitHub
API), then its GHCR digest, and the newest Pi version from npm.
- The Dockerfile pins by digest, but the digest is whatever is newest when you
install (`Dockerfile:23 FROM ${OPENCODE_IMAGE}@${OPENCODE_DIGEST}`).
- Pi: `npm install --global --ignore-scripts ...@${PI_VERSION}` (`Dockerfile:40`)
has no integrity hash and leaves transitive dependencies unpinned.
- ntfy: `go mod download heckel.io/ntfy/v2@<resolved tag>`
(`scripts/setup-native.py:613-614`). GOSUMDB still verifies module
integrity, since no GOPROXY/GONOSUMDB override was found.
- **Protections:** a host allow-list and a redirect guard in
`resolve-releases.py:59, 92-98`.
- **Mitigation:** commit reviewed pins (version + digest + npm integrity, and
the ntfy version) and make "resolve latest" an explicit flag.
#### M2b. Unpinned images and an unchecked SDK download (Medium/Low)
- **Image tags, not digests:**
- `compose.yaml:56 image: binwiederhier/ntfy:latest` (Docker mode)
- `Dockerfile:10 FROM golang:1.27-alpine`
- `app/docker/Dockerfile:7 FROM debian:bookworm-slim`
- **SDK zip:** `app/docker/Dockerfile:55` downloads the Android command-line
tools zip without a sha256 check.
- **Flutter:** cloned by tag (`--branch $FLUTTER_VERSION`, 3.44.6 from
`app/.flutter-version`) with no commit check. A tag can move.
- **Mitigation:** pin by `@sha256:` digests, verify the zip's sha256, and check
the Flutter tag's commit.
#### M2c. `pipelines update` pulls and installs with no verification (Medium)
- **Evidence:** `scripts/manage.py` `update` (around lines 369-397):
```python
pulled = subprocess.run(["git", "-C", str(source), "pull", "--ff-only"], text=True)
...
installed = subprocess.run(["sh", str(source / "install.sh"), *config.get("install_args", [])])
```
- **Risk:** whatever the tracked remote serves is built and installed.
- A compromised remote compromises every user who updates.
- The install doc clones over HTTPS from a personal Git host.
- **Mitigation:** verify signed tags (`git verify-tag`), or show the incoming
commit range and ask before installing.
#### S1. `curl | bash` advice (Low)
- **Where:** `docs/install.md:26`, `docs/harnesses.md:38,40` and
`scripts/setup-native.py:133` recommend
`curl -fsSL https://opencode.ai/install | bash`.
- **Mitigation:** also offer package-manager installs.
#### S2. App update feed signing (info: good, with notes)
- **Signature first:** the Ed25519 signature is checked before the feed is
trusted (`app/lib/features/updates/app_updates_io.dart:111-118`).
- **Hash checks:** the download's sha256 is checked before the rename
(`:177-185`). The Android signer must match.
- **No redirects:** redirects are not followed (`:44`).
- **Downgrade protection:** a feed is offered only if `versionCode > installed`.
Settings uses `_installed ?? 0` (`settings_updates_section.dart:63`), so an
unreadable installed version offers anything.
- **Fails open with no key:** a build with no embedded key accepts any feed
(`update_feed_signature.dart:44`). Installer builds always embed one.
- **Key location:** the signing key lives on the same machine and account as
the feed and the agents (`~/.config/pipelines/update-signing-key.pem`,
0600). Per H3, any agent can read it and sign a malicious update.
- **APK keystore:** APKs are signed with a keystore seeded from the Android
**debug** keystore (well-known password `android`)
(`app/android/app/build.gradle*`, `scripts/app_build.py:143-151`).
- **Extraction:** Linux uses `tar -xzf` into a staging directory beside the
install (`linux_self_update.dart:54-59`). It is hash-pinned, but members are
not filtered.
- **Mitigation:**
- Keep the signing key away from the agent user (H3).
- Fail closed in release builds without a key.
- Treat an unknown installed version as "no update".
- Add a signed expiry.
- Generate a real release keystore.
- Reject symlink, absolute and `..` tar members.
#### S3. Dependency pinning (info: good)
- **Go:** `go.mod` + `go.sum`.
- **Web proxy:** no npm dependencies at all (`web/package.json`).
- **Flutter:** `app/pubspec.lock` is committed, and the xterm fork is vendored
as a path dependency.
- **Gap:** `scripts/app_desktop_build.py:85` runs `pub get` without
`--enforce-lockfile`.
### 3.6 Secrets
- **Storage (info: good):**
- The web hash, server token, publisher token, ntfy config, install manifest,
signing key and Claude account slots are all 0600 in 0700 directories
(`setup-native.py:302-414, 683, 744`; `update_signing.py:66-85`;
`claudeaccounts/store.go:214-237`).
- No secrets on command lines or in service unit files: the launchd plist
carries only `HOME` and `PATH`.
- Inline `PIPELINES_NTFY_TOKEN` is refused (`internal/installation/service.go:224-225`).
- ~~**Docker ntfy token (Low)**~~: resolved; ntfy and its token were removed.
- **M6. No redaction of transcripts or notifications (Medium):**
- Redaction exists only for failure evidence (`internal/stage/diagnostics.go:55-70`)
and turn-diff snapshots, which skip `.env*`, `*.pem`, `.ssh`, `.aws` and
similar (`internal/filediff/snapshot.go:249-262`).
- Anything an agent prints, such as `cat ~/.aws/credentials`, is stored in the
history DB (`~/.local/share/pipelines/data/pipelines.db`, directory 0700)
and can appear in notifications and session exports.
- **Mitigation:** scrub known secret values (the server token, the publisher
token, and patterns such as AWS keys and private-key headers) before
persisting and before notifying.
- **Harness credentials:** stay where each harness keeps them (`~/.claude`,
`~/.codex`, OpenCode's auth file). Agents can read them (H3).
- **Credential forwarding:** pipeline transfer bundles contain definitions
only (`internal/transfer/bundle.go:1`). The peer relay sends the remote
password to the peer's `/login` and allows `ws://` with only a warning
(`web/src/peerRegistry.js:6-9`). See F1.
- **Retention and uninstall:**
- Storage retention is off by default (`protocol/storage.go:18`), so history
grows without limit. Chat attachments and notifications are kept 7 days.
- `./uninstall` removes `~/.config/pipelines` and the data. It probably
leaves `~/.claude/pipelines-accounts` behind (not confirmed).
- **Mitigation:** document what uninstall leaves behind, and offer a
retention default.
### 3.7 Filesystem
- **Confinement (info: good):**
- `/files`, the folder picker and `show_file` resolve symlinks, then use
`filepath.Rel` against the real `$HOME` (`internal/server/directory_listing.go:104-122`).
`..` and symlinks out of home (for example to `/etc`) are refused. Kernel
pseudo-filesystems are refused.
- Artifacts use `os.OpenRoot` with Lstat checks on each component and
`O_NOFOLLOW` (`internal/server/artifacts.go:204-294`).
- Chat uploads use `os.Root` + `O_EXCL`, at most 100 MiB per file, a 1 GiB
quota and 512 files.
- `POST /files` needs elevation and uses `O_EXCL`.
- No prefix-bug `HasPrefix` path checks were found.
- **F2. All of `$HOME` is readable by a session (Medium, part of H2):**
- A symlink to `~/.ssh` stays inside home, and `~/.ssh` itself can be read
directly.
- **Mitigation:** deny-list `~/.ssh`, `~/.gnupg`, `~/.aws`,
`~/.config/pipelines`, `~/.claude*`, `~/.codex` and `.git-credentials` in
`/files`, `show_file` and the listing, or require elevation for them.
- **F3. TOCTOU (Low):**
- `home_files.go:34` resolves the path, then opens it later (`:56`) without
`os.Root`. A same-user process could swap in a symlink between the two.
- **Mitigation:** `os.OpenRoot(realHome)` + `root.Open(rel)`, as artifacts do.
- **F4. Proxy static and `/updates` paths (Low):**
- `resolve(join(...))` + `startsWith(ROOT + sep)` (`web/serve.mjs:390-412`)
is safe against `..`, but follows symlinks inside the root.
- Fine while the directories stay 0700.
- **Where agents can write:** Claude stage `Edit` is scoped to the run and
artifacts directories. Bash in every harness, and every chat agent, can write
anywhere the user can.
- Run worktrees are created at `<repo>-runs/<slug>` and removed when landed or
discarded (`run_worktree.go:57-64, 102, 149`).
### 3.8 Multi-machine federation
- **Model:** proxy to proxy only. The Go server has no peer concept.
- A signed-in user registers `ws(s)://host/connect` and types that remote's
web password.
- The local proxy keeps the remote session cookie in memory for that local
session (`web/src/peerRegistry.js:148,168`).
- **What a peer link grants:** relaying the browser's socket to the remote
`/connect`, which is **full control of the remote as its signed-in user**
(H2 applies there), plus fixed GET/POST paths (`web/src/peerRelay.js:60-200`).
- **What it does not grant:** the remote cannot act on the local machine. The
local server token is never forwarded. No harness credentials are pushed.
- **Remote content:** gets a sandbox CSP. Redirects become 502. SSRF and DNS
pinning protections are in `web/src/peerAddress.js`.
- **TLS:** `https.request` verifies certificates.
- **F1. Plain `ws://` peers (Low):** the remote password crosses in cleartext,
only flagged as `insecure_transport` (`web/src/peerTransport.js:84-90`).
- **Mitigation:** refuse `ws://` except for tailnet or loopback addresses.
- **Compromise blast radius:** a compromised local machine holds live sessions
to each peer while the user is signed in, so it can drive those peers as well.
### 3.9 Resource abuse
#### M5. No spending cap and no global concurrency limit (Medium)
- **Limits that exist:**
- Per-stage timeout of 1 hour (`internal/stage/budget.go:16`).
- Loop limits: `maxStageVisits = 5`, `maxRunSteps = 30` (120 with grants)
(`internal/server/loop_state.go:23-29`).
- Claude chat processes are capped at 8 (`internal/claude/claude.go:40`).
- `!` commands: 4 per chat.
- **Budget off:** the run budget is off unless `DefaultBudgetUSD > 0`
(`internal/server/run_budget.go:74`).
- **No global caps:** none on concurrent runs, WebSocket connections or chats.
A runaway loop, a malicious session, or `schedule_followup` can burn API
credit.
- **DoS:**
- Body limits exist: WebSocket reads 2 MiB (`websocket.go:215`), MCP bodies
4 MiB, proxy JSON 4 KiB.
- `ReadHeaderTimeout` is 5 seconds, but there is no `IdleTimeout` or body
deadline (`cmd/pipelines-server/main.go:196`).
- `POST /files` has no disk quota, but needs elevation.
- **Mitigation:**
- Ask for a default budget at install (or ship a modest one).
- Add a server-wide concurrent-run cap and per-session connection caps.
- Add `IdleTimeout` and a disk quota.
### 3.10 Docker mode (opt-in): M3
- **Evidence:**
- `compose.yaml:26` `- "${PIPELINES_BIND_ADDRESS:-0.0.0.0}:${PIPELINES_PORT:-8080}:8080"`
- `scripts/setup-docker.py:82-84` forces `PIPELINES_BIND_ADDRESS=0.0.0.0`
- `Dockerfile:59 CMD ["-addr", "0.0.0.0:8080", ...]`
- No server token is configured. `cmd/pipelines-server/main.go:58` only logs
"no server token configured". The Host check is skipped off loopback
(`request_boundary.go:102-104`).
- **Impact:** with `./install --docker`, any LAN host using a non-browser
WebSocket client (no `Origin` header) can run agents and read the mounted home
and repositories (`compose.yaml:38-47`). That is **remote code execution from
the LAN**. Severity would be critical, but it is not the default.
- **Mitigation:**
- Bind 127.0.0.1 by default.
- Generate and mount a server token.
- Make the server refuse a non-loopback `-addr` without a token unless
`-insecure-no-token` is given.
---
## 4. "Secure by default" checklist (ordered by value / effort)
1. **Sandbox `/files`** (H1): add the artifact sandbox CSP in
`serveHomeFileFrom`, force `attachment` for HTML/SVG/XML, and add the CSP in
`proxyArtifact` too. *A few lines; closes the XSS-to-code-execution path.*
2. **Gate permissive modes behind elevation** (H2): switching a chat to Claude
`bypassPermissions` or Codex `full`, and answering permission cards. *Small.*
3. **Scrub the agent environment** (H3): drop `PIPELINES_*_FILE`,
`PIPELINES_WEB_AUTH_FILE` and token variables from every harness and `!`
child environment. *Small.*
4. ~~**ntfy off the LAN by default** (M1)~~: done by removing ntfy.
5. **Docker safe defaults** (M3): bind 127.0.0.1, generate a token, and refuse a
non-loopback bind without a token. *Small.*
6. **Deny-list secret paths** in `/files`, `show_file` and listings (F2).
*Small.*
7. **Require a shell allow-list for stages** (H4), or warn at authoring and run
start, and default the starter to text-only. *Small to medium.*
8. **Block remote loads in HTML previews** (M4): inject a strict meta CSP and
refuse same-origin links. *Small.*
9. **Default a run budget and a global run cap** (M5). *Small to medium.*
10. **Pin the supply chain** (M2): commit reviewed OpenCode and Pi
versions and digests, pin base images by digest, verify the SDK zip's
sha256, and verify signed tags in `pipelines update`. *Medium.*
11. **Make elevation a real second factor** (H2): OS password via
`su`/PAM (as the terminal does) or TOTP/WebAuthn, with a 15-60 minute TTL.
*Medium.*
12. **Isolate agents from Pipelines' own secrets** (H3): run harnesses under a
separate user or a bubblewrap/`sandbox-exec` profile, and keep the cookie
secret, server token and signing key out of their reach. *Large; biggest
long-term win.*
13. **Smaller items:**
- Default "Remember me" off.
- Disable mDNS when the LAN route is off.
- Confirm external links, OSC 52 writes and notification `link=` targets.
- Redact known secrets from transcripts.
- Refuse `ws://` peers off the tailnet.
- Use a real APK keystore.
- Fail closed on unsigned feeds in release builds.
- Run `pub get --enforce-lockfile`.
- Add a README security section (section 1).
## 5. Method notes and limits
- **Not tested at runtime:** H1 and M4 are confirmed from code paths, not
reproduced in a browser.
- **Not confirmed:** OpenCode's upstream default chat permissions (R1), and
whether uninstall leaves `~/.claude/pipelines-accounts` behind.
- **Live listener check:** `ss -ltnH` on this machine, a customised install, not
a pristine default.
- **Not covered:** the iOS build, Windows (unsupported), and the behaviour of
the third-party harness CLIs themselves.