Integrations / CI
CircleCI integration
CircleCI jobs run the same two Osty commands as any CI. osty verify gates the lockfile against signed verdicts, and osty stamp signs provenance after the image push. When CIRCLECI=true, the stamp reads project, commit, workflow ID and build URL from CircleCI's own environment, so the step needs only a digest and a key.
Written by Osty EngineeringPublished Updated
| Attestation field | CircleCI variable | Fallback | Override flag |
|---|---|---|---|
| Repository | CIRCLE_PROJECT_USERNAME / CIRCLE_PROJECT_REPONAME | Empty, which fails validation | --repo |
| Commit | CIRCLE_SHA1 | None | --commit-sha |
| CI run ID | CIRCLE_WORKFLOW_ID | CIRCLE_BUILD_NUM | --ci-run-id |
| CI run URL | CIRCLE_BUILD_URL | None | --ci-run-url |
| CI provider | Set to CIRCLECI | None | --ci-provider |
| Forge | GITHUB by default | None | --forge GITLAB |
osty verify --lockfile package-lock.json --jsonHow do I add Osty to .circleci/config.yml?
The verify job runs on a self-hosted machine runner in resource class acme/osty-edge, where osty is installed and the edge cache is readable. The build job runs on CircleCI's cloud, pushes the image and stamps it with a key from the osty-signing context.
.circleci/config.ymlyamlversion: 2.1
jobs:
osty-verify:
machine: true
resource_class: acme/osty-edge
environment:
OSTY_EDGE_CACHE: /var/lib/osty/edge-cache.sqlite
OSTY_POLICY_PATH: .osty/policy.yaml
steps:
- checkout
- run:
name: Validate policy
command: osty policy validate .osty/policy.yaml
- run:
name: Verify lockfile against signed verdicts
command: osty verify --lockfile package-lock.json --json
build-and-stamp:
docker:
- image: cimg/go:1.26
steps:
- checkout
- setup_remote_docker
- run:
name: Install osty
command: CGO_ENABLED=0 go install github.com/osty-io/osty/cmd/osty@latest
- run:
name: Build and push image
command: |
docker build -t "ghcr.io/acme/api:${CIRCLE_SHA1}" .
docker push "ghcr.io/acme/api:${CIRCLE_SHA1}"
docker inspect --format '{{index .RepoDigests 0}}' "ghcr.io/acme/api:${CIRCLE_SHA1}" | cut -d@ -f2 > image.digest
- run:
name: Stamp provenance
command: |
printf '%s\n' "$OSTY_STAMP_KEY" > /tmp/stamp.pem
osty stamp --artifact-digest "$(cat image.digest)" --signing-key /tmp/stamp.pem --out provenance.json
- store_artifacts:
path: provenance.json
workflows:
supply-chain:
jobs:
- osty-verify
- build-and-stamp:
requires: [osty-verify]
context: osty-signing
filters:
branches:
only: mainHow do I check the attestation the job produced?
Download provenance.json from the job artifacts and verify it against the public key. The output lists every signed field.
osty stamp verify --attestation provenance.json --public-key stamp.pub.pemverified provenance attestation
key_id sha256:6944ed0d90df17bdbb7bfc035e501967a7bbf154c56b8fd26c6f0b6eba5d3317
artifact_digest sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
repository GITHUB:acme/api
commit_sha 0123456789abcdef0123456789abcdef01234567
ci_provider CIRCLECI
ci_run_id wf-1
ci_run_url https://app.circleci.com/x
deployed_at 2026-11-29T19:40:13ZHow does Osty classify this config?
| Job | Class | Reasons reported |
|---|---|---|
osty-verify | SIDE_EFFECT_POSSIBLE | osty policy validate and osty verify are opaque run commands. |
build-and-stamp | SIDE_EFFECT_CONFIRMED | docker push and shell output redirection. |
Because one job is SIDE_EFFECT_CONFIRMED, Osty never triggers this config speculatively. Split verification into its own config or workflow and allowlist it in ciGovernor.safeVerifyWorkflows if you want remote speculative runs.
Frequently asked questions
Does osty stamp work for CircleCI projects hosted on GitLab?
Yes. Pass --forge GITLAB, because CircleCI detection defaults the forge to GitHub.
Why a self-hosted runner for the verify job?
It needs the signed verdict cache. On cloud executors, import a signed archive with osty airgap import first.
Where should the signing key live?
In a restricted CircleCI context such as osty-signing, attached only to jobs on main.