oficina / equipo Public

wire: sealed secrets to the runner, token connections, seal key

The contract for a Claude connection made from a pasted setup token
(Paul, 2026-11-09): Sealed and SealedPayload (crypto_box_seal to the
runner's X25519 key with the binding beside it), the durable secret
frame, Runner.seal_key and hello.seal_key, kind and prompt "token", and
the credential's expiry on a connection.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 2e5a6103bda94a8266bdfad89a45c7ef61ba8c58 parent 0285479
16 files changed, +105 −12
  • internal/wire/api.go +3 −0
  • internal/wire/connections.go +64 −0
  • internal/wire/connections_test.go +19 −2
  • internal/wire/frames.go +6 −1
  • internal/wire/wire_test.go +1 −1
  • internal/wire/wiretest/fixtures.go +2 −0
  • internal/wire/wiretest/testdata/api/connection-connecting-codex.json +1 −1
  • internal/wire/wiretest/testdata/api/connection-secret.json +1 −0
  • internal/wire/wiretest/testdata/api/connections.json +1 −1
  • internal/wire/wiretest/testdata/api/runners.json +1 −1
  • internal/wire/wiretest/testdata/api/snapshot.json +1 −1
  • internal/wire/wiretest/testdata/frames/hello-mac-probes.json +1 −1
  • internal/wire/wiretest/testdata/frames/hello-mac.json +1 −1
  • internal/wire/wiretest/testdata/frames/hello.json +1 −1
  • internal/wire/wiretest/testdata/frames/secret.json +1 −0
  • internal/wire/wiretest/testdata/frames/sync.json +1 −1
diff --git a/internal/wire/api.go b/internal/wire/api.go
index 3f178a75..c9ad36ad 100644
--- a/internal/wire/api.go
+++ b/internal/wire/api.go
@@ -254,6 +254,9 @@ type Runner struct {
// Removing: the person removed it and it is stopping the work it may
// have started; it is revoked once that work's end is proven.
Removing bool `json:"removing"`
+ // SealKey is the runner's X25519 public key (base64), derived from its
+ // enrolment ed25519 key: secrets are sealed to it (spec §2.4).
+ SealKey string `json:"seal_key"`
}
// RunnerList is GET /api/v1/runners: the person's runners, primary first.
diff --git a/internal/wire/connections.go b/internal/wire/connections.go
index e2011da2..3314d085 100644
--- a/internal/wire/connections.go
+++ b/internal/wire/connections.go
@@ -96,6 +96,9 @@ type Connection struct {
Prompt *ConnectPrompt `json:"prompt"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
+ // ExpiresAt is when the connection's own credential expires (a pasted
+ // setup token), null when it renews itself.
+ ExpiresAt *time.Time `json:"expires_at"`
}
// ConnectionList is GET /api/v1/connections: the person's own, every runner.
@@ -207,6 +210,8 @@ type HeldConnection struct {
State string `json:"state"`
Plan string `json:"plan"`
Headroom *Headroom `json:"headroom"`
+ // ExpiresAt is when a pasted credential expires (null otherwise).
+ ExpiresAt *time.Time `json:"expires_at"`
}
// Switched is the quiet line under a reply (or on a step) that moved to
@@ -223,3 +228,62 @@ type Switched struct {
// answer now. The turn stays running (the message waits) and goes on its
// own when a connection returns; the person may cancel it.
const ReasonNoConnection = "no_connection"
+
+// KindToken is a Claude connection made from a pasted `claude setup-token`
+// OAuth token (Paul, 2026-11-09): sealed in the browser to the runner's
+// seal key, opened and kept only on the runner, passed to the CLI as
+// CLAUDE_CODE_OAUTH_TOKEN. PromptToken is its card: run the command,
+// approve, paste.
+const (
+ KindToken = "token"
+ PromptToken = "token"
+ // EndpointAnthropic is the endpoint a Claude token is bound to.
+ EndpointAnthropic = "https://api.anthropic.com:443"
+ // SealedTTL is how long a sealed box may wait to be opened.
+ SealedTTL = 10 * time.Minute
+ // MaxSealedBytes caps a box (base64 included).
+ MaxSealedBytes = 4096
+ // TokenLifetime is how long a setup token lasts from when it is pasted
+ // (the CLI's one year); TokenRenewal is when the row asks for a new one.
+ TokenLifetime = 365 * 24 * time.Hour
+ TokenRenewal = 30 * 24 * time.Hour
+)
+
+// Sealed is a secret sealed to one runner (spec §2.4): Box is
+// base64 (standard, padded) libsodium crypto_box_seal of a SealedPayload
+// to the runner's seal key; the other fields travel in the clear beside
+// it and the runner refuses the box when any differs from the payload
+// inside, when ExpiresAt has passed, when the attempt is not the one it
+// is running, or when it has seen (ConnectionID, Attempt) before.
+type Sealed struct {
+ Box string `json:"box"`
+ RunnerID string `json:"runner_id"`
+ ConnectionID string `json:"connection_id"`
+ Provider string `json:"provider"`
+ Endpoint string `json:"endpoint"`
+ Attempt int64 `json:"attempt"`
+ ExpiresAt time.Time `json:"expires_at"`
+}
+
+// SealedPayload is what a Sealed box holds: the secret and the binding.
+type SealedPayload struct {
+ Secret string `json:"secret"`
+ RunnerID string `json:"runner_id"`
+ ConnectionID string `json:"connection_id"`
+ Provider string `json:"provider"`
+ Endpoint string `json:"endpoint"`
+ Attempt int64 `json:"attempt"`
+ ExpiresAt time.Time `json:"expires_at"`
+}
+
+// FrameSecret (instance to runner, durable) carries a sealed secret for a
+// connection attempt the runner is running. The instance forgets the box
+// once the runner acks it.
+const FrameSecret = "secret"
+
+// SecretCommand is the sealed secret for one of the person's attempts.
+type SecretCommand struct {
+ Connection string `json:"connection"`
+ Person string `json:"person"`
+ Sealed Sealed `json:"sealed"`
+}
diff --git a/internal/wire/connections_test.go b/internal/wire/connections_test.go
index 46add40c..85db134e 100644
--- a/internal/wire/connections_test.go
+++ b/internal/wire/connections_test.go
@@ -41,7 +41,8 @@ func TestConnectionTypesCarryNoSecrets(t *testing.T) {
for _, v := range []any{wire.Connection{}, wire.ConnectionList{}, wire.Connect{}, wire.ConnectCommand{}, wire.CancelConnectCommand{}, wire.ConnectionReport{}, wire.Hello{}, wire.Reply{}, wire.TurnReport{}, wire.Snapshot{}, wire.StepReport{}, wire.AnswerReport{}, wire.UsageReport{}, wire.DisconnectCommand{}, wire.Sync{}} {
fieldNames(reflect.TypeOf(v), seen, &names)
}
- allowed := map[string]bool{"Usage.input_tokens": true, "Usage.output_tokens": true, "Usage.cached_input_tokens": true, "Usage.cache_write_tokens": true, "Usage.reasoning_output_tokens": true}
+ // seal_key is the runner's public key (spec §2.4): public by design.
+ allowed := map[string]bool{"Hello.seal_key": true, "Runner.seal_key": true, "Usage.input_tokens": true, "Usage.output_tokens": true, "Usage.cached_input_tokens": true, "Usage.cache_write_tokens": true, "Usage.reasoning_output_tokens": true}
for _, n := range names {
_, field, _ := strings.Cut(n, ".")
for _, bad := range secretShaped {
@@ -64,7 +65,8 @@ func TestConnectionTypesCarryNoSecrets(t *testing.T) {
// app replays hold no secret-shaped key either.
func TestConnectionFixturesCarryNoSecrets(t *testing.T) {
for _, name := range []string{"api/connections.json", "api/connection-connecting-codex.json", "api/connect-request.json", "api/event-connection.json", "frames/connect.json", "frames/cancel_connect.json", "frames/connection.json", "frames/hello.json", "frames/reply-usage.json", "frames/usage.json", "frames/disconnect.json", "frames/sync.json", "frames/preference.json", "api/preferences.json", "api/event-preference.json"} {
- raw := strings.ToLower(string(wiretest.Fixture(name)))
+ // seal_key is public (spec §2.4).
+ raw := strings.ReplaceAll(strings.ToLower(string(wiretest.Fixture(name))), `"seal_key"`, "")
for _, bad := range []string{"token\"", "secret", "credential", "password", "sealed", "_key", "api_key", "access_token", "refresh"} {
if strings.Contains(raw, bad) {
t.Errorf("%s contains %q", name, bad)
@@ -104,3 +106,18 @@ func TestHousekeepingTypesCarryNoSecrets(t *testing.T) {
}
}
}
+
+// Sealed secrets go one way only: the runner never sends one back, and
+// the instance's connection resources never carry one (spec §2.4).
+func TestSealedOnlyTowardTheRunner(t *testing.T) {
+ var names []string
+ seen := map[reflect.Type]bool{}
+ for _, v := range []any{wire.Hello{}, wire.Sync{}, wire.ConnectionReport{}, wire.Reply{}, wire.TurnReport{}, wire.StepReport{}, wire.AnswerReport{}, wire.UsageReport{}, wire.Connection{}, wire.ConnectionList{}, wire.Snapshot{}} {
+ fieldNames(reflect.TypeOf(v), seen, &names)
+ }
+ for _, n := range names {
+ if l := strings.ToLower(n); strings.Contains(l, "sealed") || strings.Contains(l, "secret") || strings.HasSuffix(l, ".box") {
+ t.Errorf("%s carries a sealed secret back", n)
+ }
+ }
+}
diff --git a/internal/wire/frames.go b/internal/wire/frames.go
index 3d43fbc1..eda94170 100644
--- a/internal/wire/frames.go
+++ b/internal/wire/frames.go
@@ -60,7 +60,7 @@ type Frame struct {
// Durable reports whether a frame must be acked and resent until acked.
func (f Frame) Durable() bool {
switch f.Type {
- case FrameMessage, FrameAttachment, FrameCancel, FrameReply, FrameTurn, FrameToolCall, FrameToolResult, FrameMoveIn, FrameNotebook, FrameReset, FrameDispatch, FrameCancelStep, FrameStep, FrameRecheck, FrameWatchMerge, FrameMerged, FrameAsk, FrameCancelAsk, FrameAnswer, FrameForgetTask, FrameBranch, FrameBlob, FrameSendPack, FramePublish, FramePublished, FrameConnect, FrameCancelConnect, FrameConnection, FrameUsage, FrameDisconnect, FramePreference:
+ case FrameMessage, FrameAttachment, FrameCancel, FrameReply, FrameTurn, FrameToolCall, FrameToolResult, FrameMoveIn, FrameNotebook, FrameReset, FrameDispatch, FrameCancelStep, FrameStep, FrameRecheck, FrameWatchMerge, FrameMerged, FrameAsk, FrameCancelAsk, FrameAnswer, FrameForgetTask, FrameBranch, FrameBlob, FrameSendPack, FramePublish, FramePublished, FrameConnect, FrameCancelConnect, FrameConnection, FrameUsage, FrameDisconnect, FramePreference, FrameSecret:
return true
}
return false
@@ -149,6 +149,8 @@ func (f Frame) Decode() (any, error) {
v = &DisconnectCommand{}
case FramePreference:
v = &PreferenceCommand{}
+ case FrameSecret:
+ v = &SecretCommand{}
case FrameStepActivity:
v = &StepActivityReport{}
case FrameBlob:
@@ -285,6 +287,9 @@ type Hello struct {
// Connections are the accounts the runner holds, per person.
Connections []HeldConnection `json:"connections"`
Versions map[string]string `json:"versions"`
+ // SealKey is the runner's X25519 public key (base64) for sealed
+ // secrets.
+ SealKey string `json:"seal_key"`
// Protocol 2: the protocol the runner speaks (absent: 1), its
// platform, its label (the machine's name), how it confines steps and
// what it can do.
diff --git a/internal/wire/wire_test.go b/internal/wire/wire_test.go
index 3509a112..69ba9bae 100644
--- a/internal/wire/wire_test.go
+++ b/internal/wire/wire_test.go
@@ -73,7 +73,7 @@ func TestParseFrameRefusesUnknownFieldsAndTypes(t *testing.T) {
}
func TestDurableFrames(t *testing.T) {
- for kind, want := range map[string]bool{wire.FrameMessage: true, wire.FrameCancel: true, wire.FrameReply: true, wire.FrameTurn: true, wire.FrameToolCall: true, wire.FrameToolResult: true, wire.FrameActivity: false, wire.FrameDelta: false, wire.FrameHello: false, wire.FrameSync: false, wire.FrameAck: false, wire.FrameWelcome: false, wire.FrameDrain: false, wire.FramePreference: true} {
+ for kind, want := range map[string]bool{wire.FrameMessage: true, wire.FrameCancel: true, wire.FrameReply: true, wire.FrameTurn: true, wire.FrameToolCall: true, wire.FrameToolResult: true, wire.FrameActivity: false, wire.FrameDelta: false, wire.FrameHello: false, wire.FrameSync: false, wire.FrameAck: false, wire.FrameWelcome: false, wire.FrameDrain: false, wire.FramePreference: true, wire.FrameSecret: true} {
if (wire.Frame{Type: kind}).Durable() != want {
t.Fatalf("%s durable=%v", kind, !want)
}
diff --git a/internal/wire/wiretest/fixtures.go b/internal/wire/wiretest/fixtures.go
index 098d16a8..4d5ea6ed 100644
--- a/internal/wire/wiretest/fixtures.go
+++ b/internal/wire/wiretest/fixtures.go
@@ -105,6 +105,8 @@ func APIType(name string) any {
return &wire.Connect{}
case "preferences.json":
return &wire.Preferences{}
+ case "connection-secret.json":
+ return &wire.Sealed{}
case "duplicate-request.json":
return &wire.MarkDuplicate{}
case "housekeeping.json", "housekeeping-paused.json":
diff --git a/internal/wire/wiretest/testdata/api/connection-connecting-codex.json b/internal/wire/wiretest/testdata/api/connection-connecting-codex.json
index e7a5ab9e..9c0241ef 100644
--- a/internal/wire/wiretest/testdata/api/connection-connecting-codex.json
+++ b/internal/wire/wiretest/testdata/api/connection-connecting-codex.json
@@ -1 +1 @@
-{"id":"cn_0002","revision":2,"runner_id":"rn_0001","local_id":"","provider":"codex","kind":"subscription","label":"","state":"connecting","reason":"","plan":"","headroom":null,"prompt":{"kind":"device_code","url":"https://auth.openai.com/codex/device","code":"ABCD-1234"},"created_at":"2026-11-08T10:00:00Z","updated_at":"2026-11-08T10:00:01Z"}
+{"id":"cn_0002","revision":2,"runner_id":"rn_0001","local_id":"","provider":"codex","kind":"subscription","label":"","state":"connecting","reason":"","plan":"","headroom":null,"prompt":{"kind":"device_code","url":"https://auth.openai.com/codex/device","code":"ABCD-1234"},"created_at":"2026-11-08T10:00:00Z","updated_at":"2026-11-08T10:00:01Z","expires_at":null}
diff --git a/internal/wire/wiretest/testdata/api/connection-secret.json b/internal/wire/wiretest/testdata/api/connection-secret.json
new file mode 100644
index 00000000..601ec908
--- /dev/null
+++ b/internal/wire/wiretest/testdata/api/connection-secret.json
@@ -0,0 +1 @@
+{"box":"c2VhbGVkLWJveC1wbGFjZWhvbGRlcg==","runner_id":"rn_0001","connection_id":"cn_0003","provider":"claude","endpoint":"https://api.anthropic.com:443","attempt":1,"expires_at":"2026-11-10T10:10:00Z"}
diff --git a/internal/wire/wiretest/testdata/api/connections.json b/internal/wire/wiretest/testdata/api/connections.json
index a7dbb18d..90bad38c 100644
--- a/internal/wire/wiretest/testdata/api/connections.json
+++ b/internal/wire/wiretest/testdata/api/connections.json
@@ -1 +1 @@
-{"items":[{"id":"cn_0001","revision":4,"runner_id":"rn_0001","local_id":"claude-a","provider":"claude","kind":"subscription","label":"owner@example.com","state":"limited","reason":"","plan":"","headroom":{"utilization":1,"resets_at":"2026-11-10T10:00:00Z","windows":[{"name":"seven_day","used_percent":100,"minutes":10080,"resets_at":"2026-11-10T10:00:00Z"}]},"prompt":null,"created_at":"2026-11-06T09:00:00Z","updated_at":"2026-11-08T09:59:00Z"},{"id":"cn_0002","revision":3,"runner_id":"rn_0001","local_id":"codex-1","provider":"codex","kind":"subscription","label":"owner@example.com","state":"healthy","reason":"","plan":"pro","headroom":{"utilization":0.12,"resets_at":null,"windows":[{"name":"primary","used_percent":12,"minutes":300,"resets_at":"2026-11-08T14:00:00Z"}]},"prompt":null,"created_at":"2026-11-08T10:00:00Z","updated_at":"2026-11-08T10:00:01Z"}]}
+{"items":[{"id":"cn_0001","revision":4,"runner_id":"rn_0001","local_id":"claude-a","provider":"claude","kind":"subscription","label":"owner@example.com","state":"limited","reason":"","plan":"","headroom":{"utilization":1,"resets_at":"2026-11-10T10:00:00Z","windows":[{"name":"seven_day","used_percent":100,"minutes":10080,"resets_at":"2026-11-10T10:00:00Z"}]},"prompt":null,"created_at":"2026-11-06T09:00:00Z","updated_at":"2026-11-08T09:59:00Z","expires_at":null},{"id":"cn_0002","revision":3,"runner_id":"rn_0001","local_id":"codex-1","provider":"codex","kind":"subscription","label":"owner@example.com","state":"healthy","reason":"","plan":"pro","headroom":{"utilization":0.12,"resets_at":null,"windows":[{"name":"primary","used_percent":12,"minutes":300,"resets_at":"2026-11-08T14:00:00Z"}]},"prompt":null,"created_at":"2026-11-08T10:00:00Z","updated_at":"2026-11-08T10:00:01Z","expires_at":null}]}
diff --git a/internal/wire/wiretest/testdata/api/runners.json b/internal/wire/wiretest/testdata/api/runners.json
index 57903a0a..69893278 100644
--- a/internal/wire/wiretest/testdata/api/runners.json
+++ b/internal/wire/wiretest/testdata/api/runners.json
@@ -1 +1 @@
-{"items":[{"id":"RUNNER1","revision":4,"online":true,"label":"docs-t1","role":"primary","since":"2026-11-07T10:12:00Z","platform":{"os":"linux","arch":"amd64"},"capabilities":{"xcode":{"version":"","build":""},"simulators":[],"toolchains":{"go":"go1.26.10","swift":"","node":""},"harness":{"claude":"2.1.312","codex":"","srt":""},"tags":["linux","claude","go"]},"removing":false},{"id":"RUNNER2","revision":2,"online":false,"label":"Tito Studio","role":"worker","since":"2026-11-07T10:12:00Z","platform":{"os":"darwin","arch":"arm64"},"capabilities":{"xcode":{"version":"16.2","build":"16C5032a"},"simulators":[{"name":"iPhone 16 Pro","runtime":"iOS 18.2","udid":"5C0A1E2B-3D4F-4A5B-9C6D-7E8F90A1B2C3","state":"Shutdown"}],"toolchains":{"go":"","swift":"6.0.3","node":"v22.12.0"},"harness":{"claude":"2.1.312","codex":"","srt":"0.0.81"},"tags":["macos","xcode","ios_simulator","claude"]},"removing":false}]}
\ No newline at end of file
+{"items":[{"id":"RUNNER1","revision":4,"online":true,"label":"docs-t1","role":"primary","since":"2026-11-07T10:12:00Z","platform":{"os":"linux","arch":"amd64"},"capabilities":{"xcode":{"version":"","build":""},"simulators":[],"toolchains":{"go":"go1.26.10","swift":"","node":""},"harness":{"claude":"2.1.312","codex":"","srt":""},"tags":["linux","claude","go"]},"removing":false,"seal_key":""},{"id":"RUNNER2","revision":2,"online":false,"label":"Tito Studio","role":"worker","since":"2026-11-07T10:12:00Z","platform":{"os":"darwin","arch":"arm64"},"capabilities":{"xcode":{"version":"16.2","build":"16C5032a"},"simulators":[{"name":"iPhone 16 Pro","runtime":"iOS 18.2","udid":"5C0A1E2B-3D4F-4A5B-9C6D-7E8F90A1B2C3","state":"Shutdown"}],"toolchains":{"go":"","swift":"6.0.3","node":"v22.12.0"},"harness":{"claude":"2.1.312","codex":"","srt":"0.0.81"},"tags":["macos","xcode","ios_simulator","claude"]},"removing":false,"seal_key":""}]}
diff --git a/internal/wire/wiretest/testdata/api/snapshot.json b/internal/wire/wiretest/testdata/api/snapshot.json
index b918c4dd..7410c07f 100644
--- a/internal/wire/wiretest/testdata/api/snapshot.json
+++ b/internal/wire/wiretest/testdata/api/snapshot.json
@@ -1 +1 @@
-{"me":{"id":"owner@example.com","address":"owner@example.com","role":"owner","person":{"address":"owner@example.com","display_identity":"owner@example.com","active":true,"role":"owner"},"team_id":"TEAM1","team_name":"Example","revision":1},"messages":[{"id":"m_0001","revision":1,"role":"person","text":"hello","turn_id":"t_0001","created_at":"2026-11-06T10:00:00Z","switched":null}],"turns":[{"id":"t_0001","revision":2,"kind":"","state":"running","reason":"","attempt":1,"message_ids":["m_0001"],"reply_id":"","connection":"","created_at":"2026-11-06T10:00:00Z","updated_at":"2026-11-06T10:00:01Z","timing":null}],"runner":{"id":"RUNNER1","revision":3,"online":true,"label":"docs-t1","role":"primary","since":"2026-11-07T10:12:00Z","platform":null,"capabilities":null,"removing":false},"projects":[{"id":"p_0001","revision":1,"repo":"amadan.net/oficina/sample","name":"oficina/sample","title":"Sample","attachments":[{"kind":"repo","ref":"amadan.net/oficina/sample","name":"oficina/sample","default_branch":"main","head_sha":"3333333333333333333333333333333333333333","head_subject":"Swipe from the edge goes back","head_at":"2026-11-07T09:30:00Z"}],"state":"active","added_by":"owner@example.com","created_at":"2026-11-06T10:00:00Z","updated_at":"2026-11-06T10:00:00Z","description":"A sample app for Equipo tests.","stack":["Go"],"checks":{"here":true,"gate":"make ci","reason":""},"people":[{"address":"owner@example.com","name":"Owner","initials":"O"}]}],"cards":[{"id":"c_0001","revision":1,"kind":"project","state":"added","turn_id":"t_0001","project_id":"p_0001","name":"oficina/sample","question":"","options":[],"choice":"","task_id":"","created_at":"2026-11-06T10:00:00Z","updated_at":"2026-11-06T10:00:00Z"}],"tasks":[],"coordinator":{"id":"owner@example.com","revision":2,"state":"ready","turn_id":"","moved_in_at":"2026-11-06T09:59:00Z"},"connections":null,"housekeeping_summary":{"open_suggestions":0,"paused":false,"disabled":[],"revision":0},"cursor":40,"runners":[{"id":"RUNNER1","revision":3,"online":true,"label":"docs-t1","role":"primary","since":"2026-11-07T10:12:00Z","platform":null,"capabilities":null,"removing":false}]}
\ No newline at end of file
+{"me":{"id":"owner@example.com","address":"owner@example.com","role":"owner","person":{"address":"owner@example.com","display_identity":"owner@example.com","active":true,"role":"owner"},"team_id":"TEAM1","team_name":"Example","revision":1},"messages":[{"id":"m_0001","revision":1,"role":"person","text":"hello","turn_id":"t_0001","created_at":"2026-11-06T10:00:00Z","switched":null}],"turns":[{"id":"t_0001","revision":2,"kind":"","state":"running","reason":"","attempt":1,"message_ids":["m_0001"],"reply_id":"","connection":"","created_at":"2026-11-06T10:00:00Z","updated_at":"2026-11-06T10:00:01Z","timing":null}],"runner":{"id":"RUNNER1","revision":3,"online":true,"label":"docs-t1","role":"primary","since":"2026-11-07T10:12:00Z","platform":null,"capabilities":null,"removing":false,"seal_key":""},"projects":[{"id":"p_0001","revision":1,"repo":"amadan.net/oficina/sample","name":"oficina/sample","title":"Sample","attachments":[{"kind":"repo","ref":"amadan.net/oficina/sample","name":"oficina/sample","default_branch":"main","head_sha":"3333333333333333333333333333333333333333","head_subject":"Swipe from the edge goes back","head_at":"2026-11-07T09:30:00Z"}],"state":"active","added_by":"owner@example.com","created_at":"2026-11-06T10:00:00Z","updated_at":"2026-11-06T10:00:00Z","description":"A sample app for Equipo tests.","stack":["Go"],"checks":{"here":true,"gate":"make ci","reason":""},"people":[{"address":"owner@example.com","name":"Owner","initials":"O"}]}],"cards":[{"id":"c_0001","revision":1,"kind":"project","state":"added","turn_id":"t_0001","project_id":"p_0001","name":"oficina/sample","question":"","options":[],"choice":"","task_id":"","created_at":"2026-11-06T10:00:00Z","updated_at":"2026-11-06T10:00:00Z"}],"tasks":[],"coordinator":{"id":"owner@example.com","revision":2,"state":"ready","turn_id":"","moved_in_at":"2026-11-06T09:59:00Z"},"connections":null,"housekeeping_summary":{"open_suggestions":0,"paused":false,"disabled":[],"revision":0},"cursor":40,"runners":[{"id":"RUNNER1","revision":3,"online":true,"label":"docs-t1","role":"primary","since":"2026-11-07T10:12:00Z","platform":null,"capabilities":null,"removing":false,"seal_key":""}]}
diff --git a/internal/wire/wiretest/testdata/frames/hello-mac-probes.json b/internal/wire/wiretest/testdata/frames/hello-mac-probes.json
index 49ea79a4..924a62a9 100644
--- a/internal/wire/wiretest/testdata/frames/hello-mac-probes.json
+++ b/internal/wire/wiretest/testdata/frames/hello-mac-probes.json
@@ -1 +1 @@
-{"id":"r-hello-mac-probes","type":"hello","data":{"generation":3,"repos":[],"create_in":[],"home":"","agent":"","catalog":[],"connections":[],"versions":{"claude":"2.1.312","runner":"5eae410"},"protocol":2,"platform":{"os":"darwin","arch":"arm64"},"label":"Tito Studio","sandbox":"none","capabilities":{"xcode":{"version":"16.2","build":"16C5032a"},"simulators":[{"name":"iPhone 16 Pro","runtime":"iOS 18.2","udid":"5C0A1E2B-3D4F-4A5B-9C6D-7E8F90A1B2C3","state":"Shutdown"}],"toolchains":{"go":"go1.26.10","swift":"6.0.3","node":"v22.12.0"},"harness":{"claude":"2.1.312","codex":"","srt":"0.0.81"},"tags":["macos","xcode","ios_simulator"],"probes":[{"id":"P1","verdict":"passed","detail":"Xcode 16.2 (16C5032a); 6 iOS simulators; Tito Studio"},{"id":"P2","verdict":"failed","detail":"allowed: script.keychain plugin.keychain test.keychain; Unix permissions only: script.home plugin.home test.home; xcodebuild ran in srt"},{"id":"P3","verdict":"skipped","detail":"sign-in needs a person (slice F); keychain from the sandbox: allowed"},{"id":"P4","verdict":"passed","detail":"no other home readable; agent loaded; sleep off on power"},{"id":"P5","verdict":"skipped","detail":"Codex on the Mac is parked (slice G)"},{"id":"P6","verdict":"passed","detail":"group gone in 2s; 0 marked left; 1 simulator shut down; tree removed"},{"id":"P7","verdict":"passed","detail":"srt 0.0.81; node v22.12.0; rg 14.1.1"}]}}}
\ No newline at end of file
+{"id":"r-hello-mac-probes","type":"hello","data":{"generation":3,"repos":[],"create_in":[],"home":"","agent":"","catalog":[],"connections":[],"versions":{"claude":"2.1.312","runner":"5eae410"},"seal_key":"","protocol":2,"platform":{"os":"darwin","arch":"arm64"},"label":"Tito Studio","sandbox":"none","capabilities":{"xcode":{"version":"16.2","build":"16C5032a"},"simulators":[{"name":"iPhone 16 Pro","runtime":"iOS 18.2","udid":"5C0A1E2B-3D4F-4A5B-9C6D-7E8F90A1B2C3","state":"Shutdown"}],"toolchains":{"go":"go1.26.10","swift":"6.0.3","node":"v22.12.0"},"harness":{"claude":"2.1.312","codex":"","srt":"0.0.81"},"tags":["macos","xcode","ios_simulator"],"probes":[{"id":"P1","verdict":"passed","detail":"Xcode 16.2 (16C5032a); 6 iOS simulators; Tito Studio"},{"id":"P2","verdict":"failed","detail":"allowed: script.keychain plugin.keychain test.keychain; Unix permissions only: script.home plugin.home test.home; xcodebuild ran in srt"},{"id":"P3","verdict":"skipped","detail":"sign-in needs a person (slice F); keychain from the sandbox: allowed"},{"id":"P4","verdict":"passed","detail":"no other home readable; agent loaded; sleep off on power"},{"id":"P5","verdict":"skipped","detail":"Codex on the Mac is parked (slice G)"},{"id":"P6","verdict":"passed","detail":"group gone in 2s; 0 marked left; 1 simulator shut down; tree removed"},{"id":"P7","verdict":"passed","detail":"srt 0.0.81; node v22.12.0; rg 14.1.1"}]}}}
diff --git a/internal/wire/wiretest/testdata/frames/hello-mac.json b/internal/wire/wiretest/testdata/frames/hello-mac.json
index fd542107..63aad162 100644
--- a/internal/wire/wiretest/testdata/frames/hello-mac.json
+++ b/internal/wire/wiretest/testdata/frames/hello-mac.json
@@ -1 +1 @@
-{"id":"r-hello-mac","type":"hello","data":{"generation":3,"repos":[],"create_in":[],"home":"","agent":"","catalog":[],"connections":[],"versions":{"claude":"2.1.312","runner":"5eae410"},"protocol":2,"platform":{"os":"darwin","arch":"arm64"},"label":"Tito Studio","sandbox":"seatbelt","capabilities":{"xcode":{"version":"16.2","build":"16C5032a"},"simulators":[{"name":"iPhone 16 Pro","runtime":"iOS 18.2","udid":"5C0A1E2B-3D4F-4A5B-9C6D-7E8F90A1B2C3","state":"Shutdown"}],"toolchains":{"go":"go1.26.10","swift":"6.0.3","node":"v22.12.0"},"harness":{"claude":"2.1.312","codex":"","srt":"0.0.81"},"tags":["macos","xcode","ios_simulator","claude"]}}}
\ No newline at end of file
+{"id":"r-hello-mac","type":"hello","data":{"generation":3,"repos":[],"create_in":[],"home":"","agent":"","catalog":[],"connections":[],"versions":{"claude":"2.1.312","runner":"5eae410"},"seal_key":"","protocol":2,"platform":{"os":"darwin","arch":"arm64"},"label":"Tito Studio","sandbox":"seatbelt","capabilities":{"xcode":{"version":"16.2","build":"16C5032a"},"simulators":[{"name":"iPhone 16 Pro","runtime":"iOS 18.2","udid":"5C0A1E2B-3D4F-4A5B-9C6D-7E8F90A1B2C3","state":"Shutdown"}],"toolchains":{"go":"go1.26.10","swift":"6.0.3","node":"v22.12.0"},"harness":{"claude":"2.1.312","codex":"","srt":"0.0.81"},"tags":["macos","xcode","ios_simulator","claude"]}}}
diff --git a/internal/wire/wiretest/testdata/frames/hello.json b/internal/wire/wiretest/testdata/frames/hello.json
index 32ea6d45..17d4faa4 100644
--- a/internal/wire/wiretest/testdata/frames/hello.json
+++ b/internal/wire/wiretest/testdata/frames/hello.json
@@ -1 +1 @@
-{"id":"r-hello-1","type":"hello","data":{"generation":3,"repos":["amadan.net/oficina/sample"],"create_in":["oficina"],"home":"","agent":"equipo-docs-t1","catalog":[{"repo":"amadan.net/oficina/sample","default_branch":"main","summary":"A sample app for Equipo tests.","names":["Sample","Woodstar"],"hints":["go"],"updated_at":"2026-11-06T09:00:00Z","head_sha":"3333333333333333333333333333333333333333","head_subject":"Swipe from the edge goes back","gate":"make ci","checks_reason":""}],"connections":[{"local_id":"claude-a","person":"owner@example.com","provider":"claude","kind":"subscription","label":"owner@example.com","state":"healthy","plan":"","headroom":null}],"versions":{"claude":"2.1.312","runner":"5eae410"}}}
+{"id":"r-hello-1","type":"hello","data":{"generation":3,"repos":["amadan.net/oficina/sample"],"create_in":["oficina"],"home":"","agent":"equipo-docs-t1","catalog":[{"repo":"amadan.net/oficina/sample","default_branch":"main","summary":"A sample app for Equipo tests.","names":["Sample","Woodstar"],"hints":["go"],"updated_at":"2026-11-06T09:00:00Z","head_sha":"3333333333333333333333333333333333333333","head_subject":"Swipe from the edge goes back","gate":"make ci","checks_reason":""}],"connections":[{"local_id":"claude-a","person":"owner@example.com","provider":"claude","kind":"subscription","label":"owner@example.com","state":"healthy","plan":"","headroom":null,"expires_at":null}],"versions":{"claude":"2.1.312","runner":"5eae410"},"seal_key":""}}
diff --git a/internal/wire/wiretest/testdata/frames/secret.json b/internal/wire/wiretest/testdata/frames/secret.json
new file mode 100644
index 00000000..abc32992
--- /dev/null
+++ b/internal/wire/wiretest/testdata/frames/secret.json
@@ -0,0 +1 @@
+{"id":"c45","type":"secret","data":{"connection":"cn_0003","person":"owner@example.com","sealed":{"box":"c2VhbGVkLWJveC1wbGFjZWhvbGRlcg==","runner_id":"rn_0001","connection_id":"cn_0003","provider":"claude","endpoint":"https://api.anthropic.com:443","attempt":1,"expires_at":"2026-11-10T10:10:00Z"}}}
diff --git a/internal/wire/wiretest/testdata/frames/sync.json b/internal/wire/wiretest/testdata/frames/sync.json
index 676d2ce2..ca1757e7 100644
--- a/internal/wire/wiretest/testdata/frames/sync.json
+++ b/internal/wire/wiretest/testdata/frames/sync.json
@@ -1 +1 @@
-{"id":"r-sync-1","type":"sync","data":{"sessions":[{"person":"owner@example.com","provider":"claude","account":"claude-a","session_id":"00000000-0000-4000-8000-000000000001","last_turn":"t_0001"}],"runs":[{"turn_id":"t_0001","attempt":1,"state":"running"}],"steps":[{"task_id":"tk0001","step_id":"s_0001","attempt":1,"state":"running","candidate_sha":""}],"asks":[{"question_id":"q_0001","attempt":1,"state":"running"}],"connections":[{"local_id":"claude-a","person":"owner@example.com","provider":"claude","kind":"subscription","label":"owner@example.com","state":"healthy","plan":"","headroom":null}]}}
+{"id":"r-sync-1","type":"sync","data":{"sessions":[{"person":"owner@example.com","provider":"claude","account":"claude-a","session_id":"00000000-0000-4000-8000-000000000001","last_turn":"t_0001"}],"runs":[{"turn_id":"t_0001","attempt":1,"state":"running"}],"steps":[{"task_id":"tk0001","step_id":"s_0001","attempt":1,"state":"running","candidate_sha":""}],"asks":[{"question_id":"q_0001","attempt":1,"state":"running"}],"connections":[{"local_id":"claude-a","person":"owner@example.com","provider":"claude","kind":"subscription","label":"owner@example.com","state":"healthy","plan":"","headroom":null,"expires_at":null}]}}