December 3, 2026
🧠Phronesis: Boost Nmap on steroid by finetuned local AI model
A 0.5B model that reads what your scan already found, then picks the next NSE script to run, or says STOP.

By ./34zY (Hamza Terir)
2 min read
Nmap's Scripting Engine ships with hundreds of scripts. After a scan, the open ports and detected services point at a few of them, and the rest is noise. Most people pick by habit, run the obvious ones, and either miss something useful or waste time on scripts that had nothing to say.
Phronesis makes that choice for you. It is a small model fine-tuned for one narrow job: read a scan, pick the next script to run, or decide that none is worth it.
What it does
You give Phronesis the state of a scan: open ports, detected services, and whatever output you already collected. You also give it a list of candidate scripts. It answers with one script id per port, or STOP. The wrapper then prints the matching Nmap command. It does not run that command.
If you already have a scan, you can analyze it directly:
phronesis --xml scan.xml --top 8phronesis --xml scan.xml --top 8Or pipe Nmap into it:
nmap -Pn -sV -oX - 10.10.10.5 | phronesisnmap -Pn -sV -oX - 10.10.10.5 | phronesisUse --format jsonl for one JSON object per decision, or --commands to print only the Nmap commands. phronesis --catalog lists the whole library.
Why it is safe to try
Phronesis stays quiet by default. Nothing runs by accident.
- Once the weights are cached, the decision runs locally on CPU and makes no network call. The first run downloads about 1 GB from Hugging Face and checks its SHA-256.
- It prints commands. It runs a script only if you add
--run. - The bundled NSE library has 649 scripts. The automatic pool leaves out risky categories (
intrusive,brute,dos,exploit,malware,fuzzer) andexternalscripts. Each of those needs an explicit flag. - It can run a
-sVscan itself, but only on a target you are authorized to test. Use it on your own lab or on machines you own, and only inside a scope you have written approval for.
The numbers, with caveats
On 171 lab contexts the model saw during training, the top-ranked option picks the best script 87.1% of the time. That is an in-sample number, so I don't present it as a headline on its own.
On 124 contexts it never saw, the strict top-1 pick is right 13.7% of the time. A useful script lands in the top 3 for 76% of the 80 contexts that have one. Those same 124 contexts also helped choose this release, so read them as a sanity check, not as proof.
The weak spot is the stop decision. STOP is correct on 7 of the 44 contexts where nothing was worth running. If you use Phronesis on real engagements, that is the part to watch.
Try it
Install it from PyPI:
python -m pip install phronesis-nse
phronesis doctorpython -m pip install phronesis-nse
phronesis doctorOn Linux, install the CPU build of PyTorch first, or the default wheel pulls several GB of CUDA libraries. phronesis doctor checks Python, PyTorch, the weights, Nmap and the NSE library. It never downloads anything.
Everything is open source under Apache 2.0:
- Code and issues: https://github.com/34zY/Phronesis
- Docs: https://phronesis.34zy.red
- Model card and weights: https://huggingface.co/34zY/Phronesis
34zY/Phronesis · Hugging Face Text Generation model with 0.5B parameters. Download, explore files and run it on Hugging Face.
If you test it, the most useful feedback is a case where STOP was wrong, or a script it ranked too low. Open an issue on GitHub with the scan XML, or a sanitized version of it.