Detect and contain network scans with a local AI investigator

A penetration tester built Specter Defense, a self-hosted monitor whose Qwen3 investigator examined simulated ARP sweeps and port scans, rated them high risk and, after human approval, had the attacker isolated.

Done withCustom agentinOllama· Nov 14, 2026

What they did

David Ray Jr, a penetration tester, built Specter Defense on Kali Linux to see whether a defensive system could catch AI-style offensive activity. It combines Nmap, TShark, Python and SQLite with an AI investigator running Qwen3 14B through Ollama. Fixed rules flag suspicious traffic first; the investigator then gathers evidence with its tools and writes a structured risk assessment. A separate validation step checks the AI's conclusions against the evidence, and a policy engine decides whether to escalate. Containment needs a human to approve it. He tested it in an isolated lab network where a simulated attacker ran ARP sweeps and TCP port scans.

How it went

The rules caught three reconnaissance patterns, including high-severity ARP sweep and port-scan detections. The investigator used seven evidence tools and rated the activity high risk at 85% confidence, and its findings passed validation. The policy engine escalated to a person instead of acting alone. Once approved, filtering rules isolated the attacking machine and all six test packets were blocked; after release, all six recovery probes got through.

Worth knowing

The attack traffic was a scripted simulation, not an adaptive agent, so this shows the pieces working together rather than real-world detection rates. The author deliberately kept the model out of enforcement: it recommends, deterministic checks and a human decide. Run anything like this only on a network you own or are allowed to test.

Try it

With Custom agent· 3 parts to fill in

You are the investigator for my home network monitor. When [my detection rules or IDS] flags an event, gather evidence with [Nmap, TShark logs and my device inventory database], then write a risk assessment: what happened, which devices are involved, a risk level, your confidence and the evidence behind each claim. Recommend a response such as isolating [the device], but do not apply any firewall or containment change yourself. Stop after the assessment and wait for me to approve or reject the action.

Square brackets are the parts to fill in. The prompt is ours; the story is theirs.

Where they said it

Related