Skip to content

feat(sdk): support renewable model authentication - #720

Open
gero-oai wants to merge 1 commit into
openai:mainfrom
gero-oai:codex/renewable-model-auth
Open

feat(sdk): support renewable model authentication#720
gero-oai wants to merge 1 commit into
openai:mainfrom
gero-oai:codex/renewable-model-auth

Conversation

@gero-oai

@gero-oai gero-oai commented Aug 28, 2026

Copy link
Copy Markdown

Summary

Allow SDK callers to configure the embeddings endpoint and supply renewable credentials. Preserve an explicitly selected command-auth provider in CODEX_HOME when preparing reviews.

Changes

  • Add embedder options for the API base URL, headers, and a static key or per-batch credential callback. Preserve the original constructor, OpenAI defaults, batching, and vector validation.
  • Export the embedder, findings server, SQLite store, and core types through @openai/codex-security/server without starting a server on import.
  • Preserve selected command authentication, including profile selection, without replacing it with managed login or static OpenAI keys. Keep other authentication behavior and review isolation unchanged.
  • Select the first nonempty OPENAI_API_KEY or CODEX_API_KEY, including Windows environment-name casing.
  • Extend existing deterministic and installed-package tests. No new provider smoke framework; README changes are limited to one sentence.

Testing

Validated with Bun 1.3.14 and Node 22:

  • Focused embedding, authentication, review, comparison, and server tests: 70 passed, 5 skipped.
  • Full shared SDK suite through all three existing CI shards, seed 12345: 2,092 passed, 38 skipped, 0 failed.
  • pnpm run types, pnpm run format, and git diff --check: passed.
  • pnpm pack and pnpm run check:package: passed, including the build, side-effect-free server import, strict NodeNext consumer, installed CLI, bundled runtime, and nested-worker checks.

Earlier local verification exercised native Codex 0.149.1 command-auth renewal and failure using synthetic credentials. The verification harness is not included in this PR. No live provider credentials were used; this does not establish compatibility with a live service.

Risk and rollout

The SDK options and server subpath are additive. No new CLI surface, dependencies, models, or database migrations. Credential renewal failures remain safe errors without ambient fallback.

Callers own token acquisition and private-home lifecycle; Codex owns review-token renewal. Release through the normal package process after review and CI, and validate the caller integration against an authorized provider before rollout.

Public disclosure review

  • No customer, partner, prospect, or user identities, data, or identifying details are included.
  • No credentials, personal data, private source, scan findings, or nonpublic links or tickets are included.
  • I reviewed the branch name, title, description, commits, changes, comments, logs, screenshots, attachments, and links for public disclosure.

@github-actions github-actions Bot added the enhancement New feature or request label Aug 28, 2026
@gero-oai
gero-oai force-pushed the codex/renewable-model-auth branch from 69de46c to e01e237 Compare August 29, 2026 19:13
@gero-oai
gero-oai force-pushed the codex/renewable-model-auth branch from e01e237 to ffb4dca Compare August 29, 2026 19:37
@gero-oai
gero-oai marked this pull request as ready for review August 29, 2026 19:40
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 29, 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
🔒 Security Review Completed 2026-08-29T19:45:28.264587Z ffb4dca Draft marked ready

Security findings

Blocking findings (1)

ℹ️ 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.

@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 Security Review

Here are some automated security review suggestions for this pull request.

Reviewed commit: ffb4dcada0

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment on lines +417 to +420
if (await hasConfiguredCommandAuth(environment, signal)) {
for (const key of Object.keys(environment)) {
if (["OPENAI_API_KEY", "CODEX_API_KEY"].includes(key.toUpperCase())) {
delete environment[key];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Security: Keep auth helpers out of the scanned checkout

When the selected provider uses an auth.command that resolves relative to the process CWD, a malicious scanned checkout can supply that executable. This branch preserves the command-auth CODEX_HOME; deduplicateScan then launches the Codex app server with the saved target as cwd, so the helper runs outside the read-only filesystem profile. A local reproduction wrote to a sibling directory despite read-only mode. Resolve the helper outside the target, or run the auth-bearing parent from a private directory.

SECURITY.md reference: SECURITY.md:L63-L68


Dismiss this finding

Reply with @codex security dismiss <reason> [context].

Valid reasons: false-positive, duplicate, out-of-scope, compensating-control, risk-accepted, or other.

What each reason means
  • false-positive — Not a vulnerability
  • duplicate — Already tracked elsewhere
  • out-of-scope — Outside this review's scope
  • compensating-control — Mitigated by another control
  • risk-accepted — Risk intentionally accepted
  • other — Another reason; context required

Example: @codex security dismiss duplicate Already flagged by another review

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant