# Brain

> Brain mode - the main chat keeps strategy/driver/triage while 2-3 concurrent subagents execute. Mandatory from move 0. engage routes straight into brain; there is no open-asset precondition. Serial single-agent execution is the fallback when fewer than 2 disjoint rows exist, not a reason to skip brain. Use for "/brain", "brain mode", "run offensive via brain", "dispatch this via brain".

- Skill: `encod3d-sec/brain` (Agent Skill)
- Install (CLI): `npx get-skill add encod3d-sec/brain`
- Raw SKILL.md: https://api.skillmd.com/api/skills/encod3d-sec/brain/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: Encod3d-Sec (https://skillmd.com/u/encod3d-sec)
- Updated: 2026-11-16
- Page: https://skillmd.com/skills/encod3d-sec/brain

---


# brain

Main chat = brain. Subagents = hands. The brain never executes a fully-specified
run itself (except a safeguard-refused step, see Failure handling), and never
lets a subagent make a strategy call. The brain is also the
only one allowed to stop the loop: dispatches return results, the brain decides.

## Wiki

Hub: [[methodology-moc]] - Primary page: [[multi-agent-campaign-orchestration]]
Anchors: [[agentic-harness-patterns]]
**REFS:** [[multi-agent-campaign-orchestration]]

## Role split

The BRAIN keeps (never dispatched):

- Driver commands: `offensive.py next/note/done/foothold/closeout`. The driver is
  still the plan; the brain never hand-picks moves.
- All `targets/<eng>` writes (state.md, loot.md, Killchain.md, Deadends.md,
  decisions.md, log.md).
- Vector selection, triage, scope/RoE judgement, wiki + arsenal selection (which
  card, which hunt skill).
- Firing `Skill(hunt-*)` in the MAIN session: loads the doctrine into brain
  context AND satisfies G2 telemetry (the PostToolUse hook records main-session
  fires to `.events.jsonl`; a subagent's internal skill fire is not guaranteed to
  land there).
- Authoring every checklist, dispatching, integrating results, verifying them.

The brain DISPATCHES, fully-specified execution chunks only:

- Scanner invocations, exploit compile+run, pspy/tcpdump watch windows, evidence
  capture, read-a-source-file-end-to-end passes, payload delivery.

## Tier routing (Agent tool aliases)

| Alias | Actual model | Use for |
|---|---|---|
| haiku | glm-5.3-flash | DEFAULT. Mechanical fully-specified runs: one-tool runs, compile+run a known PoC, watch windows, scripted evidence capture, read-and-summarize passes, fuzz/research/graphify/wiki archetype lanes. |
| sonnet | glm-5.3 | Multi-step runs whose next step depends on reading live responses: hunt-skill execution against a live surface, JS-heavy analysis, a decision-bearing exploit chain, discovery-shaped lanes, Verifier. |
| opus | glm-5.3-max | RTL consults (redteamlead lanes: ranked directions + STOP, clinical verify/confirm framing), exploit development, exploit-chain construction. A `[cyber]` safeguard failure redispatches on haiku, never dropped (operator 2026-10-06; supersedes the 2026-09-02 RTL-on-MAIN rule). |

Fresh agents only: `subagent_type` general-purpose, never `fork` (a fork inherits
the main model and ignores the alias, silently voiding this table).

Discovery (route/endpoint/token enumeration) is dispatched at sonnet/opus ONLY,
never flash (a cheap model hardens a wrong negative into a fact); a discovery
lane's negative is re-verified on the brain before it reaches Deadends.md. Vector
selection and "is this surface real or am I querying it wrong" judgement stay on
the brain (see `Skill(delegate)`).

## Dispatch archetypes (roster tiers)

Named lane archetypes with a FIXED tier; the table above still governs
unnamed execution lanes.

- Verifier lane: glm-5.3, always. Independent re-derivation of an
  escalation-candidate finding from the recorded evidence, never trusting the
  discovering lane's verdict. A flash verifier hardening a wrong negative is
  the delegate cheap-tier trap; package file only, verdicts
  CONFIRMED/NOT CONFIRMED/UNVERIFIABLE citing package lines, claims-extraction pass,
  UNVERIFIABLE routes to Skill(triage).
  Independence rules (hard): a verifier's input is the discovering lane's
  evidence package only - it never receives another verifier's conclusion;
  a malformed or prose-wrapped verifier result is discarded and re-dispatched
  fresh, never repaired in place.
  Material-replacement rule: when a verifier's re-derivation materially
  CHANGES the finding (different root cause, endpoint, or severity raised),
  that replacement is not final - dispatch a second fresh verifier on the
  replacement before it enters the board. Wording-only corrections apply
  directly.
- Research lane: glm-5.3-flash. CVE/PoC lookup across NVD, MITRE, CISA KEV,
  GHSA/GitHub search, Exploit-DB, vendor advisories, Packet Storm, Vulners,
  returning a credibility read plus publication/last-updated dates. Output is
  intelligence only; the go/no-go on testing it stays on the brain. When the
  lookup is Exploit-DB/public-PoC shaped, Skill(searchsploit) owns the
  methodology (sweep, credibility, mirror, adapt, lab-first) - the lane
  dispatches it instead of hand-rolling the source list.
- Fuzz lane: glm-5.3-flash. The `fuzz` skill authors the deterministic wordlist
  pick; the lane runs the emitted commands and returns raw hit lists.
- Graphify lane: glm-5.3-flash. Structural wikilink-graph runs (`scripts/wiki-graph.py`,
  no LLM): relation chains, hub/orphan reports for the current surface.
- Wiki lane: glm-5.3-flash. qmd/BM25 lookups and arsenal pulls; returns the cards
  and payload rows the brain asked for, never the go/no-go.
- Redteamlead lane: glm-5.3-max (opus). An RTL consult dispatched as a lane: takes
  the stalled-board summary, returns ranked directions + an explicit STOP. Clinical
  framing (verify/confirm verbs); `[cyber]` failure -> redispatch on haiku.
- Hunt lane (goal hunts): sonnet default. A goal-directed hunt-* execution lane
  (hunt-sqli etc.) with a single SUCCESS criterion in slot (f); step up to opus
  when the lane becomes exploit development or chain construction.
- Scribe lane: glm-5.3-flash. Draft and merge finding entries from returned
  envelopes, dedupe, timestamp. Drafts return to the brain; the brain remains
  the only APPLIER of shared-file edits (lanes hand back paste-blocks per
  slot (f); a lane's own capture dir under `poc/<lane>/` is its output, not a
  shared-file write). Dedupe judge criteria: two entries are the SAME finding
  only when root cause AND component AND fix all match (same tainted param on
  the same endpoint version twice = duplicate; same param on two hosts or two
  sinks = two findings); anything uncertain keeps BOTH entries flagged for the
  brain, never a silent merge.
- Console / Lead Strategist: brain duties (routing, judgement, sign-off),
  never subagent roles; the main chat is glm-5.3 by definition.
- Step-up rule: a flash lane that hits a judgement fork (vector choice,
  ambiguous analysis, "is this real or am I querying it wrong") stops and
  returns to the brain for re-tier instead of guessing.

## The dispatch (delegate is the contract)

Fire `Skill(delegate)` in the MAIN session BEFORE the first dispatch of a phase
(same reasoning as hunt skills: doctrine lands in brain context, G2 records the
fire). Delegate's eight-slot checklist IS the prompt skeleton - slots a-h,
anti-give-up/no-guess, the read-first mandate verbatim, the false-root
guardrail, the log.md lane line and its close-on-return, `lane_validate.py`,
and delegate's returned-lane processing order (verdict above the claim, pending
is status not guess, partial recovery, resume-with-context, 3-fail switch).
This skill restates NONE of it; when the two files disagree, delegate wins -
EXCEPT where this file explicitly supersedes it (concurrency: up to 3 disjoint
lanes replaces delegate's serial one-at-a-time WAIT rule; nothing else
overrides). Fallback if the delegate fire was skipped or a compaction ate it:
every dispatch prompt still carries, verbatim, the false-root guardrail
(`hostname` alongside any `id` output), the read-first mandate (cat each file
in full, grep only to locate), and anti-give-up/no-guess (run the full
window, report raw output, never invent a result).

Brain adds two fleet rules on top:

- Frozen shared prefix: author the shared contract body ONCE per phase - slots
  a, c, d, e, g plus delegate's cross-lane mandates, byte-identical in every
  lane prompt; only the trailing LANE DIRECTIVE (slot b commands, slot f
  SUCCESS criterion, target/paths) differs per lane. No dynamic content in the
  shared section; any per-lane fact lives in the directive.
- Fixed return envelope: every lane returns Scope (what was attempted) /
  Result (verdict + the raw SUCCESS observable) / Key files (capture-dir
  paths) / Issues (blockers + what was ruled out). Slot h's
  no-one-line-verdict rule applies inside Result, and delegate's slot (f)
  rides whole within it (paste-able diff block for any shared-file change,
  REVERT of state the run changed); the envelope is the return shape, not a
  narrower contract.

Dispatch hygiene (fleet rule): briefs and reports are file paths, never pasted bodies;
lane returns are 15 lines or fewer; a worker never spawns its own subagent (a felt need
for a reviewer comes back as a concern); every lane slot names its `model:` (cheap tier
for transcription, mid for judgment; the cost metric is turn count); same-shape items
ship as one brief enumerating every item, verified per item, and
a listed item with no capture is a Missing finding.

## Concurrency

- Up to 3 concurrent subagents, disjoint targets or vectors only; never two
  agents on the same asset+class. This supersedes delegate's one-at-a-time
  serial rule; delegate's no-parallel-duplicate rule still applies.
- One scanner at a time on the Kali VM; parallel lanes must be genuinely
  independent (a watch window + a read-only source pass + drafting).
- While agents run, the brain keeps driving the board, wiki, and next-row prep.
- Few long lanes beat many short forks: prefer a lane that owns a whole vector
  over a fresh subagent per step (every fresh dispatch re-pays the prompt
  prefix); re-dispatch only on stall/refusal, per Failure handling.
- Discovery multiplication: LLM runs are non-deterministic - identical skills on
  identical targets return different findings per pass. A discovery-shaped lane
  (class/endpoint enumeration, content discovery) runs 2-3 passes on SEPARATE
  sessions, merged and deduped by the brain before triage; a single-pass
  discovery negative is the weakest negative in the harness and needs the
  brain-side re-verify even more than a flash lane's does. Verification lanes
  stay single-shot (their check is deterministic; repetition adds nothing).
- Lane completions arrive as notifications; never poll a running lane. Integrate
  in return order; persist to `state.md`/`loot.md` before the next dependent
  move.
- Drift-guard interplay: an OPEN, FRESH lane line (`in flight @<HH:MM>`) in
  log.md counts as driver contact, so lane-flight calls never feed the
  off-board deny - only while the line is open AND younger than the 45-min
  stale window (a forgotten line stops exempting; `status.py` flags it
  resume-or-close). Windowless lanes (offline/research/read passes) still
  write the line with `tmux win -` so it parses. Close every lane line on
  return; after several brain-side exploit-shaped calls with no lane open, run
  driver `note` before the next wave so the streak resets through the front
  door.
- Name the join strategy at every fan-in point in a lane plan (cyberstrikeai L4):
  `merge: all_merge` (apply every lane's writes) | `first_non_empty` (first lane returning
  the observable wins) | `fail_fast` (one lane's failure kills the merge). Defaults when
  unstated: all_merge for board writes, first_non_empty for verifications.

Pre-flight collision table (2+ lanes only): before dispatch, one row per lane pair
sharing a host, cred, foothold, or tool - what one produces, what the other consumes,
what was found. Rule every conflict and log it as a `Ruling:` line before launch. A
clean-looking plan with no rows is not a scan.

Child reconciliation cadence: between bounded waits, post one status line, list live
children, and chase any lane that finished without reporting (SendMessage resume);
no short-timeout polling, no one silent open-ended wait. A dead lane is noticed in
minutes, not at session end.

Steer/kill discipline (ARTEX steer_work/kill_work, 2026-11-15): on every driver
contact while lanes are live, review them against the board, not just at return.
A drifting lane (off-brief targets, re-deriving recon the board already covers)
gets ONE SendMessage course-correction naming the brief line it drifted from; a
wrong-vector lane (verified the board row was mis-picked, or the tell says
starved target) gets TaskStop as a stop-loss, its partial findings swept into its
run-ledger first if it can still write. Never let a lane burn its whole budget
walking a route you already know is wrong - waiting for return is not a strategy.

## Offensive integration (brain mode over the driver; absorbs loop-offensive)

The brain runs this loop; it is a posture, not a script. Every iteration:

1. DRIVE: `python3 scripts/offensive.py --eng <eng> next`. Prose compression is
   not a driver flag; engagement output discipline comes from AGENTS.md output
   rules. If terminal 3x -> STOP, operator decision.
2. FIRE the mapped `Skill(hunt-*)` in the MAIN session (G2 + doctrine).
3. DISPATCH the distilled action as a lane at the tier from the table above
   (briefs are .md file paths under poc/<lane>/; completion-gate init before
   dispatch). Envelope on return: Scope / Result / Key files / Issues.
4. VERIFY on return: `python3 scripts/completion-gate.py check <lane>
   --capture <dir>`; UNCHECKED/MISSING/EMPTY -> re-dispatch with the generic
   nudge verbatim. Re-verify any negative before it becomes a Deadend.
5. INTEGRATE: state.md rows, log.md lane close, driver `note`/`done`/`foothold`;
   re-run `next`. A FIND scaffolds + dispatches a Verifier lane (never flash)
   before it counts, and appends one line to `targets/<eng>/Killchain.md`
   (chain node) the same iteration it verifies.
6. ROTATE on stall: dry_streak at threshold, 2 lanes with zero finds, or a
   wrong-vector tell -> fire Skill(redteamlead) for ranked directions, add
   rows from its output, reset streak via `note`. Never re-tune a fighting
   vector (hunt-core wrong-vector tells).
7. EXTRACT while running (operator standing rule): any step a lane repeated
   3+ times verbatim -> wiki-stage a generic candidate or a ponytail marker
   the same iteration; do not stockpile for close-out.

Concurrency: up to 3 disjoint lanes per wave; collision ruling in log.md
before launch; one scanner slot on the VM.

Stop conditions (hard): hunt-core stop list, scope edge, operator stop,
board terminal. The loop never overrides a stop condition to keep hammering.

The closeout chain (triage, evidence, walkthrough, engagement-retro) stays on
the brain. New engagements OPEN in brain posture from move 0 (operator
directive 2026-10-06); single-agent `Skill(offensive)` execution is the
fallback when the board holds fewer than 2 genuinely disjoint rows (one asset,
one vector), not the default. Brain-posture default is OWNED by
Skill(offensive); this section references it.

## Failure handling

- Subagent stalls or dies: stop it, ONE re-dispatch with a tightened checklist,
  then the brain takes the step over.
- Lane VANISHED (no return, no completion notification): BEFORE any
  re-dispatch, sweep the lane's capture dir, its tmux window, and the open lane
  lines (`python3 scripts/status.py` ages them) - a vanished lane often
  finished its work on disk while the agent died (delegate's partial-recovery
  rule); re-dispatching redoes completed work.
- Safeguard refusal on a dispatched run: the brain executes that step itself
  rather than churning re-dispatches.
- An escalation-candidate finding dispatches to a Verifier lane (glm-5.3) for
  independent reproduction before it is recorded as foothold/fact.
- A negative from a subagent is re-verified on the brain before it reaches
  Deadends.md.

## Known ceilings

Deliberate simplifications, named so they read as intent. A late or duplicate
envelope (the original agent returning after sweep, re-dispatch, and takeover)
is resolved by the brain's verdict line, no merge protocol. Cron/scheduled
lanes run outside the lane-line contract: open a line for them if their calls
should count as driver contact. An operator-mandated fleet larger than 3
supersedes the cap by explicit order (disjointness and the applier rule still
bind). The scanner-cap advisory is per-engagement, so disjoint-target scanner
lanes may trade spurious serialize warnings. The shared prefix and lane
directives live only in prompts: stage a copy in the lane's capture dir if a
compaction landing in the spawn window loses one.

## Client-data boundary

Worked examples in this file use placeholders only; never put a real target IP,
hostname, or credential into this skill file.

