Policy as code
Policy decision logs
When a package is evaluated against a policy, the policy engine creates a decision log entry. Decision log entries are created for all evaluations, regardless of whether the package matched.
Cooldown policies
Decision logs for a cooldown policy are only generated for packages that are already cached in your Cloudsmith workspace.
Review policy decision logs via the Cloudsmith web app
To view decision logs in the Cloudsmith web app, go to Logs > Policy decision logs.
Click any entry to expand it and view more details about the evaluation outcome. You can also download the full decision log as JSON.
Review policy decision logs via the Cloudsmith API
You can view decision logs via the decision logs API, which provides two endpoints: a list endpoint returning lightweight summaries, and a retrieve endpoint for fetching the full decision log detail.
List decision log summaries (the created_after parameter is required):
curl -X GET \
"https://api.cloudsmith.io/v2/workspaces/$CLOUDSMITH_WORKSPACE/policies/decision-logs-v1/?created_after=2026-06-01T00:00:00Z" \
-H "Accept: application/json" \
-H "X-Api-Key: $CLOUDSMITH_API_KEY" | jq .Each summary in the list includes:
idcorrelation_idstarted_atended_atmatchpackage_namepackage_formatpolicy_name- An
actionssummary dict
Retrieve the full decision log using the id from the list response:
curl -X GET \
"https://api.cloudsmith.io/v2/workspaces/$CLOUDSMITH_WORKSPACE/policies/decision-logs-v1/$DECISION_LOG_ID/" \
-H "Accept: application/json" \
-H "X-Api-Key: $CLOUDSMITH_API_KEY" | jq .The full log also provides:
policy_input: The exact data used to evaluate the policy.policy_output: The results (match or not, partial rule states).