Skip to content

feat: add opt-in AI Gateway actor email headers - #29930

Merged
johnstcn merged 3 commits into
mainfrom
feat/actor-email-opt-in
Sep 29, 2026
Merged

johnstcn merged 3 commits into
mainfrom
feat/actor-email-opt-in

Conversation

@johnstcn

Copy link
Copy Markdown
Member

Add opt-in forwarding of the authenticated Coder account email through --ai-gateway-actor-header-meta-email, CODER_AI_GATEWAY_ACTOR_HEADER_META_EMAIL, or ai_gateway.actor_header_meta_email. The option defaults to empty: enabling send_actor_headers alone does not forward email. Set a destination header explicitly to opt in; accounts without an email omit it.

Carry authenticated email through the Gateway authorization response and strip client-supplied standard/configured email headers before applying trusted identity. The additive protocol field joins unreleased Gateway API v1.3 alongside workspace attribution. Includes email configuration precedence, authorization compatibility, captured upstream request tests, and matching documentation.

Depends on #29929, which introduces ID/username configurability. This is the second PR in the replacement stack and supersedes the email work from #29840.

Refs https://linear.app/codercom/issue/AIGOV-601

Implementation decisions and verification
  • Email is personal information and must be explicitly enabled for trusted upstream providers. The global actor-header gate and a nonempty email destination are both required.
  • Reuse native scalar option semantics. Empty overrides disable an attribute; configuring username does not alter an independently configured email destination.
  • Extend the first PR's test tables rather than duplicating fixtures. Cover default omission, standard/custom opt-in, missing email, all-disabled settings, spoofed headers, and authenticated users sharing provider credentials.
  • Preserve pre-stack gate-off behavior: client headers pass through, SDK actor-only headers are not injected. Do not add a general client-header scrubber.
  • Verified both stack layers independently and regenerated API/CLI artifacts. The full Go suite, frontend suite, site build, gateway protocol/authorization tests, and full pre-commit checks passed.
  • Create replacement draft PRs after GitHub's native-stack handling prevented retargeting the original PRs.

Generated with Coder Agents on behalf of @johnstcn.

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Docs preview

Check off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here.

@linear-code

linear-code Bot commented Sep 25, 2026

Copy link
Copy Markdown

AIGOV-601

Comment thread aibridge/intercept/actor_headers.go Resolved
@johnstcn
johnstcn added this pull request to stack #29932 September 25, 2026 15:51
@johnstcn
johnstcn marked this pull request as ready for review September 25, 2026 16:38
@johnstcn johnstcn changed the title feat: opt in to AI Gateway actor email headers feat: add opt-in AI Gateway actor email headers Sep 25, 2026
@johnstcn
johnstcn requested a review from pawbana September 25, 2026 16:44
Comment thread aibridge/intercept/client_headers.go Resolved
Comment thread aibridge/headers/headers.go Resolved
Comment thread codersdk/deployment.go Resolved
Comment thread coderd/aibridged/http.go Resolved
Comment thread docs/ai-coder/ai-gateway/setup.md Resolved
Comment thread docs/ai-coder/ai-gateway/reference.md Resolved
Base automatically changed from feat/actor-header-options to main September 29, 2026 17:23
@johnstcn
johnstcn force-pushed the feat/actor-email-opt-in branch from 2495625 to 0fad393 Compare September 29, 2026 18:07
@johnstcn
johnstcn force-pushed the feat/actor-email-opt-in branch from 0fad393 to 1a8ce80 Compare September 29, 2026 18:23
@johnstcn
johnstcn merged commit 8742d24 into main Sep 29, 2026
52 of 54 checks passed
@johnstcn
johnstcn deleted the feat/actor-email-opt-in branch September 29, 2026 19:07
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants