# A bad release lived two hours. Client repos should wait seven days

> Adding one line of uv configuration is easy; keeping the cooldown in force from CI through to an emergency patch is harder.

Original: https://fdetimes.net/en/guides/uv-dependency-cooldown-client-repos/

On October 21, 2026, a malicious release of litellm, version 1.107.0, appeared on PyPI at 11:39 UTC and stayed until 13:23, about two hours. According to LiteLLM, users who installed it through pip in that window without pinning a version were affected.

Eleven months earlier, in a post dated November 21, 2025, William Woodruff examined the supply chain attacks known at the time and argued that a seven-day wait could have kept most of them from reaching end users. He was also clear that it is no cure-all. With uv, getting started takes a single line of configuration.

The difficulty lies in the client's repo. Your laptop may be protected while the CI runner is not, and an urgent patch can get stuck behind the gate you built. This exercise covers the whole route, from the configuration line to the handover.

## When do the seven days start?

Take the litellm case. If you resolve at 12:00 UTC on October 21 with a seven-day cooldown, the cutoff is 12:00 UTC on October 14. Version 1.107.0 came out at 11:39 on October 21, so it is skipped. It would have been old enough at 11:39 on October 28 at the earliest, long after it had disappeared.

Lockfiles and cooldowns block at two different moments. uv does not treat `uv.lock` as outdated when a new version appears, so a locked repo keeps its earlier choices. The cooldown earns its keep when someone resolves again, above all during an upgrade.

**Key point:** The lockfile preserves old choices; the cooldown protects the moment you pick a new version.

## Step 1: Write the rule into the repo

You need a Python repo that uses uv, already has `pyproject.toml` and `uv.lock`, and is managed in Git. uv must be 0.9.17 or later: that release, dated December 9, 2025, was the first to accept relative durations. Work on a separate branch, and check the version on both your laptop and CI.

```bash
git switch -c try-cooldown
uv --version
```

Add this to `pyproject.toml`. If the `[tool.uv]` table already exists, add only the second line:

```toml
[tool.uv]
exclude-newer = "1 week"
```

uv also accepts `"7 days"` and the ISO 8601 form `"P7D"`. Months and years are not allowed as units.

**Check:** run `git diff pyproject.toml` and make sure the new line sits inside `[tool.uv]` and has not slipped into another table.

## Step 2: Read the lockfile as you would a code change

Now have uv resolve under the new rule:

```bash
uv lock
git diff uv.lock
```

With the cutoff of 12:00 UTC on October 14 from the example above, the diff looks like this. It is simplified: the package name and version numbers are made up, and field names and values may differ with your version of uv.

```diff
+[options]
+exclude-newer = "2026-10-14T12:00:00Z"
+exclude-newer-span = "P7D"

 [[package]]
 name = "example-package"
-version = "2.4.1"
+version = "2.4.0"
```

The top section shows the cutoff and the waiting period. The bottom section deserves the closer review: a package has moved back a version because the locked release is still too new.

uv calculates the cutoff from the current time, then writes it to the lockfile. It does not drift forward overnight; it updates only on a new resolution, such as one with `--upgrade` or `--refresh`. CI therefore does not turn red just because the date has changed.

One consequence is easy to misread. Seven days is the minimum age for a release to be considered. It is no delivery schedule: a patch that is old enough still stays out of the repo until someone upgrades.

**Check:** find the cooldown entry in the diff, then look for any package that moved back a version. If resolution fails, first look for a constraint that requires a release less than seven days old. Do not loosen the cooldown across the repo to rescue one package.

## Step 3: Turn the lockfile into a CI gate

On the runner, `--locked` makes uv raise an error when the lockfile no longer matches, instead of silently fixing it:

```bash
uv sync --locked
```

This gate checks consistency and does not yet check policy. A pull request that loosens `exclude-newer` and updates the lockfile can still match. Require someone with the authority to do so to approve every change to `[tool.uv]`.

**Check:** on the test branch, change a version constraint in `pyproject.toml` so that the locked version no longer satisfies it, do not run `uv lock`, then run the command above. It must fail; once you revert the change, it must succeed again.

## Step 4: Rehearse an urgent patch

PyPI advises pairing a cooldown with a vulnerability scanning strategy, because sometimes you need a new release immediately. The escape hatch should be exactly one package wide. The example below uses `setuptools`:

```toml
[tool.uv]
exclude-newer = "1 week"
exclude-newer-package = { setuptools = false }
```

```bash
uv lock --upgrade-package setuptools
git diff uv.lock
uv sync --locked
```

The value `false` exempts that package entirely from the global cutoff, while `--upgrade-package` limits the upgrade. If the patch pulls in a dependency that was also just released, that dependency is still subject to the cooldown; consider it as a separate exemption.

Record the reason, the approver and the removal date in the pull request. Remove the exemption once the patch is old enough, since resolving again too early would drop it from the list of candidates. Forget to remove it, and the package that was once the most dangerous becomes the only one with no waiting period.

**Check:** the diff must show `setuptools` moving to the version you want, with no other package changing version unexpectedly, and `uv sync --locked` must pass.

## Step 5: Find where the client's environment bypasses the cooldown

User configuration in `~/.config/uv/uv.toml` is merged with the project configuration, and the project wins where the two differ. Environment variables, however, override configuration files. On the runner, list the names of the uv variables that are set, without printing their values, which may contain secrets:

```bash
env | grep '^UV_' | cut -d= -f1
```

If a variable resets the cutoff, ask who owns it. Do not leave the cooldown only in your own user file, because colleagues who clone the repo will not receive it.

Internal indexes are the first thing to ask about. To filter by date, the index must return `upload-time`; according to JFrog, Artifactory from the 7.132.x line provides this field only when Simple JSON Format is enabled. Start by asking the administrator to confirm that the feature is on.

If an index holds only internal packages and has no `upload-time`, uv lets you exempt it separately. This is a simplified configuration with a placeholder URL:

```toml
[[tool.uv.index]]
name = "internal"
url = "https://packages.example.com/simple"
exclude-newer = false
```

According to the pydevtools guide updated on September 9, 2026, this is still a preview feature and uv prints a warning on every run; the flag `--preview-features index-exclude-newer` silences it. Ask whether the index forwards packages from PyPI. If it does, exempting the whole index also reopens the door to public packages.

**Check:** no variable on the runner resets the cutoff, or any that does has an accountable owner. For each index, you have either the administrator's confirmation that `upload-time` is returned, or an exemption with a stated reason.

## Three mistakes that leave the gate on paper only

The first mistake is to try the cooldown as a command-line argument and assume the job is done. According to pydevtools, which verified this with uv 0.13, uv writes the waiting period to `uv.lock` but not to the configuration. The next plain `uv lock` drops it. To check, run `uv lock` again and read the diff.

The next is to treat Dependabot and uv as a single switch. Dependabot supports uv, but its cooldown defaults to three days and applies only to version updates, not to security updates. Seven days has to be set explicitly; test both kinds of pull request against the client's uv configuration.

The last is to turn on a cooldown without assigning anyone to read vulnerability alerts. The waiting time that guards against malicious releases then also becomes time spent carrying old vulnerabilities. Before handover, ask the client to name the person authorized to approve exemptions.

## Put the work on your CV, beyond the tool's name

When you apply for an FDE role, "set up a seven-day cooldown, a lockfile gate in CI and an urgent patch process with a named approver" is more convincing than "knows uv", provided you have done it. If the job posting mentions the software supply chain or deployment inside client networks, have the diff and the rehearsal record ready to present at interview.

## Hand over once you have five pieces of evidence

| Item | Evidence for the client |
| --- | --- |
| Rule in the repo | `exclude-newer` is in `pyproject.toml`; running `uv lock` again does not remove it |
| CI gate | One deliberate failure when the lockfile is out of step |
| Environment | Names of the uv variables on the runner; confirmation of `upload-time` for each index |
| Urgent patch | A rehearsal pull request recording the reason, approver and removal date |
| Vulnerability scanning | Names of the person who reads alerts and the person who approves exemptions |

The `exclude-newer` line is typed once. A good handover also says who opens the gate when a patch cannot wait, and who closes it again.

**Try this week:**

- Create a test branch in a personal repo, add exclude-newer = "1 week", run uv lock, then read every changed line in git diff uv.lock.
- Rehearse an urgent patch: exempt one package, upgrade only that package, then write a record of the reason, approver and removal date.

## Sources

- [We should all be using dependency cooldowns](https://blog.yossarian.net/2025/11/21/We-should-all-be-using-dependency-cooldowns)

- [Contained: Oct 21, 2026 LiteLLM release v1.107.0 Compromised](https://docs.litellm.ai/blog/security-incident-oct-21-2026)

- [Resolution | uv](https://docs.astral.sh/uv/concepts/resolution/)

- [uv changelog 0.9.x](https://raw.githubusercontent.com/astral-sh/uv/main/changelogs/0.9.x.md)

- [uv docs: Resolution (docs/concepts/resolution.md)](https://raw.githubusercontent.com/astral-sh/uv/main/docs/concepts/resolution.md)

- [How to protect against Python supply chain attacks with uv](https://pydevtools.com/handbook/how-to/how-to-protect-against-python-supply-chain-attacks-with-uv/)

- [Settings | uv](https://docs.astral.sh/uv/reference/settings/)

- [Locking and syncing | uv](https://docs.astral.sh/uv/concepts/projects/sync/)

- [Configuration files | uv](https://docs.astral.sh/uv/concepts/configuration-files/)

- [ARTIFACTORY: How to Support Upload Date-Based Package Filtering for uv and pip (Artifactory 7.132.x+)](https://jfrog.com/help/r/artifactory-how-to-support-upload-date-based-package-filtering-for-uv-and-pip-artifactory-7-132-x)

- [How to Use `--exclude-newer` for Reproducible Python Environments](https://pydevtools.com/handbook/how-to/how-to-use-exclude-newer-for-reproducible-python-environments/)

- [Incident Report: LiteLLM/Telnyx supply-chain attacks, with guidance (PyPI Blog)](https://blog.pypi.org/posts/2026-04-02-incident-report-litellm-telnyx-supply-chain-attack/)

- [Dependabot options reference](https://docs.github.com/en/code-security/dependabot/working-with-dependabot/dependabot-options-reference)
