Giving a frontier large language model an unrestricted bash prompt and pointing it at production infrastructure is an architectural failure waiting to detonate. Traditional penetration testing hits an obvious scaling wall: human calendar time. Elite security engineers spend days manually mapping attack surfaces, and the resulting test coverage fluctuates wildly based on operator fatigue and personal methodology. Yet the knee-jerk industry response of granting an autonomous agent unbounded terminal execution triggers hallucination cascades, unmitigated scope creep, and destructive operations.
DarkMoon re-engineers this paradigm by enforcing an absolute separation of concerns. Instead of allowing a probabilistic neural network to issue arbitrary shell commands, the architecture physically severs cognition from execution.
+-------------------------------------------------------------+
| LLM Core |
| (Planning, Reasoning, Tech Surface Model) |
+-------------------------------------------------------------+
|
v
+-------------------------------------------------------------+
| OpenCode Orchestrator |
+-------------------------------------------------------------+
|
[ MCP Protocol Layer ]
|
v
+-------------------------------------------------------------+
| Isolated Docker Containers |
| +-----------------------------------------------------+ |
| | Allow-listed Toolset: Nuclei, sqlmap, | |
| | BloodHound, NetExec (50+ utilities) | |
| +-----------------------------------------------------+ |
| | Specialized Sub-Agents: Web, AD, K8s, Network | |
| +-----------------------------------------------------+ |
+-------------------------------------------------------------+
The Architecture: Decoupling Brains from Execution
The core system design splits responsibilities across two decoupled tiers: high-level orchestration and sandboxed container execution.
The orchestration layer, driven by OpenCode, communicates directly with the LLM backend. Its job is purely cognitive. It ingests target parameters, decomposes complex testing objectives into granular execution plans, and constructs a persistent state of the environment.
Crucially, OpenCode never touches host sockets or local network interfaces. It delegates all operational execution through the Model Context Protocol (MCP).
The MCP layer acts as a strictly bounded RPC bridge to isolated Docker containers. These containers host an explicit allow-list of over fifty battle-tested security tools, including Nuclei, sqlmap, BloodHound, and NetExec.
To avoid the inefficiencies of a monolithic reasoning engine, DarkMoon provisions specialized sub-agents segmented by tactical domain:
- Web applications
- Active Directory environments
- Kubernetes clusters
- Network protocols
The Dynamic Execution Loop
DarkMoon does not run blind, linear scripts. It executes a continuous, state-driven feedback loop that mirrors established standards like NIST SP 800-115 and ISO 27001:
- Discovery and Fingerprinting: Probing vectors map responsive services, exposed ports, and the underlying technology stack.
- Surface Modeling: OpenCode synthesizes verified signals into a structured, real-time map of the attack surface.
- Dynamic Sub-Agent Dispatch: Specialized agents spin up strictly on demand. Detecting a WordPress instance triggers the CMS sub-agent. Discovering downstream GraphQL endpoints immediately boots the GraphQL specialized agent.
[ User-Defined Scope: Domains / IPs / Apps ]
|
v
[ OpenCode In-Scope Surface Model ]
|
v
[ MCP Explicit Allow-List Verification ]
|
v
[ Deterministic Tool Execution ]
Hard Scope Guardrails: Eliminating Unbounded Execution
Autonomous security tools fail when non-deterministic models attempt out-of-scope exploration. DarkMoon neutralizes this blast radius by eliminating direct terminal access from the LLM entirely.
The model is incapable of generating arbitrary shell code against a target. Every single command must map directly to an explicit MCP-registered tool.
Target perimeters (IP ranges, domain boundaries, specific application scopes) are hard-coded into the orchestrator during initialization. The surface model rejects any asset that falls outside these boundary checks. If a utility or binary is not explicitly registered within the MCP server manifest, it cannot be invoked. This eliminates hallucinated CLI parameters and ensures total operational determinism.
Model Selection, Token Economics, and Stability
Operational cost and agent stability depend directly on the chosen inference runtime and downstream safety classifications.
| Assessment Target Profile | API Spend Baseline | Primary Token & Resource Drivers |
|---|---|---|
| Standard Web Application | ~$10 (Frontier Models) | Initial fingerprinting, surface modeling, single-agent dispatch routines |
| Heavy Infrastructure / Active Directory | High Token Consumption | Multi-host pivoting, deep reasoning over graph structures, state tracking |
| Local Runtimes (Ollama / llama.cpp) | $0 (Marginal Cost) | Compute-bound to locally provisioned bare-metal hardware |
Frontier Models vs. Provider Guardrails
DarkMoon supports upstream backends across OpenAI, Anthropic, OpenRouter, and self-hosted environments like Ollama and llama.cpp. Local setups provide a zero-marginal-cost tier for sensitive data, but frontier cloud models consistently deliver superior multi-step planning and deep context retention.
However, upstream safety filters introduce significant operational variances during authorized security tasks:
- Claude Opus 4.8: Testing revealed aggressive vendor-level classification triggers, resulting in mid-assessment refusals and dropped execution chains.
- Claude Opus 4.6: Successfully completed end-to-end multi-stage assessments without operational degradation, making it the current recommended baseline for production runs.
Organizations deploying approved assessments can also utilize the Anthropic Cyber Verification Program to resolve vendor classification friction. Small parameter-class models are explicitly unsupported for orchestration duties due to context fragmentation and reasoning failure modes under high state complexity.
Evidence-Based Reporting: Ground Truth Over Hallucinations
Generative models frequently misinterpret benign anomalies as critical vulnerabilities. DarkMoon prevents synthetic false positives by treating the LLM as an untrusted inference engine rather than an authoritative source of truth.
+-------------------------------------------------------------+
| Signal Ingestion |
+-------------------------------------------------------------+
|
+---------------------+---------------------+
| |
v v
[ Weak / Ambiguous Signals ] [ Verified Direct Proof ]
- Generic HTTP 200 responses - Exact command invocations
- Reflected input without impact - Raw execution stdout/stderr
- Ambiguous service banners - Full HTTP request/response
| |
v v
Status: UNCONFIRMED Status: CONFIRMED
(Downgraded for Review) (Traceable & Reproducible)
The validation pipeline splits signals into two deterministic tiers:
- Unconfirmed Signals: Heuristics such as generic HTTP 200 status codes, reflected input without execution impact, and ambiguous banners are downgraded automatically for human review.
- Confirmed Findings: A vulnerability is validated only when the MCP layer captures verifiable execution artifacts.
To achieve Confirmed status, the system bundles the exact CLI command invocation, standard output, standard error, raw HTTP request/response pairs, and structural execution logs directly into the report. By forcing end-to-end reproducibility for every finding, the platform replaces model hallucinations with auditable, deterministic ground truth.
