Repository navigation
docs: document evaluating a pinned rego policy version - #486
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
|
Claude finished @mintlify[bot]'s task in 1m 7s —— View job Doc review: PR #486
|
|
|
||
| [`kosli evaluate trail`](/client_reference/kosli_evaluate_trail) and [`kosli evaluate trails`](/client_reference/kosli_evaluate_trails) fetch trail data from Kosli and evaluate a local policy file in the CLI, passed with `--policy`. A local evaluation records nothing: it cannot record a decision against a control. To try a policy on the server's input before publishing it, use `kosli evaluate policy --path` instead. | ||
|
|
||
| To evaluate the same policy file on the Kosli server instead, add `--server-side` (beta) to either command. Kosli builds the input from the trails you name, so the CLI reads no trail data. The flag can't be combined with `--attestations`, `--show-input` or `--output-rule`, and a server-side evaluation takes at most 100 trails. |
There was a problem hiding this comment.
Improvement: "the same policy file" reads as a promise that a local policy works unchanged with --server-side. The next list says otherwise: local input is the trails-API shape, "not a trail moment", and fields differ (name vs trail_name, flow.name vs flow_name, see the table under Local input data). Also, a policy that passes locally "can still fail to compile on the server". A reader who adds --server-side to a working local check could get a different verdict or a compile failure.
Suggest dropping "the same" and saying which input the server builds, e.g.:
| To evaluate the same policy file on the Kosli server instead, add `--server-side` (beta) to either command. Kosli builds the input from the trails you name, so the CLI reads no trail data. The flag can't be combined with `--attestations`, `--show-input` or `--output-rule`, and a server-side evaluation takes at most 100 trails. | |
| To evaluate a policy file on the Kosli server instead, add `--server-side` (beta) to either command. Kosli builds the input from the trails you name as [trail moments](#trail-moment), so the CLI reads no trail data, and a policy written for local input may need its field paths changed. The flag can't be combined with `--attestations`, `--show-input` or `--output-rule`, and a server-side evaluation takes at most 100 trails. |
(I couldn't read the CLI source from this job to confirm the server-side input shape for evaluate trail, so check this against kosli-dev/cli#1318 before you accept it.)
Applies the Claude review findings left on #485 and #486: the skip-tags PUT example now keeps dry run explicit, the Lambda template warning matches its example, and the rego reference covers version pinning and server-side input shape. Based on [#485](#485) and [#486](#486). --------- Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
Shows how to pin a published policy version with
--identifier <id>@v<n>and adds--server-sidefor evaluate trail/trails (beta: controls page already carries the beta banner; pinning is on prod and in CLI v2.52.0).Based on evaluate a pinned policy version with --identifier @v, Evaluate a pinned version of a published rego policy and unhide server-side evaluation commands and --server-side flag.