Repository navigation
Description
Motivation
session-peer is local-first and uses SSH for remote execution. SSH is valuable
because the destination needs no resident session-peer service, but it also
requires a reachable SSH endpoint, the correct destination account, keys, and
host configuration. That makes pairing devices across NAT, firewalls, mobile
networks, and separately managed servers harder than the actual agent-message
operation.
Explore an opt-in paired-device transport similar to Paseo's connectivity model:
keep local operation as the default, permit direct TCP/Tailscale/other-VPN
connections to an explicitly enabled receiver, and offer an end-to-end encrypted
relay when direct connectivity is unavailable. Existing local and SSH transports
must remain supported.
References:
- Paseo connectivity: https://github.com/getpaseo/paseo/blob/main/public-docs/connectivity.md
- Paseo architecture and zero-knowledge relay model: https://github.com/getpaseo/paseo/blob/main/docs/architecture.md
- Tailscale DERP blind relay model: https://tailscale.com/docs/reference/derp-servers
- Orca relay workspace and deployment model: https://github.com/stablyai/orca/blob/main/cloud/README.md
- Orca shared relay wire contract: https://github.com/stablyai/orca/tree/main/cloud/packages/relay-contract/src
Product principles
- Local-only remains the zero-configuration default. Ordinary commands, JSON
consumers, and automation must never receive an unsolicited setup prompt. - Relay and direct peer listening are enabled only through an explicit setup,
pairing, or service command. - Treat WireGuard/Tailscale as an optional direct-network underlay. Do not make
session-peer a VPN control plane or implement key distribution for WireGuard. - The application relay forwards opaque encrypted frames. Endpoint private keys
never leave their devices, and relay compromise must not reveal message bodies. - Keep SSH as an independent transport. A paired-device route must not silently
guess SSH accounts or change existing--hostbehavior. - The receiver exposes a narrow session-peer protocol for discovery and message
submission, not arbitrary remote command execution.
Findings from Orca's relay implementation
Orca provides a useful production reference for the boundary between endpoint
security and relay infrastructure:
- Both endpoints open outbound WebSockets to a relay cell. A director assigns
hosts to cells and returns a versioned assignment epoch and lease, while cells
own the live user connections and splice frames. This keeps placement and
migration decisions out of the data-forwarding path. - A shared
relay-contractpackage is consumed by the relay and both endpoints.
It defines strict versioned schemas, typed close codes, protocol limits,
admission budgets, and a forward-only splice state machine. The state machine
permits client acknowledgement only after both forwarding handlers exist,
avoiding a false-positive connection result. - Relay admission credentials and assignment leases are distinct from the
endpoint E2EE session. The relay authenticates and pairs the outer connection,
then forwards an opaque encrypted stream. Orca's host proof also binds the
relay origin, host identity and public key, assignment epoch, issue/expiry
times, and resume intent into an encrypted challenge transcript. - During initial pairing, Orca probes direct and relay candidates concurrently.
The first verified path wins, with direct selected deterministically on an
exact tie. Relay resume credentials are installed with a stable request ID and
reconciled as committed before the client publishes the relay endpoint. - Frame size, first-frame and attach deadlines, idle time, per-host connections,
queued bytes, high/low watermarks, and wedged-link time are bounded. Failures
use typed close reasons rather than being reported as generic delivery success.
For session-peer, the reusable parts are the shared versioned contract, the
separation of control and opaque data paths, deterministic route selection,
transactional credential reconciliation, and bounded forwarding. Orca's
multi-region director/cell fleet, Cloud SQL/Terraform operations, and separate
mobile push gateway are later scale concerns and should not be required for the
first self-hostable relay.
Possible interface
Names are provisional and should be settled during design:
session-peer serve
session-peer relay enable
session-peer relay disable
session-peer device pair
session-peer device list
session-peer device remove <device>
session-peer send --device <device> --to <session> "message"A paired device can record one logical identity with several routes. If direct
and relay routes are both available, probe them concurrently and accept the
first authenticated endpoint response, choosing direct deterministically on an
exact tie. Report the route actually used. Keep explicit SSH
destinations separate unless a future design safely unifies them through the
structured reply-address work in #45.
The receiver service should run as the OS user that owns the Claude/Codex state
and bind only to explicitly configured interfaces. Installing the ordinary CLI
must not automatically enable or start it.
Pairing and security model to design first
- Generate endpoint identity and encryption keys locally. Pairing transfers only
public identity material, relay information, and a bounded one-time secret. - Show or verify a short fingerprint/confirmation value so a pairing link cannot
silently substitute a peer key. - Store private material with OS-appropriate protection; support revocation and
key rotation without reinstalling the CLI. - Use a reviewed protocol/library for authenticated encryption. Do not design
custom cryptographic primitives. The current standard-library-only packaging
means relay crypto may need an optional extra or a separate helper. - Define per-device capabilities such as list, Claude send, and Codex send. A
paired peer does not receive filesystem or process-execution authority. - Bind each encrypted request to protocol version, sender, receiver, message ID,
nonce, expiry, and operation. Reject replay, oversize payloads, expired
requests, and unauthorized operations before touching an agent transport. - Keep outer relay admission and route-assignment credentials separate from the
endpoint identity and payload-encryption session. Bind redirects or assignment
changes to a trusted origin and a strictly newer generation. - Document metadata visible to the relay, including device routing identifiers,
timing, connection state, and ciphertext sizes. - Apply bounded queues, backpressure, connection timeouts, and rate limits.
Delivery semantics
Do not collapse transport stages into delivered. Structured results should
distinguish at least:
- accepted by the relay, when a relay was used;
- accepted by the destination device service;
- posted to a Claude inbox or submitted to a Codex queue;
- consumed or acknowledged only when independently proven.
Use idempotent message IDs so reconnect or timeout handling never causes an
automatic duplicate submission. Coordinate the eventual response schema with
#29 and reply/wait semantics with #31 and #45.
Proposed phases
- Write the protocol, threat model, key lifecycle, device identity, route
selection, and status contract before implementing a public relay. - Add an opt-in receiver and direct connection over a controlled Tailscale/VPN
test network. Preserve all local/SSH behavior and measure operational cost. - Add a self-hostable, online-only blind relay and E2E pairing. Both endpoints
connect outbound so no inbound port or SSH configuration is required. - Consider hosted relay operation, regional routing, or encrypted offline
store-and-forward only after the online design is verified.
Out of scope for the first implementation
- Replacing SSH or removing agentless remote execution.
- Managing WireGuard interfaces, tailnets, DNS, ACLs, or VPN peer keys.
- Arbitrary remote shells, commands, or file access.
- Claiming Claude/Codex consumption from a socket write or queue acceptance.
- Offline durable relay queues, multi-relay federation, and mobile UI.
- Automatically enabling a daemon, listener, relay account, or background
service during ordinary CLI installation.
Acceptance criteria for an initial implementation
- A fresh install remains local-only, starts no listener, contacts no relay,
and preserves existing local/SSH CLI and JSON behavior. - Explicitly paired devices can list and submit to permitted local
Claude/Codex targets over a direct Tailscale/VPN route. - When direct connection is unavailable, the same paired identity can use an
explicitly enabled relay without exposing plaintext or endpoint private
keys to that relay. - Route selection and every submission stage are exposed in structured
results without claiming consumption. - Direct and relay candidates can be probed without waiting through a serial
fallback timeout; selection is deterministic when both verify together. - A versioned shared wire contract validates both endpoints and the relay,
and the destination is never acknowledged before bidirectional forwarding
and endpoint authentication are ready. - Pairing replacement, replay, expiry, revocation, key rotation, timeout,
reconnect, duplicate-message, malformed-frame, backpressure, and
unauthorized-operation cases fail closed in tests. - Credential installation and rotation survive a lost response through a
stable idempotency ID and authoritative status reconciliation. - A relay outage never changes local or explicit SSH behavior and never
triggers duplicate submission. - macOS, Linux, and Windows lifecycle behavior is specified; supported
platforms receive integration coverage for service startup/shutdown and
direct/relay transport. - Documentation includes the threat model, relay-visible metadata, firewall
requirements, setup/removal/recovery procedures, and the distinction
between the CLI package, optional receiver service, and relay service.
This is a future design and implementation project rather than part of the
current v0.7 diagnostics scope in #45.
Activity
test: validate paired-device E2EE relay transport (#69) (#87)
release: prepare v0.9.0 Antigravity and paired relay beta (#90)
abruption commentedon Sep 18, 2026
Implementation resumed on isolated branch
feat/69-relay-rc-hardening, based on main0dd9592.User-approved RC scope now includes React + Better Auth with GitHub and Google login, user/device ownership and CLI device authorization, alongside endpoint key rotation, durable reconciliation, bounded journals, recovery and KR hosting at
relay.abruption.dev. Initial hosting remains restricted to the operator's approved accounts/devices. OAuth login does not replace E2EE pairing or receiver policy.Work is divided between Python relay/lifecycle integration in the project session, the KR ontology session's isolated control-service implementation, and the Mac ontology session's infrastructure preparation. Existing production ingress is held until the integrated candidate is ready.
Release gates: 24 hours on a fixed candidate; isolated real Codex/Antigravity sessions; Claude live receive/ACK after its quota recovers. Claude calls/retries are not being attempted while quota is exhausted. The RC release PR must wait for that evidence. This task does not authorize automatic merge, tags or PyPI publication.
Automatic tests and partial implementation are not a completed deployment, OAuth-provider verification or an RC release. Remaining acceptance criteria will be tracked explicitly before closing #69.
abruption commentedon Sep 18, 2026
구현 및 검증 진행 상황을 갱신합니다. 앞선 코멘트의 배포 보류·24시간 시험 계획은 아래 상태로 변경되었습니다.
feat/69-relay-rc-hardening(63f6de6)에 푸시했습니다. 별도 인증 구현 이력은feat/69-relay-control-auth(3de5604)에 보존했습니다. 최종 통합 변경은 RC 브랜치를 기준으로 검토해 주세요.consumptionConfirmed는 계속false이며, 큐 수락·socket write를 소비 완료로 간주하지 않습니다.남은 항목: 실제 Claude 수신/ACK(쿼터 회복 전 호출·재시도 금지), 추가 지원 플랫폼/VPN-off 및 남은 fault/recovery 검증, 패키지·운영 복구 근거와 #69 전체 AC 대응표의 최종 확인. 미충족 AC를 후속 과제로 옮겨 완료 처리하지 않습니다.
현재는 소스 공유 및 제한된 검증 완료 상태이며 #69 전체 완료나 RC 릴리즈 승인으로 표시하지 않습니다. 병합·태그·게시·PyPI 릴리즈는 수행하지 않았습니다.
검증 기록: https://github.com/abruption/session-peer/blob/feat/69-relay-rc-hardening/docs/validation/69-rc.md
KR 운영 설정: https://github.com/abruption/session-peer/tree/feat/69-relay-rc-hardening/deploy/kr
abruption commentedon Sep 19, 2026
최종 RC 재검증 결과를 반영합니다.
feat/69-relay-rc-hardening의a09def3이며 PR #99로 제출했습니다.consumptionConfirmed=false는 그대로 유지하며 transcript ACK와 구분합니다.agentapi send-message인수 호환성과 macOS locale에 따른 bridge 세션 소실을 수정했고 회귀 테스트를 추가했습니다.SIGSTOP을 주입해 control/fresh readiness/relay가 35.67초 안에 자동 복구됐고, 상태·replay high-water와 설정 해시 보존 및 복구 후 공개 Claude ACK를 확인했습니다.PR: #99
검증 기록: https://github.com/abruption/session-peer/blob/feat/69-relay-rc-hardening/docs/validation/69-rc.md
현재는 리뷰 가능한 RC PR 제출 및 검증 완료 상태입니다. 병합·태그·패키지 게시·릴리즈는 수행하지 않았습니다.
abruption commentedon Sep 19, 2026
추가 운영 gate 검증을 완료했습니다.
session-peer-stack.target만multi-user.target에 enable하고 control·relay 개별 unit은 direct boot entry로 disabled 유지했습니다. migration/replay-init one-shot도 자동 실행하지 않습니다.vault status integrity=ok도 확인했고 failed unit은 0입니다.d286abf2생성이 성공했습니다. 이를 root-only 격리 경로에 실제 복원해 3,742개 항목/180.638 MiB, manifest 파일 해시·mode, DB table count, 키·revision·replay·runtime symlink를 검증했습니다. production 경로는 수정하지 않았고 복원 사본은 검증 후 삭제했습니다.관련 커밋:
ee4db45,386c83cGitHub Actions run: https://github.com/abruption/session-peer/actions/runs/35419599716 — 전체 통과
병합·태그·게시·릴리즈는 수행하지 않았습니다.
abruption commentedon Sep 19, 2026
RC scope update (
7b6e8a1, included in #99):https://relay.abruption.dev/admin/metrics, a browser-session-only aggregate view of service health, signup status, user/device/operation counts, and state revision. It contains no emails, provider IDs, internal user IDs, principals, certificates, tokens, or secrets./session-peerredirect block for the existing Authelia-protectedadmin.abruption.devportal. It preserves that site's root and/api/*; the relay performs its own operator check after redirect.Validation for this delta: Node 22.14 and Node 24.16 typecheck/build/68 tests/audit 0; Node/Python integration 5 tests; full current Caddy candidate adapt/validate passed. The portal redirect and public-signup switch are not yet live, and no merge/release is implied by this update.
abruption commentedon Sep 19, 2026
Release follow-up: the operator and user-facing surfaces described above are now live for
v1.0.0-alpha.1.https://admin.abruption.dev/session-peeris an exact Authelia-protected portal route tohttps://relay.abruption.dev/admin/metrics. The relay still performs its own provider-account operator check; the unauthenticated metrics API returns 401.https://abruption.dev/projects/session-peer/relay-server/andhttps://abruption.dev/projects/session-peer/llms.txt.abruption/abruption.dev-site#1; the productionlanding-pageWorker was deployed from that merge commit.Post-deploy checks passed for control/readiness/relay health, loopback-only listeners, Caddy reload without PID replacement, existing admin health/root behavior, all four guide locales, and the pinned alpha install instructions. No user-count cap or manual invitation gate is active.
abruption commentedon Sep 20, 2026
Post-release cross-host validation for
v1.0.0-alpha.1completed on 2026-09-20 using a disposable Windows 10 / Ubuntu 24.04 WSL2 endpoint and an Ubuntu 24.04 ARM64 endpoint. Both usedsession-peer[relay]==1.0.0a1, with only the publicwss://relay.abruption.dev/v1/connectroute configured. The 24-hour soak remained out of scope.Passed:
listin both directions;consumptionConfirmed=false;The Windows native core still behaved according to its current contract: discovery worked, while paired-device initialization rejected native Windows/Python 3.10. WSL2 enabled the endpoint test. One usability gap was reproduced: a WSL receiver can read a native Windows Codex home for
list, but cannotsendwithout an ad-hoccodex.exe/CODEX_HOMEtranslation wrapper. Follow-up: #110.No credentials, tokens, private keys, certificates, device/session identifiers, host addresses, or transcript contents are included in this report. This validation does not claim direct-route, 24-hour, load, or cost coverage.