Skip to content

Docs

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

Written by Osty EngineeringPublished Updated

osty commands, synopsis and machine-readable output
CommandSynopsisMachine output
Validate policyosty policy validate <path>One valid line with the policy digest
Gate a lockfileosty verify --lockfile <path> [--json]--json report
Sign provenanceosty stamp --artifact-digest <sha256> --signing-key <pem>JSON attestation
Check provenanceosty stamp verify --attestation <path> --public-key <pem>Text summary
Explain a decisionosty explain --package <ref> --cache <path> [--json]--json evidence report
Day-1 reportosty xray --repo <path> [--format json]--format text, json or markdown
Offline intelligenceosty airgap export and osty airgap import--json summary
Evidence bundlesosty compliance export, osty compliance verify, osty compliance push--json report
KEV waiversosty waiver sign and osty waiver verifySigned waiver JSON, --json result
Rollback approvalosty dual-control signSigned approval JSON
Ledger export checkosty ledger verify-export --bundle <path> [--json]--json result
Gate a lockfile and read the JSON report
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 buildbash
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. On macOS and Linux, the osty-dev/homebrew-tap formula installs the same release binary.

Install with Homebrewbash
brew install osty-dev/tap/osty

Coding agents can load the osty-security Agent Skill from 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?

Exit codes shared by every osty command
Exit codeMeaningExample
0Success, or --help on any commandosty policy validate on a valid file
1A check failed, a dependency was held or blocked, or a file could not be readosty verify with a quarantined dependency
2Usage error: unknown command, unknown flag or a missing required flagosty 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.
Environment variables that set osty flag defaults
VariableDefault forCommands
OSTY_EDGE_CACHE--cacheosty verify, osty explain, osty airgap import
OSTY_POLICY_PATH--policyosty verify, osty explain
OSTY_SIGNING_KEY--signing-keyosty stamp
OSTY_OPERATOR_SIGNING_KEY--signing-keyosty waiver sign, osty dual-control sign
OSTY_ORG_ID--org-idosty explain
OSTY_PROXY_KEV_WAIVER_DIR--kev-waiver-dirosty explain
GOPRIVATEPrivate Go module patternsosty 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 lists every key and rule.

Validate the policy before you commit itbash
osty policy validate .osty/policy.yaml
A failing policy lists every issue by key path and exits 1text
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.

Flags for osty verify
FlagValueDefaultWhat it does
--lockfilepathrequiredLockfile to verify.
--cachepath$OSTY_EDGE_CACHESQLite edge cache holding signed verdicts.
--policypath$OSTY_POLICY_PATHPolicy whose blockVerdicts and proxyFailureMode apply.
--originprod-ci or dev-laptopprod-ciSelects the proxyFailureMode for unvetted dependencies.
--jsonboolfalsePrint the JSON report instead of text.
Gate a lockfile against the edge cachebash
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 1text
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 itbash
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 outputtext
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

Flags for osty stamp
FlagValueDefaultWhat it does
--artifact-digestsha256 digestrequiredImmutable digest of the built artifact.
--signing-keyPEM path$OSTY_SIGNING_KEYEd25519 PKCS#8 private key. Required.
--forgeGITHUB or GITLABGITHUBSource forge recorded with the repository.
--repoowner/namedetected from CIRepository full name.
--commit-shaSHAdetected from CIBuilt commit.
--ci-providerGITHUB_ACTIONS or CIRCLECIdetected from CICI provider. Other values are rejected.
--ci-run-idstringdetected from CICI run identifier.
--ci-run-urlURLdetected from CICI run URL.
--base-image-digestsha256 digestnoneRuntime base image, used for base-image lineage.
--build-sbom-digestdigestnoneDigest of the BUILD_TIME SBOM.
--runtime-sbom-digestdigestnoneDigest of the RUNTIME_IMAGE SBOM.
--built-atRFC3339noneBuild time.
--deployed-atRFC3339nowDeploy time.
--outpathstdoutWrite the attestation to a file.

Verify: osty stamp verify

Flags for osty stamp verify
FlagValueDefaultWhat it does
--attestationpathrequiredAttestation file to verify.
--public-keyPEM pathsrequiredComma-separated trusted Ed25519 public keys.
--artifact-digestsha256 digestnoneFail unless the attestation covers this digest.

Keys: osty stamp keygen

Flags for osty stamp keygen
FlagValueDefaultWhat it does
--private-keypathrequiredWhere to write the PEM PKCS#8 private key.
--public-keypathrequiredWhere 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.

Flags for osty explain
FlagValueDefaultWhat it does
--packageecosystem:name@versionnonePackage such as npm:left-pad@1.3.0. Ecosystems: npm, pypi, go, oci, cargo, maven.
--lockfilepathnoneExplain every dependency in a lockfile.
--cveadvisory IDnoneExplain a CVE- or GHSA- advisory.
--cachepath$OSTY_EDGE_CACHEEdge cache to read. Required.
--policypath$OSTY_POLICY_PATHPolicy applied to the explanation.
--originprod-ci or dev-laptopprod-ciPull origin used for the failure mode.
--brain-public-keyPEM pathnoneRe-verify cached bundle signatures against this key.
--org-idUUID$OSTY_ORG_IDOrganisation that KEV cooldown waivers are bound to.
--kev-waiver-dirdirectory$OSTY_PROXY_KEV_WAIVER_DIRSigned KEV cooldown waivers to report. Needs --operator-key and --org-id.
--operator-keykey-id=operator-id=pathnoneTrusted operator key for waivers. Repeatable.
--jsonboolfalsePrint the JSON evidence report.
Explain one package and one advisory from the edge cachebash
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.

Flags for osty xray
FlagValueDefaultWhat it does
--repopathnoneRepository to scan. Repeatable or comma-separated.
--fleetpathnoneJSON fleet snapshot of live workloads.
--formattext, json or markdowntextReport format.
--outpathstdoutWrite the report to a file.
--reachabilityoff or autooffNative-compiler call-graph reachability.
--cachepathnoneEdge cache or osty airgap import cache with signed verdicts and advisories.
--brain-public-keyPEM pathnoneBrain key the bundles in --cache must verify against. Repeatable.
--advisoriespathnoneSigned advisory feed snapshot. Repeatable.
--advisories-keyPEM pathnoneKey trusted to sign advisory snapshots. Repeatable.
--attestation-keyPEM pathnoneKey trusted to sign osty stamp attestations. Repeatable.
--dependency-cachemaven=path or cargo=pathnoneOffline dependency cache for Java and Rust. Repeatable.
--private-scopeprefix or globnoneInternally owned package names such as @acme/. Repeatable.
--private-registryhostnamenoneRegistry whose packages are private. Repeatable.
--public-registryhostnamenoneMirror of public packages. Repeatable.
--respect-goprivatebooltrueTreat Go modules matching GOPRIVATE as private.
--public-feedpathnoneSigned public namespace hash batch for the dependency-confusion check. Repeatable.
--public-feed-keyPEM pathnoneKey trusted to sign public namespace batches. Repeatable.
--as-ofRFC3339nowReport time for the 90-day contributor window.
Write a Markdown report for the current repositorybash
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 offlinebash
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

Flags for osty airgap export
FlagValueDefaultWhat it does
--outpathrequiredArchive to create. Must not exist.
--brain-public-keyPEM pathrequiredKey every exported bundle must verify against.
--brain-urlURLnoneStream bundles from a live osty-brain.
--bundlespathnoneFile or directory of signed bundles (.pb or .json).
--namespace-batchespathnoneFile or directory of signed namespace hash batches.
--after-sequenceinteger0Export only bundles after this sequence.
--after-namespace-sequenceinteger0Export only namespace batches after this sequence.
--signing-keyPEM pathnoneSign the archive manifest.
--signing-key-idstringairgap-courierKey ID recorded with the manifest signature.
--jsonboolfalsePrint a JSON export summary.

Import: osty airgap import

Flags for osty airgap import
FlagValueDefaultWhat it does
--archivepathrequiredArchive to import.
--brain-public-keyPEM pathrequiredKey every bundle must verify against.
--cachepath$OSTY_EDGE_CACHEImport into a SQLite edge cache.
--verify-onlyboolfalseVerify the archive without writing.
--manifest-public-keyPEM pathnoneKey that must have signed the manifest.
--verdict-override-keyskey-id=path listnoneKeys trusted to sign human verdict overrides.
--private-packagespathnonePrivate package names to check against imported namespace batches.
--jsonboolfalsePrint 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 shows each provider.

Export, verify and push a SOC 2 bundlebash
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

Flags for osty compliance export
FlagValueDefaultWhat it does
--frameworksoc2, iso27001, eu-cra or fedramprequiredControl framework.
--inputpathrequiredEvidence JSON with the organisation ledger chain from genesis.
--signing-keyPEM pathrequiredSigns the bundle manifest.
--signing-key-idstringcompliance-exportKey ID recorded with the signature.
--ledger-keysJSON pathbundle signing keyMaps ledger key IDs to public key paths.
--outpathrequiredBundle to create. Must not exist.
--jsonboolfalsePrint a JSON export summary.

Verify: osty compliance verify

Flags for osty compliance verify
FlagValueDefaultWhat it does
--bundlepathrequiredBundle to verify.
--public-keyPEM pathrequiredKey that must have signed the manifest.
--ledger-keysJSON path--public-keyMaps ledger key IDs to public key paths.
--jsonboolfalsePrint a JSON verification report.

Push: osty compliance push

Flags for osty compliance push
FlagValueDefaultWhat it does
--bundlepathrequiredBundle to verify and push.
--public-keyPEM pathrequiredKey that must have signed the manifest.
--ledger-keysJSON path--public-keyMaps ledger key IDs to public key paths.
--providervanta, drata, servicenow, jira or webhookrequiredGRC destination.
--endpointhttps URLrequiredFull provider API URL for your tenant.
--token-envvariable namerequiredEnvironment variable that holds the token, password or webhook secret.
--authbearer or basicnoneScheme for ServiceNow and Jira. Webhooks always use HMAC.
--usernamestringnoneUsername for basic authentication.
--jira-projectkeynoneJira project for the evidence issue.
--jira-issue-typestringTaskJira issue type.
--ca-filePEM pathnoneExtra CA certificates for the endpoint.
--allow-private-endpointboolfalseAllow loopback and private-network endpoints. Link-local and metadata addresses stay blocked.
--allow-insecure-httpboolfalseAllow plain http endpoints, for lab use.
--max-attemptsinteger4Delivery attempts on 429 and 5xx responses.
--jsonboolfalsePrint 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 itbash
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

Flags for osty waiver sign
FlagValueDefaultWhat it does
--operator-idstringrequiredApproving operator.
--key-idstringrequiredRegistered operator signing key ID.
--signing-keyPEM path$OSTY_OPERATOR_SIGNING_KEYOperator private key.
--waiverpathnoneExisting waiver to co-sign. Cannot be combined with the body flags below.
--org-idUUIDnoneOrganisation the waiver is bound to.
--ecosystemNPM, PYPI, GO or OCInonePackage ecosystem.
--namestringnonePackage name.
--versionstringnoneVersion that carries the KEV fix.
--artifact-digestsha256 digestcached verdict digestExact artifact being approved.
--advisory-idCVE IDnoneKEV advisory the version fixes.
--service-tierTIER_0 to TIER_3noneHighest tier the fix ships to, as audit metadata.
--repositorystringnoneRepository the waiver was approved for, as audit metadata.
--justificationstringnoneHuman justification recorded in the ledger.
--expires-atRFC3339noneExpiry, at most 7 days after signing.
--expires-indurationnoneExpiry relative to now, at most 168h.
--anomaly-delta-filepathnoneObserved anomaly delta. Use this or --cache.
--cachepathnoneEdge cache holding the signed ANOMALOUS_REVIEW verdict.
--outpathstdoutWrite the signed waiver to a file.

Verify: osty waiver verify

Flags for osty waiver verify
FlagValueDefaultWhat it does
--waiverpathrequiredSigned waiver JSON.
--operator-keykey-id=operator-id=pathrequiredTrusted operator key. Repeatable.
--cachepathnoneAlso check the waiver against the cached signed verdict.
--jsonboolfalsePrint a JSON verification result.

Approve: osty dual-control sign

Flags for osty dual-control sign
FlagValueDefaultWhat it does
--campaign-idUUIDrequiredKill switch campaign.
--triggering-bundle-digestsha256 digestrequiredSigned threat bundle shown on the kill switch page.
--target-workload-keyscomma-separated keysrequiredWorkloads to roll back, such as k8s:prod:payments:Deployment/api.
--operator-idstringrequiredApproving operator.
--key-idstringrequiredRegistered operator signing key ID.
--signing-keyPEM path$OSTY_OPERATOR_SIGNING_KEYOperator 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.

Flags for osty ledger verify-export
FlagValueDefaultWhat it does
--bundlepathrequiredosty.ledger.export.v1 JSON bundle.
--trusted-keykey-id=keynonePinned ledger key as base64 or a PEM path. Repeatable.
--trusted-checkpointpathnoneSigned checkpoint from an earlier export.
--jsonboolfalsePrint a JSON verification result.
Verify an export against a pinned keybash
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.

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.