An override doesn’t delete or edit the original attestation. Kosli records the override as a new event on the trail, so the trail stays append-only. Both the original attestation and the override stay in the trail’s events, and the audit trail shows the original result and the decision that replaced it.
Who can override
Overriding is a write to a trail, so it needs the same role as reporting an attestation: Admin or Member. Readers and Snapshotters can’t override. This applies to users and service accounts alike.Send an override
Use thekosli attest override command, or send a POST request to the trail’s override endpoint. Both take the same information:
The optional fields are stored on the override, not on the original attestation.
The API endpoint is:
200 with the body "OK". The CLI reads the organization, API token, and host from KOSLI_ORG, KOSLI_API_TOKEN, and KOSLI_HOST like any other kosli command.
Make a non-compliant attestation compliant
A trail is non-compliant because itssecurity-review attestation reported findings. The security team has reviewed them and accepts them as false positives:
- CLI
- API
Make a compliant attestation non-compliant
An override works in the other direction too. Thesecurity-review attestation passed, but the reviewer was not independent of the change author:
- CLI
- API
Link the override to a ticket
Use the optional fields to connect the decision to the evidence behind it, such as a risk-acceptance ticket:- CLI
- API
Override an attestation on an artifact
When the flow template puts the attestation under an artifact, tell Kosli which artifact it belongs to. There are two ways to point at it. By fingerprint. Use the attestation’s own name, such asunit-tests:
- CLI
- API
app.unit-tests with --commit, as other kosli attest commands do. The API takes the attestation’s own name, with the artifact’s template name in target_artifacts:
- CLI
- API
kosli attest commands, --commit is read from the git repository at --repo-root, which defaults to the current directory.Override a control decision
A decision recorded against a control is an attestation of typesystem:decision, so you can override it like any other attestation. Use the name the decision is recorded under: the --name passed to kosli evaluate policy, which defaults to <control>-decision.
When the decision was reported, Kosli takes the control from it. When the decision was never reported, there is no decision to take the control from, so name the control with --control. Without it, the override belongs to no control.
- CLI
- API
--control is only allowed with system:decision. The CLI refuses it for any other type before sending anything.
How overrides behave
- An override is the newest attestation for its name. Kosli uses its compliance status until something newer arrives. If a new attestation with the same name is reported after the override, the new attestation’s own status applies again. Override again if the decision still holds. A second override replaces the first.
- You can override an attestation that hasn’t been reported. If the flow template expects an attestation that is missing, an override with
new_compliance_status: truemarks it compliant and the trail is no longer incomplete. This includes a control decision, as long as you name the control with--control. - You can’t override an attestation that doesn’t exist anywhere. If the attestation is neither on the trail nor in its template, the request fails with a
400error. - The artifact must be reported first. Overriding an attestation on an artifact that isn’t on the trail yet fails: with
404when you point at it by fingerprint, and with400when you point at it by template name and commit. - You can’t override on an archived flow, and an override for a flow that doesn’t exist fails with a
404error.
Find overrides in the audit trail
Each override is recorded as anattestation_overridden event on the trail. In the web app it appears in the trail’s Events tab under the attestation’s name, labeled as an override. Open it to see who made the override, when, why, and which attestation it overrides.
Through the API, read it from the trail’s events:
is_latest tells you whether the override is still the trail’s current attestation for its name.
In the trail’s compliance status, an overridden attestation is the override itself: is_override is true, attestation_id is the override’s ID, original_attestation_id is the ID of the attestation it overrides, and is_compliant is the overridden value. In kosli get trail with --output markdown, its status is marked (override).
Run overrides from a manually triggered workflow
To keep overrides out of ad-hoc terminal sessions, run them from a CI workflow that someone triggers by hand. The person who triggers it, the inputs they gave, and the run itself are then recorded in your CI system as well as in Kosli, and you control who can run it with your CI system’s permissions. This GitHub Actions workflow runs onworkflow_dispatch and takes the override fields as inputs. Pick the CLI or the API version:
- CLI
- API
.github/workflows/kosli-override.yml
- Inputs go through environment variables, not straight into the script, and are quoted where they’re used. The API version also builds the request body with
jq. Either way, a value with quotes or shell characters can’t break the request or inject commands. - The host comes from the
KOSLI_HOSTrepository variable and falls back tohttps://app.kosli.com. Set it tohttps://app.us.kosli.comor your Kosli Dedicated address if your organization lives on another instance. - The origin URL links the override back to the workflow run, so anyone reading the trail can see where it came from.
- The
kosli-overridesGitHub environment can require approval from named reviewers before the job runs. Store the API key of a dedicated service account with the Member role as a secret of that environment, so only approved runs can use it.
Kosli records the service account as the reporter of the override, not the person who triggered the workflow. That’s why the workflow adds
$GITHUB_ACTOR to the reason.