Safeguard
Developer Tools•

How long does Bitbucket Pipelines keep artifacts, and what is scoped?

Artifacts last up to 14 days and 1 GB each. Shared artifacts pass between steps, scoped ones do not. How to limit what lands in them and move records out.

Safeguard Security Team
4 min read

Bitbucket Pipelines keeps artifacts for up to 14 days, each up to 1 GB. Shared artifacts are available to later steps, and scoped artifacts cannot be downloaded across steps. Treat artifacts as short lived working files. For anything an auditor or a later investigation needs, copy it to storage you control.

What the documentation says

Artifacts are files a step produces that you can share or export once defined in the pipeline configuration. There are three types. Shared artifacts are accessible across multiple steps. Scoped artifacts suit logs, test reports, screenshots or videos and cannot be downloaded across steps. Test report artifacts are XML and confined to a single step.

TypeCrosses stepsTypical content
SharedYesBuild output for the next step
ScopedNoLogs, reports, screenshots
Test reportNoXML test results

Defaults that matter for security

By default a step downloads all artifacts from earlier steps. A step can set download: false to skip them, or list the specific names it needs. That default means a poisoned file from an early step reaches every later step, including deploy. Files must sit inside the clone directory when the step ends. Downloaded files get default permissions of 644, so scripts need chmod +x.

Steps to tighten them

  1. Set download: false on steps that do not need earlier output, and list names on those that do.
  2. Use ignore-paths or narrow patterns so you do not sweep up configuration files, .env files or credentials.
  3. Choose scoped artifacts for reports so they do not flow into later steps.
  4. Build once and deploy the same output. See build once, promote the same artifact.
  5. For long retention, send files to external storage such as an object store or artifact repository. The page names AWS S3, JFrog Artifactory and Google Cloud Storage, and passes credentials through environment variables, not in the file.
  6. Record a hash of the final deploy artifact in a place the pipeline cannot rewrite. See build artifact integrity verification.
- step:
    name: Deploy
    artifacts:
      download: false
    script:
      - ./fetch-signed-release.sh

The script name is a placeholder.

Evidence after 14 days

Auditors often ask for scan results from months ago, and a 14 day window will not cover that. Keep dated scan outputs and approval records in a retained location. The post on CI pipeline output as audit evidence explains what counts.

Common mistakes

A frequent one is publishing a whole build directory as an artifact because it is easy, then finding configuration files or local credentials inside it. Another is assuming a later step will see a fresh checkout when it actually receives earlier artifacts by default. Check what a step really downloads by reading its log, and trim both what you upload and what you accept.

Try it yourself

Click through it at your own pace, or open it full screen. Look at how findings are tracked over time rather than inside a single run.

Safeguard's compliance and evidence automation keeps results beyond one pipeline run, and you can try a free scan at https://gold.safeguard.sh/scan.

Quick check

Can a later step read a scoped artifact?

No. Scoped artifacts cannot be downloaded across steps.

Does Bitbucket say who can browse artifacts in the UI?

The page we read does not say. Check your own workspace permissions.

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.