From 87b314df6d147ecfa15e2b9805c001f048de9a69 Mon Sep 17 00:00:00 2001 From: Nikhil Unni Date: Wed, 2 Dec 2026 12:43:13 -0800 Subject: [PATCH 1/2] feat(helm): add a dedicated connection-broker bearer secret value The coordinator sends ENGRAM_CONNECTION_BROKER_BEARER to the orchestrator's connection credential broker. The chart took it from the CONTROL_PLANE_BEARER key and could not set the orchestrator's CONNECTION_BROKER_BEARER, so every chart deployment used the control-plane bearer for the broker. `orchestrator.connectionBrokerSecret` (`existingSecret`, `key`) now feeds both variables from one Secret key, so they always match. When `existingSecret` is empty, the render is the same as before: the coordinator reads the CONTROL_PLANE_BEARER key, and the orchestrator env omits CONNECTION_BROKER_BEARER and falls back. This is the expand step; a later release makes the dedicated secret required. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 4 ++++ deploy/helm/engram/templates/deployment.yaml | 16 ++++++++++++---- .../templates/orchestrator-deployment.yaml | 11 +++++++++++ deploy/helm/engram/values.yaml | 14 ++++++++++++++ docs/deploy.md | 1 + .../content/docs/docs/reference/configuration.md | 1 + .../content/docs/docs/reference/helm-engram.md | 2 +- 7 files changed, 44 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91e1ba4ff..76c766f2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,10 @@ starts with **Upgrade notes**: read them before you upgrade. The upgrade procedu - A session that spawns a child session gets a new prompt when the child finishes a turn. The prompt carries the child's outcome and its last message, so the parent does not have to poll for it. ([#1825]) +- The Helm value `orchestrator.connectionBrokerSecret` (`existingSecret`, `key`) gives the + connection credential broker its own bearer. The chart sets it on the coordinator and the + orchestrator. Unset, nothing changes: the broker uses the control-plane bearer. Set it + now: a later release will require it. ### Fixed diff --git a/deploy/helm/engram/templates/deployment.yaml b/deploy/helm/engram/templates/deployment.yaml index b5be3280c..e994a0452 100644 --- a/deploy/helm/engram/templates/deployment.yaml +++ b/deploy/helm/engram/templates/deployment.yaml @@ -146,13 +146,21 @@ spec: key: {{ $agKey }} {{- end }} {{- if .Values.web.enabled }} - # ADR 0109: host-only bearer for coordinator calls to the connection - # credential broker. It must match the orchestrator's validated bearer. + # ADR 0109: the bearer for coordinator calls to the connection + # credential broker. It must match the orchestrator's broker bearer + # (orchestrator-deployment.yaml reads the same Secret key). - name: ENGRAM_CONNECTION_BROKER_BEARER valueFrom: secretKeyRef: - name: {{ .Values.orchestrator.databaseSecret.existingSecret }} - key: {{ .Values.orchestrator.databaseSecret.bearerKey }} + {{- with .Values.orchestrator.connectionBrokerSecret }} + {{- if .existingSecret }} + name: {{ .existingSecret }} + key: {{ .key }} + {{- else }} + name: {{ $.Values.orchestrator.databaseSecret.existingSecret }} + key: {{ $.Values.orchestrator.databaseSecret.bearerKey }} + {{- end }} + {{- end }} {{- end }} {{- if eq .Values.forge.provider "github" }} # ADR 0023: the GitHub App private key (PEM). The coord reads diff --git a/deploy/helm/engram/templates/orchestrator-deployment.yaml b/deploy/helm/engram/templates/orchestrator-deployment.yaml index 0889f6c9c..b627db311 100644 --- a/deploy/helm/engram/templates/orchestrator-deployment.yaml +++ b/deploy/helm/engram/templates/orchestrator-deployment.yaml @@ -76,6 +76,17 @@ spec: secretKeyRef: name: {{ .Values.orchestrator.databaseSecret.existingSecret }} key: {{ .Values.orchestrator.databaseSecret.bearerKey }} + {{- with .Values.orchestrator.connectionBrokerSecret }} + {{- if .existingSecret }} + # Unset, the orchestrator's broker falls back to CONTROL_PLANE_BEARER, + # which is also what the coordinator then sends. + - name: CONNECTION_BROKER_BEARER + valueFrom: + secretKeyRef: + name: {{ .existingSecret }} + key: {{ .key }} + {{- end }} + {{- end }} - name: BETTER_AUTH_SECRET valueFrom: secretKeyRef: diff --git a/deploy/helm/engram/values.yaml b/deploy/helm/engram/values.yaml index c258ab9aa..71d099243 100644 --- a/deploy/helm/engram/values.yaml +++ b/deploy/helm/engram/values.yaml @@ -508,6 +508,20 @@ orchestrator: bearerKey: CONTROL_PLANE_BEARER authSecretKey: BETTER_AUTH_SECRET + # The bearer the coordinator presents to the orchestrator's connection + # credential broker. The chart gives the same Secret key to the coordinator + # (ENGRAM_CONNECTION_BROKER_BEARER) and the orchestrator + # (CONNECTION_BROKER_BEARER), so the two always match. + # - Default (existingSecret: ""): the broker uses CONTROL_PLANE_BEARER + # (databaseSecret.bearerKey above), and the orchestrator env omits + # CONNECTION_BROKER_BEARER. + # - Set existingSecret to a Secret that holds a DEDICATED random value + # under `key`, so a holder of the control-plane bearer cannot mint + # connection credentials. A later release requires this secret. + connectionBrokerSecret: + existingSecret: "" + key: CONNECTION_BROKER_BEARER + # ADR 0051: the orchestrator KEK-envelope-seals `user_session_secrets` at rest # (the user's harness tokens, e.g. CLAUDE_CODE_OAUTH_TOKEN) using the SAME # 32-byte key + envelope format as the coordinator's `kek.provider: env-var` diff --git a/docs/deploy.md b/docs/deploy.md index 16fd58f13..df8cd092d 100644 --- a/docs/deploy.md +++ b/docs/deploy.md @@ -92,6 +92,7 @@ lands where. | `ENGRAM_GCP_PROJECT_ID` | gcp secrets backend: the Secret Manager project | | `ENGRAM_CHUNK_GC_INTERVAL_SECS` / `ENGRAM_CHUNK_GC_RETAIN_SECS` | chunk-GC cadence / unreferenced retention | | `ENGRAM_APP_GRPC_TOKENS` | The orchestrator's bearer (fail-closed when empty) | +| `ENGRAM_CONNECTION_BROKER_BEARER` | The bearer for calls to the orchestrator's connection credential broker. Must match the orchestrator's `CONNECTION_BROKER_BEARER`. The chart reads both from `orchestrator.connectionBrokerSecret`; unset, both use `CONTROL_PLANE_BEARER` | Cloud credentials are ambient: GKE Workload Identity / EKS IRSA on the coordinator's ServiceAccount — no key files. diff --git a/site/src/content/docs/docs/reference/configuration.md b/site/src/content/docs/docs/reference/configuration.md index 118cdd98d..c65072d71 100644 --- a/site/src/content/docs/docs/reference/configuration.md +++ b/site/src/content/docs/docs/reference/configuration.md @@ -15,6 +15,7 @@ where, for anyone reading a manifest or running a component outside the charts. | `DATABASE_URL` | Postgres connection string, from the coordinator's Secret. | | `ENGRAM_AUTH_TOKENS` | Comma-separated bearer tokens that hosts and the orchestrator present. | | `ENGRAM_APP_GRPC_TOKENS` | The orchestrator's bearer for the coordinator's private RPC port. Empty means every call is refused. | +| `ENGRAM_CONNECTION_BROKER_BEARER` | The bearer the coordinator sends to the orchestrator's connection credential broker. It must match the orchestrator's `CONNECTION_BROKER_BEARER`. When the orchestrator has no `CONNECTION_BROKER_BEARER`, it accepts its control-plane bearer here. | | `ENGRAM_BLOB_BACKEND` | `gcs`, `s3`, or `local` for development. | | `ENGRAM_GCS_BUCKET` | With `gcs`: the chunks bucket. | | `ENGRAM_S3_BUCKET`, `ENGRAM_S3_REGION`, `ENGRAM_S3_ENDPOINT_URL` | With `s3`: the bucket, the signing region, and an optional endpoint for S3-compatible stores such as MinIO or R2, which switches the client to path-style addressing. | diff --git a/site/src/content/docs/docs/reference/helm-engram.md b/site/src/content/docs/docs/reference/helm-engram.md index bf35c33f0..673c65ccc 100644 --- a/site/src/content/docs/docs/reference/helm-engram.md +++ b/site/src/content/docs/docs/reference/helm-engram.md @@ -94,7 +94,7 @@ at boot. | `upgradeDrain` | The job that runs before an upgrade whose host agents cannot adopt the VMs running now: whether it runs and its time budget. It runs the coordinator image. See [Upgrade engrams](../../guides/upgrade/#when-a-release-changes-how-hosts-run-vms). | | `probes`, `drainSeconds`, `terminationGracePeriodSeconds` | Liveness on `/healthz`, readiness on `/readyz`, and how long a replica drains before it stops. | | `web` | The dashboard: image, Ingress, and the annotations that attach a managed certificate. | -| `orchestrator` | The orchestrator: image, its Secret with the session-signing key, `auth` (see [Sign-in](#sign-in)), the public URL, and integration settings. | +| `orchestrator` | The orchestrator: image, its Secret with the session-signing key, `auth` (see [Sign-in](#sign-in)), the public URL, and integration settings. `connectionBrokerSecret` names a Secret and key with a dedicated bearer for the connection credential broker; the chart gives it to the coordinator and the orchestrator. Unset, the broker uses the control-plane bearer. | ## Upgrades From 6826d55860658f5e326edd7c0eec734d67155b59 Mon Sep 17 00:00:00 2001 From: Nikhil Unni Date: Wed, 2 Dec 2026 12:43:46 -0800 Subject: [PATCH 2/2] docs(changelog): link the connection-broker secret entry to its pull request Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 76c766f2c..de6be7cee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,7 +46,7 @@ starts with **Upgrade notes**: read them before you upgrade. The upgrade procedu - The Helm value `orchestrator.connectionBrokerSecret` (`existingSecret`, `key`) gives the connection credential broker its own bearer. The chart sets it on the coordinator and the orchestrator. Unset, nothing changes: the broker uses the control-plane bearer. Set it - now: a later release will require it. + now: a later release will require it. ([#1859]) ### Fixed @@ -454,3 +454,4 @@ The first tagged release. See the [#1825]: https://github.com/cortexapps/engrams/pull/1825 [#1826]: https://github.com/cortexapps/engrams/pull/1826 [#1849]: https://github.com/cortexapps/engrams/pull/1849 +[#1859]: https://github.com/cortexapps/engrams/pull/1859