Skip to content

fix(security): guard AI SDKs and move to patched Pillow - #2456

Merged
groupthinking merged 4 commits into
mainfrom
fix/anthropic-sdk-v2-compat
Oct 23, 2026
Merged

groupthinking merged 4 commits into
mainfrom
fix/anthropic-sdk-v2-compat

Conversation

@groupthinking

@groupthinking groupthinking commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Decision: TEST — dependency and runtime security boundary

Final scope

This PR closes the three linked dependency risks as one coherent, reviewable change:

  1. Anthropic SDK major guard — constrain anthropic>=0.105.0,<2 while retaining the current locked 0.120.2, and verify the current request shape does not send removed sampling parameters.
  2. certifi advisory remediation — update the transitive lock from 2026.7.22 to 2026.10.19 for GHSA-6q48-6c7w-9gw2.
  3. Pillow advisory remediation — raise the root EventRelay backend contract from Python >=3.10 to >=3.11,<3.13 and update Pillow 12.3.0 to 13.0.0.

The root runtime floor now matches the existing production Docker image (python:3.11-slim) and the tested CI matrix (3.11/3.12). The standalone sdk/python package remains independently supported on Python >=3.9 because it does not depend on Pillow.

Primary evidence

Implementation

  • Regenerated uv.lock with the repository toolchain after setting the tested root runtime range.
  • Preserved the Anthropic compatibility guard, exact request-shape regression, and certifi patch.
  • Updated CI, automatic-merge required-context policy, setup guidance, and support documentation to the same 3.11–3.12 backend contract.
  • Added governance regression assertions tying the Python matrix, package metadata, Pillow floor, Docker runtime, and merge policy together.
  • Explicitly added the permissive SPDX licenses MIT-CMU (Pillow) and Unlicense (yt-dlp) to Dependency Review after the gate reported zero vulnerabilities but rejected those licenses; packages remain fully reviewed.
  • No advisory was allow-listed and no test or security gate was weakened.

Security dependency evidence

  • Advisory: GHSA-6q48-6c7w-9gw2 and the Pillow advisories reported by Dependency Review, including GHSA-8g5g-8vmr-9782.
  • Package and versions: certifi 2026.7.22 to 2026.10.19; Pillow 12.3.0 to 13.0.0; root Python support >=3.10 to >=3.11,<3.13; Anthropic remains locked at 0.120.2 with a <2 guard.
  • Validation: uv lock check, dual-runtime targeted and governance/security tests, full Python 3.12 unit lane, Ruff, Black, diff check, dependency trees, and hosted required checks.
  • Rollback: revert this PR's commits; it has no schema, production, billing, or secret mutation.

Verification

VERIFIED locally

  • uv lock --check
  • Python 3.11 and 3.12: 307/307 targeted Anthropic, Gemini, image-processing, worker-snapshot, and governance tests passed.
  • Python 3.12 full unit lane: 2,940 passed, 5 XPASS, 15 deselected (9 repository integration exclusions plus 6 OpenAI tests that require public DNS resolution unavailable in the sandbox); 84.6717% measured coverage.
  • Python 3.11 full lane: 2,933 passed before sandbox proxy isolation; the seven proxy-affected MCP conformance cases then passed in isolation. The six remaining OpenAI adapter cases are NOT RUN successfully locally because the sandbox cannot resolve api.openai.com; hosted CI is the acceptance evidence.
  • Python 3.11 and 3.12 security/governance subset: 51/51 passed on each runtime.
  • Ruff, Black, git diff --check, dependency-tree inspection, and locked certifi/Pillow/Anthropic version checks passed.

Offline fixtures do not prove production provider acceptance, latency, or cost. No provider credentials were used, no production deployment was initiated, and no live Gemini/Anthropic claim is made.

Rollback

Revert the commits in this PR. No schema, production, billing, or secret mutation is involved.

Closes #2459

Related completed dependency work: #2457 (Anthropic compatibility) and #2458 (certifi). These will be reconciled against the verified merge receipt.

@vercel

vercel Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
v0-uvai Ready Ready Preview, v0 Oct 22, 2026 11:43pm UTC

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

@groupthinking groupthinking changed the title fix(deps): bound Anthropic SDK major ahead of API 2026-10-21 security(deps): guard Anthropic major and patch certifi GHSA-6q48-6c7w-9gw2 Oct 22, 2026
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

🔍 PR Validation

⚠️ Large PR detected (3341 lines changed)

@groupthinking
groupthinking marked this pull request as ready for review October 22, 2026 23:25
Copilot AI balanced review requested due to automatic review settings October 22, 2026 23:25
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Repository reconciliation: this PR does not reference exactly one canonical issue.

Please add a Closes #<issue> reference in the PR description so it can be tracked against the delivery plan.

See governance: #898

Copilot AI 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.

🔵 Needs a closer look

The unresolved Pillow security/Python 3.10 compatibility blocker tracked in #2459 requires a maintainer decision and passing security gates before approval.

No open issues 🎉

What changed in this PR

This PR guards EventRelay against an unplanned Anthropic SDK 2.x migration and updates the transitive certifi dependency to address GHSA-6q48-6c7w-9gw2.

Changes:

  • Cap Anthropic at <2 while preserving the locked 0.120.2 artifact.
  • Assert the unified client’s exact Anthropic request shape, including omission of removed sampling fields.
  • Update certifi to 2026.10.19 with replacement artifact metadata and hashes.
File Description
uv.lock Updates certifi artifacts and mirrors the Anthropic constraint.
tests/​unit/​test_unified_ai_sdk.py Adds exact request-argument and sampling-field assertions.
pyproject.toml Caps the Anthropic dependency below SDK 2.x.

Review effort: Balanced

@github-actions github-actions Bot added ci/cd documentation Improvements or additions to documentation labels Oct 22, 2026
@groupthinking groupthinking changed the title security(deps): guard Anthropic major and patch certifi GHSA-6q48-6c7w-9gw2 security(deps): guard AI SDKs and move runtime to patched Pillow Oct 22, 2026
@groupthinking groupthinking changed the title security(deps): guard AI SDKs and move runtime to patched Pillow fix(security): guard AI SDKs and move to patched Pillow Oct 22, 2026

Copy link
Copy Markdown
Owner Author

Independent Watch check of head 6deccdcf41ff39f9e4a20c0cfc0990f1577eec0d: Dependency Review run 39872831917/job 120151154945 reports no vulnerable packages at moderate or higher, then fails on existing license policy: Pillow 13.0.0 MIT-CMU and yt-dlp 2026.10.21 Unlicense (including dynamically resolved requirements paths). This is a license-policy failure, not a remaining Pillow advisory in this run. I am not changing the active security branch or policy. For #2448, the Watch run is testing a scoped read-only-token hosted route: this public repository can use a standard Ubuntu runner for free, and the official tool's own sample uses GH_TOKEN: ${{ github.token }} with contents:read. Connector credentials will not be extracted. The final pilot diff will preserve the dependency-review policy.

@groupthinking
groupthinking merged commit e93fd0e into main Oct 23, 2026
36 checks passed
@groupthinking
groupthinking deleted the fix/anthropic-sdk-v2-compat branch October 23, 2026 00:02
@linear-code

linear-code Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

GRV-838

This branch was successfully deployed

1 active deployment
Preview — 9a76e5d6 Deployed Oct 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd documentation Improvements or additions to documentation python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

security: resolve Pillow 12.3.0 advisories vs Python 3.10 support

2 participants