# Osty CLI reference

Docs. Breadcrumb: [Home](https://osty.dev/) / [Docs](https://osty.dev/docs) / CLI reference

The `osty` CLI (Apache 2.0 source) has ten commands and `version`. Every command exits 0 on success, 1 when a check fails or blocks a dependency, and 2 on a usage error. Flags use Go syntax, so `-json` and `--json` are the same flag, and `--help` works on every command and subcommand.

Table: `osty` commands, synopsis and machine-readable output

| Command | Synopsis | Machine output |
| --- | --- | --- |
| Validate policy | `osty policy validate <path>` | One `valid` line with the policy digest |
| Gate a lockfile | `osty verify --lockfile <path> [--json]` | `--json` report |
| Sign provenance | `osty stamp --artifact-digest <sha256> --signing-key <pem>` | JSON attestation |
| Check provenance | `osty stamp verify --attestation <path> --public-key <pem>` | Text summary |
| Explain a decision | `osty explain --package <ref> --cache <path> [--json]` | `--json` evidence report |
| Day-1 report | `osty xray --repo <path> [--format json]` | `--format text`, `json` or `markdown` |
| Offline intelligence | `osty airgap export` and `osty airgap import` | `--json` summary |
| Evidence bundles | `osty compliance export`, `osty compliance verify`, `osty compliance push` | `--json` report |
| KEV waivers | `osty waiver sign` and `osty waiver verify` | Signed waiver JSON, `--json` result |
| Rollback approval | `osty dual-control sign` | Signed approval JSON |
| Ledger export check | `osty ledger verify-export --bundle <path> [--json]` | `--json` result |

Gate a lockfile and read the JSON report:

```bash
osty verify --lockfile package-lock.json --json
```

## How do I install the osty CLI?

The CLI is pure Go and builds with `CGO_ENABLED=0`, so one static binary runs on Linux, macOS and CI runners. `osty version` prints the build, Go version and platform.

Install and check the build:

```bash
CGO_ENABLED=0 go install github.com/osty-io/osty/cmd/osty@latest
osty version
osty --help
```

Prebuilt `osty` and `osty-sensor` archives for each release are on [osty-dev/osty](https://github.com/osty-dev/osty/releases). On macOS and Linux, the [osty-dev/homebrew-tap](https://github.com/osty-dev/homebrew-tap) formula installs the same release binary.

Install with Homebrew:

```bash
brew install osty-dev/tap/osty
```

Coding agents can load the `osty-security` Agent Skill from [osty-dev/agent-skills](https://github.com/osty-dev/agent-skills) so they call these commands with the right flags instead of guessing.

## How do exit codes, flags and output streams work?

Table: Exit codes shared by every `osty` command

| Exit code | Meaning | Example |
| --- | --- | --- |
| 0 | Success, or `--help` on any command | `osty policy validate` on a valid file |
| 1 | A check failed, a dependency was held or blocked, or a file could not be read | `osty verify` with a quarantined dependency |
| 2 | Usage error: unknown command, unknown flag or a missing required flag | `osty verify` without `--lockfile` |

- Flags come before positional arguments. `osty policy validate` takes its path last, and every other command takes flags only.
- Value flags accept `--flag value` or `--flag=value`. Boolean flags such as `--json` take no value, or an explicit `--json=false`.
- Results go to stdout. Errors go to stderr as `osty <command>: <error>`, so `--json` output stays parseable.
- `--help` and `-h` print the command's usage or flag list to stderr and exit 0.

Table: Environment variables that set `osty` flag defaults

| Variable | Default for | Commands |
| --- | --- | --- |
| `OSTY_EDGE_CACHE` | `--cache` | `osty verify`, `osty explain`, `osty airgap import` |
| `OSTY_POLICY_PATH` | `--policy` | `osty verify`, `osty explain` |
| `OSTY_SIGNING_KEY` | `--signing-key` | `osty stamp` |
| `OSTY_OPERATOR_SIGNING_KEY` | `--signing-key` | `osty waiver sign`, `osty dual-control sign` |
| `OSTY_ORG_ID` | `--org-id` | `osty explain` |
| `OSTY_PROXY_KEV_WAIVER_DIR` | `--kev-waiver-dir` | `osty explain` |
| `GOPRIVATE` | Private Go module patterns | `osty xray` with `--respect-goprivate` |

## osty policy validate

`osty policy validate` parses one `.osty/policy.yaml` file with the same strict parser `osty-edge` and `osty-proxy` use, then prints the `sha256` digest the edge pins. It takes no flags. The [policy reference](https://osty.dev/docs/policy) lists every key and rule.

Validate the policy before you commit it:

```bash
osty policy validate .osty/policy.yaml
```

A failing policy lists every issue by key path and exits 1:

```text
osty policy: policy has 1 validation issue(s):
  autonomy.tiers.TIER_9: invalid service tier "TIER_9": allowed values are TIER_0, TIER_1, TIER_2, TIER_3
```

## osty verify

`osty verify` checks every dependency in a lockfile against signed verdicts in the local edge cache and exits 1 when any dependency is quarantined or blocked. It reads `package-lock.json`, `go.sum`, `go.mod`, `requirements.txt` and `uv.lock`. Without `--policy` it fails closed and blocks `CONFIRMED_MALICIOUS` and `QUARANTINED_HIGH_RISK` verdicts.

Table: Flags for `osty verify`

| Flag | Value | Default | What it does |
| --- | --- | --- | --- |
| `--lockfile` | path | required | Lockfile to verify. |
| `--cache` | path | `$OSTY_EDGE_CACHE` | SQLite edge cache holding signed verdicts. |
| `--policy` | path | `$OSTY_POLICY_PATH` | Policy whose `blockVerdicts` and `proxyFailureMode` apply. |
| `--origin` | `prod-ci` or `dev-laptop` | `prod-ci` | Selects the `proxyFailureMode` for unvetted dependencies. |
| `--json` | bool | false | Print the JSON report instead of text. |

Gate a lockfile against the edge cache:

```bash
osty verify --lockfile package-lock.json --policy .osty/policy.yaml --cache /var/lib/osty/edge-cache.sqlite
```

Text output with no verdict cached for `left-pad`, exit 1:

```text
verified 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 dependencies
```

The same run with `--json` (stdout only):

```json
{
  "path": "package-lock.json",
  "format": "NPM_PACKAGE_LOCK",
  "total": 1,
  "allowed": 0,
  "quarantined": 1,
  "blocked": 0,
  "findings": [
    {
      "ecosystem": "NPM",
      "name": "left-pad",
      "version": "1.3.0",
      "decision": "PULL_DECISION_QUARANTINE_HOLD",
      "verdict": "SUPPLY_CHAIN_VERDICT_UNSPECIFIED",
      "reasons": [
        "no verified verdict in local cache; policy failure mode FAIL_CLOSED blocks unvetted pull"
      ]
    }
  ]
}
```

## osty stamp

`osty stamp` signs an Ed25519 provenance attestation that binds an artifact digest to its repository, commit and CI run. In GitHub Actions and CircleCI it fills repository, commit and run details from the CI environment. Anywhere else, pass `--repo`, `--commit-sha`, `--ci-provider` and `--ci-run-id` yourself.

Generate a key, sign an attestation outside CI and verify it:

```bash
osty stamp keygen --private-key stamp.pem --public-key stamp.pub.pem
osty stamp \
  --artifact-digest sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \
  --signing-key stamp.pem \
  --repo acme/api \
  --commit-sha 0123456789abcdef0123456789abcdef01234567 \
  --ci-provider GITHUB_ACTIONS \
  --ci-run-id 9137 \
  --ci-run-url https://github.com/acme/api/actions/runs/9137 \
  --out provenance.json
osty stamp verify --attestation provenance.json --public-key stamp.pub.pem
```

`osty stamp verify` output:

```text
verified provenance attestation
  key_id               sha256:ae6d53cb0ebf0362c33118694f6dc0eb2554b69d8a6340e545e09cdc095613d4
  artifact_digest      sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  repository           GITHUB:acme/api
  commit_sha           0123456789abcdef0123456789abcdef01234567
  ci_provider          GITHUB_ACTIONS
  ci_run_id            9137
  ci_run_url           https://github.com/acme/api/actions/runs/9137
  deployed_at          2026-11-29T23:02:06Z
```

### Sign: osty stamp

Table: Flags for `osty stamp`

| Flag | Value | Default | What it does |
| --- | --- | --- | --- |
| `--artifact-digest` | sha256 digest | required | Immutable digest of the built artifact. |
| `--signing-key` | PEM path | `$OSTY_SIGNING_KEY` | Ed25519 PKCS#8 private key. Required. |
| `--forge` | `GITHUB` or `GITLAB` | `GITHUB` | Source forge recorded with the repository. |
| `--repo` | owner/name | detected from CI | Repository full name. |
| `--commit-sha` | SHA | detected from CI | Built commit. |
| `--ci-provider` | `GITHUB_ACTIONS` or `CIRCLECI` | detected from CI | CI provider. Other values are rejected. |
| `--ci-run-id` | string | detected from CI | CI run identifier. |
| `--ci-run-url` | URL | detected from CI | CI run URL. |
| `--base-image-digest` | sha256 digest | none | Runtime base image, used for base-image lineage. |
| `--build-sbom-digest` | digest | none | Digest of the `BUILD_TIME` SBOM. |
| `--runtime-sbom-digest` | digest | none | Digest of the `RUNTIME_IMAGE` SBOM. |
| `--built-at` | RFC3339 | none | Build time. |
| `--deployed-at` | RFC3339 | now | Deploy time. |
| `--out` | path | stdout | Write the attestation to a file. |

### Verify: osty stamp verify

Table: Flags for `osty stamp verify`

| Flag | Value | Default | What it does |
| --- | --- | --- | --- |
| `--attestation` | path | required | Attestation file to verify. |
| `--public-key` | PEM paths | required | Comma-separated trusted Ed25519 public keys. |
| `--artifact-digest` | sha256 digest | none | Fail unless the attestation covers this digest. |

### Keys: osty stamp keygen

Table: Flags for `osty stamp keygen`

| Flag | Value | Default | What it does |
| --- | --- | --- | --- |
| `--private-key` | path | required | Where to write the PEM PKCS#8 private key. |
| `--public-key` | path | required | Where to write the PEM PKIX public key. |

## osty explain

`osty explain` reports, offline, why Osty allows, quarantines or blocks one package, every package in a lockfile, or one advisory. Choose exactly one of `--package`, `--lockfile` or `--cve`. It reads only the local edge cache and exits 1 when an explained package or lockfile is held or blocked.

Table: Flags for `osty explain`

| Flag | Value | Default | What it does |
| --- | --- | --- | --- |
| `--package` | `ecosystem:name@version` | none | Package such as `npm:left-pad@1.3.0`. Ecosystems: `npm`, `pypi`, `go`, `oci`, `cargo`, `maven`. |
| `--lockfile` | path | none | Explain every dependency in a lockfile. |
| `--cve` | advisory ID | none | Explain a `CVE-` or `GHSA-` advisory. |
| `--cache` | path | `$OSTY_EDGE_CACHE` | Edge cache to read. Required. |
| `--policy` | path | `$OSTY_POLICY_PATH` | Policy applied to the explanation. |
| `--origin` | `prod-ci` or `dev-laptop` | `prod-ci` | Pull origin used for the failure mode. |
| `--brain-public-key` | PEM path | none | Re-verify cached bundle signatures against this key. |
| `--org-id` | UUID | `$OSTY_ORG_ID` | Organisation that KEV cooldown waivers are bound to. |
| `--kev-waiver-dir` | directory | `$OSTY_PROXY_KEV_WAIVER_DIR` | Signed KEV cooldown waivers to report. Needs `--operator-key` and `--org-id`. |
| `--operator-key` | `key-id=operator-id=path` | none | Trusted operator key for waivers. Repeatable. |
| `--json` | bool | false | Print the JSON evidence report. |

Explain one package and one advisory from the edge cache:

```bash
osty explain --package npm:left-pad@1.3.0 --cache /var/lib/osty/edge-cache.sqlite --json
osty explain --cve CVE-2024-5535 --cache /var/lib/osty/edge-cache.sqlite
```

## osty xray

`osty xray` writes the read-only Day-1 report of false positives, stale deploys, drift and owners for local repositories or a fleet snapshot. It needs at least one `--repo` or a `--fleet` file, and it refuses to write `--out` inside a scanned input.

Table: Flags for `osty xray`

| Flag | Value | Default | What it does |
| --- | --- | --- | --- |
| `--repo` | path | none | Repository to scan. Repeatable or comma-separated. |
| `--fleet` | path | none | JSON fleet snapshot of live workloads. |
| `--format` | `text`, `json` or `markdown` | `text` | Report format. |
| `--out` | path | stdout | Write the report to a file. |
| `--reachability` | `off` or `auto` | `off` | Native-compiler call-graph reachability. |
| `--cache` | path | none | Edge cache or `osty airgap import` cache with signed verdicts and advisories. |
| `--brain-public-key` | PEM path | none | Brain key the bundles in `--cache` must verify against. Repeatable. |
| `--advisories` | path | none | Signed advisory feed snapshot. Repeatable. |
| `--advisories-key` | PEM path | none | Key trusted to sign advisory snapshots. Repeatable. |
| `--attestation-key` | PEM path | none | Key trusted to sign `osty stamp` attestations. Repeatable. |
| `--dependency-cache` | `maven=path` or `cargo=path` | none | Offline dependency cache for Java and Rust. Repeatable. |
| `--private-scope` | prefix or glob | none | Internally owned package names such as `@acme/`. Repeatable. |
| `--private-registry` | hostname | none | Registry whose packages are private. Repeatable. |
| `--public-registry` | hostname | none | Mirror of public packages. Repeatable. |
| `--respect-goprivate` | bool | true | Treat Go modules matching `GOPRIVATE` as private. |
| `--public-feed` | path | none | Signed public namespace hash batch for the dependency-confusion check. Repeatable. |
| `--public-feed-key` | PEM path | none | Key trusted to sign public namespace batches. Repeatable. |
| `--as-of` | RFC3339 | now | Report time for the 90-day contributor window. |

Write a Markdown report for the current repository:

```bash
osty xray --repo . --reachability auto --format markdown --out /tmp/xray.md
```

## osty airgap

`osty airgap export` packs signed intelligence bundles into a `.tar.gz` archive, and `osty airgap import` verifies every bundle, the chain and downgrades before it writes anything. Use `--verify-only` to check an archive without importing it.

To export from or import into the control plane database, run `osty-control airgap` with the same flags. It also takes `--database-url` (default `$OSTY_DATABASE_URL`), and its import signs Evidence Ledger entries for imported overrides with `--ledger-signing-key` (default `$OSTY_CONTROL_LEDGER_KEY`) and `--ledger-key-id` (default `control-ledger` or `$OSTY_CONTROL_LEDGER_KEY_ID`).

Export from a live brain, then verify and import offline:

```bash
osty airgap export --out osty-intel.tar.gz --brain-public-key brain.pub.pem --brain-url https://brain.osty.example.com --json
osty airgap import --archive osty-intel.tar.gz --brain-public-key brain.pub.pem --verify-only
osty airgap import --archive osty-intel.tar.gz --brain-public-key brain.pub.pem --cache /var/lib/osty/edge-cache.sqlite
```

### Export: osty airgap export

Table: Flags for `osty airgap export`

| Flag | Value | Default | What it does |
| --- | --- | --- | --- |
| `--out` | path | required | Archive to create. Must not exist. |
| `--brain-public-key` | PEM path | required | Key every exported bundle must verify against. |
| `--brain-url` | URL | none | Stream bundles from a live `osty-brain`. |
| `--bundles` | path | none | File or directory of signed bundles (`.pb` or `.json`). |
| `--namespace-batches` | path | none | File or directory of signed namespace hash batches. |
| `--after-sequence` | integer | 0 | Export only bundles after this sequence. |
| `--after-namespace-sequence` | integer | 0 | Export only namespace batches after this sequence. |
| `--signing-key` | PEM path | none | Sign the archive manifest. |
| `--signing-key-id` | string | `airgap-courier` | Key ID recorded with the manifest signature. |
| `--json` | bool | false | Print a JSON export summary. |

### Import: osty airgap import

Table: Flags for `osty airgap import`

| Flag | Value | Default | What it does |
| --- | --- | --- | --- |
| `--archive` | path | required | Archive to import. |
| `--brain-public-key` | PEM path | required | Key every bundle must verify against. |
| `--cache` | path | `$OSTY_EDGE_CACHE` | Import into a SQLite edge cache. |
| `--verify-only` | bool | false | Verify the archive without writing. |
| `--manifest-public-key` | PEM path | none | Key that must have signed the manifest. |
| `--verdict-override-keys` | `key-id=path` list | none | Keys trusted to sign human verdict overrides. |
| `--private-packages` | path | none | Private package names to check against imported namespace batches. |
| `--json` | bool | false | Print a JSON import report. |

## osty compliance

`osty compliance` builds SOC 2, ISO 27001, EU CRA and FedRAMP evidence bundles from the hash-chained ledger, verifies them offline and pushes a signed summary to Vanta, Drata, ServiceNow, Jira or a webhook. `osty compliance push` verifies the bundle before it sends anything. The [GRC guide](https://osty.dev/integrations/vanta-drata-servicenow) shows each provider.

Export, verify and push a SOC 2 bundle:

```bash
osty compliance export --framework soc2 --input evidence.json --signing-key compliance.pem --out soc2-2026q4.tar.gz
osty compliance verify --bundle soc2-2026q4.tar.gz --public-key compliance.pub.pem --json
osty compliance push --provider vanta --bundle soc2-2026q4.tar.gz --public-key compliance.pub.pem \
  --endpoint "$VANTA_EVIDENCE_URL" --token-env VANTA_API_TOKEN
```

### Export: osty compliance export

Table: Flags for `osty compliance export`

| Flag | Value | Default | What it does |
| --- | --- | --- | --- |
| `--framework` | `soc2`, `iso27001`, `eu-cra` or `fedramp` | required | Control framework. |
| `--input` | path | required | Evidence JSON with the organisation ledger chain from genesis. |
| `--signing-key` | PEM path | required | Signs the bundle manifest. |
| `--signing-key-id` | string | `compliance-export` | Key ID recorded with the signature. |
| `--ledger-keys` | JSON path | bundle signing key | Maps ledger key IDs to public key paths. |
| `--out` | path | required | Bundle to create. Must not exist. |
| `--json` | bool | false | Print a JSON export summary. |

### Verify: osty compliance verify

Table: Flags for `osty compliance verify`

| Flag | Value | Default | What it does |
| --- | --- | --- | --- |
| `--bundle` | path | required | Bundle to verify. |
| `--public-key` | PEM path | required | Key that must have signed the manifest. |
| `--ledger-keys` | JSON path | `--public-key` | Maps ledger key IDs to public key paths. |
| `--json` | bool | false | Print a JSON verification report. |

### Push: osty compliance push

Table: Flags for `osty compliance push`

| Flag | Value | Default | What it does |
| --- | --- | --- | --- |
| `--bundle` | path | required | Bundle to verify and push. |
| `--public-key` | PEM path | required | Key that must have signed the manifest. |
| `--ledger-keys` | JSON path | `--public-key` | Maps ledger key IDs to public key paths. |
| `--provider` | `vanta`, `drata`, `servicenow`, `jira` or `webhook` | required | GRC destination. |
| `--endpoint` | https URL | required | Full provider API URL for your tenant. |
| `--token-env` | variable name | required | Environment variable that holds the token, password or webhook secret. |
| `--auth` | `bearer` or `basic` | none | Scheme for ServiceNow and Jira. Webhooks always use HMAC. |
| `--username` | string | none | Username for basic authentication. |
| `--jira-project` | key | none | Jira project for the evidence issue. |
| `--jira-issue-type` | string | `Task` | Jira issue type. |
| `--ca-file` | PEM path | none | Extra CA certificates for the endpoint. |
| `--allow-private-endpoint` | bool | false | Allow loopback and private-network endpoints. Link-local and metadata addresses stay blocked. |
| `--allow-insecure-http` | bool | false | Allow plain `http` endpoints, for lab use. |
| `--max-attempts` | integer | 4 | Delivery attempts on 429 and 5xx responses. |
| `--json` | bool | false | Print a JSON push report. |

## osty waiver and osty dual-control

Both commands sign approvals with an operator's Ed25519 key. `osty waiver sign` drafts or co-signs a KEV cooldown waiver for an `ANOMALOUS_REVIEW` fix, which needs two distinct operator signatures and expires within 7 days. `osty dual-control sign` signs one operator approval for a kill switch rollback, which a broad rollback needs from two operators when `killSwitch.requireDualControlForBroadRollback` is true.

Draft a KEV waiver from the cached verdict, then verify it:

```bash
osty waiver sign --org-id 7f9c0c56-7a8e-4f4b-9d55-1f9f1d1c2e3a --ecosystem NPM --name left-pad --version 1.3.1 \
  --advisory-id CVE-2026-12345 --service-tier TIER_1 --justification "KEV fix reviewed in CHG-4182" \
  --expires-in 72h --cache /var/lib/osty/edge-cache.sqlite \
  --operator-id alice --key-id ops-alice --signing-key alice.pem --out waiver.json
osty waiver sign --waiver waiver.json --operator-id bob --key-id ops-bob --signing-key bob.pem --out waiver.json
osty waiver verify --waiver waiver.json --operator-key ops-alice=alice=alice.pub.pem --operator-key ops-bob=bob=bob.pub.pem --json
```

### Sign: osty waiver sign

Table: Flags for `osty waiver sign`

| Flag | Value | Default | What it does |
| --- | --- | --- | --- |
| `--operator-id` | string | required | Approving operator. |
| `--key-id` | string | required | Registered operator signing key ID. |
| `--signing-key` | PEM path | `$OSTY_OPERATOR_SIGNING_KEY` | Operator private key. |
| `--waiver` | path | none | Existing waiver to co-sign. Cannot be combined with the body flags below. |
| `--org-id` | UUID | none | Organisation the waiver is bound to. |
| `--ecosystem` | `NPM`, `PYPI`, `GO` or `OCI` | none | Package ecosystem. |
| `--name` | string | none | Package name. |
| `--version` | string | none | Version that carries the KEV fix. |
| `--artifact-digest` | sha256 digest | cached verdict digest | Exact artifact being approved. |
| `--advisory-id` | CVE ID | none | KEV advisory the version fixes. |
| `--service-tier` | `TIER_0` to `TIER_3` | none | Highest tier the fix ships to, as audit metadata. |
| `--repository` | string | none | Repository the waiver was approved for, as audit metadata. |
| `--justification` | string | none | Human justification recorded in the ledger. |
| `--expires-at` | RFC3339 | none | Expiry, at most 7 days after signing. |
| `--expires-in` | duration | none | Expiry relative to now, at most `168h`. |
| `--anomaly-delta-file` | path | none | Observed anomaly delta. Use this or `--cache`. |
| `--cache` | path | none | Edge cache holding the signed `ANOMALOUS_REVIEW` verdict. |
| `--out` | path | stdout | Write the signed waiver to a file. |

### Verify: osty waiver verify

Table: Flags for `osty waiver verify`

| Flag | Value | Default | What it does |
| --- | --- | --- | --- |
| `--waiver` | path | required | Signed waiver JSON. |
| `--operator-key` | `key-id=operator-id=path` | required | Trusted operator key. Repeatable. |
| `--cache` | path | none | Also check the waiver against the cached signed verdict. |
| `--json` | bool | false | Print a JSON verification result. |

### Approve: osty dual-control sign

Table: Flags for `osty dual-control sign`

| Flag | Value | Default | What it does |
| --- | --- | --- | --- |
| `--campaign-id` | UUID | required | Kill switch campaign. |
| `--triggering-bundle-digest` | sha256 digest | required | Signed threat bundle shown on the kill switch page. |
| `--target-workload-keys` | comma-separated keys | required | Workloads to roll back, such as `k8s:prod:payments:Deployment/api`. |
| `--operator-id` | string | required | Approving operator. |
| `--key-id` | string | required | Registered operator signing key ID. |
| `--signing-key` | PEM path | `$OSTY_OPERATOR_SIGNING_KEY` | Operator private key. |

## osty ledger verify-export

`osty ledger verify-export` checks an exported Evidence Ledger bundle offline: every entry hash, the chain from genesis, the signatures and, with `--trusted-checkpoint`, that the export extends a checkpoint you saved earlier.

Table: Flags for `osty ledger verify-export`

| Flag | Value | Default | What it does |
| --- | --- | --- | --- |
| `--bundle` | path | required | `osty.ledger.export.v1` JSON bundle. |
| `--trusted-key` | `key-id=key` | none | Pinned ledger key as base64 or a PEM path. Repeatable. |
| `--trusted-checkpoint` | path | none | Signed checkpoint from an earlier export. |
| `--json` | bool | false | Print a JSON verification result. |

Verify an export against a pinned key:

```bash
osty ledger verify-export --bundle ledger-export.json --trusted-key control-ledger=ledger.pub.pem --json
```

## Frequently asked questions

### Does osty verify need network access?

No. `osty verify` and `osty explain` read only the local edge cache. Fill the cache from `osty-edge` or with `osty airgap import`.

### Why does osty verify fail when nothing is cached?

Under `FAIL_CLOSED`, a dependency without a verified verdict is held, so the report counts it as quarantined and the command exits 1. Use `--origin dev-laptop` only where the policy sets `devLaptop: FAIL_OPEN_WITH_CACHE`.

### Can I sign provenance in GitLab CI?

Not yet. `osty stamp` accepts only `GITHUB_ACTIONS` and `CIRCLECI` as CI providers and rejects any other value.

### Which output is safe to parse?

Parse stdout from `--json` or `osty xray --format json`. Diagnostics and errors always go to stderr.

## Related pages

- [Policy reference](https://osty.dev/docs/policy): Every `.osty/policy.yaml` key, autonomy tier and tighten-only rule.
- [Edge and proxy reference](https://osty.dev/docs/edge-proxy): `osty-edge serve` and `osty-proxy serve` flags, endpoints and fail-closed behavior.
- [GitHub Actions](https://osty.dev/integrations/github-actions): Run `osty verify` and `osty stamp` in a workflow.
- [Guard](https://osty.dev/guard): Pre-install supply-chain firewall: Firecracker honey-secret detonation, artifact-vs-Git diffs, behavior baselines, dependency-confusion defense and `osty-proxy`.

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

Get a free X-Ray: https://osty.dev/xray

Written by Osty Engineering. Published 2026-11-29. Updated 2026-11-29.

Canonical: https://osty.dev/docs/cli
