Safeguard
Security Guides•

Bake CI tools into the runner image or download them at job time?

Baking tools into a versioned runner image gives repeatable, reviewable builds. Downloading at job time is flexible but adds supply chain risk.

Safeguard Security Team
4 min read

For most teams, bake the tools your pipelines need into a versioned runner image and download only what a specific job genuinely varies. Baked tools are reviewed once, pinned and scanned. Tools fetched at job time are fetched again on every run, from whatever the network serves that minute.

The two approaches

Baked. The image build installs compilers, scanners and CLIs at pinned versions. Jobs start fast, need less outbound access, and run the same tool everywhere.

Downloaded at job time. A step runs a download script or a package install. It is flexible, and teams like it because anyone can add a tool without touching the image. It is also the pattern behind many supply chain incidents, because the download happens inside a job that may hold credentials.

Comparison

QuestionBaked into imageDownloaded at job time
Is the version the same every run?Yes, if pinnedOnly if the script pins it
Who reviews the tool?The image owner, onceWhoever wrote the step
Outbound network needed in jobs?LessMore
Can you scan it before use?Yes, as part of the imageHarder, it arrives mid job
SpeedFaster startsAdds download time per job
FlexibilityNeeds an image changeHigh

When downloading is acceptable

Per-project tools with narrow use, such as a one-off migration utility, can reasonably be downloaded. If you do that:

  1. Pin an exact version, never a moving label.
  2. Verify a checksum or signature published by the maintainer, and keep the expected value in your repository.
  3. Fetch from an internal mirror where you can, so the source is under your control.
  4. Do not run the download step in a job that holds deploy credentials.

Steps to move from downloaded to baked

  1. Search your pipeline files for download commands such as curl piped to a shell, wget, or install scripts.
  2. List the tools and versions each one fetches.
  3. Add the common ones to the runner image build with pinned versions and checksums.
  4. Replace the job steps with a version check that fails if the tool differs from what you expect.
  5. Leave a documented path for adding a tool, with review, so people do not route around it.

What this does for your SBOM and scans

A baked image can be inventoried. Its SBOM lists what a job could execute, and a scan can flag vulnerable tool versions before the image is released. Tools downloaded mid job never appear in that inventory unless you capture them separately, which is why they tend to be invisible in audits.

Try it yourself

Click through it at your own pace, or open it full screen.

Notice how an inventory only lists what it can see, which is the argument for putting tools in the image where they can be seen.

Safeguard's SBOM and dependency scanning can inventory a runner image like any other artifact, and you can try a free scan at gold.safeguard.sh/scan.

Quick check

Does baking tools make images huge?

It can. Keep the image to what most pipelines use and split a second, larger image for specialised teams rather than one image for everyone.

Is curl piped to a shell ever fine in CI?

Treat it as unreviewed code execution with whatever credentials the job holds. Pin and verify instead.

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.