Skip to content

feat(auth): add caller-attested X.509 transport capability - #2428

Open
jbeckwith-oai wants to merge 5 commits into
mainfrom
codex/x509-transport-capability
Open

feat(auth): add caller-attested X.509 transport capability#2428
jbeckwith-oai wants to merge 5 commits into
mainfrom
codex/x509-transport-capability

Conversation

@jbeckwith-oai

Copy link
Copy Markdown
Contributor

Summary

  • Add an isolated, preview openai/auth/x509-transport entrypoint for one explicitly caller-attested Node.js Undici Agent or ProxyAgent.
  • Freeze and privately brand each opaque transport generation; snapshot its dispatcher; reject unsupported runtimes, executable getters, JavaScript proxies, unknown options, plaintext targets, and per-request dispatcher replacement without examining Undici private state.
  • Keep Undici optional for ordinary SDK consumers and verify installed-package CommonJS/ESM behavior with the optional peer both absent and present.
  • Exercise genuine direct mTLS and independently authenticated HTTPS CONNECT, including distinct proxy/workload certificate authorities, certificate fingerprints, proxy credential isolation, and post-construction option mutation.

This is PR 2 of 5, following #2417. Certificate stability, safe proxy TLS separation, and fresh-dispatcher rotation are application attestations—not claims that transport identity cryptographically proves certificate selection. OAuth exchange, OpenAI client integration, credential caching, and lifecycle policy remain explicitly out of scope.

Verification

  • pnpm install --frozen-lockfile --ignore-scripts
  • pnpm lint
  • pnpm exec tsc --noEmit
  • pnpm build
  • node --experimental-strip-types scripts/test-packed-package.ts — CommonJS, ESM, TypeScript 4.9/current, browser-safe source navigation, and optional Undici absent/present
  • Node 22.15.1, 22.22.0, 24.16.0, and 26.2.0: all 30 focused X.509 and real-wire conformance tests pass
  • env NODE_USE_ENV_PROXY=0 CI=1 ./scripts/test --testNamePattern='^(?!.*(?:pre-opened readable original inode|original held inode)).*$'4,064 handwritten tests passed; two pre-existing Linux-only inode cases skipped on macOS; 559 generated tests and 12 snapshots passed
  • Exact-head Codex Security diff scan a3ac2b08-df37-44b8-9ba1-e105c884df5e — complete changed-source coverage, zero findings

@jbeckwith-oai
jbeckwith-oai requested a review from a team as a code owner August 20, 2026 01:13
@openai-sdks

openai-sdks Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

OkTest Summary

237/237 SDK tests passed in 10.95s for Node SDK PR #2428.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 161ms
tests/chat-completions-create.test.ts ✅ Passed 305ms
tests/chat-completions-stream.test.ts ✅ Passed 206ms
tests/files-content-binary.test.ts ✅ Passed 171ms
tests/files-create-multipart.test.ts ✅ Passed 157ms
tests/files-list-pagination.test.ts ✅ Passed 171ms
tests/initialize-config.test.ts ✅ Passed 176ms
tests/instance-isolation.test.ts ✅ Passed 108ms
tests/models-list.test.ts ✅ Passed 149ms
tests/responses-background-lifecycle.test.ts ✅ Passed 246ms
tests/responses-body-method-errors.test.ts ✅ Passed 391ms
tests/responses-cancel-timeout.test.ts ✅ Passed 197ms
tests/responses-cancel.test.ts ✅ Passed 275ms
tests/responses-compact-retries.test.ts ✅ Passed 274ms
tests/responses-compact.test.ts ✅ Passed 248ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 139ms
tests/responses-create-advanced.test.ts ✅ Passed 225ms
tests/responses-create-disconnect.test.ts ✅ Passed 1.204s
tests/responses-create-errors.test.ts ✅ Passed 209ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 157ms
tests/responses-create-retries.test.ts ✅ Passed 270ms
tests/responses-create-stream-failures.test.ts ✅ Passed 242ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 2.169s
tests/responses-create-stream-wire.test.ts ✅ Passed 2.705s
tests/responses-create-stream.test.ts ✅ Passed 105ms
tests/responses-create-terminal-states.test.ts ✅ Passed 267ms
tests/responses-create-timeout.test.ts ✅ Passed 208ms
tests/responses-create.test.ts ✅ Passed 190ms
tests/responses-delete.test.ts ✅ Passed 201ms
tests/responses-input-items-errors.test.ts ✅ Passed 181ms
tests/responses-input-items-list.test.ts ✅ Passed 205ms
tests/responses-input-items-options.test.ts ✅ Passed 113ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 234ms
tests/responses-input-tokens-count.test.ts ✅ Passed 222ms
tests/responses-malformed-inputs.test.ts ✅ Passed 2.408s
tests/responses-not-found-errors.test.ts ✅ Passed 291ms
tests/responses-parse.test.ts ✅ Passed 194ms
tests/responses-retrieve-retries.test.ts ✅ Passed 295ms
tests/responses-retrieve.test.ts ✅ Passed 229ms
tests/responses-stored-method-errors.test.ts ✅ Passed 668ms
tests/retry-behavior.test.ts ✅ Passed 3.106s
tests/sdk-error-shape.test.ts ✅ Passed 283ms

View OkTest run #32533576325

SDK merge (8dd1b9c90f07) · head (9aa16c5c9791) · base (7b7d6ca71130) · OkTest (2b1bdfd25e98)

@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Castiron custom code

✅ No new custom-code files detected.

32 mixed files remain; 0 existing customizations changed.

Compared 7b7d6ca711309aa16c5c9791. Generated baselines verified.

32 existing customizations unchanged
  • api.md
  • scripts/castiron/README.md
  • scripts/castiron/custom_code_report.py
  • scripts/castiron/test_custom_code_report.py
  • src/client.ts
  • src/resources/audio/transcriptions.ts
  • src/resources/audio/translations.ts
  • src/resources/beta/assistants.ts
  • src/resources/beta/beta.ts
  • src/resources/beta/index.ts
  • src/resources/beta/responses/internal-base.ts
  • src/resources/beta/responses/responses.ts
  • src/resources/beta/threads/index.ts
  • src/resources/beta/threads/runs/index.ts
  • src/resources/beta/threads/runs/runs.ts
  • src/resources/beta/threads/threads.ts
  • src/resources/chat/completions/completions.ts
  • src/resources/chat/completions/index.ts
  • src/resources/conversations/index.ts
  • src/resources/embeddings.ts
  • src/resources/files.ts
  • src/resources/fine-tuning/checkpoints/permissions.ts
  • src/resources/images.ts
  • src/resources/responses/internal-base.ts
  • src/resources/responses/responses.ts
  • src/resources/skills/skills.ts
  • src/resources/skills/versions/versions.ts
  • src/resources/vector-stores/file-batches.ts
  • src/resources/vector-stores/files.ts
  • src/resources/webhooks/index.ts
  • src/resources/webhooks/webhooks.ts
  • tests/lib/data-residency.test.ts

A changed generated baseline means this report cannot reliably identify which handwritten lines changed.

Inspect the custom-code diff

Download the exact patch produced by this run (requires repository access):

gh run download 32533602163 --repo openai/openai-node \
  --name castiron-custom-code-32533602163-1 --dir /tmp/castiron-custom-code-32533602163-1
git apply --stat /tmp/castiron-custom-code-32533602163-1/custom-code.patch
cat /tmp/castiron-custom-code-32533602163-1/custom-code.patch

Or reproduce it from an SDK checkout containing the vendored reporter:

git fetch --no-tags origin 7b7d6ca71130d37ec09792c50056b47861f2eccf 9aa16c5c97919506a86ce562a600320562e187a0
python3 scripts/castiron/custom_code_report.py report \
  --base 7b7d6ca71130d37ec09792c50056b47861f2eccf \
  --head 9aa16c5c97919506a86ce562a600320562e187a0 --fetch --require-head-hash --public \
  --out /tmp/castiron-custom-code-9aa16c5c9791
cat /tmp/castiron-custom-code-9aa16c5c9791/custom-code.patch

This is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR.

Full report and patch

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b2ffa2c910

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/internal/auth/x509-transport-capability.ts Outdated
Comment thread src/internal/auth/x509-transport-capability.ts Outdated
Comment thread package.json Outdated
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-21T22:37:33.525857Z 9aa16c5 New commits
🔒 Security Review Completed 2026-08-21T22:37:43.436799Z 9aa16c5 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@jbeckwith-oai
jbeckwith-oai force-pushed the codex/x509-transport-capability branch from 1db8103 to acab1ae Compare August 20, 2026 01:40
@jbeckwith-oai jbeckwith-oai changed the title Add explicit caller-attested X.509 transport capability feat(auth): add caller-attested X.509 transport capability Aug 20, 2026

@HAYDEN-OAI HAYDEN-OAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One validated P2 package-installation compatibility regression.

Comment thread package.json Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a249be1004

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/internal/auth/x509-transport-capability.ts Outdated
Comment thread src/internal/auth/x509-transport-capability.ts Outdated
Comment thread src/internal/auth/x509-transport-capability.ts Outdated

@apcha-oai apcha-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[sdk codex review] Completed two independent full reviews of 0125855c39e9a5e5a0966b54ae9c59b745629a26, covering all six changed files, supporting code, compatibility, tests, CI, maintainability and all existing feedback.

Requesting changes for one P2: the opt-in X.509 capability accepts Undici implementations that cannot satisfy its dispatch contract. The ordinary compatibility details and suggested regression boundary are in the inline comment. Preserve older optional-peer installation for unrelated SDK consumers while establishing the feature’s actual activation requirements.

Potentially security-sensitive technical details are in the OpenAI-only Slack thread: #sdk-reviews details. That discussion also states the current reachability limits; this is not a claim that ordinary OpenAI clients currently use the new internal sender.

Immediately before submission: open, non-draft, Justin-authored and MERGEABLE; PR base/actual merge base a0d68cc53125c2cb82eab31271b8984b8d65d4b2, live main 7b7d6ca71130d37ec09792c50056b47861f2eccf. All 32 check contexts are terminal (20 successful, 12 expected skips). Hosted CI uses modern Undici; recorded OkTest integration used an older base. Source analysis and hosted CI only; no PR code or tests executed locally.

Comment thread src/internal/auth/x509-transport-capability.ts Outdated
@jbeckwith-oai
jbeckwith-oai force-pushed the codex/x509-transport-capability branch from 5906d3b to 9aa16c5 Compare August 21, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants