stackhawk-hawkscan-openapi-specs

A reference for connecting an accurate OpenAPI specification to StackHawk, a tool that tests web applications for security problems. OpenAPI is a machine-readable description of an API's routes and operations.

In plain words
What is it for?
Use it when configuring openApiConf, discovering how a framework generates its API description, checking base or context paths, or investigating coverage gaps caused by an unverified specification.
Why use it?
It helps prevent scans from requesting incorrect API paths and producing many 404 errors or missing real routes. It explains how to obtain, verify, and correctly base the specification against the running application.

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-openapi-specs
Clone the repo
git clone --depth 1 https://github.com/stackhawk/agent-skills

Made for: Cursor.

Per session 92 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,872 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.00092 $0.02872
Opus 5 $0.00046 $0.01436
Sonnet 5 $0.00018 $0.00574
Haiku 4.5 $0.00009 $0.00287

Measured 2d ago against content hash eab3b870ff39, 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-openapi-specs 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.

curl -sf -o /dev/null -w "%{http_code} $p\n" "$APP_BASE_URL$p"
cursor/.cursor/rules/stackhawk-hawkscan-openapi-specs.mdc · 185 lines

How it starts

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

OpenAPI Spec Accuracy Reference

A REST scan is only as good as the spec behind it. An accurate spec is one whose operations match the app's real routes and resolve against the scanned host — same base path, same context path. An inaccurate spec is worse than no spec: HawkScan faithfully requests every path it declares, so wrong paths become a wall of 404s that bury real coverage and generate recurring false-positive noise on every rescan.

This reference is framework-generic. Use it whenever a REST surface needs a spec wired into openApiConf — discovery (SKILL.md Step 1a / scan-planning.md) points here, and the quality gate points here when it reports a spec-not-wired or coverage gap.

Contents


The one rule: an unverified spec is a hypothesis

A checked-in openapi.yaml, a spec you generated, and a spec the app serves are all claims about the API until you prove they resolve against the running app. Never wire a spec into openApiConf and scan without the verification in "Mandatory: verify the spec resolves" below. A checked-in file is the least trustworthy source — it drifts from the code, can be stale, hand-maintained, or (as seen in the wild) emptied by a commit — so treat its presence as a starting hypothesis, not a done task.

Get an accurate spec (preference order)

Prefer a spec the framework produces from the running app over any static artifact. Work down this list; stop at the first that yields a spec that passes verification.

Read the full file on GitHub · 185 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 · 185 lines · 92 tokens per session scan A eab3b870ff39

Subscribe to this mod's changes

stackhawk-hawkscan-openapi-specs is a cursor rule published in the GitHub repository stackhawk/agent-skills (15 stars, last pushed 12d ago), licensed MIT. It adds 92 tokens to every session and 2,872 once invoked, about $0.0005 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.