prototype
MAmattpocock/skills337k4,978 new stars in the last 7 days
Wiring an LLM into a recon tool's decisions ("let AI pick {feature} for {tool}"): the never-raise contract, the per-target cache, the full+partial coverage, and the two UI toggles bound to one field. A raising AI helper or an empty fallback silently breaks or disables a live scan. Trigger: adding or editing a recon AI hook; a new recon/helpers/ai_planner/{tool}_{feature}.py; a /llm/{tool}-{feature} endpoint in agentic/api.py; a data.{tool}Ai{feature} toggle; editing apply_ai_pipeline_overrides in recon/project_settings.py; an LLM | Jev engine switch (a {tool}AiUseJev field, a /jev/* endpoint, agent_jev_gate); a Jev-only hook ({tool}Jev{Feature}, jev_shadow.py, shadow mode).
For adding a whole new recon tool, use recon-tool-integration. For the setting
that toggles it, use project-settings-cascade.
current_tags on any failure").[]/"".agent_llm breaker AFTER the cache check, and honour it by
returning the existing fallback. The agent's /llm/* endpoints share one
breaker: gate = agent_llm_gate() (from
recon/helpers/ai_planner/init.py);
when not gate.allowed, print "... Agent LLM paused (breaker open) - using the
fallback." and return the user's current value WITHOUT a POST. After the POST
call gate.record(resp=resp); in the except branch call gate.record(exc=e).
The cache is checked first so a cached answer is still served while the breaker
is open. This is the same never-raise/never-empty fallback as above — the
breaker just skips the call that would fail anyway when the agent is down.engine: str = "llm" and uses
its OWN breaker. engine == "jev" posts to /jev/<hook> (same request body,
same response shape as /llm/<hook>, so the existing validator is reused),
takes agent_jev_gate() and logs [*][<Tool>-Jev]. Never record a Jev outcome
on agent_llm: that breaker marks 401/402/403 FATAL for the whole run, so a Jev
auth or credit failure would silence every LLM hook. The Jev gate reads the
agent's 503 error_type (no token, auth, no credit, forbidden are FATAL; rate
limited carries retry_after; the rest are transient). A Jev failure uses the
hook's static fallback: never re-route to the LLM, never return empty.aiInPipeline forces each per-hook AI flag; the {tool}AiUseJev engine
fields stay OUT of apply_ai_pipeline_overrides, are in KEPT_WHEN_ABSENT
(webapp/src/lib/project-preset-utils.ts) so a preset apply does not reset
them, and a switch-ON is refused server-side unless the project's
jevProviderId names a Jev row (TypeSafe or OpenRouter) on the project OWNER's
account (validateJevEngineChange, every write path, fail closed). Give a hook a
Jev engine only when a wrong answer cannot drop a finding: the Nuclei
false-positive filter deletes findings from target-controlled bytes and has no
Jev engine.{tool}Jev{Feature}, no LLM twin) has TWO levels and
starts in shadow. Nothing upstream folds its flag into aiInPipeline, so
EVERY call site, full and partial, tests AI_IN_PIPELINE and <FLAG> itself;
never add it to the master fan-out in TargetSection.tsx. Build it on
recon/helpers/ai_planner/jev_shadow.py (jev_post takes the agent_jev
breaker; ShadowRecorder caps the per-decision lines at 50, prints one
summary, and keeps the records in the recon JSON under jev_shadow.<hook>).
ROLLOUT = SHADOW acts on the deterministic path; ROLLOUT = ACT acts on
Jev's answer with the deterministic result as the fallback, and flipping a
hook is a separate change. In AI_HOOKS it is kind: 'enable', so a false flag
reports off, not llm._ask_items, which sends each request only its own items; _ask re-sends
one state per chunk and a scan's items would exceed the request limit.run_vuln_scan is called by both main_recon_modules/ and
partial_recon_modules/); hook it once and both paths inherit. grep the
function name to confirm before you edit. The feature must work in the full
pipeline AND partial recon.aiInPipeline cascade (apply_ai_pipeline_overrides,
in recon/project_settings.py) is the
single source of truth for per-tool AI flags. Presets must not hard-code them;
update the Zod schema instead.Project column {tool}Ai{Feature}
in recon_settings/registry.yaml, beside
ffufAiExtensions, nucleiAiTags, nucleiAiResponseFilter and
wafAiClassifier. A test walking Prisma.ProjectScalarFieldEnum fails until
every column has one. An AI hook is an ordinary boolean toggle: mcp: settable, traffic: none (the hook itself sends no traffic; the tool it
advises does), and a meaning that says which decision it moves from the
operator to the model.data.{tool}Ai{Feature}: the master AI-in-Pipeline panel
(the aiInPipeline block in TargetSection.tsx)
and the tool's own section (e.g.
NucleiSection.tsx).
Read AND write the same field; no copy-on-flip (they stay in sync because
they share the field).| Piece | File | Note |
|---|---|---|
| Helper | recon/helpers/ai_planner/{tool}_{feature}.py | POSTs to the agent; never raises; logs [*][{Tool}-AI] / [!][{Tool}-AI] to stdout |
| Agent endpoint | agentic/api.py (e.g. /llm/nuclei-tags at :641, /llm/ffuf-extensions at :543) | Pydantic model; returns 422 (bad body) / 503 (no key), never 500 |
| Setting | recon/project_settings.py DEFAULT_SETTINGS + fetch_project_settings + both branches of apply_ai_pipeline_overrides | see project-settings-cascade |
| Zod | webapp/src/lib/recon-preset-schema.ts | so AI-generated presets see the field |
| UI | TargetSection.tsx + the tool's section | two toggles, one field |
docker compose build agent && docker compose up -d agent # the /llm endpoint lives in agentic/ (baked)
# recon/*.py is volume-mounted at spawn - no rebuild
# verify: a minimal POST returns 422/503, never 500; and a live scan logs
# [*][{Tool}-AI] in BOTH a full run and a partial recon run; stop the agent -> scan still completes.
recon-tool-integration, project-settings-cascadeMAmattpocock/skills337k4,978 new stars in the last 7 days
AFaffaan-m/ECC315k4,381 new stars in the last 7 days
FIfirecrawl/firecrawl215k5,595 new stars in the last 7 days
ANanthropics/skills203k3,265 new stars in the last 7 days
Set visual direction and typography for UI, avoiding templated defaults.
ANanthropics/skills203k3,265 new stars in the last 7 days
Build complex HTML artifacts with React, Tailwind CSS, state management and routing.
ANanthropics/skills203k3,265 new stars in the last 7 days