Skip to main content
This is a beta feature. Beta features provide early access to product functionality. These features may change between releases without warning, or can be removed in a future release. Please contact us to enable this feature for your organization.

Synopsis

Publish a new version of a rego policy in a Kosli org. The policy is addressed by IDENTIFIER, which decisions cite and which cannot be changed after the first publish. --name is required on the first publish only. Only an org admin can publish. --path takes a Rego file or a directory on this machine, and can be given more than once, so a policy and a shared library are published together from wherever each is kept. Every --path joins one bundle, by the same rules as kosli evaluate policy --path: files in dot-directories are left out, and the bundle can hold at most 100 files and 1 MiB. Each publish stores the next version, with --comment kept on it. A change to the files or to --input-schema makes a new version. When the files and the input schema are the same as the newest version, and that version is pending or valid, nothing new is stored and that version is reported. A change to only --name or --description makes no new version. Kosli validates each version after it is stored, and the command waits up to 30 seconds for the result:
  • valid: the version can be evaluated. The command exits 0.
  • rejected: the policy is at fault, for example it does not compile. The command prints the reason and exits 1.
  • failed: Kosli could not validate the version. Publish again to retry. The command exits 1. If the wait expires, the command exits 1 and says how to read the version later. With --output json, the version is always printed: with the reason for a rejected or failed one, and as pending when the wait expires.
An evaluation runs the highest-numbered valid version, so a rejected or failed version leaves the policy in service unchanged.

Flags

Flags inherited from parent commands

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 October 30, 2026