Skip to content

fix: secure gateway bootstrap and conversation binding#18

Draft
vessenes wants to merge 2 commits into
agent/enforce-governance-quorumfrom
agent/secure-gateway-conversation-binding
Draft

fix: secure gateway bootstrap and conversation binding#18
vessenes wants to merge 2 commits into
agent/enforce-governance-quorumfrom
agent/secure-gateway-conversation-binding

Conversation

@vessenes

@vessenes vessenes commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

What changed

  • require a dedicated bearer secret for POST /v1/promote
  • make the TypeScript client and AIM browser send the configured operator token during promotion
  • keep the AIM promotion token ephemeral: password input, no local-storage persistence, cleared after success
  • validate canonical 32-byte conversation keys and a non-negative safe-integer epoch
  • reject idempotent bootstrap retries whose crypto material differs from durable state
  • require every gate and governance message conv_id to match the durable conversation
  • store vote bodies and make scanners fail closed on legacy/bodyless or cross-conversation votes
  • configure the promotion token in deploy automation, docs, and the local integration harness

Why

The public bootstrap endpoint was first-writer-wins and unauthenticated. Separately, signed requests and votes could be replayed into another durable conversation because handlers verified their embedded conv_id without comparing it to trusted state.

The original security fix also broke AIM promotion because the browser had no authenticated bootstrap path. This revision adds that path without persisting the operator secret.

Deployment requirement

Create the QNTM_GATEWAY_PROMOTION_TOKEN GitHub Actions secret before merging. The workflow installs it as the GATEWAY_PROMOTION_TOKEN Worker secret.

Validation

  • gateway worker: 66 tests and typecheck
  • client: 191 tests, build, and publish tarball verification
  • AIM UI: 49 tests and production build
  • model integration: 24 tests
  • downstream PR Add cross-surface UI acceptance gate #22: 13/13 real-service browser/CLI/TUI/gateway/relay scenarios
  • Proofshot: required/disabled token state and masked ready state; 0 console/server errors

Stack

This PR targets PR #16. PR #17 and PR #22 are stacked above it so #22 tests the exact combined security tree.

@vessenes
vessenes force-pushed the agent/secure-gateway-conversation-binding branch from 1a46b01 to a379182 Compare July 21, 2026 02:32
@vessenes
vessenes changed the base branch from main to agent/enforce-governance-quorum July 21, 2026 02:33
@vessenes
vessenes force-pushed the agent/enforce-governance-quorum branch from 597b9df to b823c77 Compare July 21, 2026 02:34
@vessenes
vessenes force-pushed the agent/secure-gateway-conversation-binding branch from a379182 to fd177c2 Compare July 21, 2026 02:34
@vessenes
vessenes force-pushed the agent/enforce-governance-quorum branch from b823c77 to 67d1d13 Compare July 21, 2026 02:39
@vessenes
vessenes force-pushed the agent/secure-gateway-conversation-binding branch from fd177c2 to 068ef2e Compare July 21, 2026 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant