Skip to content

fix(record): require Docker auth only for HTTPS docker.com gateways - #4252

Open
aheritier wants to merge 1 commit into
mainfrom
fix/record-gateway-docker-auth-4250
Open

fix(record): require Docker auth only for HTTPS docker.com gateways#4252
aheritier wants to merge 1 commit into
mainfrom
fix/record-gateway-docker-auth-4250

Conversation

@aheritier

@aheritier aheritier commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator

Fixes #4250.

--record and --fake route provider traffic through a local capture proxy so requests can be recorded or replayed. The proxy’s loopback address remains trusted for local routing, but loopback and third-party gateways no longer trigger a Docker Desktop authentication requirement.

What changed

  • Add a strict Docker-domain predicate that requires HTTPS and matches only docker.com and its subdomains.
  • Require Docker Desktop authentication only when the configured models gateway targets an HTTPS docker.com domain.
  • Continue treating loopback gateways as trusted for local routing and encrypted-configuration forwarding, without requiring a Docker Desktop token.
  • Limit Docker token preflight and model-gateway authentication checks to Docker domains.
  • Remove encrypted_agent_config and its digest:
    • from recording cassettes for every upstream;
    • before forwarding requests to untrusted upstreams; and
    • before forwarding requests when no upstream gateway is configured.
  • Preserve encrypted-configuration forwarding to trusted loopback and Docker upstreams where it is required.
  • Keep the forwarded request independent from the sanitized request captured in the cassette.

Security behavior

Encrypted agent configuration and its digest are never persisted in recording cassettes. They are also scrubbed before requests are sent directly to untrusted providers or when no upstream gateway is configured. Trusted loopback and Docker gateways retain the configuration needed for their routing behavior.

Regression context

This fixes a recent interaction regression rather than a long-standing --record issue:

  • --record was introduced in December 2025.
  • Loopback URLs became trusted for Docker Desktop JWT routing in June 2026, to support local development gateways.
  • In July 2026, PR fix: route --record proxy through the configured models gateway #3428 changed recording to forward through the configured models-gateway path. The recording proxy’s loopback URL could then be treated as a Docker gateway, incorrectly requiring Docker Desktop sign-in before the provider request was made.

The issue was reported in v1.138.1. Releases containing the July 2026 routing change are potentially affected; the precise first released version has not been pinned.

References: #3428; commits b996731, b5a9b8b, and 9e67ddd.

Tests

Added and updated coverage for:

  • strict HTTPS docker.com domain matching;
  • Docker Desktop authentication requirements for Docker, loopback, and third-party gateways;
  • loopback gateways receiving an available token without requiring one;
  • Docker token preflight and forwarding behavior;
  • encrypted-configuration and digest removal from cassettes;
  • scrubbing before forwarding to untrusted and direct upstreams;
  • retaining encrypted configuration for trusted upstreams; and
  • request-body sanitization and replay behavior.

Validated with:

  • task build
  • task test
  • task lint

@aheritier
aheritier marked this pull request as ready for review September 12, 2026 11:17
@aheritier
aheritier requested a review from a team as a code owner September 12, 2026 11:17
@aheritier aheritier added area/cli CLI commands, flags, output formatting area/config For configuration parsing, YAML, environment variables kind/fix PR fixes a bug (maps to fix:). Use on PRs only. labels Sep 12, 2026
@aheritier
aheritier marked this pull request as draft September 12, 2026 18:45
Require Docker Desktop authentication only for HTTPS docker.com gateways while retaining loopback trust for forwarded encrypted configuration. Scrub encrypted config and its digest independently from recording captures, and remove both before forwarding to untrusted or direct upstreams.

Fixes #4250
@aheritier
aheritier force-pushed the fix/record-gateway-docker-auth-4250 branch from be4637f to bb6c474 Compare September 13, 2026 07:33
@aheritier aheritier changed the title fix(record): don't require Docker Desktop sign-in for non-gateway providers fix(record): require Docker auth only for HTTPS docker.com gateways Sep 13, 2026
@aheritier
aheritier marked this pull request as ready for review September 13, 2026 09:51
@aheritier
aheritier enabled auto-merge September 13, 2026 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cli CLI commands, flags, output formatting area/config For configuration parsing, YAML, environment variables kind/fix PR fixes a bug (maps to fix:). Use on PRs only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

run --record requires Docker AI Gateway

1 participant