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:
| Stage | When | Behaviour |
|---|---|---|
| wisec_notify | early (build) | Collects, signs and submits the build event. Never blocks (fire-and-forget). |
| wisec_gate | after build + tests | Polls 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
| Type | Stage | Triggers on |
|---|---|---|
secrets_detected | pre-analysis | A hardcoded secret found by gitleaks |
critical_file_modified | pre-analysis | A change to a critical file (CI config, Dockerfile…) |
unapproved_contributor | pre-analysis | A commit author not in your approved-contributors list |
cve_severity | post-analysis | A CVE at or above a chosen severity (via OSV) |
risk_threshold | post-analysis | The 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:
./wisec-agent --gate
| Variable | Default | Meaning |
|---|---|---|
WISEC_GATE_TIMEOUT | 120 | Seconds to wait for analysis before giving up |
WISEC_STRICT | false | If true, fail on timeout; if false, pass silently on timeout |
See the GitLab and GitHub guides for complete pipeline examples.