Skip to content

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

CircleCI variables osty stamp reads when CIRCLECI=true
Attestation fieldCircleCI variableFallbackOverride flag
RepositoryCIRCLE_PROJECT_USERNAME / CIRCLE_PROJECT_REPONAMEEmpty, which fails validation--repo
CommitCIRCLE_SHA1None--commit-sha
CI run IDCIRCLE_WORKFLOW_IDCIRCLE_BUILD_NUM--ci-run-id
CI run URLCIRCLE_BUILD_URLNone--ci-run-url
CI providerSet to CIRCLECINone--ci-provider
ForgeGITHUB by defaultNone--forge GITLAB
Gate the lockfile in a CircleCI job
osty verify --lockfile package-lock.json --json

How 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.ymlyaml
version: 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: main

How 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.

Offline verificationbash
osty stamp verify --attestation provenance.json --public-key stamp.pub.pem
Example outputtext
verified 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:13Z

How does Osty classify this config?

Classifier output for the .circleci/config.yml on this page
JobClassReasons reported
osty-verifySIDE_EFFECT_POSSIBLEosty policy validate and osty verify are opaque run commands.
build-and-stampSIDE_EFFECT_CONFIRMEDdocker 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.

See your fleet in 10 minutes

Connect a read-only GitHub App and cloud role. Osty installs nothing in your environment and writes nothing to your repositories, and the report shows false positives, stale deploys and unowned workloads.