Skip to main content

Synopsis

Assert the compliance status of an artifact in Kosli. There are four (mutually exclusive) ways to use kosli assert artifact:
  1. Against an environment. When --environment is specified, asserts against all policies currently attached to the given environment.
  2. Against one or more policies. When --policy is specified, asserts against all the given policies.
  3. Against a flow. When --flow is specified, asserts against the current template file of the given flow.
  4. Against many flows. When none of --environment, --policy, or --flow are specified, asserts against the template files of all flows the artifact is found in (by fingerprint).
Exits with zero code if the artifact has compliant status, non-zero code if non-compliant status.

Flags

Flags inherited from parent commands

Live Examples in different CI systems

View an example of the kosli assert artifact command in GitHub.In this YAML file, which created this Kosli Event.

Examples Use Cases

These examples all assume that the flags --api-token, --org, --host, (and --flow, --trail when required), are set/provided.
Last modified on March 10, 2026