From 0033208fd48e81d721e2e580063a66469f180b4e Mon Sep 17 00:00:00 2001 From: Barak Korren Date: Wed, 4 Nov 2026 13:04:20 +0200 Subject: [PATCH 1/4] docs(adr): define named secret connections Record reusable named connections, explicit kinds, Vault defaults, and per-secret connection selection. Signed-off-by: Barak Korren Assisted-by: Codex (gpt-6) --- ...5-configure-vault-backed-runner-secrets.md | 189 ++++++++++++++++++ docs/architecture.md | 15 +- docs/problems/agent-infrastructure.md | 2 +- docs/problems/security-threat-model.md | 2 +- 4 files changed, 202 insertions(+), 6 deletions(-) create mode 100644 docs/ADRs/0155-configure-vault-backed-runner-secrets.md diff --git a/docs/ADRs/0155-configure-vault-backed-runner-secrets.md b/docs/ADRs/0155-configure-vault-backed-runner-secrets.md new file mode 100644 index 0000000000..3264377210 --- /dev/null +++ b/docs/ADRs/0155-configure-vault-backed-runner-secrets.md @@ -0,0 +1,189 @@ +--- +title: "155. Select native or Vault sources for runner secrets" +status: Accepted +relates_to: + - agent-infrastructure + - security-threat-model +topics: + - secrets + - configuration + - workload-identity +--- + +# 155. Select native or Vault sources for runner secrets + +Date: 2026-11-03 + +## Status + +Accepted + +## Context + +Fullsend reads selected long-lived credentials in the runner process, including +Jira credentials, OTLP collector headers, and the optional GitHub bundle for +host-side scripts. Today these values come from forge-native secrets or +variables, or from the local process environment. [ADR 0136](0136-runner-secrets-through-one-stored-secret.md) +records the GitHub bundle and anticipates an external secret manager accessed +with the job's OIDC identity. + +Copying a long-lived value into each repository's forge secret store is +unnecessary when the organization already operates a central secret manager. +Repository-shared configuration also needs to select different Vault paths for +different target repositories. This ADR aims to let trusted runner code resolve +selected user-managed secrets from HashiCorp Vault through workload identity, +while retaining native delivery by default and keeping resolved values out of +agent sandboxes. + +## Options + +1. **Keep forge-native storage only.** This preserves the current delivery + model, but each repository must continue to maintain its own copy of every + selected long-lived value. +2. **Choose one secret store for an installation.** This simplifies + configuration, but forces all secrets into one backend even when some + should remain forge-native. +3. **Define named connections to secret stores and select one for each + secret.** This lets multiple secrets reuse one Vault endpoint and + authentication setup, while a shared configuration layer can route + selected values to Vault and leave the rest on the existing native source. + +## Decision + +We adopt named connections to secret stores in layered configuration. Each +connection names a service kind and its connection settings; a secret selects +the named connection it uses. This lets multiple secrets share one Vault +configuration without adding a long-lived Vault credential to a forge. + +The top-level `connections` mapping names reusable connections to secret +services. Each entry has a required `kind` that identifies the service. The +top-level `secrets` mapping names a registered Fullsend runner secret and +selects a connection. A Vault configuration has this shape: + +```yaml +connections: + vault: + kind: vault + vault_address: https://vault.example.com + vault_auth_path: jwt + vault_role: fullsend-runner + vault_audience: https://fullsend.sh/vault + +secrets: + JIRA_TOKEN: + connection: vault + vault_secrets: + - kv/data/fullsend/{{repo.owner}}/{{repo.name}}/jira + - kv/data/fullsend/{{repo.owner}}/shared/jira +``` + +- A connection name, such as `vault`, is an arbitrary alias. Each declared + connection must specify `kind`; there is no default and Fullsend does not + infer it from the connection name. `kind` identifies the secret service and + how Fullsend connects to it. V1 defines `kind: vault`; unknown or missing + kinds fail closed. Additional kinds can be added without changing the + `secrets` shape. `native` is a reserved built-in connection name and cannot + be declared under `connections`. +- `vault_address` is required for a Vault connection, is the Vault API base + URL, and must use HTTPS. `vault_namespace` is optional and selects a Vault + Enterprise namespace. `vault_auth_path` is optional and defaults to `jwt`; + it names the mount path of the JWT auth method, without the `auth/` prefix. + `vault_role` defaults to `fullsend-runner`, and `vault_audience` defaults to + `https://fullsend.sh/vault`. These defaults may be overridden for a Vault + deployment that uses different names or audiences. Vault-specific connection + fields are valid only when `kind: vault`. +- `secrets..connection` selects a named entry from `connections`. If it + is omitted, the secret continues to use the forge-native source. The + built-in connection name `native` may be used to select that source + explicitly; it does not need a declaration under `connections`. + References to undeclared connection names are configuration errors. +- `vault_secrets` is valid only when the selected connection has `kind: vault` + and must be a non-empty ordered list of Vault logical paths. A Vault KV + record supplies the value from the field named for the configured Fullsend + secret, such as `JIRA_TOKEN`. +- Fullsend requests the job's OIDC token for `vault_audience` and submits it to + the configured JWT auth mount and role (including the default role when + omitted). The audience must match a `bound_audiences` value on that Vault + role. The role must be configured in Vault to bind the expected issuer and + trusted repository/workflow identity, and to issue a short-lived token + limited to the required secret paths. The defaults do not grant access; + Vault's role and policy remain the authorization boundary. +- Fullsend tries candidates in order. A missing path, a path denied by the + Vault policy, or a record without the named field advances to the next + candidate. The first readable candidate containing a non-empty string wins. + Vault authentication, transport, and server errors fail the resolution + immediately. If no candidate supplies a value, the run fails; it does not + fall back to the forge-native value. +- Configuration layers merge `connections` by connection name and `secrets` + by secret name. A more-specific definition replaces the entire matching + entry; fields within that entry and Vault candidate lists are not merged. + This keeps connection identity and secret-path precedence explicit. + +Service-specific endpoint and authentication fields live on the connection; +secret locators, such as `vault_secrets`, live on each secret entry. Future +secret services can add their own connection kinds and fields without +changing the top-level `connections` and `secrets` shape. Connection settings +must come from trusted configuration: the job's OIDC token is a bearer +credential, and Fullsend must not send it to an address selected by untrusted +PR-head or event-provided configuration. The Vault address must also pass +deployment egress policy. Fullsend requests a short-lived Vault token for the +current invocation, reads the configured values, and neither persists that +token nor caches values between invocations. There is no static `VAULT_TOKEN` +or AppRole-secret fallback. + +Vault paths may use `{{forge}}`, `{{repo.host}}`, `{{repo.owner}}`, +`{{repo.name}}`, `{{repo.full_name}}`, and `{{org}}`. `repo.owner` is the +canonical owner or top-level namespace; `repo.full_name` is the canonical +namespace/project path, including nested GitLab groups; `org` is available +only when the target belongs to an organization or group. Values come from the +trusted target-repository context, not PR-head or event-supplied repository +names. Path components are validated before substitution. An unknown or +unavailable variable fails closed before Vault access. The variable syntax is +reserved for path interpolation and is distinct from shell environment +expansion. + +The initial Vault-eligible set is user-managed runner secrets whose lifecycle +Fullsend does not create or rotate: `JIRA_TOKEN`, +`OTEL_EXPORTER_OTLP_HEADERS`, `OTEL_EXPORTER_OTLP_TRACES_HEADERS`, and +`FULLSEND_GITHUB_RUNNER_SECRETS`. The bundle retains the host-side-only, +reference-only rules in ADR 0136 and ADR 0145. Forge CLI authentication such as +`GH_TOKEN` and `GITLAB_TOKEN` remains explicit operator authentication outside +this per-repository configuration. Installer-managed GitLab role, dispatch, +webhook, and trigger credentials remain native in this decision: their +creation and rotation require a write and ownership contract with the selected +secret store. + +Fetched values are scoped to their registered Fullsend consumers. They are not +written into config files, logs, or the agent sandbox. A Vault lookup failure +for a configured Vault source is a hard error rather than a reason to use a +different credential source. + +## Forge scope + +The configuration and connection-selection contract is forge-neutral. Vault +resolution via WIF is supported for GitHub Actions and GitLab CI, using each +platform's job-issued OIDC token and a Vault JWT role configured for that +issuer. The job token's audience must match the configured value; the +Fullsend audience is the default. GitLab workflows must declare an ID token +with the selected audience, because Fullsend cannot change the audience of an +already-issued token. Forgejo remains on `native` until Fullsend has a trusted +Forgejo job OIDC token integration. Local runs use `native` unless a +supported WIF identity is available; they do not accept a static Vault token +as a fallback. + +## Consequences + +- Operators can reuse named connections across runner secrets and + use shared, repository-templated configuration to select per-repository + paths. +- Forge-native storage remains the default, and an explicitly selected Vault + source fails closed rather than silently using a stale native value. +- Vault-backed names in this decision are read-only and user-managed; + installer-generated GitLab credentials stay native until secret-store writes and + their rotation lifecycle are decided. +- Vault availability and WIF policy become run prerequisites for entries that + select Vault, while secret values and Vault tokens are not persisted between + runs. +- New secret services can be added as connection `kind` values with + service-specific configuration; each requires its own authentication, + access-policy, and failure-semantics decision. diff --git a/docs/architecture.md b/docs/architecture.md index 19b5cbc5ab..48135aef99 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -134,10 +134,7 @@ repo baseline and overrides) the sandbox `.env` file from `env.sandbox` at bootstrap. `runner_env` is deprecated ([ADR 0055](ADRs/0055-unified-env-var-delivery.md), amending [ADR 0024](ADRs/0024-harness-definitions.md)). -- Runner secrets on GitHub (interim until external secret manager support - or #6359 settles the long-term route, then kept as the fallback for - workflows without GitHub OIDC or WIF; integrations fullsend owns keep their - own named secrets): user secrets +- Runner secrets on GitHub: user secrets reach host-side scripts through one optional stored secret, `FULLSEND_GITHUB_RUNNER_SECRETS` (a JSON object of name → value), staged by the composite action in a mode 0600 file that @@ -152,6 +149,16 @@ repo baseline and overrides) The refusal does not consult the credential deny-list that the `env.sandbox` gate also checks ([ADR 0145](ADRs/0145-keep-credential-deny-list-out-of-runner-secret-refusal.md)). +- External source selection for user-managed runner secrets is decided but not + yet implemented: named connections under `connections` define service kinds + and settings, while `secrets` entries select a connection (native when + omitted). A Vault connection has an address and JWT role/audience, defaulting + to `fullsend-runner` and `https://fullsend.sh/vault`; secret paths are ordered + and templated from trusted repository context. Vault access uses job + OIDC/WIF, and connection settings must come from trusted configuration. + Native remains the default; + installer-managed GitLab credentials remain native until Vault write and + rotation behavior is decided ([ADR 0155](ADRs/0155-configure-vault-backed-runner-secrets.md)). - Agent configuration env vars: behavioral knobs use `{AGENT}_{SETTING_NAME}` naming (e.g., `REVIEW_SEVERITY_THRESHOLD`), delivered via `env.runner` and `env.sandbox` in the harness YAML. Each agent documents its config vars in diff --git a/docs/problems/agent-infrastructure.md b/docs/problems/agent-infrastructure.md index 731bb5a68f..b5e810d416 100644 --- a/docs/problems/agent-infrastructure.md +++ b/docs/problems/agent-infrastructure.md @@ -123,7 +123,7 @@ Many fullsend scenarios skew toward **ephemeral, task-scoped** execution (triage ## Open questions - What is the right level of isolation per agent (process, container, microVM, separate cluster)? -- How do we provide agents with “resources to do their work” (clone, tools, APIs) without over-privileging them or creating a single high-value target? (Credential access decided in [ADR 0017](../ADRs/0017-credential-isolation-for-sandboxed-agents.md), with [ADR 0092](../ADRs/0092-openai-wif-credential-delivery.md) as the first inference credential delivered entirely through a gateway provider, and [ADR 0137](../ADRs/0137-inference-gateway-credential-route.md) routing inference through an LLM gateway that accepts the job's OIDC token so the forge stores no reusable provider key ([ADR 0138](../ADRs/0138-inference-gateway-api-key-credential-mode.md) adds an opt-in API-key mode for gateways that cannot trust forge OIDC, at the cost of a long-lived secret); tool access restrictions decided in [ADR 0027](../ADRs/0027-allowed-and-disallowed-tools-for-agents.md); cross-org public GitHub Packages access decided in [ADR 0114](../ADRs/0114-github-packages-via-host-bound-workflow-token-provider.md); user secrets for host-side scripts on GitHub decided in [ADR 0136](../ADRs/0136-runner-secrets-through-one-stored-secret.md); other resource access remains open.) +- How do we provide agents with “resources to do their work” (clone, tools, APIs) without over-privileging them or creating a single high-value target? (Credential access decided in [ADR 0017](../ADRs/0017-credential-isolation-for-sandboxed-agents.md), with [ADR 0092](../ADRs/0092-openai-wif-credential-delivery.md) as the first inference credential delivered entirely through a gateway provider, and [ADR 0137](../ADRs/0137-inference-gateway-credential-route.md) routing inference through an LLM gateway that accepts the job's OIDC token so the forge stores no reusable provider key ([ADR 0138](../ADRs/0138-inference-gateway-api-key-credential-mode.md) adds an opt-in API-key mode for gateways that cannot trust forge OIDC, at the cost of a long-lived secret); tool access restrictions decided in [ADR 0027](../ADRs/0027-allowed-and-disallowed-tools-for-agents.md); cross-org public GitHub Packages access decided in [ADR 0114](../ADRs/0114-github-packages-via-host-bound-workflow-token-provider.md); user secrets for host-side scripts on GitHub decided in [ADR 0136](../ADRs/0136-runner-secrets-through-one-stored-secret.md), with source selection for selected runner secrets decided in [ADR 0155](../ADRs/0155-configure-vault-backed-runner-secrets.md); other agent resource access remains open.) - Do we need a dedicated “agent runner” image or environment with a known, auditable tool set? - ~~How do we preserve end-to-end traceability for event-driven agent dispatch in GitHub Actions?~~ Decided in [ADR 0041](../ADRs/0041-synchronous-workflow-call-event-dispatch.md) (synchronous `workflow_call` dispatch for the event path). - How do we compare 3rd party vs internal vs build-our-own on concrete criteria: cost, time to first agent, compliance, and alignment with our security and coordination model? diff --git a/docs/problems/security-threat-model.md b/docs/problems/security-threat-model.md index fa7546288a..d3ff843e00 100644 --- a/docs/problems/security-threat-model.md +++ b/docs/problems/security-threat-model.md @@ -107,7 +107,7 @@ In fullsend's architecture, this is mitigated by several design decisions: agent source arrived through an event or an API ([ADR 0133](../ADRs/0133-actor-attributed-data-security-boundary.md)). - How do we handle the case where legitimate code contains text that looks like prompt injection? (e.g., a test for prompt injection defenses) -- What's the blast radius if an injection succeeds? How do we limit it? (Credential exposure mitigated by keeping credentials out of sandboxes entirely — see [ADR 0017](../ADRs/0017-credential-isolation-for-sandboxed-agents.md); model-provider credentials for runtimes that need one follow the same rule through a run-scoped provider and a placeholder the agent never resolves — see [ADR 0092](../ADRs/0092-openai-wif-credential-delivery.md) and, for codex, [ADR 0099](../ADRs/0099-codex-agent-runtime.md); an inference gateway that accepts the job's OIDC token keeps reusable provider keys off the forge, though the gateway itself becomes a concentrated risk — see [ADR 0137](../ADRs/0137-inference-gateway-credential-route.md); a gateway that cannot trust forge OIDC can instead take an opt-in API key, which relies on a long-lived secret held by the forge — see [ADR 0138](../ADRs/0138-inference-gateway-api-key-credential-mode.md); the Actions workflow token used for GitHub Packages has its *placeholder* bound the same way, resolving only at the two registry hosts; but a value recovered through the registry's error echo is the job's own `GITHUB_TOKEN` and is replayable against whatever hosts the running role's forge profile already allows — read-write for `coder` — see [ADR 0114](../ADRs/0114-github-packages-via-host-bound-workflow-token-provider.md). Tool access limited by `permissions.deny` hard-blocks — see [ADR 0027](../ADRs/0027-allowed-and-disallowed-tools-for-agents.md). User secrets reach only host-side scripts that reference them, never the sandbox — see [ADR 0136](../ADRs/0136-runner-secrets-through-one-stored-secret.md). Other blast radius dimensions remain open.) +- What's the blast radius if an injection succeeds? How do we limit it? (Credential exposure mitigated by keeping credentials out of sandboxes entirely — see [ADR 0017](../ADRs/0017-credential-isolation-for-sandboxed-agents.md); model-provider credentials for runtimes that need one follow the same rule through a run-scoped provider and a placeholder the agent never resolves — see [ADR 0092](../ADRs/0092-openai-wif-credential-delivery.md) and, for codex, [ADR 0099](../ADRs/0099-codex-agent-runtime.md); an inference gateway that accepts the job's OIDC token keeps reusable provider keys off the forge, though the gateway itself becomes a concentrated risk — see [ADR 0137](../ADRs/0137-inference-gateway-credential-route.md); a gateway that cannot trust forge OIDC can instead take an opt-in API key, which relies on a long-lived secret held by the forge — see [ADR 0138](../ADRs/0138-inference-gateway-api-key-credential-mode.md); the Actions workflow token used for GitHub Packages has its *placeholder* bound the same way, resolving only at the two registry hosts; but a value recovered through the registry's error echo is the job's own `GITHUB_TOKEN` and is replayable against whatever hosts the running role's forge profile already allows — read-write for `coder` — see [ADR 0114](../ADRs/0114-github-packages-via-host-bound-workflow-token-provider.md). Tool access limited by `permissions.deny` hard-blocks — see [ADR 0027](../ADRs/0027-allowed-and-disallowed-tools-for-agents.md). User secrets reach only host-side scripts that reference them, never the sandbox — see [ADR 0136](../ADRs/0136-runner-secrets-through-one-stored-secret.md); selected runner secrets can be sourced from Vault through job WIF without changing that boundary — see [ADR 0155](../ADRs/0155-configure-vault-backed-runner-secrets.md). Other blast radius dimensions remain open.) - Should agents operate on Unicode-normalized text with non-rendering characters stripped, or on raw text with a separate detection pass? ([ADR 0133](../ADRs/0133-actor-attributed-data-security-boundary.md) decides that model-bound source content is the filtered representation and that raw text is never exposed; strip versus detect-and-preserve remains deferred to the versioned content-filter contract.) - How do we handle invisible Unicode in code itself (source files, not just metadata)? Some non-rendering characters are legitimate in string literals for internationalization. What heuristics distinguish malicious use from legitimate use? [ADR 0133](../ADRs/0133-actor-attributed-data-security-boundary.md) defines the source-content boundary; code-content handling remains open. From 3fb1c1bbd503aadde0d7f81f93914e4368ac6fab Mon Sep 17 00:00:00 2001 From: Barak Korren Date: Wed, 4 Nov 2026 13:58:36 +0200 Subject: [PATCH 2/4] docs(adr): address Vault secret review feedback Clarify KV v2 paths and fail-closed WIF behavior, use host-qualified repository paths, and preserve native fallback context. Add decision provenance and cross-references. Signed-off-by: Barak Korren Assisted-by: Codex (gpt-6) --- ...unner-secrets-through-one-stored-secret.md | 3 ++ ...5-configure-vault-backed-runner-secrets.md | 48 ++++++++++++------- docs/architecture.md | 15 ++++-- 3 files changed, 43 insertions(+), 23 deletions(-) diff --git a/docs/ADRs/0136-runner-secrets-through-one-stored-secret.md b/docs/ADRs/0136-runner-secrets-through-one-stored-secret.md index e9724998a8..b8a102fe83 100644 --- a/docs/ADRs/0136-runner-secrets-through-one-stored-secret.md +++ b/docs/ADRs/0136-runner-secrets-through-one-stored-secret.md @@ -110,6 +110,9 @@ that receives a value can still leak it. settling #6359, ends the interim role; the stored secret stays as the fallback for workflows that cannot use GitHub OIDC or a WIF provider with the user's secret manager. +- [ADR 0155](0155-configure-vault-backed-runner-secrets.md) decides Vault-backed + source selection for selected long-lived Fullsend runner secrets. It does not + settle the separate custom BYOA secret-handling question tracked in #6359. - An OpenShell provider is not that successor: credential drivers keep copies of values the gateway is given, without reading existing backend secrets ([OpenShell #1931](https://github.com/NVIDIA/OpenShell/issues/1931)), and a diff --git a/docs/ADRs/0155-configure-vault-backed-runner-secrets.md b/docs/ADRs/0155-configure-vault-backed-runner-secrets.md index 3264377210..479d5fd47e 100644 --- a/docs/ADRs/0155-configure-vault-backed-runner-secrets.md +++ b/docs/ADRs/0155-configure-vault-backed-runner-secrets.md @@ -23,9 +23,13 @@ Accepted Fullsend reads selected long-lived credentials in the runner process, including Jira credentials, OTLP collector headers, and the optional GitHub bundle for host-side scripts. Today these values come from forge-native secrets or -variables, or from the local process environment. [ADR 0136](0136-runner-secrets-through-one-stored-secret.md) -records the GitHub bundle and anticipates an external secret manager accessed -with the job's OIDC identity. +variables, or from the local process environment. +Jira runner-secret examples appear in +[ADR 0024](0024-harness-definitions.md). The OpenTelemetry configuration is +recorded in [ADR 0050](0050-distributed-tracing-instrumentation.md). +[ADR 0136](0136-runner-secrets-through-one-stored-secret.md) records the GitHub +bundle and anticipates an external secret manager accessed with the job's OIDC +identity. Copying a long-lived value into each repository's forge secret store is unnecessary when the organization already operates a central secret manager. @@ -73,8 +77,8 @@ secrets: JIRA_TOKEN: connection: vault vault_secrets: - - kv/data/fullsend/{{repo.owner}}/{{repo.name}}/jira - - kv/data/fullsend/{{repo.owner}}/shared/jira + - kv/data/fullsend/repositories/{{repo.host}}/{{repo.full_name}}/jira + - kv/data/fullsend/organizations/{{repo.host}}/{{org}}/shared/jira ``` - A connection name, such as `vault`, is an arbitrary alias. Each declared @@ -98,9 +102,11 @@ secrets: explicitly; it does not need a declaration under `connections`. References to undeclared connection names are configuration errors. - `vault_secrets` is valid only when the selected connection has `kind: vault` - and must be a non-empty ordered list of Vault logical paths. A Vault KV - record supplies the value from the field named for the configured Fullsend - secret, such as `JIRA_TOKEN`. + and must be a non-empty ordered list of Vault KV v2 API read paths, relative + to `/v1/` and including the mount's `/data/` segment (see the + [KV v2 read API](https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v2#read-secret-version)). + Fullsend reads the latest version and takes the field named for the configured + Fullsend secret from the response's `data.data` map, such as `JIRA_TOKEN`. - Fullsend requests the job's OIDC token for `vault_audience` and submits it to the configured JWT auth mount and role (including the default role when omitted). The audience must match a `bound_audiences` value on that Vault @@ -135,12 +141,16 @@ Vault paths may use `{{forge}}`, `{{repo.host}}`, `{{repo.owner}}`, `{{repo.name}}`, `{{repo.full_name}}`, and `{{org}}`. `repo.owner` is the canonical owner or top-level namespace; `repo.full_name` is the canonical namespace/project path, including nested GitLab groups; `org` is available -only when the target belongs to an organization or group. Values come from the -trusted target-repository context, not PR-head or event-supplied repository -names. Path components are validated before substitution. An unknown or -unavailable variable fails closed before Vault access. The variable syntax is -reserved for path interpolation and is distinct from shell environment -expansion. +only when the target belongs to an organization or group. Repository-isolated +paths must include both `repo.host` and `repo.full_name`, preserving every +nested namespace segment. Organization-shared paths use a separate +`organizations/` prefix so they cannot collide with repository paths or a +repository named `shared`. Values come from the trusted target-repository +context, not PR-head or event-supplied repository names. The host is validated +as one path component, and `repo.full_name` is expanded into individually +validated path components. An unknown or unavailable variable fails closed +before Vault access. The variable syntax is reserved for path interpolation +and is distinct from shell environment expansion. The initial Vault-eligible set is user-managed runner secrets whose lifecycle Fullsend does not create or rotate: `JIRA_TOKEN`, @@ -166,10 +176,12 @@ platform's job-issued OIDC token and a Vault JWT role configured for that issuer. The job token's audience must match the configured value; the Fullsend audience is the default. GitLab workflows must declare an ID token with the selected audience, because Fullsend cannot change the audience of an -already-issued token. Forgejo remains on `native` until Fullsend has a trusted -Forgejo job OIDC token integration. Local runs use `native` unless a -supported WIF identity is available; they do not accept a static Vault token -as a fallback. +already-issued token. Forgejo uses `native` when a secret omits its +connection or selects `native`; an explicit Vault selection fails closed until +Fullsend has a trusted Forgejo job OIDC token integration. Local runs likewise +use `native` only when no Vault connection is selected. An explicit Vault +selection without a supported WIF identity fails before any native credential +is read. Local runs do not accept a static Vault token as a fallback. ## Consequences diff --git a/docs/architecture.md b/docs/architecture.md index 48135aef99..3ad0279004 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -134,8 +134,9 @@ repo baseline and overrides) the sandbox `.env` file from `env.sandbox` at bootstrap. `runner_env` is deprecated ([ADR 0055](ADRs/0055-unified-env-var-delivery.md), amending [ADR 0024](ADRs/0024-harness-definitions.md)). -- Runner secrets on GitHub: user secrets - reach host-side scripts through one +- Runner secrets on GitHub: the user-managed bundle is an interim channel for + custom host-side scripts and remains the native fallback for workflows + without GitHub OIDC/WIF. User secrets reach host-side scripts through one optional stored secret, `FULLSEND_GITHUB_RUNNER_SECRETS` (a JSON object of name → value), staged by the composite action in a mode 0600 file that `fullsend run` deletes after reading, and filtered by the resolved @@ -156,9 +157,13 @@ repo baseline and overrides) to `fullsend-runner` and `https://fullsend.sh/vault`; secret paths are ordered and templated from trusted repository context. Vault access uses job OIDC/WIF, and connection settings must come from trusted configuration. - Native remains the default; - installer-managed GitLab credentials remain native until Vault write and - rotation behavior is decided ([ADR 0155](ADRs/0155-configure-vault-backed-runner-secrets.md)). + Native remains the default only when no Vault connection is selected; + an explicit Vault selection fails closed when WIF or Vault resolution is + unavailable. Installer-managed GitLab credentials remain native until Vault + write and rotation behavior is decided + ([ADR 0155](ADRs/0155-configure-vault-backed-runner-secrets.md)). + > **Planned:** Vault-backed resolution is not implemented yet; the existing + > GitHub bundle remains the current native source until it is available. - Agent configuration env vars: behavioral knobs use `{AGENT}_{SETTING_NAME}` naming (e.g., `REVIEW_SEVERITY_THRESHOLD`), delivered via `env.runner` and `env.sandbox` in the harness YAML. Each agent documents its config vars in From 5860bb4fde57a5b672feecdda458da2f8910c38f Mon Sep 17 00:00:00 2001 From: Barak Korren Date: Wed, 4 Nov 2026 14:31:59 +0200 Subject: [PATCH 3/4] docs(adr): polish Vault review updates Reflow the ADR context and label Vault sourcing as target state. Signed-off-by: Barak Korren Assisted-by: Codex (gpt-6) --- .../0155-configure-vault-backed-runner-secrets.md | 13 ++++++------- docs/architecture.md | 6 ++---- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/docs/ADRs/0155-configure-vault-backed-runner-secrets.md b/docs/ADRs/0155-configure-vault-backed-runner-secrets.md index 479d5fd47e..e4e6344a08 100644 --- a/docs/ADRs/0155-configure-vault-backed-runner-secrets.md +++ b/docs/ADRs/0155-configure-vault-backed-runner-secrets.md @@ -23,13 +23,12 @@ Accepted Fullsend reads selected long-lived credentials in the runner process, including Jira credentials, OTLP collector headers, and the optional GitHub bundle for host-side scripts. Today these values come from forge-native secrets or -variables, or from the local process environment. -Jira runner-secret examples appear in -[ADR 0024](0024-harness-definitions.md). The OpenTelemetry configuration is -recorded in [ADR 0050](0050-distributed-tracing-instrumentation.md). -[ADR 0136](0136-runner-secrets-through-one-stored-secret.md) records the GitHub -bundle and anticipates an external secret manager accessed with the job's OIDC -identity. +variables, or from the local process environment. Jira runner-secret examples +are described in [ADR 0024](0024-harness-definitions.md); OpenTelemetry +settings are in [ADR 0050](0050-distributed-tracing-instrumentation.md). +[ADR 0136](0136-runner-secrets-through-one-stored-secret.md) records the +GitHub bundle and anticipates an external secret manager accessed with the +job's OIDC identity. Copying a long-lived value into each repository's forge secret store is unnecessary when the organization already operates a central secret manager. diff --git a/docs/architecture.md b/docs/architecture.md index 3ad0279004..cf3bca4fb9 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -150,8 +150,8 @@ repo baseline and overrides) The refusal does not consult the credential deny-list that the `env.sandbox` gate also checks ([ADR 0145](ADRs/0145-keep-credential-deny-list-out-of-runner-secret-refusal.md)). -- External source selection for user-managed runner secrets is decided but not - yet implemented: named connections under `connections` define service kinds +- External source selection for user-managed runner secrets (target state; not + yet implemented): named connections under `connections` define service kinds and settings, while `secrets` entries select a connection (native when omitted). A Vault connection has an address and JWT role/audience, defaulting to `fullsend-runner` and `https://fullsend.sh/vault`; secret paths are ordered @@ -162,8 +162,6 @@ repo baseline and overrides) unavailable. Installer-managed GitLab credentials remain native until Vault write and rotation behavior is decided ([ADR 0155](ADRs/0155-configure-vault-backed-runner-secrets.md)). - > **Planned:** Vault-backed resolution is not implemented yet; the existing - > GitHub bundle remains the current native source until it is available. - Agent configuration env vars: behavioral knobs use `{AGENT}_{SETTING_NAME}` naming (e.g., `REVIEW_SEVERITY_THRESHOLD`), delivered via `env.runner` and `env.sandbox` in the harness YAML. Each agent documents its config vars in From b08182d6783d568a7d3f718fc94040df24981724 Mon Sep 17 00:00:00 2001 From: Barak Korren Date: Tue, 10 Nov 2026 10:54:16 +0200 Subject: [PATCH 4/4] docs(adr): harden Vault secret configuration Require trusted configuration for secret source selection and validate every Vault path component before access. Signed-off-by: Barak Korren Assisted-by: Codex (gpt-6) --- ...5-configure-vault-backed-runner-secrets.md | 38 +++++++++++++------ docs/architecture.md | 11 ++++-- docs/problems/security-threat-model.md | 2 +- 3 files changed, 35 insertions(+), 16 deletions(-) diff --git a/docs/ADRs/0155-configure-vault-backed-runner-secrets.md b/docs/ADRs/0155-configure-vault-backed-runner-secrets.md index e4e6344a08..7edcc00bbe 100644 --- a/docs/ADRs/0155-configure-vault-backed-runner-secrets.md +++ b/docs/ADRs/0155-configure-vault-backed-runner-secrets.md @@ -123,18 +123,24 @@ secrets: by secret name. A more-specific definition replaces the entire matching entry; fields within that entry and Vault candidate lists are not merged. This keeps connection identity and secret-path precedence explicit. +- Connection definitions and secret entries must come from trusted + configuration revisions. This includes each secret's `connection` selection + and complete ordered `vault_secrets` list. A PR-head or event-provided layer + cannot define or override these entries, including by removing a trusted + Vault selection or omitting its `connection` to restore the native default. + A more-specific layer may replace an entry only when that layer is trusted. + Fullsend rejects an untrusted override before using the job's OIDC token. Service-specific endpoint and authentication fields live on the connection; secret locators, such as `vault_secrets`, live on each secret entry. Future secret services can add their own connection kinds and fields without changing the top-level `connections` and `secrets` shape. Connection settings -must come from trusted configuration: the job's OIDC token is a bearer -credential, and Fullsend must not send it to an address selected by untrusted -PR-head or event-provided configuration. The Vault address must also pass -deployment egress policy. Fullsend requests a short-lived Vault token for the -current invocation, reads the configured values, and neither persists that -token nor caches values between invocations. There is no static `VAULT_TOKEN` -or AppRole-secret fallback. +include the Vault address, so the job's bearer OIDC token is never sent to an +address selected by untrusted PR-head or event-provided configuration. The +Vault address must also pass deployment egress policy. Fullsend requests a +short-lived Vault token for the current invocation, reads the configured +values, and neither persists that token nor caches values between +invocations. There is no static `VAULT_TOKEN` or AppRole-secret fallback. Vault paths may use `{{forge}}`, `{{repo.host}}`, `{{repo.owner}}`, `{{repo.name}}`, `{{repo.full_name}}`, and `{{org}}`. `repo.owner` is the @@ -145,11 +151,19 @@ paths must include both `repo.host` and `repo.full_name`, preserving every nested namespace segment. Organization-shared paths use a separate `organizations/` prefix so they cannot collide with repository paths or a repository named `shared`. Values come from the trusted target-repository -context, not PR-head or event-supplied repository names. The host is validated -as one path component, and `repo.full_name` is expanded into individually -validated path components. An unknown or unavailable variable fails closed -before Vault access. The variable syntax is reserved for path interpolation -and is distinct from shell environment expansion. +context, not PR-head or event-supplied repository names. `forge`, `repo.host`, +`repo.owner`, `repo.name`, and `org` each form one path component. Fullsend +splits `repo.full_name` on `/` and handles each namespace/project component +separately, preserving nested groups. Every component must be non-empty, must +not be `.` or `..`, and must not contain `/`, `\`, or control characters. +Fullsend encodes each validated component using path-segment semantics and +joins the encoded components; it never inserts raw template values into the +Vault request URL. After expansion, Fullsend validates the complete relative +KV v2 API path: it has no leading `/`, scheme, authority, query, fragment, +empty component, `.` or `..` component, or path escape. Unknown or unavailable +variables and invalid paths fail closed before Vault access. The variable +syntax is reserved for path interpolation and is distinct from shell +environment expansion. The initial Vault-eligible set is user-managed runner secrets whose lifecycle Fullsend does not create or rotate: `JIRA_TOKEN`, diff --git a/docs/architecture.md b/docs/architecture.md index c7504c245b..7f8477fbae 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -169,9 +169,14 @@ repo baseline and overrides) and settings, while `secrets` entries select a connection (native when omitted). A Vault connection has an address and JWT role/audience, defaulting to `fullsend-runner` and `https://fullsend.sh/vault`; secret paths are ordered - and templated from trusted repository context. Vault access uses job - OIDC/WIF, and connection settings must come from trusted configuration. - Native remains the default only when no Vault connection is selected; + and templated from trusted repository context. Connection definitions and + secret entries, including source selection and path order, must come from + trusted configuration revisions; PR-head and event-provided config cannot + define or override these entries, including removing a trusted Vault + selection or omitting its `connection` to restore native. Fullsend validates + and encodes every path component and validates the completed relative KV API + path before access. Vault access uses job OIDC/WIF. Native remains the + default only when no Vault connection is selected; an explicit Vault selection fails closed when WIF or Vault resolution is unavailable. Installer-managed GitLab credentials remain native until Vault write and rotation behavior is decided diff --git a/docs/problems/security-threat-model.md b/docs/problems/security-threat-model.md index c5d8409e9d..e161245033 100644 --- a/docs/problems/security-threat-model.md +++ b/docs/problems/security-threat-model.md @@ -107,7 +107,7 @@ In fullsend's architecture, this is mitigated by several design decisions: agent source arrived through an event or an API ([ADR 0133](../ADRs/0133-actor-attributed-data-security-boundary.md)). - How do we handle the case where legitimate code contains text that looks like prompt injection? (e.g., a test for prompt injection defenses) -- What's the blast radius if an injection succeeds? How do we limit it? (Credential exposure mitigated by keeping credentials out of sandboxes entirely — see [ADR 0017](../ADRs/0017-credential-isolation-for-sandboxed-agents.md); model-provider credentials for runtimes that need one follow the same rule through a run-scoped provider and a placeholder the agent never resolves — see [ADR 0092](../ADRs/0092-openai-wif-credential-delivery.md) and, for codex, [ADR 0099](../ADRs/0099-codex-agent-runtime.md); an inference gateway that accepts the job's OIDC token keeps reusable provider keys off the forge, though the gateway itself becomes a concentrated risk — see [ADR 0137](../ADRs/0137-inference-gateway-credential-route.md); a gateway that cannot trust forge OIDC can instead take an opt-in API key, which relies on a long-lived secret held by the forge — see [ADR 0138](../ADRs/0138-inference-gateway-api-key-credential-mode.md); the Actions workflow token used for GitHub Packages has its *placeholder* bound the same way, resolving only at the two registry hosts; but a value recovered through the registry's error echo is the job's own `GITHUB_TOKEN` and is replayable against whatever hosts the running role's forge profile already allows — read-write for `coder` — see [ADR 0114](../ADRs/0114-github-packages-via-host-bound-workflow-token-provider.md). Tool access limited by `permissions.deny` hard-blocks — see [ADR 0027](../ADRs/0027-allowed-and-disallowed-tools-for-agents.md). User secrets reach only host-side scripts that reference them, never the sandbox — see [ADR 0136](../ADRs/0136-runner-secrets-through-one-stored-secret.md); selected runner secrets can be sourced from Vault through job WIF without changing that boundary — see [ADR 0155](../ADRs/0155-configure-vault-backed-runner-secrets.md). Other blast radius dimensions remain open.) +- What's the blast radius if an injection succeeds? How do we limit it? (Credential exposure mitigated by keeping credentials out of sandboxes entirely — see [ADR 0017](../ADRs/0017-credential-isolation-for-sandboxed-agents.md); model-provider credentials for runtimes that need one follow the same rule through a run-scoped provider and a placeholder the agent never resolves — see [ADR 0092](../ADRs/0092-openai-wif-credential-delivery.md) and, for codex, [ADR 0099](../ADRs/0099-codex-agent-runtime.md); an inference gateway that accepts the job's OIDC token keeps reusable provider keys off the forge, though the gateway itself becomes a concentrated risk — see [ADR 0137](../ADRs/0137-inference-gateway-credential-route.md); a gateway that cannot trust forge OIDC can instead take an opt-in API key, which relies on a long-lived secret held by the forge — see [ADR 0138](../ADRs/0138-inference-gateway-api-key-credential-mode.md); the Actions workflow token used for GitHub Packages has its *placeholder* bound the same way, resolving only at the two registry hosts; but a value recovered through the registry's error echo is the job's own `GITHUB_TOKEN` and is replayable against whatever hosts the running role's forge profile already allows — read-write for `coder` — see [ADR 0114](../ADRs/0114-github-packages-via-host-bound-workflow-token-provider.md). Tool access limited by `permissions.deny` hard-blocks — see [ADR 0027](../ADRs/0027-allowed-and-disallowed-tools-for-agents.md). User secrets reach only host-side scripts that reference them, never the sandbox — see [ADR 0136](../ADRs/0136-runner-secrets-through-one-stored-secret.md); selected runner secrets can be sourced from Vault through job WIF without changing that boundary; only trusted configuration defines connections and each secret's source and ordered paths, and PR-head or event-provided config cannot override them. Fullsend validates each interpolated path component and the completed relative KV path before Vault access — see [ADR 0155](../ADRs/0155-configure-vault-backed-runner-secrets.md). Other blast radius dimensions remain open.) - Should agents operate on Unicode-normalized text with non-rendering characters stripped, or on raw text with a separate detection pass? ([ADR 0133](../ADRs/0133-actor-attributed-data-security-boundary.md) decides that model-bound source content is the filtered representation and that raw text is never exposed; strip versus detect-and-preserve remains deferred to the versioned content-filter contract.) - How do we handle invisible Unicode in code itself (source files, not just metadata)? Some non-rendering characters are legitimate in string literals for internationalization. What heuristics distinguish malicious use from legitimate use? [ADR 0133](../ADRs/0133-actor-attributed-data-security-boundary.md) defines the source-content boundary; code-content handling remains open.