LuaN1aoAgent is a fully autonomous AI penetration testing agent driven by graph-based cognitive reasoning, developed by postgraduate researchers from Prof. Lu H
LuaN1aoAgent is a fully autonomous AI penetration testing agent driven by graph-based cognitive reasoning, developed by postgraduate researchers from Prof. Lu H
LuaN1aoAgent
Cognitive-Driven Autonomous Security Agent
LuaN1aoAgent v2 is a complete rewrite of LuaN1aoAgent, built on TypeScript and the Pi SDK for autonomous, authorized security research.
v2 keeps the original project's cognitive-driven direction while rebuilding its runtime around explicit Agent boundaries, durable events and artifacts, evidence-backed graph memory, and observable tool actions.
LuaN1aoAgent v2 separates responsibility into three roles:
The system is designed around one principle: every important conclusion must remain traceable to persisted events, artifacts, and graph evidence.
[!IMPORTANT] LuaN1aoAgent v2 is not an in-place refactor of the Python v1 runtime. It is a new implementation with different configuration, persistence, Agent lifecycle, and observability contracts.
[!NOTE] Benchmark results reported by v1 are not automatically attributed to v2. v2 benchmark results will be published only after reproducible reruns on a frozen release.
https://github.com/user-attachments/assets/85febe15-0644-496a-888d-905fbf5f4d5f
Demo video
Live Trace — inspect what each Agent is reasoning about, which action it takes, the associated task, and persisted artifacts.
Causal Reasoning Graph — trace evidence into hypotheses, confirmed vulnerabilities, and successful exploits.
v2 replaces the shared-history P-E-R loop with explicit runtime boundaries.
planner_submit terminating tool.TaskEnvelope and independently chooses its tool strategy.task_result_submit terminating tool.control_submit and graph_delta_submit.LuaN1ao turns observations into explicit, traceable reasoning chains instead of relying on conclusions hidden in model history:
flowchart LR
Evidence[Evidence] -->|supports / contradicts| Hypothesis[Hypothesis]
Hypothesis -->|confirms| Vulnerability[Vulnerability]
Vulnerability -->|exploited by| Exploit[Exploit]
Evidence -. observed on .-> Endpoint[WebEndpoint / Service]Vulnerability nodes and successful Exploit nodes cannot be written without evidence references.The Planner maintains an evolving Task Graph rather than regenerating a linear checklist:
flowchart LR
Goal --> Recon[Recon Task]
Goal --> Auth[Auth Task]
Recon --> Milestone[Service Profile]
Milestone --> Validate[Validation Task]
Auth --> Validate
Blocker -. blocks .-> Validatecreate_tasks, patch_task, replace_dependencies, set_task_status, and set_node_status form the planning language.| Capability | Linear task list | LuaN1ao PoG |
|---|---|---|
| Plan structure | Ordered steps | Dependency graph |
| Adaptation | Regenerate the plan | Patch affected nodes and edges |
| Scheduling | Manual ordering | Dependency-aware admitted waves |
| Traceability | Natural-language history | Structured commands and persisted events |
Every Pi event is normalized before it enters the runtime ledger:
toolCallId correlation.Executors use Pi coding tools inside the configured sandbox boundary:
read, grep, find, and ls for workspace inspection.bash for controlled command execution.web_fetch for fetching public HTTP(S) references, advisories, and PoC writeups into bounded Markdown previews.web_search for public web search through Brave Search when BRAVE_SEARCH_API_KEY or BRAVE_API_KEY is set, with HTML search fallbacks when no key is available.vulnerability_search for CVE/advisory research through NVD and public web references, preserving weak negative semantics when no public hit is found.browser_render for post-JavaScript DOM inspection inside the Executor network boundary; Docker mode runs Chromium through the same transparent Gateway as other target traffic.artifact_read and artifact_write for durable cross-task material; complete workspace files can be imported without passing their contents through the model context.route_open, route_status, route_stop, and route_reconnect for Docker-mode Runtime-managed SSH and Chisel reachability. The operator-owned process-wide SOCKS5 proxy is configured before Agent execution and is not exposed through route_open.task_result_submit for structured task completion or checkpoint handoff.Public research results are treated as hypotheses or intelligence leads until the Executor validates them against the authorized target with sandboxed tools. Optional NVD_API_KEY increases NVD rate limits but is not required.
Planner receives graph_query and graph_trace for compact task, reasoning, operation, and session views. Executor receives the graph closure and dependency outcomes selected by Runtime as explicit input rather than direct access to the control-plane graph store.
LuaN1ao uses the Agent Skills convention through the Pi runtime. These optional community collections provide useful security references and task-specific workflows:
| Collection | Recommended for |
|---|---|
| crazyMarky/pentest-skills | Natural-language pentest workflows: recon (port scan, subdomain enum, directory scan, fingerprint/WAF) and exploitation (SQLi, XSS, LFI, file download), plus reporting skills |
| Eyadkelleh/awesome-skills-security | Curated fuzzing payloads, password and username lists, sensitive-data patterns, web-shell samples, and LLM security testing resources |
| ljagiello/ctf-skills | CTF and lab workflows covering Web, Pwn, Crypto, Reverse Engineering, Forensics, OSINT, AI/ML, malware analysis, and writeups |
One-click setup from the repository root — installs all three recommended skill collections into the project-local .agents/skills/, runs npm ci and npm run build, and builds both Docker images when a daemon is available. On first run in an interactive terminal it also offers to write a minimal .env (mode 0600); existing .env files are never touched and non-interactive installs skip the prompt:
./install.shOr install individual collections with the skills installer:
npx skills add Eyadkelleh/awesome-skills-security \
--skill '*' --agent pi --global --yes
npx skills add ljagiello/ctf-skills \
--skill '*' --agent pi --global --yesSkills installed by ./install.sh live in the project-local .agents/skills/ (gitignored). The Executor session loads them through the runtime's additional skill paths, and the Executor sandbox whitelists the directory for reads. They remain separate third-party projects with their own licenses and update cycles.
auto prefers a per-Task Docker Executor on a private internal network; explicit docker fails closed when Docker or a required image is unavailable. The Executor and its Gateway use separate network namespaces, and the Gateway is the task network's only exit./tmp, and a host-visible persistent /workspace.NET_ADMIN, SETUID, and SETGID after dropping all capabilities: PID 1 configures TUN/policy routing and launches the protocol-aware Go Gateway as a dedicated UID; that process then clears its capability bounding set. HTTP/HTTPS is detected and transparently captured on any TCP port, while other TCP is relayed unchanged.workspace is the explicit development fallback.Each fresh CLI invocation creates an isolated session under .agent-runtime/sessions//. The TUI prints the selected session path at startup. A session contains:
| Path | Purpose |
|---|---|
state.sqlite |
Graphs, execution events, projector watermarks, ar |
No open issues yet, or sync has not completed.