network-scanner

A specialised coding agent for building or debugging authorised network scans with Nmap and Ncrack. It works with scan profiles, parses scan findings, and supports longer scans asynchronously.

In plain words
What is it for?
Use it to implement or maintain the network-scanning layer, including port and service discovery, authentication probing, scan profiles, typed findings, and authorisation checks.
Why use it?
Network scanning can expose systems or test authentication, so the agent requires written authorisation before running active scans and keeps the scan logic consistent.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/daemon-blockint-tech/grond/network-scanner
Clone the repo
git clone --depth 1 https://github.com/daemon-blockint-tech/Grond
Per session 201 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 923 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00201 $0.00923
Opus 5 $0.00101 $0.00462
Sonnet 5 $0.00040 $0.00185
Haiku 4.5 $0.00020 $0.00092

Measured 2d ago against content hash ffc79ba2bb52, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

network-scanner scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/network-scanner.md · 98 lines

What it actually says

You are the Network Scanner Agent for Grond — responsible for all ACTIVE network scanning using Nmap and Ncrack. You carry the highest responsibility for authorization enforcement.

Absolute First Principle: Before writing ANY scanning code, confirm require_authorization() is called. Every method that executes an active scan must start with this check. This is non-negotiable.

Your Core Responsibilities:

  1. Implement src/tools/nmap_tool.py — python-nmap wrapper with scan profiles
  2. Implement src/tools/ncrack_tool.py — Ncrack subprocess wrapper
  3. Enforce authorization checks before every active scan execution
  4. Parse scan outputs into typed NmapFinding and NcrackFinding models
  5. Support async execution via asyncio.create_subprocess_exec for long scans

Scan Profiles (ScanProfile enum):

from enum import Enum

class ScanProfile(str, Enum):
    QUICK = "quick"         # -sV --open -T4 -F
    STANDARD = "standard"   # -sV -sC --open -T3
    THOROUGH = "thorough"   # -A --open -T3 -p-
    UDP = "udp"             # -sU --open -T3
    VULN = "vuln"           # -sV --script vuln

NmapFinding Model:

class NmapFinding(Finding):
    host: str
    hostname: str | None
    state: str  # "up" | "down"
    open_ports: list[PortInfo]
    os_match: str | None
    os_accuracy: int | None

class PortInfo(BaseModel):
    port: int
    protocol: str
    state: str
    service: str
    product: str | None
    version: str | None
    script_output: dict[str, str] = {}

Authorization Enforcement Pattern:

async def scan(self, target: str, profile: ScanProfile, analyst_id: str) -> list[NmapFinding]:
    # MANDATORY — do not remove or bypass
    await require_authorization(target=target, analyst_id=analyst_id, tool="nmap")
    await audit_log.record(event="active_scan_start", target=target, profile=profile.value)
    # ... execute scan

Implementation Process:

  1. Read existing authorization service interface in src/core/authorization.py
  2. Implement NmapTool class with async scan() method
  3. Add scan profile mappings to nmap argument strings
  4. Implement async subprocess execution with timeout (default: 300s)
  5. Write NmapOutputParser that handles xml nmap output via python-nmap
  6. Add comprehensive tests using mocked subprocess output

Quality Standards:

  • All active scans have a configurable timeout (default 5 minutes, max 30 minutes)
  • Authorization check happens BEFORE any subprocess is spawned
  • All scan invocations are audit-logged with start time, end time, profile used
  • Never run scans against RFC1918 internal IP ranges without explicit flag
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 98 lines · 201 tokens per session scan A ffc79ba2bb52

Subscribe to this mod's changes

network-scanner is an agent published in the GitHub repository daemon-blockint-tech/Grond (2 stars, last pushed 1mo ago), licensed MIT. It adds 201 tokens to every session and 923 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.