Repository navigation
Add opt-in trusted LLM service routing and secret headers - #11345
Conversation
Co-authored-by: lpcox <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Non-empty secretHeaders crash Compose rendering before startup, and enclave proxies inherit trusted-service routes and secrets while bypassing Squid.
5 open issues
What changed in this PR
Introduces opt-in trusted HTTPS intermediaries for Anthropic and OpenAI through AWF’s credential-isolated API proxy, with supplemental headers sourced from runner environment variables.
Changes:
- Adds configuration, validation, sidecar secret inheritance, and agent-environment filtering.
- Extends provider routing, proxy-scoped Squid rules, TLS enforcement, and redirect handling.
- Adds focused coverage and documents standalone setup, topology limits, release requirements, and the separate native-telemetry handoff.
| File | Description |
|---|---|
src/types/squid.ts |
Adds proxy-only upstream admission metadata. |
src/types/api-proxy-credential-options.ts |
Exposes trusted-service credential options. |
src/trusted-service.ts |
Implements validation, routing, and environment-isolation helpers. |
src/trusted-service.test.ts |
Covers configuration, policy, and secret isolation. |
src/squid/policy-manifest.ts |
Represents proxy-only HTTPS admission rules. |
src/squid/api-proxy-upstreams.ts |
Generates scoped CONNECT and TLS-splice rules. |
src/services/api-proxy-service-config.ts |
Adds runner-secret environment passthrough entries. |
src/services/api-proxy-env-config.ts |
Builds trusted targets and upstream admission metadata. |
src/services/agent-environment/excluded-vars.ts |
Excludes configured secret variable names. |
src/services/agent-environment/environment-builder.ts |
Filters secrets after environment assembly. |
src/config-mapper.ts |
Maps file configuration into trusted-service options. |
src/config-file.ts |
Adds target types and semantic validation. |
src/compose-generator.ts |
Applies final agent-environment secret filtering. |
src/commands/resolve-credentials.ts |
Propagates trusted-service settings. |
src/commands/preflight.ts |
Validates trusted services during domain resolution. |
src/awf-config-schema.json |
Adds runtime schema definitions and conflict constraints. |
README.md |
Links the trusted-service guide. |
docs/awf-config.schema.json |
Defines the public trusted-service configuration schema. |
docs/awf-config-spec.md |
Documents trust, setup, topology, and telemetry boundaries. |
containers/api-proxy/upstream-http.test.js |
Covers redirect cancellation and cleanup. |
containers/api-proxy/upstream-http.js |
Adds trusted-request TLS, redirect, and fallback controls. |
containers/api-proxy/trusted-service.test.js |
Exercises adapters, verified TLS routing, and policy denials. |
containers/api-proxy/trusted-service.js |
Validates sidecar settings, injects headers, and tracks redaction values. |
containers/api-proxy/server-factory.js |
Rejects trusted-service WebSocket upgrades. |
containers/api-proxy/request-headers.js |
Replaces spoofed headers and suppresses credential previews. |
containers/api-proxy/proxy-request.js |
Marks trusted-service requests for downstream handling. |
containers/api-proxy/model-discovery.js |
Requires verified TLS for trusted discovery requests. |
containers/api-proxy/logging.js |
Redacts known secrets in nested log fields. |
containers/api-proxy/Dockerfile |
Includes the trusted-service helper in the image. |
containers/api-proxy/deprecated-header-tracker.js |
Protects injected headers from learned stripping. |
containers/api-proxy/adapter-factory.js |
Integrates trusted targets and supplemental authentication headers. |
Review effort: Max (auto)
| if (Object.prototype.hasOwnProperty.call(proxyService.environment, name)) { | ||
| throw new Error('trustedService secret environment name conflicts with sidecar configuration'); | ||
| } | ||
| proxyService.environment[name] = null; |
| if (config.containerRuntime && !['docker', 'runc'].includes(config.containerRuntime)) { | ||
| throw new Error('trustedService currently supports only the ordinary Docker runtime'); | ||
| } |
| ? (oidcContext) => getAuthHeaders({ ...config, ...headerBuilders, ...oidcContext }) | ||
| : undefined, | ||
| }); | ||
| if (trustedService) adapter.trustedService = true; |
| const authType = config.authType ?? getConfigEnvValue(config, 'AWF_AUTH_TYPE') ?? process.env.AWF_AUTH_TYPE; | ||
| const authProvider = config.authProvider ?? getConfigEnvValue(config, 'AWF_AUTH_PROVIDER') ?? process.env.AWF_AUTH_PROVIDER; |
|
@copilot address review feedback |
Addressed the review findings in commit |
Documentation PreviewDocumentation has been built for this PR. To view locally:
Built from commit 1ca2bbd |
|
@copilot fix the failiing ci check and address all review feedback https://github.com/github/gh-aw-firewall/actions/runs/42569502676/job/129005520024?pr=11345 |
…e validation' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
|
✅ Copilot review passed with no inline comments. @copilot Add the |
Added the missing trusted-service runtime fixture asset, fixing the Root Unit Tests failure. The TLS-test override removal is in |
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (4 files)
✨ New Files (1 files)
Coverage comparison generated by |
- Actions OIDC runtime variables are forwarded to the sidecar for GH_AW_OTLP_WORKLOAD_IDENTITY as well as github-oidc (buildOtelEnv). - Native OpenAI WIF enables agent routing via isOpenAiOidcConfigured(); the Azure OIDC caveat now states this explicitly. - Document the trustedService secret-header contract (#11345) in the auth matrix, linking the normative spec section 9.10. Co-authored-by: Copilot <[email protected]>
…ce in NET-003 Adds provenance for PR #11345 (trusted LLM service sidecar upstream, exact HTTPS/443 proxy-only) and PR #11363 (Azure Foundry target on the same exact custom-port sidecar ACL path) to NET-003. Generated consumers are intentionally not regenerated here; trusted CI or a reviewer runs diagnostics:render. Co-authored-by: Copilot <[email protected]>
…d-service docs (#11572) * docs: fix auth OIDC forwarding and OpenAI routing docs - Actions OIDC runtime variables are forwarded to the sidecar for GH_AW_OTLP_WORKLOAD_IDENTITY as well as github-oidc (buildOtelEnv). - Native OpenAI WIF enables agent routing via isOpenAiOidcConfigured(); the Azure OIDC caveat now states this explicitly. - Document the trustedService secret-header contract (#11345) in the auth matrix, linking the normative spec section 9.10. Co-authored-by: Copilot <[email protected]> * docs: resolve stale OIDC forwarding guidance Co-authored-by: copilot-swe-agent[bot] <[email protected]> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <[email protected]> Co-authored-by: lpcox <[email protected]> Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…ry upstream provenance in NET-003 (#11576) * docs(diagnostics): cite trusted-service and Foundry upstream provenance in NET-003 Adds provenance for PR #11345 (trusted LLM service sidecar upstream, exact HTTPS/443 proxy-only) and PR #11363 (Azure Foundry target on the same exact custom-port sidecar ACL path) to NET-003. Generated consumers are intentionally not regenerated here; trusted CI or a reviewer runs diagnostics:render. Co-authored-by: Copilot <[email protected]> * docs(diagnostics): refresh generated NET-003 consumers Co-authored-by: copilot-swe-agent[bot] <[email protected]> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <[email protected]> Co-authored-by: lpcox <[email protected]> Co-authored-by: copilot-swe-agent[bot] <[email protected]>


Custom model targets do not establish a credential-isolated service-proxy contract. This change adds trusted HTTPS intermediaries behind AWF’s API proxy and defines the separate native-telemetry handoff.
Routing and policy
agent → AWF api-proxy → Squid → trusted service → provider.Credential handling
Contract and coverage
CORPORATE_LLM_TOKENnames a runner environment variable—not a literal secret.