euxis exit codes

euxis check, euxis triage and euxis review return structured exit codes so CI gates can tell infrastructure failures, advisory results and blocking results apart without parsing stdout. The codes are defined in apps/cli/include/euxis/cli/exit_codes.hpp; the mapping from a verdict to a code is apps/cli/src/verdict_exit.cpp, and apps/cli/tests/test_exit_contract.cpp tests every row below.

Code

Meaning

Typical CI behaviour

0

Verdict TRUSTED or TRUSTED WITH GAPS.

Job passes.

1

Infrastructure error: no agent produced evidence, missing or invalid manifest, internal error.

Job fails as a real CI error.

2

Advisory: verdict CAUTION (or INCONCLUSIVE without failing evidence).

Job passes with a warning annotation.

3

Blocking: any failing evidence, including a BLOCKED verdict, contradictory evidence, or a verdict rejected at --human-approve.

Job fails. Block the merge.

4

Policy violation: --policy reported a violation on an otherwise passing verdict.

Job fails. Treat as a security event.

5

Partial result: an agent timed out and the verdict is short of trusted.

Job fails as flake-prone; re-run or raise the mode’s time budget.

64

Usage error: unknown flag, flag without its value, more than one target, --human-approve without a terminal.

Fix the invocation.

130

Interrupted (SIGINT). The process ends on the signal and the shell reports 128 + 2.

Pass through Ctrl-C semantics.

How a verdict becomes a code

The checks run in this order; the first that applies decides the code.

  1. No evidence at all: 1.

  2. Failing evidence (or a BLOCKED verdict): 3. A failing verdict is the stronger signal, so it wins over a policy violation.

  3. A policy violation: 4.

  4. TRUSTED or TRUSTED WITH GAPS: 0.

  5. Any agent timed out: 5.

  6. Otherwise (CAUTION, INCONCLUSIVE): 2.

With --ci, the artifact printed to stdout carries the same code in its exit_code field.

Through v0.0.19 the commands returned 0 (trusted), 1 (anything else, including policy violations) and 2 (no evidence, or a usage error), and ignored unknown flags. See DEPRECATIONS.md.

CI outputs and severity thresholds

Four flags on check, triage and review add a deterministic scan and its artefacts to the agents’ verdict:

Flag

Writes

--sarif <path>

SARIF 2.1.0 of the scan’s findings (CWE and OWASP tags, file and line).

--sbom <path>

CycloneDX 1.6 SBOM of the dependency manifests.

--evidence <path>

An evidence pack: a .tar.gz holding findings.sarif, sbom.cdx.json and metadata.json. Sign it with euxis attest.

--fail-on <severity>

Nothing; sets the threshold: critical, high (the default), medium, low, info or none.

The scan is euxis scan with its defaults: the built-in taint specs (sources such as input(), os.Getenv, req.body, sinks such as os.system, exec.Command, SQL execution) with reachability, and no rule packs. Its result is 3 when a finding is at or above the threshold (none blocks nothing), 2 when there are findings below it, and 0 otherwise. The process exits with the worse of that and the verdict’s code, in the order of the mapping above (1, 3, 4, 5, 2, 0). An output that cannot be written is 1.

--sbom alone runs no scan. The scan runs whenever --sarif, --evidence or --fail-on is given, after the agents, and reports on stderr, so --ci keeps stdout to the artifact.

GitLab example

euxis_audit:
  script:
    - euxis check . --sarif euxis.sarif --fail-on high
  allow_failure:
    exit_codes: [2]   # advisory only

templates/gitlab-ci/.gitlab-ci.euxis.yml is a complete job that downloads and checks the release binary.

Jenkins example

script {
  def code = sh(returnStatus: true, script: 'euxis check . --sarif euxis.sarif --fail-on high')
  if (code == 2) {
    currentBuild.result = 'UNSTABLE'
  } else if (code != 0) {
    error("euxis failed with exit code ${code}")
  }
}

GitHub Actions example

- name: euxis check
  id: scan
  run: |
    set +e
    euxis check . --sarif euxis.sarif --fail-on high
    code=$?
    echo "exit-code=$code" >> "$GITHUB_OUTPUT"
    case "$code" in
      0|2) exit 0 ;;   # trusted, or advisory only
      *)   exit "$code" ;;
    esac