# AI use cases for Syft (anchore/syft)

Repo: [anchore/syft](https://github.com/anchore/syft) | Use cases: 3 | Page: https://dedupedai.com/use-cases/anchore-syft/

Syft is a CLI tool and Go library that generates a Software Bill of Materials (SBOM) from container images and filesystems. It supports dozens of packaging ecosystems, outputs CycloneDX, SPDX and Syft JSON, can convert between SBOM formats, and pairs with Grype for vulnerability detection. It is Apache-2.0 licensed.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- List every package inside a container image: https://dedupedai.com/use-cases/anchore-syft/list-the-packages-inside-a-container-image-with-syft/
- Export an SBOM in SPDX and CycloneDX formats: https://dedupedai.com/use-cases/anchore-syft/export-an-sbom-in-spdx-and-cyclonedx-with-syft/
- Scan images built with Podman or Buildah: https://dedupedai.com/use-cases/anchore-syft/scan-podman-and-buildah-images-with-syft/

## How to list every package inside a container image with Syft

Repo: [anchore/syft](https://github.com/anchore/syft) | Difficulty: Beginner | Time: 15 minutes | Basis: From the README

Point Syft at an image and see all the packages it contains in one command.

**Who it is for:** A platform engineer who wants to know what actually ships inside an image before deploying it.

**The problem:** Images pull in OS and language packages that nobody wrote down.

**The outcome:** A readable list of the packages found in the image.

### Steps

1. Install Syft with `curl -sSfL https://get.anchore.io/syft | sudo sh -s -- -b /usr/local/bin`
2. Run `syft alpine:latest`, replacing alpine:latest with your own image reference
3. Read the package list that Syft prints
4. Run `syft ./my-project` on a directory to inventory a project the same way

### Prompt to paste into your agent

```text
Using anchore/syft, install it with `curl -sSfL https://get.anchore.io/syft | sudo sh -s -- -b /usr/local/bin`, run `syft alpine:latest` against <my image>, and summarise the packages by ecosystem.
```

### Caveat

Syft inventories packages; for vulnerabilities the README points to a scanner like Grype.

Risk, system: The install command runs a downloaded script with sudo; read it first or use another method from the Syft installation docs.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/anchore-syft/list-the-packages-inside-a-container-image-with-syft/

## How to export an SBOM in SPDX and CycloneDX formats with Syft

Repo: [anchore/syft](https://github.com/anchore/syft) | Difficulty: Beginner | Time: 15 minutes | Basis: From the README

Write SPDX and CycloneDX SBOM files in a single run so customers and auditors can each get their format.

**Who it is for:** A security lead who has to hand an SBOM to customers or compliance reviewers.

**The problem:** Different consumers ask for different SBOM formats.

**The outcome:** An spdx.json and a cdx.json file written from one scan.

### Steps

1. Install Syft with `curl -sSfL https://get.anchore.io/syft | sudo sh -s -- -b /usr/local/bin`
2. Run Syft on your image or directory with the flags `-o spdx-json=./spdx.json -o cyclonedx-json=./cdx.json`
3. Check both files were written
4. Attach them to your release or share them with the reviewer

### Prompt to paste into your agent

```text
Use anchore/syft to scan <my project or image> and write both an SPDX JSON and a CycloneDX JSON SBOM with the flags `-o spdx-json=./spdx.json -o cyclonedx-json=./cdx.json`, then confirm both files exist and count the packages in each.
```

### Caveat

The README shows several -o flags in one run, each writing its own file.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/anchore-syft/export-an-sbom-in-spdx-and-cyclonedx-with-syft/

## How to scan images built with Podman or Buildah with Syft

Repo: [anchore/syft](https://github.com/anchore/syft) | Difficulty: Intermediate | Time: 20 minutes | Basis: From the README

Inventory a locally built image straight from containers-storage without pushing it anywhere.

**Who it is for:** A developer building images with Podman or Buildah on Linux who wants an SBOM before pushing.

**The problem:** Plain image references never look in the local containers-storage store.

**The outcome:** A package list for a local image that was never published.

### Steps

1. Install Syft on Linux from the release binaries, which include this feature
2. Run `syft --from containers-storage localhost/myimage:latest` for a normal store
3. For rootless stores run `podman unshare syft --from containers-storage localhost/myimage:latest`
4. Add an output format flag to save an SBOM file

### Prompt to paste into your agent

```text
With anchore/syft on Linux, run `syft --from containers-storage localhost/myimage:latest` for my local image <name> (use `podman unshare syft --from containers-storage localhost/myimage:latest` if rootless) and report the package count.
```

### Caveat

Linux only per the README; building Syft from source needs extra build tags.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/anchore-syft/scan-podman-and-buildah-images-with-syft/
