agentleFS
mahumadadmahumadad/quarry/skills/core/scope-discipline/SKILL.md

scope-discipline

Skill1 starsChanged 11 days agoMITView on GitHub

Scope validation rules for pentest engagements: how to confirm a target is in scope before touching it, how to handle out-of-scope discoveries, and how to handle scope ambiguity. Use before ANY recon, scanning, or testing action against a target, and whenever a new host/domain/IP/asset is discovered mid-engagement. This is a gating skill, not a recon technique — every other skill depends on it.

7 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use control-flow-clarity, hal-and-abstractions and 2 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • uxjuliaSkill

    control-flow-clarity

    Branching and state-modeling clarity in C/C++. Use when writing or refactoring logic that branches on discrete values: if/else-if ladders, status flags, mode or state ints, or anything that should be an enum plus an exhaustive switch. Covers enum class over magic ints, exhaustive switch over nested if, early-return guard clauses, table dispatch, and when each is the right call.

    Also in 3 projects that use this

  • uxjuliaSkill

    hal-and-abstractions

    Layering and abstraction discipline for the firmware. Use when touching storage, input, display, settings, i18n, or rendering, or any code that could reach into the SDK. Covers routing through the HAL (HalStorage / HalGPIO / HalDisplay) instead of raw SDK classes, MappedInputManager logical buttons instead of raw GPIO indices, UITheme/GUI for all rendering, the singleton macros, tr() for user-facing text, and where a new abstraction boundary belongs.

    Also in 3 projects that use this

  • +2 more from uxjulia

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 4 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 7 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before the first action against any new host, domain, IP range, or cloud asset.

    line 19
  2. Very specific:

    Before engagement start, build an explicit scope list from the RoE — domains, subdomains, CIDR ranges, cloud account IDs, and anything …

    line 32
  3. Distinctive:

    When a scan/tool returns results outside the defined ranges (common with wildcard subdomain brute force, ASN-based IP discovery, or …

    line 58
  4. Distinctive:

    Do not hunt or exploit against the filtered-out set, even "just to see."

    line 63
  5. Distinctive:

    Before any active action against a target:

    line 72
  6. Very specific:

    Never widen scope based on verbal requests mid-engagement ("can you also check our other site?") without written confirmation added to the …

    line 87

“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Signals

  • Before the first action against any new host, domain, IP range, or cloud asset.
  • A recon skill discovers a new subdomain, IP, CNAME target, or cloud bucket not in the original scope list.
  • The client asks to "just check this one more thing" mid-engagement.
  • Ambiguity about whether a shared/third-party asset (CDN, SaaS, partner API) is testable.

Prerequisites

  • Written authorization: a signed statement of work, rules of engagement (RoE) document, or explicit written client sign-off naming the exact assets, IP ranges, and testing windows. Verbal "go ahead" is not sufficient for anything beyond passive OSINT.

Methodology

  1. Before engagement start, build an explicit scope list from the RoE — domains, subdomains, CIDR ranges, cloud account IDs, and anything explicitly excluded. Keep it as a literal file (e.g. scope.txt with one entry per line) that every other skill reads from.
  2. For every new target before touching it, validate membership:
    # domain/subdomain membership
    grep -E "(^|\.)example\.com$" scope.txt
    
    # IP in CIDR range
    python3 -c "import ipaddress; print(ipaddress.ip_address('1.2.3.4') in ipaddress.ip_network('1.2.3.0/24'))"
    
    # or with a CLI tool
    prips 1.2.3.0/24 | grep 1.2.3.4
  3. For discovered assets with ambiguous ownership (shared hosting, CDN edge, SaaS subdomain), confirm actual ownership before scanning:
    whois example.com | grep -i "org\|registrant"
    dig +short CNAME sub.example.com      # does it point to a third party (e.g. *.herokuapp.com, *.cloudfront.net)?
    curl -sI https://sub.example.com | grep -i "server\|x-served-by"
    A CNAME to infra not owned by the client (Shopify, AWS CloudFront, Cloudflare Pages, etc.) is presumptively out of scope unless the RoE explicitly covers shared/cloud infrastructure testing — stop and ask.
  4. Log every scope decision, including exclusions, in a scope-log (timestamp, asset, decision, reasoning). This is evidence for the final report and for covering yourself if questioned later.
  5. When a scan/tool returns results outside the defined ranges (common with wildcard subdomain brute force, ASN-based IP discovery, or Shodan/Censys queries), filter immediately:
    subfinder -d example.com -silent | grep -E "\.example\.com$" > inscope-subs.txt
    Do not hunt or exploit against the filtered-out set, even "just to see."

Tooling

whois, dig/host, curl -I, ipaddress (Python stdlib), prips, grep/comm for set filtering against scope.txt.

Validation gate

Before any active action against a target:

  • Target appears in scope.txt (domain suffix match, or IP within an authorized CIDR).
  • If the target resolves/CNAMEs to third-party infrastructure, ownership and RoE coverage confirmed explicitly — not assumed.
  • If in doubt, the ambiguity has been raised with the human operator, not resolved silently.

Gotchas

  • Wildcard DNS and subdomain brute force will return hosts the client doesn't own (dev environments on third-party PaaS, abandoned subdomains pointing to expired cloud resources, partner integrations). Scope match on the domain name is necessary but not sufficient — check what actually answers.
  • "In scope" at engagement start doesn't mean "in scope forever" — RoE windows, IP allowlisting requirements, and excluded assets can change; re-check scope.txt if the engagement spans more than a few days.
  • Never widen scope based on verbal requests mid-engagement ("can you also check our other site?") without written confirmation added to the RoE — redirect to engagement-flow's escalation step.
  • A target that was in scope and is now unreachable/decommissioned is not an invitation to pivot to whatever replaced it without re-confirming that the replacement is also in scope.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.