# CyberStrikeus/CyberStrike

> opencode-derived TypeScript agent harness with security sub-agents, a traffic-capture and HTTP replay pipeline, and SQLite-backed findings.

- Category: [Open-source AI pentest and offensive-security agents](https://llms-technical-reviews.com/offensive-security-agents/)
- Repository: https://github.com/CyberStrikeus/CyberStrike (reviewed at commit `61044eddf31d1549b54cea64a5c0dd694ab0341b`, 2026-11-01)
- Stars: 3350 · Language: TypeScript · License: AGPL-3.0
- Canonical page: https://llms-technical-reviews.com/p/cyberstrike/

## Overview

CyberStrike is a terminal coding-agent harness repurposed for offensive security. Its changelog records the lineage: it is a fork of the opencode agent (the bin launcher was renamed from `opencode` to `cyberstrike`), so the core is opencode's Bun/TypeScript stack. That means a session loop over the Vercel AI SDK, a permission ruleset engine, SQLite through Drizzle, MCP clients, a TUI and an HTTP server. On top of that it adds security agents, about 50 security tools, a methodology engine with phases and checklists, a browser crawler that captures HTTP traffic, and an HTTP replay engine that testers use instead of `curl`.

Two working styles share the same code. In the general style, the primary `cyberstrike` agent has the full tool set and works like a coding agent with a shell. In the web "proxy pipeline", the crawler captures traffic, a `proxy-agent` orchestrator (which can only delegate) sends captured requests to a small-model analyzer, and then to one tester sub-agent per vulnerability class (IDOR, authz, injection, SSRF, file attacks, LLM and others). Each tester has a narrowed permission set.

## Architecture

```mermaid
flowchart LR
  U["TUI / web UI / CLI"] --> SRV["Server routes"]
  SRV --> LOOP["SessionPrompt.loop"]
  LOOP --> AG["Agent registry + permission rulesets"]
  LOOP --> LLM["Provider (AI SDK, models.dev catalog)"]
  LOOP --> TOOLS["ToolRegistry"]
  TOOLS --> BASH["bash (host shell)"]
  TOOLS --> TASK["task -> sub-agent session"]
  TOOLS --> HB["hackbrowser crawl"]
  TOOLS --> REPLAY["http_replay engine"]
  TOOLS --> SEC["Security tools and hooks"]
  TOOLS --> MCP["MCP servers / Bolt"]
  HB --> DB["SQLite: requests, intel, vulns"]
  REPLAY --> DB
  TASK --> LOOP
  DB --> RPT["Validation gates + generate_report"]
```

| Component | Path | Role |
|---|---|---|
| Session loop | `packages/cyberstrike/src/session/prompt.ts` | Turn loop, tool resolution, step caps, loop detectors, compaction |
| Agents | `packages/cyberstrike/src/agent/agent.ts`, `agent/prompt/` | Primary and sub-agent definitions, prompts, permission rulesets, step caps |
| Permissions | `packages/cyberstrike/src/permission/next.ts` | `allow` / `deny` / `ask` rules matched by wildcard, last match wins |
| Tools | `packages/cyberstrike/src/tool/` | `bash`, `task`, security tools, reporting, methodology tools |
| Replay engine | `packages/cyberstrike/src/replay/`, `tool/http-replay.ts` | Mutate and send captured requests with a host scope guard and rate governor |
| Crawler | `packages/hackbrowser/`, `tool/hackbrowser.ts` | Autonomous browser crawl that streams captured requests into the session |
| Methodology | `packages/cyberstrike/src/methodology/` | Phases, intel entries, VRT checklists, chain detection, validation gates |
| Storage | `packages/cyberstrike/src/storage/db.ts` | One SQLite database in the user data directory |
| Providers / MCP | `provider/`, `mcp/` | Model catalog and SDK loading; MCP over stdio, SSE and streamable HTTP |

## How a request flows

Take "test the web app at https://app.example for access-control bugs" in the TUI:

1. **Loop.** `SessionPrompt.loop` sets up loop detectors and enters `while (true)`. Each step reloads messages from SQLite, picks the agent and model, and checks the step cap ([prompt.ts](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/session/prompt.ts#L310-L344)).
2. **Tools.** `resolveTools` offers only the tools the agent's ruleset allows. On the last allowed step every tool is removed, so the model must finish in text ([prompt.ts](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/session/prompt.ts#L644-L740)).
3. **Crawl.** The model calls `hackbrowser` with the target URL. The crawl runs in the background, derives a network scope of `*.{eTLD+1}` from the target, and stores each captured request in the session.
4. **Delegate.** The `task` tool starts a child session for a sub-agent, for example `proxy-agent`. That orchestrator is deny-all except `task`, read tools and `scope_check` ([agent.ts](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/agent/agent.ts#L480-L512)). It sends captured requests to the analyzer and to class-specific testers, with the raw request prepended to their prompt.
5. **Test.** A tester sends variants through `http_replay`. The tool refuses any host that is not among the session's captured hosts ([http-replay.ts](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/tool/http-replay.ts#L105-L115), [L385-L397](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/tool/http-replay.ts#L385-L397)). It returns facts (status, timing, reflection, error signatures), not a verdict.
6. **Record.** The tester calls `report_vulnerability`, `add_intel` and `update_vrt_check`. Off-class findings are rerouted as intel hints.
7. **Report.** `generate_report` runs the validation gates and writes a Markdown report with findings, coverage, methodology progress and chains.

## Key components

### Agent loop and termination

Agents are either primary or sub-agents. Sub-agents run in child sessions created by `task`, which can also resume a prior child. Step caps exist only for some agents: 40 for `proxy-agent`, 20 for `proxy-analyzer`, and 60 for the `proxy-tester-*` agents ([agent.ts](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/agent/agent.ts#L120-L127), [L903](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/agent/agent.ts#L903-L903)). The primary agent has no cap, so `maxSteps` is `Infinity`. It stops when the model ends a turn without tool calls, or on abort. The cross-turn repeat detector, which forces a wrap-up after the same tool call with the same arguments repeats, runs only for native sub-agents. The primary agent relies on the within-turn `doom_loop` check, which asks the user. The "monologue" stuck detector exists but ships disabled ([stuck-detector.ts](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/session/stuck/stuck-detector.ts#L32-L41)). When context nears the model limit, compaction prunes old tool output.

### Permissions and scope

The default ruleset for every agent starts with `"*": "allow"`. Only `doom_loop`, access outside the project directory and `.env` reads ask the user ([agent.ts](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/agent/agent.ts#L163-L200)). In practice the primary agent can run any shell command, attack script or post-exploitation module without a prompt unless the user adds rules. Rules are evaluated with last-match-wins wildcards. An unmatched permission falls back to `ask` ([next.ts](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/permission/next.ts#L131-L160), [L237-L246](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/permission/next.ts#L237-L246)).

The tester agents are tighter. Their base is deny-all with `bash` allowed except for HTTP clients, inline interpreters and raw-socket tools, which pushes traffic through `http_replay` ([agent.ts](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/agent/agent.ts#L597-L640)). The injection tester also denies destructive SQL, SQL-to-command and file-write patterns, merged after user rules so users cannot loosen them ([agent.ts](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/agent/agent.ts#L678-L720)). These are glob matches on command text. They are a guardrail against a model's habits, not a sandbox.

Target scope has three parts of different strength:
- `http_replay` enforces a real host allowlist built from captured traffic, and its governor sets rate, concurrency, circuit-breaker and a 5,000-request session budget ([governor.ts](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/replay/governor.ts#L1-L30)).
- `scope_check` is advisory. The model supplies both the target and the scope list, and the tool only prints a warning ([scope-check.ts](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/tool/scope-check.ts#L4-L44)).
- The validation gates flag out-of-scope assets only at report time, after testing.

Nothing scopes `bash`, the attack scripts or the host-level hook tools.

### Tool execution

`bash` parses the command with tree-sitter to find paths and command prefixes for the permission check. It then spawns the command in the host shell with the full process environment ([bash.ts](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/tool/bash.ts#L160-L195)). There is no container or namespace sandbox. The changelog notes that the inherited Docker setup was removed. Security tools fall into four groups: bundled Python attack scripts, a payload-battery probe for injection testing, cloud/Kubernetes/CI audit tools, and a family of host and cloud post-exploitation modules (Linux, macOS, Windows, AWS, Azure, GCP, containers, eBPF). The modules run as local subprocesses, so they act on whatever machine CyberStrike runs on. Bolt is a remote MCP tool server with Ed25519 authentication, for running tools from another host.

### Findings and validation

`report_vulnerability` always records a finding. For execution-dependent classes reported by the injection tester at high or critical without `execution_evidence`, the code caps severity at medium and marks the title `[UNCONFIRMED CANDIDATE]`. A later report with evidence upgrades it in place ([vulnerability.ts](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/tool/vulnerability.ts#L59-L128)). Evidence is a string from the model, so the gate checks that evidence is present, not that it is true. Near-duplicates by endpoint, title and CWE land as `new` for triage. Report-time gates check evidence fields, severity-to-impact wording, at least three requests for "exploited" entries, and scope ([validation.ts](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/methodology/validation.ts#L180-L245)).

### State and models

All sessions, messages, captured requests, intel, VRT checks, vulnerabilities and methodology state live in one SQLite file, `cyberstrike.db`, in the user's data directory ([db.ts](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/storage/db.ts#L145-L150)). A file-based memory under `.cyberstrike/` in the project adds long-term and daily notes. Models come from the models.dev catalog plus bundled AI SDK providers, including OpenAI-compatible endpoints for local servers. Agents can pin a model, or use the provider's small model (`useSmallModel`), as the analyzer does.

## Extending it

- **Agents.** Add agents in config with their own prompt, model, steps and permission rules. User rules merge into each agent's ruleset.
- **Tools.** Plugins can register tools through the plugin API, and MCP servers add more over stdio, SSE or streamable HTTP.
- **Skills.** The skill tool loads Markdown skills from skill directories, which are readable without prompts.
- **Testers.** A new vulnerability class needs a prompt folder under `agent/prompt/vuln/`, an entry in the tester list, and an entry in the class-scope map used for lane checks.

## Running it

- **Install.** `npm i -g @cyberstrike-io/cyberstrike` and run `cyberstrike`. The TUI asks for a provider and key on first run.
- **Other front ends.** A web UI and server routes cover sessions, methodology, MCP and Bolt. `cyberstrike hackbrowser` runs the crawler from the CLI.
- **Required.** Node/npm to install, Python 3 for the script tools, and any external scanners you want the shell to call. Run it in a VM or container you control, because the shell runs on the host.

## Strengths and caveats

- **Strength: mature agent core.** It inherits opencode's loop, permission engine, compaction and provider catalog, so many models work out of the box.
- **Strength: disciplined web pipeline.** Single-purpose testers, deny-by-default rulesets and a replay engine with a host allowlist and rate governor are a real structural control.
- **Strength: honest evidence handling.** Unconfirmed high-severity claims are downgraded by code, not by prompt.
- **Caveat: permissive defaults.** The primary agent allows everything, including host shell and post-exploitation modules, without a prompt.
- **Caveat: scope is mostly advisory.** Only `http_replay` enforces it. `scope_check` trusts the model's own scope list.
- **Caveat: no sandbox.** Commands run as the user on the host with the full environment.
- **Caveat: uncapped primary loop.** Only the proxy-pipeline agents have step caps. There is no spend limit.

*Sources: code at 61044ed, verified Q&A.*

## How CyberStrikeus/CyberStrike answers the Open-source AI pentest and offensive-security agents questions

### How is the agent loop and planning implemented? (answered)

**Single agent with multi-agent crew dispatch.** CyberStrike uses a primary agent (cyberstrike, general, or user-chosen) that dispatches work to 13+ specialized subagents via the `task()` tool. The architecture is not a fixed crew — subagents are spawned dynamically per task/request through a `SessionPrompt.loop()` function that runs the LLM turn loop.

**Planning & decomposition.** The methodology engine defines 13 sequential phases (scope_analysis → passive_recon → active_recon → technology_profiling → authentication_testing → session_management → authorization_testing → input_validation → business_logic → data_protection → api_security → infrastructure → reporting). Each phase has prerequisites, required tags, and minDeliverables tracked in a SQLite database via `Methodology.computeState()`. Phase status (not_started/in_progress/completed/blocked) is persisted and reported to the agent as prompt context via `Methodology.formatForPrompt()`.

**Turn structure.** The loop at `session/prompt.ts:310-378` (`SessionPrompt.loop`) is a `while(true)` that: (1) streams messages from SQLite, (2) finds the last user/assistant messages, (3) increments step counter, (4) resolves the LLM provider model (with optional small-model downgrade via `useSmallModel`), (5) builds tools filtered by the current agent's permission ruleset, (6) calls the LLM, (7) processes response (tool calls or finish). The loop breaks when the assistant finishes with a non-tool-calls reason or when the abort signal fires.

**Stop conditions & iteration caps.** Hard step caps are defined in `Agent.STEP_CAPS` (orchestrator: 40, analyzer: 20, proxy-tester-*: 60). A stuck detector (`StuckDetector`, line 333) and repeat detector (`RepeatDetector`, line 343) guard against infinite loops. The loop also checks for abort signals (`abort.aborted`). Session compaction runs when token counts approach the model's context limit.

**Agent definitions** are registered in `Agent.Info` with mode (primary/subagent), permission rulesets, model overrides, step caps, and specialization prompts loaded from embedded text files like PROMPT_WEB_APPLICATION, PROMPT_CLOUD_SECURITY, etc.

> **Editor's note.** Correction: the stuck detector ships disabled and both loop detectors run only for native sub-agents; the primary agent has no step cap (maxSteps is Infinity) and stops on a tool-free turn, an abort, or the within-turn doom_loop ask.

Citations: [packages/cyberstrike/src/agent/agent.ts:1-200](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/agent/agent.ts#L1-L200) · [packages/cyberstrike/src/session/prompt.ts:310-420](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/session/prompt.ts#L310-L420) · [packages/cyberstrike/src/methodology/methodology.ts:1-100](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/methodology/methodology.ts#L1-L100) · [packages/cyberstrike/src/methodology/phase.ts:1-100](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/methodology/phase.ts#L1-L100)

### How are security tools integrated and executed? (answered)

**56+ built-in tools** registered in `ToolRegistry.all()` at `tool/registry.ts`. Each tool is defined using `Tool.define()` which wraps a Zod schema for parameter validation and an async `execute()` function. Tools are filtered by the current agent's permission ruleset before being sent to the LLM.

**Shell execution** is via the `bash` tool (`tool/bash.ts`): commands are parsed with **tree-sitter** (a Bash language WASM parser) to extract file paths and command patterns for permission checking. The command is spawned via `Bun.spawn()` with a configurable timeout (default 2 min). Output is capped at 2000 lines / 50KB via the `Truncate` system, with overflow saved to files in `.claude/tool-output/`.

**Security tools:** `attack_script` executes bundled Python scripts (jwt_tamper, race_tester, ssrf_listener, file_upload_tester, cloud_storage_enum, subdomain_takeover, github_dorker, wayback_endpoints) from `data/scripts/`. The `http_replay` tool provides structured HTTP replay with request/response recording. The `inject_probe` tool generates payload batteries for injection testing. Platform-specific post-exploitation tools exist for AWS (`awshook`), Azure (`azurehook`), GCP (`gcphook`), Kubernetes (`kubehook`), Linux (`linuxhook`), macOS (`machook`), Windows (`winhook`), and containers (`containerhook`).

**MCP servers** are integrated via `mcp/index.ts` using the Model Context Protocol SDK, supporting stdio, SSE, and StreamableHTTP transports. 176+ MCP tools are discoverable. Built-in security MCP servers include github-security, cve, osint, cloud-audit, and board.

**eBPF tools** (`tool/ebpf.ts`) deploy Python-based eBPF scripts for kernel-level introspection (syscall sniffing, file hiding, process hiding, keylogging, etc.).

**The `hackbrowser` tool** operates an autonomous browser for crawling and capturing web app state, which feeds into the proxy-analyzer pipeline.

**Tool output truncation** (`tool/truncation.ts`) applies hard caps (2000 lines/50KB) with overflow saved to disk, and a cleanup scheduler removes expired output files after 7 days.


Citations: [packages/cyberstrike/src/tool/registry.ts:1-100](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/tool/registry.ts#L1-L100) · [packages/cyberstrike/src/tool/bash.ts:72-195](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/tool/bash.ts#L72-L195) · [packages/cyberstrike/src/tool/tool.ts:1-89](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/tool/tool.ts#L1-L89) · [packages/cyberstrike/src/tool/attack-script.ts:1-60](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/tool/attack-script.ts#L1-L60) · [packages/cyberstrike/src/mcp/index.ts:1-60](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/mcp/index.ts#L1-L60)

### How are scope, authorization and dangerous actions controlled? (answered)

**Scope checking** is implemented via the `scope_check` tool (`tool/scope-check.ts`) which validates targets against scope items supporting exact domain match, wildcard domains (*.example.com), CIDR ranges (10.0.0.0/24), and URL prefix matching. It returns an explicit warning for out-of-scope targets.

**Authorization/permission system** (`permission/next.ts`) is a ruleset-based engine. Each agent has a flat list of `PermissionNext.Rule` objects (permission, pattern, action). Actions are "allow", "deny", or "ask" (human-in-the-loop). Rules are evaluated by the `Wildcard.match()` function with last-match-wins semantics. Each agent's permission is constructed by merging defaults with user config, and special per-agent overrides. For example, the injection agent denies destructive SQL patterns (DROP TABLE, xp_cmdshell, INTO OUTFILE), while proxy-tester subagents deny direct HTTP clients (curl, wget, Python requests) to force traffic through the controlled `http_replay` tool.

**Lane discipline** (`tool/vuln-scope.ts`): proxy vulnerability testers (`proxy-tester-*`) are structurally restricted to their own vulnerability class. `vrtScopeViolation()` checks the `TESTER_VRT_SCOPE` map at report time; finding titles are cross-checked via `classifyFindingTitle()` to prevent category spoofing. Off-class findings are still recorded via `add_intel(vulnerability_hint)` for re-routing, never dropped.

**Human-in-the-loop** is implemented by the `Permission.ask()` mechanism in `permission/index.ts`: permission requests that are not pre-approved are presented to the user (via the TUI or plugin hooks) and the agent blocks until the user responds with "once", "always", or "reject". The `Permission.RejectedError` is thrown when denied.

**Rate limiting and sandboxing:** The bash tool uses native OS process isolation (spawn with shell, no Docker/Kali sandbox detected). Network isolation relies on tool-level permissions (blocking curl/wget). Rate limiting is not directly implemented at the agent level — each tool has configurable timeouts. The bash tool invokes commands via the system shell with detached processes on non-Windows. External directory writes are permission-gated via `external_directory` rules.

> **Editor's note.** Correction: the base ruleset for every agent is `"*": "allow"`, so the primary agent runs shell and security tools without asking; `scope_check` is advisory (the model supplies both target and scope list). The one enforced scope is in `http_replay`, which refuses hosts not captured in the session and rate-limits sends via the replay governor.

Citations: [packages/cyberstrike/src/permission/index.ts:1-210](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/permission/index.ts#L1-L210) · [packages/cyberstrike/src/permission/next.ts:1-100](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/permission/next.ts#L1-L100)

### How are findings validated and reported? (answered)

**Reporting.** The `report_vulnerability` tool (`tool/vulnerability.ts`) records each finding into the `Vulnerability` system backed by SQLite. Fields include severity (critical/high/medium/low/info), title, description, CWE ID, endpoint, attack_vector, vrt_category, PoC, execution_evidence, and repro steps. Findings are **never dropped** — they always persist with status "new" or "approved" depending on similarity to prior findings.

**Evidence-gated confirmation.** For execution-dependent classes (XSS, SSTI, command-injection, deserialization-RCE), findings reported at critical/high severity WITHOUT `execution_evidence` are **downgraded to medium** and labelled `[UNCONFIRMED CANDIDATE]` with `candidate` field set to the original severity. Re-reporting with evidence upgrades the candidate in place (no duplicate). This logic is in `tool/vulnerability.ts:67-128`.

**Deduplication.** `Vulnerability.similarCandidates()` finds near-duplicates by endpoint, title, and CWE ID. If similar candidates exist, the new finding lands as "new" and the agent must call `triage_vulnerability` to resolve it to "approved" or "duplicate" (linked via `duplicate_of`). Without similar findings, it lands as "approved" directly.

**Validation gates** (`methodology/validation.ts`): `runAllGates()` checks evidence quality (requestSent must contain an HTTP verb, responseSummary ≥50 chars, reasoning ≥100 chars, exploited entries must reference real data), run triager checks (severity-impact matching, reproducibility with ≥3 requests, scope validation, duplicate detection), and per-asset coverage (minimum 60% threshold). Blocking violations prevent report finalization.

**Report generation.** The `generate_report` tool (`tool/generate-report.ts`) produces a structured Markdown report with sections: executive summary, vulnerability findings (severity-sorted table with details), testing coverage, methodology progress, vulnerability chains, attack surface, timeline, agent performance, and validation status. The report includes AI-fillable placeholders for executive summary, risk assessment, and remediation priorities.


Citations: [packages/cyberstrike/src/methodology/validation.ts:1-100](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/methodology/validation.ts#L1-L100) · [packages/cyberstrike/src/tool/generate-report.ts:1-150](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/tool/generate-report.ts#L1-L150) · [packages/cyberstrike/src/session/vulnerability.ts:1-100](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/session/vulnerability.ts#L1-L100)

### How is engagement state and knowledge kept across a long run? (answered)

**SQLite persistence.** All engagement state is stored in a local SQLite database (via Drizzle ORM). Key tables include: `intel_entry` (discovered assets, endpoints, technologies), `vulnerability` (findings with severity/status), `methodology_phase` (phase progress), `vrt_check` (per-intel-entry test results), `chain_candidate` (attack chain detections), `request` (captured HTTP requests), and `coverage_note` (what was tested by which agent). The database is project-scoped under the `.cyberstrike` directory.

**Intel system** (`methodology/intel.ts`): Each discovered asset/endpoint is logged via `add_intel` with type, asset, severity, confidence, tags, and chain potential. Entries auto-generate VRT checklists for systematic testing. Dedup prevents duplicate entries. Chains are auto-detected (`Chain.detect()`) when findings across multiple entries could combine into high-impact exploits (8 patterns: credential+endpoint, info_disclosure+ssrf, redirect+oauth, idor+data_leak, xss+csrf, ssti+rce, race_condition+business, custom).

**Session compaction** (`session/compaction.ts`): When total tokens approach the model's context limit (minus a 20K token buffer), the system prunes old tool call outputs, keeping only the last ~40K tokens of tool interactions. Compaction preserves the task structure (subtask parts) while stripping verbose command output.

**Memory system** (`memory/index.ts`): File-based long-term memory stored in `.cyberstrike/memory/MEMORY.md` with daily notes in `.cyberstrike/memory/<date>.md`. Supports append-to-long-term, append-to-daily, search, and getSessionContext (which returns yesterday's + today's notes + long-term memory). Memory tools are exposed to agents via `MemorySearchTool`, `MemoryWriteTool`, `MemoryReadTool`, and `MemoryContextTool`.

**Session chaining.** Child sessions are created for subagent task execution (`Session.create({parentID})`), allowing recursive decomposition of work while maintaining the audit trail.


Citations: [packages/cyberstrike/src/methodology/intel.ts:1-120](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/methodology/intel.ts#L1-L120) · [packages/cyberstrike/src/memory/index.ts:1-220](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/memory/index.ts#L1-L220) · [packages/cyberstrike/src/session/compaction.ts:1-60](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/session/compaction.ts#L1-L60) · [packages/cyberstrike/src/methodology/chain.ts:1-80](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/methodology/chain.ts#L1-L80) · [packages/cyberstrike/src/session/vulnerability.ts:1-100](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/session/vulnerability.ts#L1-L100)

### Which models are supported and how are cost and context managed? (answered)

**150+ AI providers, 5,300+ models supported.** The provider system (`provider/provider.ts`) is a plugin-based architecture. Bundled providers include Anthropic, OpenAI, GitHub Copilot, Google Vertex, Amazon Bedrock, OpenRouter, Azure, GitLab, Cloudflare Workers AI, SAP AI Core, and 23+ bundled SDK providers. An additional 150+ providers are loaded from the models.dev catalog. The configuration can enable/disable providers via `enabled_providers`/`disabled_providers`, and blacklist/whitelist models per provider.

**Model definition** (`Provider.Model`, lines 597-675) includes cost per token (input/output/cache), context/output limits, capabilities (temperature, reasoning, attachment, toolcall, modalities), status (alpha/beta/active/deprecated), and variants for mode-specific overrides (e.g., different providers for structured output vs chat).

**Per-role model selection.** Each agent can specify a `model` override or `useSmallModel: true` (resolved via `Provider.getSmallModel()` to a cheaper tier like Claude Haiku or GPT-5-nano). During the loop, `useSmallModel` downgrades the model at runtime without changing the persisted user message. Step caps prevent runaway costs.

**Context-window management.** Each model defines `limit.context` (max context tokens) and `limit.output`. The compaction system (`SessionCompaction.isOverflow`) triggers at context-limit minus reserved tokens (20K default). The error module (`provider/error.ts`) detects context-overflow errors from various providers (OpenAI, OpenRouter, DeepSeek, MiniMax, xAI) to handle gracefully.

**Cost tracking** is built into every model definition with per-tier costs for input, output, and cache (read/write). The system tracks token usage per message/part. The `getSmallModel()` heuristic prefers `claude-haiku-4-5`, `gemini-3-flash`, `gpt-5-nano` based on provider availability.

**Local model support** is supported through OpenAI-compatible endpoints (vLLM, Ollama, etc.) configured via the config file with custom `api` URL. Authentication supports API key, OAuth, and Bearer token methods. The `cyberstrike` public provider offers free models (nano tier) as fallback.


Citations: [packages/cyberstrike/src/provider/provider.ts:1-200](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/provider/provider.ts#L1-L200) · [packages/cyberstrike/src/provider/provider.ts:597-700](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/provider/provider.ts#L597-L700) · [packages/cyberstrike/src/session/compaction.ts:30-50](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/session/compaction.ts#L30-L50) · [packages/cyberstrike/src/agent/agent.ts:120-160](https://github.com/CyberStrikeus/CyberStrike/blob/61044eddf31d1549b54cea64a5c0dd694ab0341b/packages/cyberstrike/src/agent/agent.ts#L120-L160)
