# MoonSSH Agent Push for Herdr The plugin runs on the machine that runs the Herdr server. It needs Herdr 0.9 or newer and Python 3.9 or newer on macOS or Linux. Use a normal, unprivileged account. ## Install from MoonSSH 1. Connect to the intended Herdr session in MoonSSH. 2. Open the terminal’s **… → Lock Screen Push**, choose the SSH host and Herdr session, and tap **Install & Enable Alerts**. MoonSSH Pro is required for hosted push. Complete the one-time security check; no MoonSSH account or invitation is required. 3. MoonSSH checks prerequisites, sends its built-in plugin over the verified SSH connection, and links it to Herdr. The host key goes over a private SSH channel and stays in a user-only file on the host. If the connection drops, reconnect and choose **Retry Installation**. An older pairing can use **Update Push Plugin** to update without a new security check. Under **Notification Content**, choose **Agent and status** or **Task name and reply excerpt** for the pairing. If a Codex pane sends alerts without reply text, install the current plugin using **Repair Installation** for an existing pairing. In the Codex pane, run `/title` and select only **Thread ID**. The plugin can use that terminal title when the native session ID is missing. It compares the pane and session at the start and end of the turn and reads only a uniquely matched local transcript. The thread ID stays on the host. If the session or current reply cannot be verified, the alert still arrives with its usual task and status information. ## What you are installing Review `herdr-plugin.toml`, `push.py`, and `install.py`. The signed app sends its bundled sources over the already verified SSH connection; it does not download executable code from this website. Herdr runs plugins as your host user and does not sandbox them. Use an unprivileged account. The plugin has no root installer, public listener, auto-update service, or third-party Python dependency. Optional previews use your system OpenSSL. The default production origin is `https://moonssh-herdr-push.moonssh.workers.dev`, hosted in the dedicated MoonSSH Cloudflare account. Public URLs and public encryption keys are not credentials. No Apple signing/APNs private key, Cloudflare administrator token, SSH password, or SSH private key is included in this package. Existing pairings require the current MoonSSH app and an active Pro subscription. Open the app after upgrading so it can verify your subscription; the host never receives your Apple receipt or payment information. The interactive `push.py pair` command is retained for users who already hold a scoped host key; never place that key in shell history or chat. The hook receives only Herdr's agent-state events. It verifies the terminal instance on the local Unix socket and sends an event ID, status type, a hash of the pane and terminal IDs, and the recognized Agent type. It respects the host’s HTTPS proxy and validates the relay’s TLS certificate. When detailed push content is enabled, the hook encrypts a Herdr task label and can read a bounded excerpt from the current Codex or Claude Code session’s local transcript at turn completion. The hook uses the host’s system OpenSSL to encrypt the excerpt with the public key installed over SSH. No preview is attached if the session, reply, or key cannot be verified. It does not read terminal buffers, forward raw prompts, or transmit host paths. Alerts reflect Herdr’s semantic status, and intermediate states can be missed if Herdr has already advanced before a hook runs. APNs acceptance is not a guarantee that iOS displays an alert immediately. The host key can submit alerts for one pairing. The plugin stores it in a user-only file under `~/.config/moonssh-herdr-push`. Run `python3 -I /path/to/moonssh-herdr-push/push.py unpair` from the Herdr session to remove all MoonSSH push pairings and deduplication data for that session on the host. Use **Revoke Pairing** in MoonSSH to invalidate the key at the relay as well. If none of your Herdr sessions use the plugin, run `herdr plugin unlink moonssh.agent-push`. ## Delivery, privacy and power Version 0.5.1 commits the generic event and its deduplication state in one local SQLite transaction before sending. Only metadata and optional device-encrypted preview ciphertext enter the outbox; clear-text task labels/replies and credentials do not. The per-device payload and UUID are reused across retries, preserving the original pane and avoiding duplicate alerts. The queue is capped at 512 per-device deliveries per Herdr socket, discarding the oldest overflow. A background child exists only while queued events remain. It sleeps with exponential backoff, retries temporary network failures/408/429/5xx at most nine times for up to 15 minutes, then discards stale alerts. A revoked/rotated key drops that pairing’s pending events. No iPhone polling or permanent host daemon is installed. After host/process restart, the next Herdr status hook resumes any unexpired queue. The Pro relay accepts 30 new events per minute and 300 per UTC day per pairing, up to 1,000 new events per UTC day per subscription across 10 active pairings, with a separate aggregate safety budget. Apple-signed purchase and renewal records verify access; signed App Store server notifications handle renewals, expiration and refunds. The relay stores a hash of the original purchase identifier and verification timestamps, never card details. Expired or refunded access stops delivery; the host drops these rejected events instead of repeatedly retrying them. Restore Pro in the app to refresh access. Voice input, basic SSH and local terminal recovery remain free. Retries of an accepted event do not consume another event allowance. Quota failures back off within the same 15-minute bound; they do not retry until the next day. Pairings expire after 90 days without app refresh. Revoke Pairing in the app removes the registration; local `unpair` removes this Herdr socket’s pairing files and outbox. Neither action touches other Herdr sessions.