Integrations / CI
GitHub Actions integration
Two workflow steps connect GitHub Actions to Osty. osty verify fails the job when the lockfile resolves a blocked version or one without a signed verdict, and osty stamp signs an Ed25519 attestation that ties the image digest to the commit and run. Both commands ship in the osty CLI (Apache 2.0 source).
Written by Osty EngineeringPublished Updated
| Step | Command | Fails the job when | Reads from GitHub Actions |
|---|---|---|---|
| Policy check | osty policy validate .osty/policy.yaml | The policy has a schema or semantic error. | Nothing. |
| Lockfile gate | osty verify --lockfile package-lock.json | A dependency is blocked, or has no verified verdict under FAIL_CLOSED. | OSTY_EDGE_CACHE and OSTY_POLICY_PATH from env. |
| Provenance | osty stamp --artifact-digest <sha256> --signing-key <pem> | The digest, key or detected CI context is invalid. | GITHUB_REPOSITORY, GITHUB_SHA, GITHUB_RUN_ID, GITHUB_RUN_ATTEMPT, GITHUB_SERVER_URL. |
| Attestation check | osty stamp verify --attestation provenance.json --public-key stamp.pub.pem | The signature or digest does not match. | Nothing. |
osty verify --lockfile package-lock.json --jsonWhat do I need before adding the workflow?
- A Go 1.26 toolchain on the runner to install the pure-Go
ostybinary (CGO_ENABLED=0). - A signed verdict cache.
osty-edgekeeps one at--cache-path; a self-hosted runner on the edge host can read it directly. - A committed
.osty/policy.yaml. See Policy and Ledger for the schema. - For provenance, an Ed25519 key pair from
osty stamp keygen, with the private key stored as theOSTY_STAMP_KEYsecret.
osty stamp keygen --private-key stamp.pem --public-key stamp.pub.pemHow do I gate pull requests with osty verify?
The job runs on a self-hosted runner labelled osty-edge that can read the edge cache. osty verify reads OSTY_EDGE_CACHE and OSTY_POLICY_PATH when --cache and --policy are omitted, and accepts package-lock.json, go.sum, go.mod, requirements.txt and uv.lock.
.github/workflows/osty-verify.ymlyamlname: osty-verify
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
jobs:
verify:
runs-on: [self-hosted, linux, osty-edge]
env:
OSTY_EDGE_CACHE: /var/lib/osty/edge-cache.sqlite
OSTY_POLICY_PATH: .osty/policy.yaml
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.26"
- name: Install osty
run: CGO_ENABLED=0 go install github.com/osty-io/osty/cmd/osty@latest
- name: Validate policy
run: osty policy validate .osty/policy.yaml
- name: Verify lockfile against signed verdicts
run: osty verify --lockfile package-lock.json --jsonRun self-hosted runners only on repositories that do not build pull requests from forks, so untrusted code never executes next to the edge cache.
Why does an empty cache fail the build?
With proxyFailureMode.prodCI: FAIL_CLOSED, a version with no verified verdict in the cache is held. The job prints the reason and exits non-zero:
osty verify output with no verdict cachedtextverified package-lock.json (NPM_PACKAGE_LOCK): total=1 allowed=0 quarantined=1 blocked=0
NPM left-pad@1.3.0 [PULL_DECISION_QUARANTINE_HOLD/SUPPLY_CHAIN_VERDICT_UNSPECIFIED]: no verified verdict in local cache; policy failure mode FAIL_CLOSED blocks unvetted pull
osty verify: lockfile verification blocked one or more dependenciesCan I use GitHub-hosted runners?
Yes, if the job first imports a signed intelligence archive into a local cache. osty airgap import verifies every bundle against the brain public key before writing.
osty airgap import --archive osty-intel.tar.gz --brain-public-key brain.pub.pem --cache "$RUNNER_TEMP/edge-cache.sqlite"
osty verify --lockfile package-lock.json --cache "$RUNNER_TEMP/edge-cache.sqlite" --jsonIs there a published GitHub Action?
Yes. osty-dev/osty-action is an Apache 2.0 action that installs the osty CLI, runs osty policy validate and osty verify, and can sign provenance with osty stamp. It writes the verdict counts to step outputs and a Markdown table to the job summary.
osty-dev/osty-action@v1yamlsteps:
- uses: actions/checkout@v4
- id: osty
uses: osty-dev/osty-action@v1
with:
lockfile: package-lock.json
cache: .osty/edge-cache.sqlitePass airgap-archive and airgap-brain-public-key instead of cache to import a signed intelligence archive on a GitHub-hosted runner, and fail-on-block: "false" to record the verdict without failing the job.
How do I sign build provenance with osty stamp?
Run osty stamp after the image push. It detects GitHub Actions from GITHUB_ACTIONS=true and fills repository, commit, run ID and run URL, so only the artifact digest and signing key are required. Pass --base-image-digest to record base-image lineage.
.github/workflows/build-and-stamp.ymlyamlname: build-and-stamp
on:
push:
branches: [main]
permissions:
contents: read
packages: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.26"
- name: Install osty
run: CGO_ENABLED=0 go install github.com/osty-io/osty/cmd/osty@latest
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: push
uses: docker/build-push-action@v6
with:
push: true
tags: ghcr.io/${{ github.repository }}:${{ github.sha }}
- name: Stamp provenance
env:
IMAGE_DIGEST: ${{ steps.push.outputs.digest }}
OSTY_STAMP_KEY: ${{ secrets.OSTY_STAMP_KEY }}
run: |
printf '%s\n' "$OSTY_STAMP_KEY" > "$RUNNER_TEMP/stamp.pem"
osty stamp --artifact-digest "$IMAGE_DIGEST" --signing-key "$RUNNER_TEMP/stamp.pem" --out provenance.json
- uses: actions/upload-artifact@v4
with:
name: osty-provenance
path: provenance.jsonosty stamp verify --attestation provenance.json --public-key stamp.pub.pem --artifact-digest "$IMAGE_DIGEST"How does Osty classify these workflows before speculative CI?
Before Osty pushes a speculative branch, osty-edge classifies every workflow the push would trigger. Only PURE_VERIFY workflows run remotely by default. These are the classifier's real results for the two files above:
| Workflow | Class | Reasons reported |
|---|---|---|
osty-verify.yml | SIDE_EFFECT_POSSIBLE | The go install, osty policy validate and osty verify run steps are opaque commands the classifier cannot prove side-effect free. |
build-and-stamp.yml | SIDE_EFFECT_CONFIRMED | docker/login-action, docker/build-push-action with push: true, and shell output redirection. |
A SIDE_EFFECT_CONFIRMED workflow never runs speculatively. A SIDE_EFFECT_POSSIBLE workflow runs remotely only when its path, name or file name appears in ciGovernor.safeVerifyWorkflows; otherwise Osty verifies inside the edge's local container. Repository overlays may only narrow that list.
ciGovernor section of .osty/policy.yamlyamlciGovernor:
maxConcurrentCampaignRuns: 10
routineBudgetPercent: 20
kevBurstBudgetPercent: 60
flakeControlRerun: true
safeVerifyWorkflows:
- .github/workflows/osty-verify.ymlFrequently asked questions
Is there a published GitHub Action for Osty?
Yes. Use uses: osty-dev/osty-action@v1 from osty-dev/osty-action, or install the CLI with go install as shown and bake it into your runner image.
Which lockfiles does osty verify read?
package-lock.json, go.sum, go.mod, requirements.txt and uv.lock.
Does osty stamp need network access?
No. It signs locally with your key and writes the attestation to stdout or --out.
Why is my verify workflow not PURE_VERIFY?
The classifier treats run steps it cannot prove read-only as opaque. Add the workflow path to ciGovernor.safeVerifyWorkflows after review.