Skip to content

fix: protect access to the AI SDK UI demo and limit resource use - #2181

Merged
markstuart-oai merged 1 commit into
feat/codex-harnessfrom
codex-security/ai-sdk-ui-demo-limits
Nov 5, 2026
Merged

markstuart-oai merged 1 commit into
feat/codex-harnessfrom
codex-security/ai-sdk-ui-demo-limits

Conversation

@markstuart-oai

Copy link
Copy Markdown
Contributor

Summary

The AI SDK UI demo let any visitor create provider conversations and run models. The demo now requires AI_SDK_UI_DEMO_ACCESS_TOKEN before provider work. It also checks that each conversation belongs to the requesting browser. It rejects requests from other browser origins, including when the browser has cached the demo credentials.

The demo limits conversation creation and model runs per process. It deletes expired provider conversations once their active work ends and retries failed deletions. Both chat views use the same limits and ownership checks. The README explains how to set the token and open the demo.

Please review the access checks and provider cleanup.

Test plan

  • Passed 27 focused tests for access, ownership, streaming, and limits.
  • Checked sign-in and both chat views in a local browser with a stub provider. A request from another origin reached no provider endpoint.
  • Passed the full repository verification with both example patches applied.

Checks

  • Added regression tests and updated the example README.
  • Ran .agents/skills/code-change-verification/scripts/run.sh.

@markstuart-oai
markstuart-oai requested a review from a team as a code owner November 5, 2026 18:44
@changeset-bot

changeset-bot Bot commented Nov 5, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: fb34d86

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 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-11-05T18:45:57.938080Z fb34d86 PR opened
🔒 Security Review ✅ Completed 2026-11-05T18:46:01.612626Z fb34d86 PR opened
ℹ️ 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 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.

Approved at fb34d86. Reviewed all ten changed files, route/conversion code, provider session cleanup and stream adapters. Authentication gates provider work at the proxy and handlers, ownership remains enforced, synchronous quota reservations cover concurrent admission, and expiry cleanup waits for active reads/runs while retaining failed deletion slots. Tests cover access, quota, expiry and cleanup boundaries.

Coordinator and independent static review found no actionable issues; existing feedback checked. Hosted CI remains pending. No candidate code, tests, builds or CI reruns executed.

@markstuart-oai
markstuart-oai merged commit f690590 into feat/codex-harness Nov 5, 2026
8 checks passed
@markstuart-oai
markstuart-oai deleted the codex-security/ai-sdk-ui-demo-limits branch November 5, 2026 19:46
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