# Hold new versions with the age gate

> Turn on the age gate on an npm or PyPI proxy, and new versions wait a set number of days before installs and upgrades pick them up.

New versions wait 7 days before installs and upgrades pick them up.

That is the age gate, on an npm or PyPI proxy. A version published in the last few days is held back, and installs and upgrades get the newest version that has waited long enough.

Check a proxy’s gate with curl. It reads your repository token from `~/.netrc`, so the token never appears on a command line ([Repository Tokens](/docs/authenticate/repository-tokens.html) says how to make one):

**Terminal**

```bash
curl --netrc --fail --silent --show-error --output /dev/null --dump-header - \
  https://your-org.mycloudrepo.io/repositories/npmjs/lodash
```

Expected: a `200` status line and a header like `x-cloudrepo-age-gate: days=7, held=1`. `days` is the setting and `held` is how many versions of that package this answer held back.

The age gate is in early access. Tell us what you think from the card in the portal.

## Turn it on

1. Open the proxy repository in the portal and choose **Settings**.
2. Turn on **Age gate**. New versions wait 7 days.
3. To change the wait, type a number of days from 1 to 3,650 and choose **Save**.

The owner, every Admin and any member with Manage repositories can change it. Turning the gate off, or lowering the days, asks you to confirm who you are first, because it lets younger versions through. The Audit Log records every change.

The gate is per proxy repository and is off until someone turns it on.

## What your clients see

- **npm** prints one line during the install: `npm notice CloudRepo age gate: 1 version of lodash newer than 7 days is held back.`
- **pip and uv** install the newest file that has waited long enough. Open the project’s simple page in a browser to see how many files are held back.

## Why is a version missing?

A version published less than the wait ago is held back. Installs and upgrades get the newest version that has waited long enough, and `latest` points at it. `npm install lodash@<new version>` and `pip install requests==<new version>` say the version is not found until it has waited. A request for that npm version’s own document answers 404 [`version_held_by_age_gate`](/docs/reference/error-codes.html#version_held_by_age_gate), with the reason in its message.

## Lockfiles and direct downloads

A `package-lock.json` or `uv.lock` that already names a version still installs it. `npm ci` and `uv sync --frozen` download the tarball or wheel the lockfile pinned, as before: the gate decides only what installs and upgrades resolve to. A `package-lock.json` written against npmjs works the same way, so a team moving to CloudRepo does not break its first `npm ci`. Installing a gated package with –offline needs a lockfile.

## Groups

A group has no gate of its own. Each proxy member’s gate applies to the packages that member serves, and a hosted member is never gated: those are your team’s own releases. The group’s Connect tab names each proxy member whose gate is on.

## Registries that do not publish release times

The gate needs the upstream to date each version. If it dates none, installs through a gated proxy answer:

> This repository’s upstream does not publish release times, so its age gate cannot check new versions. An Admin can turn the age gate off in the repository’s settings.

Turn the gate on only if your registry publishes release times. The code is [`age_gate_undated_upstream`](/docs/reference/error-codes.html#age_gate_undated_upstream).

A PyPI project whose page is too large to check answers that it is “too large to check its age; ask us to raise the limit” ([`age_gate_page_too_large`](/docs/reference/error-codes.html#age_gate_page_too_large)). Tell us, and we will.

## PyPI checks each file

On PyPI the gate judges each file by its own upload time, not each release. When an old release gets a new wheel, that wheel waits too. Until it has waited, a new Python version may install the sdist or an older release.

## Maven

Maven proxies do not have an age gate yet. Maven Central does not publish a trustworthy release time for each version, so we will add it when one exists.

---

The page: https://www.cloudrepo.io/docs/consume/age-gate.html
