Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Heuristic:ARCANGEL0 EVA Recon Mode Command Allowlist

From Leeroopedia
Knowledge Sources
Domains Security, Safety
Last Updated 2026-10-29 12:00 GMT

Overview

In Recon mode, only allow a curated set of non-mutating, read-only commands (ls, stat, find, git status/diff/log, whois, host, nslookup, dig) to prevent unintended target interaction.

Description

Recon mode restricts the agent to passive, read-only operations. The `_is_low_impact_recon_command` function validates bash commands against an allowlist of safe executables and argument patterns. Commands are rejected if they contain shell metacharacters (`|;&<>`$()\n\r`), exceed 500 characters, or use dangerous flags (e.g., `find -delete`, `find -exec`, `dig axfr`). Approved commands include `pwd`, `ls`, `stat`, `file`, `find` (without destructive flags), `git status/diff/log/show`, `whois` (single argument), `host`/`nslookup` (single argument), and `dig` (with allowed record types and options). `curl` and `nmap` are explicitly excluded and require approval even in Recon mode.

Usage

Apply this heuristic when the agent is in Recon mode. Any bash command that does not pass the low-impact check requires explicit operator approval. Non-bash tools are evaluated separately via `recon_action_is_low_impact`.

The Insight (Rule of Thumb)

  • Action: Allow only read-only, non-mutating commands in Recon mode without approval.
  • Value: Allowlist of executables: `pwd`, `ls`, `stat`, `file`, `find` (safe flags), `git` (read-only subcommands), `whois`, `host`, `nslookup`, `dig` (safe record types).
  • Trade-off: Limits the agent's autonomous capability in Recon mode, but prevents accidental target modification or detection.
  • Compatibility: Recon mode only. Guided and AutoPwn modes allow all tools (with approval in Guided).

Reasoning

During reconnaissance, the goal is to gather information without alerting the target or modifying its state. The allowlist ensures only passive information-gathering commands run without approval. Shell metacharacters are blocked to prevent command chaining that could sneak in destructive operations. `curl` and `nmap` are excluded because they can trigger IDS alerts or cause load on the target even in "passive" configurations.

Code Evidence

Metacharacter rejection from `tools/agent_host.py:66-69`:

if any(character in command for character in "|;&<>`$()\n\r"):
    return False

Safe executable allowlist from `tools/agent_host.py:79-93`:

if executable in {"curl", "nmap"}:
    return False
if executable in {"pwd", "ls", "stat", "file"}:
    return True
if executable == "find":
    return not any(
        argument.casefold() == "-delete"
        or argument.casefold().startswith(("-exec", "-ok", "-fprint", "-fls"))
        for argument in arguments
    )
if executable == "git":
    return bool(arguments) and arguments[0].casefold() in {"status", "diff", "log", "show"}
if executable == "whois":
    return len(arguments) == 1 and not arguments[0].startswith("-")

Dig record type validation from `tools/agent_host.py:95-115`:

if executable == "dig":
    allowed_options = {"+short", "+noall", "+answer", "+norecurse"}
    record_types = {
        "a", "aaaa", "caa", "cname", "https", "mx", "ns", "ptr", "soa",
        "srv", "txt", "https", "svcb", "dnskey", "ds", "rrsig", "nsec",
    }
    # ... validates that only allowed options and record types are used ...
    # Rejects axfr, ixfr, any zone transfers
    if lowered in {"axfr", "ixfr", "any"} or argument.startswith(("-", "@")):
        return False

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment