LLM-assisted triage
A model can save you morning time, but only if you never trust it on facts. It is useful for grouping a night’s findings, drafting a description from an evidence folder, and ordering a morning queue. It is unreliable about versions, CVE IDs, severity and reproduction steps. Treat every output as an untrusted draft. Force it into a schema, reject anything that cites facts not in the evidence, cap the spend, and never let it send traffic outside the scope file.
Where a model helps in 2026
Section titled “Where a model helps in 2026”The automation page covers agents in recon and how to keep them inside scope. This part is narrower: a model as one stage in a triage pipeline, reading files the pipeline already wrote.
| Task | Why a model helps | Input | Output |
|---|---|---|---|
| Clustering similar findings | Fifty “exposed panel” hits on forty hosts are three underlying issues; a model groups them by meaning, not exact string | triage.tsv, titles, template names |
A cluster label per fingerprint |
| Drafting a finding description | Turns meta.txt, the request and the matched lines into readable prose you then edit |
One evidence folder | A short draft in evidence/<fp>/draft.md |
| Ranking a morning queue | Reads the scored queue and the night’s findings together and writes a five-line “start here” note | queue.tsv, triage.tsv |
A short ordered list with reasons |
| Explaining unfamiliar output | What is this header, what does this product do, what does this error mean | One response | Notes for you, not for a report |
All of these are Passive: the model reads local files and sends nothing to the target. They also all produce drafts, never decisions.
Where it fails
Section titled “Where it fails”| Failure | What it looks like | Why it happens | Guard |
|---|---|---|---|
| Invented reproduction steps | Steps that mention a parameter, header or endpoint not in the evidence | Models complete patterns from training data | Reject output whose steps cite anything not present in the evidence files |
| False confidence in severity | “Critical: full database compromise” for an exposed version banner | Severity words are common in training data, impact reasoning is hard | The model’s severity is a suggestion field; routing uses the template’s severity, and you decide |
| Made-up versions | “Jenkins 2.401.1” when the response said only “Jenkins” | Filling a plausible gap | Every version string in the output must appear in the evidence, checked by script |
| Made-up CVEs | A real-looking CVE ID that does not exist or does not apply | Same | Every CVE ID in the output must appear in the evidence or in your CVE feed, checked by script |
| Leaking data | Pasting a response containing a secret into a third-party API | You sent it | Redact before sending, or use a local model for raw responses |
The rule: model output never goes into a report without you checking each claim against the evidence folder. The pipeline enforces the mechanical part (schema, cited facts exist); you do the rest.
A minimal pipeline
Section titled “A minimal pipeline”Four steps: build a small input from the evidence folder, call a model with a strict prompt, validate the JSON it returns, and only then save it.
1. The strict prompt
Section titled “1. The strict prompt”Keep the prompt in a file under version control, so changes are deliberate.
You are a triage assistant for an authorized bug bounty pipeline.You receive ONE finding as JSON with these keys: fingerprint, template, severity, url, matched, request, response_excerpt.Rules:1. Use only facts present in the input. Do not add versions, CVE IDs, parameters, endpoints or impact that the input does not state.2. If the input does not support a claim, leave it out. Do not guess.3. Output ONLY one JSON object, no prose, no code fences, with exactly these keys: fingerprint (string, copied from input), cluster (string, 2 to 5 words naming the kind of issue), summary (string, at most 400 characters, plain description of what the response shows), claims (array of objects with keys text and source, where source is one of: request, response_excerpt, matched, template), suggested_severity (one of: critical, high, medium, low, info), confidence (one of: low, medium, high), next_manual_step (string, one concrete check a human should do, without sending new payloads).2. Build the input, redacted
Section titled “2. Build the input, redacted”Send the smallest input that answers the question. Redact anything that looks like a credential before it leaves your machine.
# Build a compact, redacted model input for one evidence folderev=~/pipeline/programs/example/evidence/2d7bbe2f093b189djq -n --arg fp "$(basename "$ev")" --rawfile req "$ev/request.txt" --rawfile resp "$ev/response.txt" --rawfile m "$ev/matched.txt" --slurpfile f "$ev/finding.json" '{fingerprint:$fp, template:$f[0]["template-id"], severity:$f[0].info.severity, url:$f[0]["matched-at"], matched:$m, request:($req|.[0:2000]), response_excerpt:($resp|.[0:3000])}' | sed -E 's/((password|secret|token|key|passwd|pwd)[^=:"]{0,20}[=:"][[:space:]]*)[^"&[:space:]]+/\1[REDACTED]/Ig' > "$ev/llm-input.json"The redaction regex is a blunt instrument. It catches DB_PASSWORD=... and "api_key":"..." but not every secret format. For responses that contain real secrets, a model running locally is the safer choice.
3. Call a model from the command line
Section titled “3. Call a model from the command line”Any CLI that reads a prompt and returns text works. The llm tool by Simon Willison is a common choice; it supports many providers and local models through plugins. Model names and the option for structured output change often: check its README.
# Ask a model for one JSON triage object; the system prompt comes from the filellm -m "$LLM_MODEL" -s "$(cat ~/pipeline/etc/llm-triage-prompt.txt)" < "$ev/llm-input.json" > "$ev/llm-raw.json"4. Schema check before use
Section titled “4. Schema check before use”Never trust the shape of model output. Check it with jq, and check that every fact it cites exists in the evidence.
# Valid JSON object with the right keys and enumerated values, and the fingerprint matches the folderjq -e --arg fp "$(basename "$ev")" 'type=="object" and .fingerprint==$fp and (.cluster|type=="string") and (.summary|type=="string" and length<=400) and (.claims|type=="array" and all(.[]; (.text|type=="string") and (.source|IN("request","response_excerpt","matched","template")))) and (.suggested_severity|IN("critical","high","medium","low","info")) and (.confidence|IN("low","medium","high")) and (.next_manual_step|type=="string")' "$ev/llm-raw.json" >/dev/null || { echo "schema check failed"; exit 1; }# Every CVE ID and version-looking string in the output must appear somewhere in the evidencefor tok in $(grep -oE 'CVE-[0-9]{4}-[0-9]{4,}|[0-9]+\.[0-9]+(\.[0-9]+)+' "$ev/llm-raw.json" | sort -u); do grep -qrF -- "$tok" "$ev"/request.txt "$ev"/response.txt "$ev"/matched.txt "$ev"/finding.json || { echo "ungrounded: $tok"; exit 1; }; done; mv "$ev/llm-raw.json" "$ev/llm.json"If either check fails, the output is discarded and logged, and the finding goes to you without a draft. Do not retry in a loop with a different prompt until it passes; that teaches the model to pass the check, not to be right.
| Stage | Input | Output | Failure mode | Noise |
|---|---|---|---|---|
| LLM draft | evidence/<fp>/ files |
evidence/<fp>/llm.json |
Schema or grounding check fails: no draft, logged. API down or budget hit: stage skipped, findings still delivered | Passive |
The stage is optional. If it fails, nothing else in the pipeline changes.
What a model record proves
Section titled “What a model record proves”Grounded draft
Section titled “Grounded draft”{"fingerprint":"2d7bbe2f093b189d","cluster":"exposed configuration file","summary":"Exposed .env file containing database host reference"}This record asserts the schema check passed and the summary was saved as evidence/2d7bbe2f093b189d/llm.json. The strings it relies on were found in that folder’s evidence.
This record does not assert the database credentials work, that the database port is reachable, or that the program will pay. Read response.txt yourself before any of that summary goes into a report.
Rejected CVE token
Section titled “Rejected CVE token”ungrounded: CVE-2023-38606This record asserts the grounding loop found CVE-2023-38606 in llm-raw.json and grep -qrF did not find that token in request.txt, response.txt, matched.txt, or finding.json. The script then exits 1 and does not rename the raw file to llm.json.
This record does not assert the scanner was wrong, or that the CVE is fake. It asserts the id was not in the evidence you sent. The finding still reaches you, with no draft. Do not prompt again until the check passes.
Call counter
Section titled “Call counter”98state/llm-calls-2026-11-14 holds that integer. budget_ok writes it when it allows a call, before the model runs.
This record does not assert 98 drafts passed the schema check. With LLM_MAX_CALLS unset, the cap is 100, so two calls remain today. The next failure of budget_ok skips drafts and leaves the rest of the pipeline running.
API pipelines: cost and budgets
Section titled “API pipelines: cost and budgets”Cost per thousand findings
Section titled “Cost per thousand findings”Estimate tokens, then multiply by your provider’s current prices. All numbers here are approximate and only illustrate the arithmetic; check the pricing page of the provider you use.
| Item | Approximate size |
|---|---|
| Prompt file | about 300 tokens |
| Compact finding input, after truncation | about 1,000 to 1,500 tokens |
| JSON output | about 200 to 300 tokens |
| Per finding, total | about 1,500 input and 300 output tokens |
| Per 1,000 findings | about 1.5 million input and 0.3 million output tokens |
# Cost arithmetic with placeholder prices: replace with your provider's current per-million ratescost = (input_tokens / 1e6) x input_price + (output_tokens / 1e6) x output_price = 1.5 x 3.00 + 0.3 x 15.00 = 4.50 + 4.50 = about 9 USD per 1,000 findings at those example ratesWhat drives it: response truncation length (the biggest lever), model choice, and how many findings reach the stage. Run the model only on findings that passed dedup and suppression, never on raw scanner output.
Keys and budget limits
Section titled “Keys and budget limits”# Keys live in a secrets file outside the repo, loaded only by the stage that needs themset -a; source ~/.config/pipeline/secrets.env; set +a# A per-day call counter: refuse to call the model past LLM_MAX_CALLS for this program todaybudget_ok() { local f="$P/state/llm-calls-$(date -u +%F)"; local n; n=$(cat "$f" 2>/dev/null || echo 0); [[ "$n" -lt "${LLM_MAX_CALLS:-100}" ]] || return 1; echo $((n + 1)) > "$f"; }# Use it in the stage loop: skip, do not fail, when the budget is spentbudget_ok || { log "llm: daily budget reached, skipping drafts"; break; }Set a hard spending limit in the provider’s console as well. The shell counter protects you from your own loop bugs; the console limit protects you from everything else, including a leaked key.
Agentic tools inherit the same rules
Section titled “Agentic tools inherit the same rules”An agent that can run commands or send HTTP requests is a stage that sends traffic. It gets no exceptions.
- Same scope file. Its targets pass through
inscopeexactly like a shell stage, and it can only call the guarded wrappers from Part 4, not rawcurlornmap. - Same rate limits. Read from
policy.env, enforced by the wrappers, not by asking the agent nicely in a prompt. - Sandboxed. Run it as a separate Unix user, in a container or VM, with outbound traffic forced through a proxy that only allows in-scope destinations. If the proxy denies a request, the agent cannot reach the host, whatever it decides.
- Logged. Every command and every request is logged to a file you keep, so you can answer a program that asks what you sent.
- Approval for active steps. Anything heavier than a single read-only request needs your approval, the same rule the automation page sets.
# Squid egress allowlist generated from the scope file (sketch; check Squid docs for your version)# /etc/squid/inscope.acl holds one ".example.com" or "api.example.net" per lineacl inscope dstdomain "/etc/squid/inscope.acl"http_access allow inscopehttp_access deny all# Generate the Squid domain list from in-scope.txt: wildcards become leading dots, exact hosts stay as they aresed -E 's/#.*//; s/[[:space:]]//g; /^$/d; /\//d; s/^\*\./\./' ~/pipeline/programs/example/scope/in-scope.txt > /etc/squid/inscope.aclSquid’s leading-dot form also matches the apex, which is broader than the pipeline’s *.example.com rule. Out-of-scope exclusions need a matching deny rule placed before the allow. A proxy allowlist is a second wall, not a replacement for the scope filter.
Next, run the whole pipeline overnight with the checks in The unattended night.
Open local graph around this page
Recon AtlasFor authorized testing only. Your scope is the map edge.