stackhawk-optimize-trial

stackhawk-optimize-trial is a cursor rule for Cursor from stackhawk/agent-skills. It costs 62 tokens per session (831 once invoked), scanned A, original, MIT.

A set of rules for safely testing a named StackHawk scan policy before applying changes. StackHawk is a tool that scans web applications for security issues.

In plain words
What is it for?
Use it to create a temporary policy, run a trial scan, then promote or discard the result using predictable names and recovery safeguards.
Why use it?
It provides a repeatable trial process that avoids changing the application's live policy and handles failed or interrupted attempts.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it to create a temporary policy, run a trial scan, then promote or discard the result using predictable names and recovery safeguards.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/stackhawk/agent-skills/stackhawk-optimize-trial
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.

Clone the repo
git clone --depth 1 https://github.com/stackhawk/agent-skills

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for stackhawk-optimize-trial

README.md
[![agentmods](https://agentmods.dev/badge/rules/stackhawk/agent-skills/stackhawk-optimize-trial/github.svg)](https://agentmods.dev/rules/stackhawk/agent-skills/stackhawk-optimize-trial)
Your own site
<a href="https://agentmods.dev/rules/stackhawk/agent-skills/stackhawk-optimize-trial"><img src="https://agentmods.dev/badge/rules/stackhawk/agent-skills/stackhawk-optimize-trial/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for stackhawk-optimize-trial

Your own site · 80×15
<a href="https://agentmods.dev/rules/stackhawk/agent-skills/stackhawk-optimize-trial"><img src="https://agentmods.dev/badge/rules/stackhawk/agent-skills/stackhawk-optimize-trial.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 62 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 831 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00062 $0.00831
Opus 5.5 $0.00025 $0.00332
Sonnet 5.5 $0.00012 $0.00166
Haiku 4.5 $0.00006 $0.00083

Measured 1mo ago against content hash 2094e5a737ad, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

stackhawk-optimize-trial scanned grade A with 0 findings 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 1mo 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

cursor/.cursor/rules/stackhawk-optimize-trial.mdc · 55 lines

How it starts

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

Trial Lifecycle

Setup mode builds + references the policy (steps 1–4, no scan); Refine mode runs the trial scan and promotes/discards (steps 5–9). Setup is re-runnable and is what hawkscan Phase 0c invokes on every fresh stackhawk.yml.

How a named policy reaches a scan (why this is non-destructive)

When app.scanPolicy.name is set in stackhawk.yml, HawkScan bootstrap detects an org-level policy and downloads it directly from S3 at scan start (AssetManagerClient.getDownloadedAsset(orgId, SCAN_POLICY, name)), applying its tech flags

  • plugins and then layering the local includePluginIds/excludePluginIds toggles. The application's own stored policy/flags are never read or mutated by this path.

Naming

Trial policy name: OPTIMIZE_TRIAL_<APP>_<ENV>, transformed to match ^[A-Z0-9_]+$ (uppercase; replace any non [A-Z0-9] run with _). Deterministic so re-runs are idempotent.

Create (trial)

  1. Build the trial ScanPolicy JSON (base preset + edited tech flags + toggled plugins).
  2. Clean up any stale orphan first: hawk op policy delete --name OPTIMIZE_TRIAL_… --yes (ignore "not found").
  3. hawk op policy create --file <tmp.json> --name OPTIMIZE_TRIAL_… --display-name "Optimize trial (<APP>/<ENV>)".
  4. Back up stackhawk.yml — but guard against clobbering a good backup: if stackhawk.yml.optimize-bak ALREADY exists (a prior crashed run left it), do NOT overwrite it — it holds the true original. Warn the user, reuse the existing backup, and skip re-copying. Only when no backup exists, copy stackhawk.yml → stackhawk.yml.optimize-bak.
  5. Set app.scanPolicy.name and the corrections; show the diff.

Promote

  1. Ask the user for a permanent policy name (default OPTIMIZE_<APP>), upper-snake.
  2. Ensure the policy JSON is available, then create the permanent policy. The trial policy already lives on the platform, so do NOT assume the local <tmp.json> survived (a resumed/crashed session may have lost it). If <tmp.json> is missing, reconstruct it from the live trial policy: hawk op policy get --name OPTIMIZE_TRIAL_… > <tmp.json>. Then hawk op policy create --file <tmp.json> --name <PERMANENT>.
  3. Update stackhawk.yml app.scanPolicy.name → <PERMANENT>; remove the backup file.
  4. hawk op policy delete --name OPTIMIZE_TRIAL_… --yes.
  5. (Optional) hawk op policy assign --app <APP> --name <PERMANENT> to set the platform default.
  6. Leave the stackhawk.yml change staged for the user to review/commit (do not commit for them).

Read the full file on GitHub · 55 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. 1mo ago Changed 2094e5a737ad
  2. 1mo ago First seen · 55 lines · 62 tokens per session scan A 41519ac949f2

Subscribe to this mod's changes

stackhawk-optimize-trial is a cursor rule published in the GitHub repository stackhawk/agent-skills (16 stars, last pushed 8d ago), licensed MIT. It adds 62 tokens to every session and 831 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.