You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add --params flag to kosli evaluate commands (#762)
## Summary
- Adds `--params` flag to `evaluate trail`, `evaluate trails`, and `evaluate input`, allowing policy authors to pass configuration data (thresholds, expected counts, etc.) without duplicating policy files
- Params are available in Rego policies as `data.params`, using OPA's idiomatic data document — existing policies that don't reference `data.params` are completely unaffected
- Accepts inline JSON (`--params '{"min_approvers": 2}'`) or file reference (`--params @params.json`)
## Motivation
Policies are currently fully static. Thresholds like "zero approvers" or "no critical vulnerabilities" are baked into the `.rego` file. If you want the same policy logic with different tolerances — say, 1 approver in staging, 2 in production — you need separate policy files duplicating the logic. That's the kind of duplication `kosli evaluate` is meant to eliminate.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
cmd.Flags().BoolVar(&o.showInput, "show-input", false, "[optional] Include the policy input data in the output.")
30
32
cmd.Flags().StringSliceVar(&o.attestations, "attestations", nil, "[optional] Limit which attestations are included. Plain name for trail-level, dot-qualified (artifact.name) for artifact-level.")
33
+
cmd.Flags().StringVar(&o.params, "params", "", "[optional] Policy parameters as inline JSON or @file.json. Available in policies as data.params.")
0 commit comments