Policy as Code & the CI Gate

Wisec lets you define block/warn policies that are enforced automatically in your pipeline. Policies turn Wisec from passive notarization into active supply-chain governance.


How enforcement works

Wisec separates notarization from enforcement across two pipeline stages:

StageWhenBehaviour
wisec_notifyearly (build)Collects, signs and submits the build event. Never blocks (fire-and-forget).
wisec_gateafter build + testsPolls Wisec until analysis is complete, then exits non-zero if a block policy was violated.

⚠️ The gate is the only place policies block. If you omit the wisec_gate step, block policies will never fail your pipeline.


Policy types

TypeStageTriggers on
secrets_detectedpre-analysisA hardcoded secret found by gitleaks
critical_file_modifiedpre-analysisA change to a critical file (CI config, Dockerfile…)
unapproved_contributorpre-analysisA commit author not in your approved-contributors list
cve_severitypost-analysisA CVE at or above a chosen severity (via OSV)
risk_thresholdpost-analysisThe build security score falls below a minimum (higher is better)

Each policy has an action: block (fails the gate) or warn (logged, does not fail).


Configuring policies

Policies are managed per organization in the dashboard under Policies (admin only). Create rules, enable/disable them, and set the action for each.


VEX-aware gating

A CVE you have triaged as not_affected or fixed (see Signed VEX) is automatically suppressed from the cve_severity gate - so you don't block your pipeline on a vulnerability you've already proven isn't exploitable, with signed evidence to back it up.


Adding the gate to your pipeline

The wisec_gate stage runs the agent with --gate:

bash
./wisec-agent --gate
VariableDefaultMeaning
WISEC_GATE_TIMEOUT120Seconds to wait for analysis before giving up
WISEC_STRICTfalseIf true, fail on timeout; if false, pass silently on timeout

See the GitLab and GitHub guides for complete pipeline examples.