stackhawk-hawkscan-ci-failure

A reference for handling HawkScan security-scan results in continuous integration (automated build and test pipelines). It explains what exit codes mean and how a pipeline should react.

In plain words
What is it for?
Use it to set severity thresholds, decide whether findings block builds or only warn, choose pull-request versus scheduled scans, and define retry and cache rules.
Why use it?
It helps teams distinguish a real security finding from a scan or configuration failure. It also prevents retrying findings or hiding them through unsuitable caching and scheduling choices.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/stackhawk/agent-skills/stackhawk-hawkscan-ci-failure
Clone the repo
git clone --depth 1 https://github.com/stackhawk/agent-skills

Made for: Cursor.

Per session 61 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,309 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00061 $0.02309
Opus 5 $0.00030 $0.01154
Sonnet 5 $0.00012 $0.00462
Haiku 4.5 $0.00006 $0.00231

Measured 2d ago against content hash 62a3f150a675, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

stackhawk-hawkscan-ci-failure scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

read -r version url < <(curl -fsSL https://download.stackhawk.com/hawkdocs/hawk.manifest.json \
cursor/.cursor/rules/stackhawk-hawkscan-ci-failure.mdc · 197 lines

How it starts

The opening of the file, as written. The whole thing — 197 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Failure Semantics Reference

How HawkScan signals scan outcomes in CI, when to block vs warn, and how to think about retries and caching.

Exit Codes

Exit code Meaning Pipeline action
0 Scan ran; no findings at or above failureThreshold. Pass.
1 Scan failed before producing results (config error, app unreachable, auth failure, invalid applicationId, internal scanner error). Fail. Do not retry — this is almost always a config issue that needs human attention.
42 Scan ran; findings met or exceeded failureThreshold. Real finding. Either fail (block mode) or warn (warn-only mode), per the integration choice.

Exit code 42 is the intended success path of failure — the scan worked, and it found something worth blocking on. Treating it like a flake (retrying, swallowing) defeats the purpose of running the scan.

failureThreshold — Tuning the Block Line

failureThreshold in stackhawk.yml decides which severity levels trip exit code 42:

app:
  applicationId: ${APP_ID}
  failureThreshold: High   # one of: High, Medium, Low, All
Value Exit 42 when...
High Any High finding is present (default; recommended for new pipelines)
Medium Any Medium or High finding is present
Low Any Low, Medium, or High finding is present
All Any finding at all is present (often noisy)

Tuning guidance:

  • Start at High for a new pipeline. You want the first month to be calibration — find out which severity levels your app actually produces, work through them, then ratchet down.
  • Drop to Medium once the High-severity backlog is empty AND the team is committed to triaging Mediums within a sprint cadence.
  • Low and All are appropriate only for high-maturity teams with active triage processes; otherwise the noise drowns out real signal.

The hawkscan skill owns failureThreshold writes — this skill does not change it. If the user asks to "make CI less noisy," route them to the hawkscan skill for the config edit (which also handles excludePaths and excludePlugins).

Read the full file on GitHub · 197 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 197 lines · 61 tokens per session scan A 62a3f150a675

Subscribe to this mod's changes

stackhawk-hawkscan-ci-failure is a cursor rule published in the GitHub repository stackhawk/agent-skills (16 stars, last pushed 12d ago), licensed MIT. It adds 61 tokens to every session and 2,309 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.