Skip to content

feat: add github cosign for releases - #24683

Closed
krrish-berri-2 wants to merge 2 commits into
mainfrom
litellm_dev_cosign_gh_releases
Closed

feat: add github cosign for releases#24683
krrish-berri-2 wants to merge 2 commits into
mainfrom
litellm_dev_cosign_gh_releases

Conversation

@krrish-berri-2

Copy link
Copy Markdown
Contributor

Relevant issues

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/test_litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

Delays in PR merge?

If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).

CI (LiteLLM team)

CI status guideline:

  • 50-55 passing tests: main is stable with minor issues.
  • 45-49 passing tests: acceptable but needs attention
  • <= 40 passing tests: unstable; be careful with your merges and assess the risk.
  • Branch creation CI run
    Link:

  • CI run for the last commit
    Link:

  • Merge / cherry-pick CI run
    Links:

Type

🆕 New Feature
🐛 Bug Fix
🧹 Refactoring
📖 Documentation
🚄 Infrastructure
✅ Test

Changes

@vercel

vercel Bot commented Mar 27, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment Apr 5, 2026 7:27am

Request Review

Comment thread .github/workflows/release_docker.yml Outdated
cosign verify \
--certificate-identity-regexp "https://github.com/BerriAI/litellm/" \
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
"ghcr.io/berriai/${{ matrix.image }}:${{ github.event.inputs.tag }}"

Check failure

Code scanning / zizmor

code injection via template expansion Error

code injection via template expansion
Comment thread .github/workflows/release_docker.yml Outdated
--certificate-identity-regexp "https://github.com/BerriAI/litellm/" \
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
--type spdxjson \
"ghcr.io/berriai/${{ matrix.image }}:${{ github.event.inputs.tag }}"

Check failure

Code scanning / zizmor

code injection via template expansion Error

code injection via template expansion
Comment thread .github/workflows/release_docker.yml Outdated
cache-to: type=gha,mode=max

- name: Install cosign
uses: sigstore/cosign-installer@3454372f43399081ed03b604cb2d021dabca52bb # v4.1.1

Check warning

Code scanning / zizmor

detects commit SHAs that don't match their version comment tags Warning

detects commit SHAs that don't match their version comment tags
Comment thread .github/workflows/release_docker.yml Outdated

steps:
- name: Install cosign
uses: sigstore/cosign-installer@3454372f43399081ed03b604cb2d021dabca52bb # v4.1.1

Check warning

Code scanning / zizmor

detects commit SHAs that don't match their version comment tags Warning

detects commit SHAs that don't match their version comment tags
Comment thread .github/workflows/publish_to_pypi.yml Outdated
- name: Download published package from PyPI
run: |
pip download --no-deps --no-binary :all: \
litellm==${{ needs.preflight-checks.outputs.version }} \

Check notice

Code scanning / zizmor

code injection via template expansion Note

code injection via template expansion
Comment thread .github/workflows/publish_to_pypi.yml Outdated
litellm==${{ needs.preflight-checks.outputs.version }} \
-d verify/
pip download --no-deps --only-binary :all: \
litellm==${{ needs.preflight-checks.outputs.version }} \

Check notice

Code scanning / zizmor

code injection via template expansion Note

code injection via template expansion
@codspeed-hq

codspeed-hq Bot commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 16 untouched benchmarks


Comparing litellm_dev_cosign_gh_releases (742e035) with main (88ed4f9)

Open in CodSpeed

@CLAassistant

CLAassistant commented Mar 27, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ yuneng-berri
❌ krrish-berri-2
You have signed the CLA already but the status is still pending? Let us recheck it.

@greptile-apps

greptile-apps Bot commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds GitHub Cosign signing for LiteLLM releases. It introduces a new create-release.yml workflow that auto-generates GitHub releases with embedded cosign verification instructions, updates docker_quick_start.md with keyless signature verification commands for Docker images and PyPI packages, updates release_cycle.md to reference Sigstore signing, and adds a scripts/install.sh script for one-line installation.

Key issue found:

  • The create-release.yml release notes template references cosign.pub for key-based verification (--key https://raw.githubusercontent.com/BerriAI/litellm/${tag}/cosign.pub), but no cosign.pub file is committed to the repository. Simultaneously, the user-facing documentation uses keyless/OIDC-based signing — a fundamentally different mechanism. Every release will embed broken verification instructions until this inconsistency is resolved."

Confidence Score: 4/5

Safe to merge with one blocking issue: the embedded cosign.pub key-based verification in release notes will be broken.

The core infrastructure (workflow structure, permissions, input validation) is solid, but the release notes template embeds a verification command that will fail for every release — it references a non-existent cosign.pub file and uses a different signing paradigm than the documentation. This is a P1 correctness defect on the primary feature being shipped.

.github/workflows/create-release.yml lines 53-57 — the cosign verification snippet references a missing public key file and uses a different signing approach than the docs

Important Files Changed

Filename Overview
.github/workflows/create-release.yml New release workflow with solid structure (draft-then-publish, input validation, pinned action SHA), but embeds a key-based cosign verification command referencing a non-existent cosign.pub file that conflicts with the keyless signing described in documentation
docs/my-website/docs/proxy/docker_quick_start.md Adds keyless OIDC-based cosign verification docs for Docker images and PyPI packages; overly broad regexp issue already flagged in prior review threads
docs/my-website/docs/proxy/release_cycle.md Minor update adding a reference to Sigstore signing documentation — no issues
scripts/install.sh New one-line install script with proper POSIX compatibility, Python version checking, and interactive setup wizard prompt — no issues

Sequence Diagram

sequenceDiagram
    participant Maintainer
    participant GH as GitHub Actions
    participant DockerBuild as Docker Build Workflow
    participant GHCR as ghcr.io
    participant Sigstore as Sigstore/Fulcio
    participant User

    Maintainer->>GH: workflow_dispatch(tag, commit_hash)
    GH->>GH: Validate tag format + SHA
    GH->>GH: createRelease(draft=true)
    GH->>GH: Prepend cosign section to release body
    GH->>GH: updateRelease(draft=false)

    Note over DockerBuild,Sigstore: Separate Docker signing flow (keyless)
    DockerBuild->>GHCR: docker push image
    DockerBuild->>Sigstore: cosign sign (OIDC keyless)
    Sigstore-->>GHCR: Store signature

    User->>GHCR: cosign verify --key cosign.pub (from release notes)
    GHCR-->>User: ❌ Fails — no key-based signature exists
    User->>GHCR: cosign verify --certificate-identity-regexp (from docs)
    GHCR-->>User: ✅ Succeeds — keyless signature found
Loading

Reviews (2): Last reviewed commit: "chore: fixes" | Re-trigger Greptile

Comment thread .github/workflows/release_docker.yml Outdated
Comment on lines +138 to +141
cosign verify \
--certificate-identity-regexp "https://github.com/BerriAI/litellm/" \
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
"ghcr.io/berriai/${{ matrix.image }}:${{ github.event.inputs.tag }}"

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.

P1 Overly broad certificate identity regexp weakens supply-chain guarantee

The regexp "https://github.com/BerriAI/litellm/" matches the identity of any workflow in the repository — not just the release workflow. An image signed by a compromised or unrelated workflow would pass this check, defeating the core supply-chain assurance sigstore is meant to provide.

The PyPI workflow correctly uses an exact --cert-identity flag pinned to the specific workflow file and branch. The Docker verification should follow the same pattern — use --certificate-identity (not the regexp variant) and pin to release_docker.yml@refs/heads/main.

The same issue applies to the SBOM attestation verification on lines 145–149.

Comment thread .github/workflows/release_docker.yml Outdated
Comment on lines +143 to +149
- name: Verify SBOM attestation
run: |
cosign verify-attestation \
--certificate-identity-regexp "https://github.com/BerriAI/litellm/" \
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
--type spdxjson \
"ghcr.io/berriai/${{ matrix.image }}:${{ github.event.inputs.tag }}"

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.

P1 Overly broad regexp in SBOM attestation verification

Same issue as the image signature verification above: --certificate-identity-regexp "https://github.com/BerriAI/litellm/" accepts a signature from any workflow in the repository. Use --certificate-identity (exact match) pinned to the specific workflow file path and branch, consistent with how the PyPI verification is implemented.

Comment on lines +886 to +890
cosign verify \
--certificate-identity-regexp "https://github.com/BerriAI/litellm/" \
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
ghcr.io/berriai/litellm:main-latest
```

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.

P1 Documentation propagates the overly broad identity regexp

The user-facing verification command uses --certificate-identity-regexp "https://github.com/BerriAI/litellm/", which accepts a signature from any workflow in the repository. The documentation tells users this proves the artifact "was built by the official BerriAI/litellm CI", but the regexp is much weaker than that claim implies.

Compare with the PyPI section (line 914), which correctly pins --cert-identity to the exact workflow file. The Docker verification commands should do the same — swap the regexp flag for an exact --certificate-identity pinned to release_docker.yml@refs/heads/main.

The same change is needed for the SBOM attestation command on lines 899–903.

Comment thread .github/workflows/release_docker.yml Outdated
Comment on lines +62 to +64
tags: |
type=raw,value=${{ github.event.inputs.tag }}
type=raw,value=main-latest

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.

P2 main-latest tag is unconditionally overwritten for every dispatch

type=raw,value=main-latest is always included in the pushed tags, meaning any workflow_dispatch invocation — including nightly, RC, or hotfix releases — will silently overwrite main-latest. Users relying on that tag for production deployments could inadvertently pick up a pre-release image.

Consider making this conditional, for example by only adding main-latest when the tag doesn't contain -nightly or similar pre-release markers.

Comment thread .github/workflows/release_docker.yml Outdated
Comment on lines +136 to +141
- name: Verify image signature
run: |
cosign verify \
--certificate-identity-regexp "https://github.com/BerriAI/litellm/" \
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
"ghcr.io/berriai/${{ matrix.image }}:${{ github.event.inputs.tag }}"

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.

P2 Verification uses mutable tag instead of immutable digest

The verify-signatures job verifies by the mutable tag value (${{ github.event.inputs.tag }}). Because tags can be overwritten, this verification does not strictly confirm the just-signed digest is still what that tag points to.

The build-and-push job captures the exact digest in steps.push.outputs.digest. Consider passing it as a job output and verifying by digest instead of tag for stronger guarantees.

@greptile-apps greptile-apps Bot mentioned this pull request Mar 27, 2026
7 tasks
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions Bot added the stale label Jul 5, 2026
@github-actions github-actions Bot closed this Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants