mirror of
https://github.com/danpeg/bug-hunt.git
synced 2026-04-26 14:05:52 +03:00
[PR #3] Add dynamic model assignment with security hardening #3
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/bug-hunt#3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/danpeg/bug-hunt/pull/3
State: open
Merged: No
What changed
This PR adds dynamic model assignment to bug-hunt, letting users run Hunter, Skeptic, and Referee on different AI providers (Claude, Codex CLI, Gemini CLI). It also fixes several security and robustness issues discovered by running bug-hunt on itself with mixed providers.
Dynamic model assignment (SKILL.md, README.md)
Users can now assign providers per role via CLI flags:
Presets provide named configurations:
claude(default) — all three roles run as Claude Code subagents, identical to current behaviorcodex— all roles shell out to Codex CLIgemini— all roles shell out to Gemini CLImixed— Hunter=Codex, Skeptic=Claude, Referee=GeminiIndividual
--hunter=,--skeptic=,--referee=flags override any preset. With no flags, behavior is unchanged from the original (all Claude).Provider dispatch:
mktemp) and pipe it via stdin to the CLI (codex exec -/gemini -p -)Security and robustness fixes (found by self-scan)
After implementing model assignment, we ran
/bug-hunt --hunter=codex --skeptic=claude --referee=codexon this repo. The adversarial review confirmed 7 real issues, all now fixed:Critical — shell injection (BUG-1, BUG-2):
The original external CLI instructions interpolated scan targets and report content directly into shell command strings. A path like
src; rm -rf /or report text containing shell metacharacters could execute arbitrary commands. Fixed by always passing prompt content via stdin/temp file, never inlining into shell args.Medium — tempfile collisions (BUG-3):
The hard-coded path
/tmp/bug-hunt-hunter-prompt.mdwould corrupt concurrent runs. Fixed withmktemp /tmp/bug-hunt-{role}-XXXXXX.mdfor unique files per invocation, with cleanup after use.Medium — no provider validation (BUG-4):
Invalid provider values (e.g.,
--hunter=gpt4) were silently accepted with undefined dispatch behavior. Step 0 now validates all provider values and stops with a clear error on invalid input.Medium — no Hunter success gate (BUG-18):
If the Hunter agent failed (CLI not installed, crash, empty output), the flow continued to Skeptic/Referee with no input. Step 2b now explicitly verifies Hunter success before proceeding.
Low — no target validation (BUG-9):
Specifying a nonexistent scan target would dispatch agents that fail confusingly downstream. Step 0 now checks target existence and fails fast with a clear message.
Low — malformed markdown link (BUG-11):
The
@systematiclsattribution link in README.md used nested markdown syntax[text]([url](url)). Fixed to a single valid link.Codex CLI invocation fix:
The original instructions used
codex exec "prompt"which doesn't work for theexecsubcommand. Corrected tocat file | codex exec -(stdin mode).Files changed
SKILL.md— argument parsing, provider validation, target validation, external CLI dispatch via stdin, Hunter success gateREADME.md— dynamic model assignment docs, provider table, fixed markdown linkNo changes to the prompt files (hunter.md, skeptic.md, referee.md).
Backward compatibility
Running
/bug-huntor/bug-hunt src/with no provider flags behaves identically to the current version. All three roles default to Claude Code subagents. The new functionality is additive.How I tested
/bug-hunt --hunter=codex --skeptic=claude --referee=codexon this repo itself — Hunter (Codex gpt-5.3) found 20 issues, Skeptic (Claude) challenged them down to 4, Referee (Codex) confirmed 7. All confirmed bugs are fixed in this PR.codex exec -)Checklist
/bug-hunt