Safeguard
Developer Tools•

How long do GitLab job artifacts last, and who can download them?

Artifacts expire by expire_in or the instance default, but the latest are kept. Covers artifacts:access, dependencies, and why not to use them as releases.

Safeguard Security Team
3 min read

Artifacts expire after the time you set with expire_in, or after the instance default if you set none. GitLab also keeps the latest artifacts from each ref by default, and expire_in does not apply to them. Use artifacts:access to limit who can download, and do not treat artifacts as a release store.

Expiry rules

GitLab says that when expire_in is not defined, the default artifact expiration instance setting is used. A user can select Keep on a job page to stop one from expiring. Separately, GitLab keeps artifacts from the latest pipeline on each ref, and from the most recent successful pipeline, and notes that expire_in does not apply to these. That can use a lot of storage, and the behavior can be turned off in project CI/CD settings.

For scan outputs and test reports, that means old reports may live longer than you expect. If a report contains a secret or internal paths, deletion is your control. Deleting logs and artifacts is permanent and needs the job owner or a Maintainer or Owner.

Who can download

The artifacts:access keyword limits who can download a job's artifacts; the page example uses access: maintainer. Check the keyword reference for the full list of values. The page also mentions publicly accessible download URLs, so confirm project visibility. Our post on who can read logs and artifacts goes deeper.

Passing artifacts between jobs

By default, later jobs download artifacts from earlier stages. The dependencies keyword limits which jobs supply them, and dependencies: [] stops a job downloading any. To fetch from jobs in the same pipeline, GitLab says use needs:artifacts.

KeywordEffect
expire_inSets when the artifact is removed
artifacts:accessLimits who can download
dependencies: []A job downloads none
needs:artifactsFetch from named jobs in the same pipeline
untrackedIncludes untracked files, so check what you sweep up

Steps to tidy up

  1. Set expire_in on every job that produces artifacts.
  2. Exclude files that may hold secrets, using artifacts:exclude.
  3. Set dependencies: [] on jobs that do not need earlier output, so a poisoned artifact has fewer readers.
  4. Restrict download with artifacts:access where reports are sensitive.
  5. Move releases to the package or container registry. GitLab says not to use job artifacts as a release store.
  6. Remember each artifact file has a default size cap of 100 MB.

Try it yourself

Click through it at your own pace, or open it full screen. Look at how results are tracked over time instead of living in a one-off file.

Safeguard's compliance and evidence automation keeps results in the platform, so they are not tied to an artifact expiry date. A free scan is at https://gold.safeguard.sh/scan. For a CI recipe, see the GitLab job artifacts recipe.

Quick check

Why is an old report still downloadable?

GitLab keeps the latest artifacts for each ref by default, regardless of expire_in.

Should I keep release binaries as artifacts?

No. GitLab advises against using artifacts as a release store.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.