ChainGraph: Neo4j-Based Exploit-Chain Reasoning for Penetration-Testing Agents
Thinking in Graphs: Neo4j-Backed Exploit-Chain Reasoning for LLM Penetration-Testing Agents
The result suggests the weakness in agentic security testing lies in flat context windows rather than model capability, so externalizing memory to a graph is a fix practitioners can apply today. Security engineers and red-team builders can wire Neo4j into existing MCP-compatible agents like Claude Code and Codex without custom tooling. The findings are illustrative single-run measurements, so treat them as a design pattern to replicate rather than a benchmark.
Researchers introduce ChainGraph, a pattern that stores exploit-chain reasoning in a Neo4j property graph connected to off-the-shelf agents via the Model Context Protocol, requiring no bespoke harness.
The graph types findings, attack steps, credentials, assets, and evidence receipts as nodes with pre/post-condition edges, formalizing five operator questions as reusable Cypher and Graph Data Science queries.
On a synthetic multi-forest Active Directory engagement modeled on GOAD, three findings rated Medium in isolation become Critical once their path to the forest root is materialized, and betweenness centrality identifies chain break-points.
Scoping each decision to a graph result instead of re-reading the engagement cut the reasoning payload by about 98% on a token proxy.
A reproducible setup is provided for Claude Code and Codex.
Thinking in Graphs: Neo4j-Backed Exploit-Chain Reasoning for LLM Penetration-Testing Agents
LLM coding agents such as Claude Code and OpenAI Codex can drive penetration-testing tools, but they reason about an engagement as a flat list of findings in a context window. Attackers think in graphs: isolated low-severity exposures turn catastrophic once chained through credential capture, privilege escalation, and lateral movement. This gap feeds a common belief that AI agents cannot truly chain exploitation; we argue this describes the flat context window, not the model. We present ChainGraph, a pattern that externalizes exploit-chain reasoning into a Neo4j property graph wired to an off-the-shelf agent via the Model Context Protocol, no bespoke harness. Findings, attack steps, credentials, assets, and tamper-evident evidence receipts are typed nodes with pre/post-condition edges; JSON/Markdown holds documentary memory while Neo4j holds reasoning memory. We formalize five operator questions (next-step inference, entry-to-crown-jewel pathing, combined-severity promotion, evidence provenance, and chokepoint identification) as reusable Cypher and Graph Data Science queries, plus a chain-severity score distinct from per-finding local severity. On a synthetic multi-forest Active Directory engagement modeled on GOAD, in live Neo4j with GDS, three findings rated Medium in isolation become Critical once their path to the forest root is materialized, and betweenness centrality names the best chain break-points. Scoping each decision to a graph result rather than re-reading the engagement cut the reasoning payload by about 98% on a token proxy. We give a reproducible setup for Claude Code and Codex. Results are illustrative single-run measurements, not a benchmark.
This report is categorized under AITOP's "Papers" desk, focusing on US frontier AI labs and Silicon Valley technology leaders. Within our cross-regional analytical framework, it directly maps to AI developer toolchains, coding agents, and engineering workflows. Key entities and technical topics under continuous tracking include ChainGraph, Neo4j, Claude Code, MCP and tools.
Primary source verification: published directly by arXiv: OpenAI with first-party authority.