DarkMoon research series·A. Architecture & attack paths·Article 2 of 23·All 23 articles
Introduction
There are two broad ways to build an attack graph from a penetration test. You can derive it after the fact: a server or a rule engine reads the findings and logs and decides which ones are connected. Or you can let the acting agent declare the connection while it works, because the agent is the one that just used a password it found earlier.
DarkMoon tried the first family for months and ended up with the second. This article explains what an agent-native attack graph is in DarkMoon, why the team chose it, and what the measurements say it is good and bad at. The full analysis is in the agent-native graphs chapter of the research repository.
The problem
Every edge in an attack graph needs an author. DarkMoon's earlier designs asked three different authors, and each one failed in its own way:
- Structured agent claims went unfilled. Four optional "chain data" fields (prerequisites, produced artefacts, reached assets, negative control) were exposed on the push tool. On 18 production campaigns, 0 of 340 findings carried any causal field; on a later real campaign the four fields were filled 0 of 51 times. Specialist agents, which push about 96 % of findings, had never been instructed to fill them (
VERIFIED). - Server-side reconstruction guessed. The production proof path at the time had 20 guessing rules (endpoint, host plus service, push order, mention) and made at least one wrong binding on real campaigns (
VERIFIED). - Rule bases did not generalise. A capability graph built from CWE, CAPEC and ATT&CK pre/post-conditions got 10 of 78 edges right; rules on finding text reached 12 to 15 % held-out precision (
SIMULATED).
A fourth constraint shaped the answer: the product owner capped the token overhead of the whole mechanism at +1 % of a campaign.
Methodology
Definition. In DarkMoon, an agent-native attack graph is one whose edges are declared by the LLM agents in the tool calls they already make. It is not reconstructed later from logs, not extracted by a second LLM, and not derived from a fixed rule base.
Mechanism. The declaration is a single optional list, enabled_by, on the dashboard_push_finding tool. When an agent pushes finding B with enabled_by = [A], it asserts the directed edge A → B: "B's exploitation used a result obtained in A". The rest follows in code:
- the server stores the list as written, merges later additions and dates each one;
- it resolves references lazily and validates them structurally (unknown, self, other campaign, forward in time, cycles);
- ATT&CK tactic order is used as context warnings only, never as a verdict;
- each valid edge is shown at once with the state
declared_by_agent; - a zero-token qualification step on the server's own records may later promote it.
Properties worth knowing. Two references give two edges; there is no AND/OR semantic in the declaration. An empty list means an entry point. The agent has no "unlink" call: corrections come from the operator or from a finding being marked false positive. References may cross agents. The declaration reads no protocol data, so it is protocol-agnostic by construction. A typed variant (DIRECT / SAME_CAUSE / CONTEXT / NONE) was tested in simulation and not adopted.
Lever. After a first real campaign where only 4 of 36 findings carried enabled_by (the instruction existed in one agent prompt only), every pushing sub-agent received one prompt line, and the push reply started listing recently exploited findings to cite.
Measurement. Fill rates, invented ids and precision were measured on real campaigns against hand-adjudicated oracles; token cost was modelled, not recounted.
Real results
It gets filled, and it does not invent. enabled_by was filled on 22 of 50 findings across campaigns c5 and c6 with 0 invented ids; on DVGA in the Community edition, 16 of 68 findings declared links and 0 references were rejected (VERIFIED). Fill went from 4 of 36 (c4) to 15 of 39 (c5) after the prompt lever, under different conditions and n = 1.
It is cheap. The enabled_by values themselves cost about +0.04 to 0.08 % of a campaign's tokens; the whole mechanism (schema, prompt lines, hint) about +0.52 to 0.57 %. By comparison, asking agents to cite execution ids on every command cost +1.02 % and +1.75 %. These are SIMULATED estimates with an error band of −20/+25 % of the overhead; an exact recount was never done.
It contributes coverage that nothing else produced.
| Contribution | Evidence |
|---|---|
| Links on protocols the server cannot observe (Redis → PostgreSQL → file read → SSH key, SMB) | c6, c7 and the final lab run; server observation is effectively HTTP-only |
| Coverage of the real chain spine | strict recall 2/6 (c5), 5/6 (c6), 6/9 (c7) |
| Multi-step chains | complete chains of 3+ findings: 2 in c6, 3 in c7 |
| Cross-agent links | c7: 4 of 7 expected cross-agent links declared |
It is often wrong. Strict precision against independent oracles was 0.6 (c5, only 5 decidable), 0.556 (c6, interval 0.27 to 0.81), 0.316 (c7, interval 0.15 to 0.54) and about 0.37 on the final lab run (approximate scoring). The dominant error is linking two facets of one root cause, the subject of article 8.
It is never proof. The server qualified 0 declared links on every real campaign measured. Agents mask credentials in their evidence and the Privacy Gateway tokenises them, so the values needed for exact attribution are absent.
The repository summarises the division of labour this way: the agent is a high-recall, low-precision proposer that costs little; the server is a near-zero-recall, high-precision verifier on real data. DarkMoon keeps both and never adds them together into one "proven" count.
Limits
- Every precision figure is a single run on one target with one model (claude-opus-4-6); intervals overlap and no configuration is shown better than another.
- Run-to-run variance of about ±17 to 20 points was observed between passes of the same prompt variant in proxy simulations; real cost varied +53 % between c6 and c7 with similar prompts.
- No prompt change was shown useful outside the data that suggested it. A wording change was reverted; two further variants were not applied.
- The comparison between agent declarations, server observation, rule graphs and structured claims synthesises small samples on different targets and is labelled
HYPOTHESISin the repository.
Figures
enabled_by pipeline, simplified from the repository's agent-native chapter.Scientific sources
- Yao et al. ReAct: Synergizing Reasoning and Acting in Language Models. ICLR 2023. arXiv:2210.03629
- Wu et al. AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation. 2023. arXiv:2308.08155
- Cemri et al. Why Do Multi-Agent LLM Systems Fail? 2025. arXiv:2503.13657
- Stevanovic, Wachter. Automating Attack Graph Construction for Agentic Pentesting. Towards Neuro-Symbolic Vulnerability Hunting. 2026. arXiv:2609.15523
- Wang et al. Staying on the Attack Path: Structured State for Long-Horizon Automated Penetration Testing. 2026. arXiv:2609.07344
- dos Santos Barbosa. Thinking in Graphs: Neo4j-Backed Exploit-Chain Reasoning for LLM Penetration-Testing Agents. 2026. arXiv:2610.20902
The last three put a graph in front of the agent as planning state; DarkMoon puts it behind the agent as an audit layer. See the repository's comparisons.
Research, source code & reproducibility
- Main research repository: ASCIT31/darkmoon-attack-paths-research, in particular docs/agent-native and decision record ADR-A06
- Source code (open source): ASCIT31/Dark-Moon, declaration handling in
declared_links.py - Benchmarks: ASCIT31/Darkmoon-Benchmarks (finding detection; no edge-level benchmark exists yet)
- Official documentation: docs.dark-moon.org
- Scientific references: literature review
- Reproducible experiments: EXP-041 (c4), EXP-042 (c5), EXP-043 (c6), EXP-046 (token model), EXP-050 (c7)
Related articles
- From Vulnerability Findings to Attack Paths: DarkMoon's Research Journey
- Building an Expert-System-Inspired Architecture with LLM Agents
- Declared vs Proven Attack Paths: A Practical Evidence Model
- Cross-Agent Dependencies and the Common-Root-Cause Problem
enabled_by ships in the open-source edition. If you run DarkMoon Community and score your own declared links against a ground truth, the research repository welcomes the result, including a disappointing one.
See the proof, not just the write-up: the Pro remediation benchmark (fixes retested against the exploit) · how Darkmoon compares to other AI pentest tools.
← All articles