Skip to main content

Follow the graph, not the alert

1,000 security alerts, only 69 matter: how we built an agent on FalkorDB that finds the real attack paths, fixes them, and proves the fix.

Updated 11 min readMarkdown
Follow the graph, not the alert

By Yash Soni and Rohan Jaiswal · WeMakeDevs × FalkorDB Graph Hacks 2026 · Track 01: Agents That Act on Connected Data

In 30 seconds

  • A scanner hands you 1,000 alerts. Interdict uses a FalkorDB graph to find the 69 that sit on a real path from the Internet to a crown-jewel database.

  • An agent investigates through seven MCP tools built on graph queries and algorithms, and decides every next step from what the graph returns. No AI model, so every decision is explainable.

  • It plans the smallest safe fix, then tries to break it on a copy of the graph with three independent methods. It acts only when all three agree.

  • Code and setup: github.com/YashSoni998265/interdict. One Docker command runs it locally.

  • Try it live: interdict-graphhack.duckdns.org, the full demo in your browser (simulation only).

  • Watch the demo: 6-minute video

Severity is not the answer

Monday morning. Your scanner has produced 1,000 alerts, and 104 of them are critical. Which do you fix first?

The usual answer is "the critical ones". In the environment we built, that answer misses most of the risk.

Only 33 of the 104 critical alerts sit on a real attack path. Meanwhile 36 alerts rated high do, and a list sorted by severity would bury them.

A severity score describes a vulnerability. It can't see the network around it.

Whether an alert matters is a path question: can an attacker get from the Internet, through this workload, all the way to a crown-jewel database?

An attack is a path, so we built on a graph

In Interdict, an alert matters only if the graph shows four things at once: the workload is exposed, exploitable, connected onward, and the last hop is authorised to reach the database. Each one is a multi-hop pattern in FalkorDB.

Every piece of evidence records where it came from and until when it is valid. Stale evidence makes a verdict inconclusive, never "safe".

From that evidence, Cypher builds one ATTACK_STEP edge for every move an attacker could make. Here is the lateral step, exactly as it runs:

MATCH (a:Pod)-[c:CAN_REACH]->(b:Pod) WHERE a.id <> b.id
MATCH (b)-[:RUNS_IMAGE]->(:ContainerImage)-[:HAS_VULNERABILITY]->(v:Vulnerability {status: 'ACTIVE'})
WHERE coalesce(v.attack_vector, 'NETWORK') IN ['NETWORK', 'ADJACENT']
WITH a, b, collect(DISTINCT c.port) AS ports, collect(DISTINCT c.id) + collect(DISTINCT v.id) AS backing
CREATE (a)-[:ATTACK_STEP {kind: 'LATERAL', capacity: 1, ports: ports, backing_evidence_ids: backing,
        built_at_revision: $revision, technique_id: 'T1210', technique: 'Exploitation of Remote Services'}]->(b)

Reachability searches over those steps (algo.bfs) then sort all 1,000 alerts: 69 on a real attack path, 382 vulnerable but on no path, 549 not actionable. The 69 fall into four clusters, which means four places to fix.

The agent reads the graph, decides, and acts

The agent never touches the database directly. It works through exactly seven tools, served over MCP, and each one is a fixed, parameterised graph query or algorithm:

  • triage_alert_storm builds the attack steps and sorts every alert into on a path, on no path, not actionable, or inconclusive.

  • recall_incident_memory returns what this session already learned about a database: earlier plans, certificates, and whether they still hold.

  • find_evidence_by_workload returns a workload's four evidence tiers, with where each piece came from and whether it is still fresh.

  • find_attack_paths_to_asset lists every attack chain into a crown jewel, up to three lateral hops.

  • plan_remediation computes the smallest safe fix, either with fully known impact or allowing unknown impact.

  • hunt_residual_paths applies a fix to a copy of the graph and tries to break it.

  • submit_remediation_execution is the only way to act, through the Action Gateway.

No tool accepts a query, a label or a property name, and no tool can change the visitor's graph. After every answer, the agent chooses its next step with a written rule:

In words: read memory first, stop on bad evidence, prefer the fix whose impact is fully known, plan again if the graph moves, and act only with a certificate.

Memory is a graph too. Every finished hunt leaves a dated Plan node in a small memory graph, linked to the crown jewels it protects and to its Certificate, if it earned one. Right after triage, before it plans anything, the agent reads that memory and says when a decision came from it. A recalled result is only a starting point, so it is always verified again.

Its limits are enforced in code, not in a prompt. The agent gets at most 12 tool calls, and the final report's status, plan, certificate and receipt are copied from tool results, never written by the agent.

We kept the decision-making free of an AI model on purpose. In security, "why did it do that?" needs an answer you can check. Here the reason for every step is on screen, in plain words, and a run costs nothing.

Run it twice and you can watch it learn. The first run makes 9 tool calls. The second makes 7, because memory says the stricter fix already failed on this version of the graph.

Because the tools speak MCP, our agent isn't their only possible user. In a local setup, any MCP client can call the same seven tools, Claude Code included, and the README shows the setup command. The guard rails stay the same whoever calls them.

The first fix wasn't enough

This is the moment we're proudest of. Here is the attack graph for the payments database, with three ways in:

The planner's first fix cut the cluster's own path with a single policy. Most tools would stop here and show a green tick.

Interdict doesn't trust its own plan.

The Path Hunter copies the visitor's graph with GRAPH.COPY and applies the proposed policies inside the copy. FalkorDB itself deletes every network flow those policies no longer allow, and if that differs from what the planner predicted, nothing gets certified. Then it searches again, with no hop limit, and finds the two ways in that the first fix missed. So the plan widens to three policies, and the hunt runs again:

"Nothing survives" is checked three independent ways, and all three must agree:

  • E, bounded chains: every attack chain of up to three lateral hops, over the raw evidence.

  • F, max-flow in FalkorDB: from the Internet to each crown jewel. With unit capacities, the flow is the number of attack paths that share no step, so 0 means none.

  • O, an independent oracle: a separate breadth-first search, in code that shares nothing with the engine.

MATCH (s:Internet {id: $internet_id}) MATCH (t:Database) WHERE t.id IN $targets
WITH s, collect(t) AS targets
CALL algo.maxFlow({sourceNodes: [s], targetNodes: targets,
                   capacityProperty: 'capacity', relationshipTypes: ['ATTACK_STEP']})
YIELD edges, edgeFlows, maxFlow
RETURN maxFlow, [e IN edges | [startNode(e).id, endNode(e).id]], edgeFlows

It acts, with proof

Only now does the agent act. It submits the fix through the Action Gateway, which demands an allowlisted action type, simulation mode, a valid certificate for the current version of the graph, and an idempotency key.

The fix is three Kubernetes egress allowlist policies. The planner searched every combination of up to three policies exactly, and even the worst case, 4,526 combinations over 10,000 chains, takes about 50 ms.

The certificate says model-verified containment (simulation), and it means exactly that. On this snapshot of the graph, no modelled attack chain reaches the database. It is not evidence of real-world containment, and Interdict never changes real infrastructure.

Now try to break it

A proof you can't challenge isn't worth much, so the demo invites you to break it. Every visitor gets a private copy of the graph.

Each change runs as one Cypher query that also moves the graph's revision, so a certificate from an earlier revision can never look current:

MATCH (m:Meta {id: 'meta'}) WHERE m.revision = $expected_revision WITH m
// ... the change itself ...
SET m.revision = m.revision + 1 RETURN m.revision

Expire one piece of evidence instead, and 451 alerts turn inconclusive. Not one is called safe.

Under the hood

One click, end to end. Here is what happens when you press "Run the agent":

  1. The web app asks the API to start an investigation for one cluster.

  2. The decision agent calls the MCP tool server, one tool at a time, carrying a secret internal token and your session.

  3. Each tool runs fixed Cypher and FalkorDB algorithms against your private copy of the graph.

  4. Every call and every result streams back to your screen as it happens, so the timeline fills in live.

  5. A fix is recorded only through the Action Gateway, and only as a simulation.

Five kinds of graph, one FalkorDB. The environment lives in one graph: 1,235 nodes and 2,566 relationships. Every visitor works on a private copy of it, made with GRAPH.COPY and kept for two idle hours. Every hunt round works on a throwaway copy of that. The copy a certificate was earned on is kept for 24 hours, and what the agent learns goes into a memory graph for seven days. Sandboxes, verification and memory all run on FalkorDB itself.

Safe by construction. The agent's only door to the data is the MCP server. It checks the secret token, derives your sandbox from your session itself rather than trusting the caller, rejects any unknown or malformed argument, and has no query tool at all. Visitors can change only their own copy, through checked operations with a per-session limit, and real execution is switched off.

Fast, and tested. A full investigation takes between one and two seconds: triage in about 0.1 seconds, and each hunt in under a second. Behind it are about 230 automated tests, run in CI on every change. One of them checks the exact planner against a brute-force search on 300 random cases.

What we built it with

  • FalkorDB 4.22 as the only database: Cypher for evidence and attack steps, algo.bfs and algo.maxFlow for triage and proof, and GRAPH.COPY for sandboxes and candidate graphs.

  • Python 3.12 and FastAPI for the engine and the API, with live updates streamed to the browser.

  • The official MCP Python SDK for the tool server, over Streamable HTTP.

  • React 18, TypeScript and Vite for the web app, React Flow for the attack graph, and TanStack Query for data.

  • Docker Compose to run FalkorDB and the app together, with Caddy for HTTPS.

  • pytest and Vitest for the tests, and GitHub Actions to run them on every change.

Built for the track

Track 01 asks for an agent that uses a graph to decide and to act. Here is where each key focus shows up in the demo:

What we'd tell other builders

  1. Give your agent graph algorithms, not just lookups. One max-flow call answers "is every path cut?" A pile of query results can't.

  2. Make every query a fixed template. Our agent can't write Cypher, so there is nothing to inject, and the same question always gets the same answer.

  3. Check your answer with something independent. Our oracle shares no code with the engine. When two methods disagree, that's a bug, never a pass.

  4. Make "I don't know" a first-class answer. Inconclusive isn't failure. Calling something safe on stale evidence is.

Honest limits

  • Simulation only. Interdict proposes and records policies. It never applies them to a real cluster.

  • Synthetic data. The environment is generated from a fixed seed in the shape of Google's Online Boutique demo, with made-up DEMO-CVE identifiers.

  • Only as good as its evidence. A flow nobody observed isn't in the graph, which is why every verdict says what it rests on.

  • Bounded plans. A fix uses at most three policies. When that isn't enough, Interdict says "no safe plan within 3 changes" and shows the best partial plan.

Try it

https://www.youtube.com/watch?v=MdRmfKqdNKw

Next time someone asks which of a thousand alerts to fix first, don't sort by severity. Follow the graph.


Built by Yash Soni and Rohan Jaiswal for WeMakeDevs × FalkorDB Graph Hacks 2026, Track 01: Agents That Act on Connected Data. We used Claude Code as an AI coding assistant, as disclosed in the repository, and reviewed and tested every part, with about 230 automated tests run in CI on every change.

26 views

No comments yet. Be the first to comment.