Differential reachability analysis for Agent Skill bundles. Reachability is
not a property of a skill bundle — it is a property of the resolver that
decides which references count. Scanners resolve by substring containment;
agents resolve by judgment. waterline computes the reachable closure under
four resolver models and reports where they disagree.
Offline, LLM-free, pure-stdlib. No network, no API keys, no dependencies.
Every Agent Skill scanner shipping today — JFrog's skill scanner, Snyk's
agent-scan, SkillSpector, the various open-source skill-scanner bundles —
starts by deciding what to audit. Because a skill uses progressive disclosure,
that means walking a reachability graph from SKILL.md. The documented
implementation of that walk is substring containment: a file counts as
reachable if its path or basename appears somewhere in already-reachable text.
That heuristic fails in both directions, and both failures are exploitable:
-
It under-approximates. An instruction like "load every rule pack under
rulepacks/" names a directory, not a file. A glob in a helper script names a pattern, not a file. A path assembled at runtime names nothing at all. In each case an agent loads content that the scanner never enumerated, so the scanner reports a clean bundle it never fully read. This is the audit-runtime gap (arXiv 2605.05274) localized to specific files. -
It over-approximates. A filename appearing anywhere in reachable text — in a changelog line, a compatibility note, a "do not use this" warning — marks that file "referenced". Nothing directs the agent there, but the file now has a clean provenance story: it is audited, it is linked, it belongs. This is how a dormant payload launders itself into a bundle.
waterline's contribution is to stop treating reachability as a fact and start
treating it as a measurement that depends on the instrument. It runs four
instruments over one shared candidate set and reports the deltas. The
interesting output is not "here is the reachable set" — it is "here is where
your scanner and your agent disagree about what this skill is."
This is the smallest thing that proves the idea: a real resolver hierarchy, a real graph, and a fixture corpus where each divergence class is isolated and asserted.
It is not another content scanner. It does not pattern-match for malicious strings, and it is not a replacement for the tools named above — it is the thing you run alongside them to find out whether they read the whole bundle. Capability markers appear only to grade the severity of a divergence, never to claim a file is malicious.
Requires Python 3.11+. Nothing else.
git clone https://github.com/freyesperales/dev-experiment-031
cd dev-experiment-031
python -m waterline fixtures # the one-command demo
python -m unittest discover -s tests # 118 tests, no dependenciesOr via make:
make run # analyze the fixture corpus
make test # run the suite
make demo # walk each fixture with full evidence
make graph # export the disclosure graph as Graphviz DOTInstalling the package adds a waterline entry point:
pip install -e .
waterline ./my-skill --fail-on highwaterline [path] [--json] [--graph dot|mermaid] [--resolver NAME]
[--fail-on SEV] [--strict] [--quiet-dead] [-v] [--explain]
path may be a single bundle or a directory containing many; every directory
holding a SKILL.md is discovered and analyzed.
Exit codes: 0 passed the gate, 1 a finding met --fail-on (default
high), 2 the bundle could not be analyzed. Use --fail-on never to report
without gating.
| Resolver | Accepts | Models |
|---|---|---|
link |
Markdown links/images, literal file-open calls, local imports | The smallest defensible reachable set |
containment |
Any bundle file whose path or bare basename appears as a substring in reachable text | What shipping skill scanners actually do |
directive |
Structural links, plus path-like tokens governed by an imperative verb (read X, run X, load X) |
An agent that follows its instructions |
agent |
Everything above, plus directory expansion, glob expansion, sibling-relative spellings, runtime-constructed paths, and external URLs | The upper bound on what can enter context |
Extraction runs once per file and is resolver-agnostic; the resolvers differ only in acceptance policy. That is what makes the comparison honest — all four see an identical candidate set.
Two deltas carry the findings:
agent \ containment -> WL-BLIND-01 (audit-runtime gap)
containment \ (link ∪ directive) -> WL-LAUNDER-01 (reference laundering)
bundle.py load the bundle; parse frontmatter; walk files; detect symlink escapes
frontmatter.py stdlib parser for the YAML subset SKILL.md actually uses
extract.py one resolver-agnostic pass -> Candidate records (kind, line, directive verb, fence state)
resolvers.py four acceptance policies + path resolution (relative / root-relative / escape / missing / glob)
reach.py BFS closure per resolver -> tiers; cycle detection
capability.py lexical capability markers (exec / network / credential / fs-write / obfuscation)
diverge.py set differences between closures -> Findings
analyze.py orchestration -> Report (score, grade, metrics)
report.py text / JSON / Graphviz DOT / Mermaid renderers
cli.py argparse front end, exit-code gate
Data flow: bundle → extract (once) → 4 × closure → set deltas → findings → report.
Tiers mirror how progressive disclosure actually loads a skill. Tier 0 is the
frontmatter name/description — always resident for every installed skill,
and the entire basis of the routing decision. Tier 1 is the SKILL.md body,
loaded on activation. Tier 2+ is everything reached transitively. A file's tier
is its BFS depth: the shortest disclosure chain that can bring it into context.
That model is what makes WL-CAPGAP-01 possible — "tiers 0–1 exercise no
capability at all; tier 3 reads credentials and opens a socket." The routing
surface is not describing the blast radius.
A — one resolver, tunable. A single reachability walk with flags to make it stricter or looser. Cheaper (one BFS, less memory) and simpler to explain. Rejected: it can only ever report a reachable set. The finding this tool exists to produce is a disagreement, which needs at least two sets simultaneously. Tuning a single walk moves the boundary; it never shows you where the boundary sits relative to someone else's.
B — N independent closures over one shared candidate set (chosen). Costs 4× the BFS and holds four tier maps at once. For skill bundles — tens of files, kilobytes of text — that is microseconds and kilobytes; the fixture corpus of five bundles analyzes in well under a second. The payoff is that every finding is a set difference with a reconstructible disclosure chain for evidence, and adding a fifth resolver (a specific vendor's semantics, say) is one acceptance policy rather than a rewrite.
The deciding trade-off was maintenance, not performance: keeping extraction separate from acceptance means a new reference syntax is learned once by all resolvers, and a bug in one policy cannot silently change the others' results.
$ python -m waterline fixtures/blind-spot
--------------------------------------------------------------------------
waterline repo-inspect
--------------------------------------------------------------------------
Disclosure profile
tier 0 routing surface (always resident) 151B
tier 1 SKILL.md body (on activation) 324B
~~~~~~~~~~~~~~~~~~~~ waterline ~~~~~~~~~~~~~~~~~~~~
tier 2+ reachable below the surface 2.4KB
total reachable closure 2.7KB (19x the routing surface)
files present 5 | reachable 5 | unreachable 0 | deepest tier 3
Reachable file count by resolver
link 1 #
containment 3 ###
directive 5 #####
agent 5 #####
blind spots (agent \ containment): 2 | laundered (containment \ justified): 0
Capability markers by tier
tier 3: credential / secret material, network egress
Findings (9)
[CRIT] WL-ESCAPE-01 Reference escapes the bundle: ~/.aws/credentials
rulepacks/network.md line 7 points at ~/.aws/credentials, which
resolves outside the skill directory. [...]
[HIGH] WL-BLIND-01 Reachable but unaudited: rulepacks/network.md
An agent can pull rulepacks/network.md into context, but a scanner
that computes reachability by substring containment will not follow
the reference chain that reaches it, so it never audits the file.
The file carries capability markers (credential / secret material,
network egress).
. <frontmatter>
. --[activation]--> SKILL.md
. --[code_span (read 'references/procedure.md')]--> references/procedure.md
. --[code_span (load 'rulepacks/')]--> rulepacks/network.md
[HIGH] WL-CAPGAP-01 Capability disclosed only below the routing surface:
credential / secret material, network egress
[...]
--------------------------------------------------------------------------
score 0/100 grade F critical=2 high=5 medium=1 low=1
--------------------------------------------------------------------------
The whole corpus at once:
$ python -m waterline fixtures --fail-on never
F 0/100 blind=2 laundered=0 dead=0 amp= 19x repo-inspect
A 100/100 blind=0 laundered=0 dead=0 amp= 15x csv-tidy
A 91/100 blind=0 laundered=0 dead=0 amp= 12x incident-review
F 38/100 blind=0 laundered=0 dead=0 amp= 11x deploy-check
F 36/100 blind=0 laundered=1 dead=0 amp= 17x release-notes
$ python -m unittest discover -s tests
......................................................................................................................
Ran 118 tests in 0.570s
OK
pytest collects the same suite (118 passed) if you prefer it; the tests use
stdlib unittest so neither runner is required.
| Code | Family | Severity | Means |
|---|---|---|---|
WL-BLIND-01 |
blind-spot | high / medium | Reachable by an agent, invisible to a containment scanner |
WL-LAUNDER-01 |
laundered-reference | high / medium | Counted as referenced only via an incidental substring |
WL-DARK-01 |
dark-content | high | Runtime-constructed path: no static resolver can know what loads |
WL-DARK-02 |
dark-content | high / medium / low | External URL enters context; not covered by any bundle audit |
WL-ESCAPE-01 |
confinement | critical | Reference resolves outside the bundle root (../, ~/, absolute) |
WL-ESCAPE-02 |
confinement | critical | Symlink resolves outside the bundle root |
WL-DANGLING-01 |
drift | medium / low | Reference to a file that is not present (update-drift) |
WL-DEAD-01 |
dead-weight | low | Present, unreachable under every resolver |
WL-DEAD-02 |
dead-weight | high | Unreachable and carrying capability markers |
WL-CYCLE-01 |
expansion | medium | Reference cycle; eager loaders will not terminate |
WL-AMPLIFY-01 |
disclosure | medium | Closure dwarfs the routing surface it was selected on |
WL-CAPGAP-01 |
disclosure | high | Capability appears only below tiers 0–1 |
WL-DEPTH-01 |
disclosure | low | Disclosure chain deeper than the configured limit |
WL-ROUTE-01/02 |
disclosure | medium | No frontmatter / no description: no routing surface |
Score starts at 100 and deducts by severity (critical 30, high 16, medium 7, low 2); grade is A ≥ 90 down to F < 60. The score is a triage aid for ranking many bundles, not a safety certificate.
Each fixture isolates one divergence class and is asserted in tests/test_analysis.py.
| Fixture | Demonstrates |
|---|---|
clean-formatter |
All four resolvers agree. 100/A, zero findings. |
blind-spot |
Directory-scoped instruction (load every pack under `rulepacks/` ) plus a glob in a helper script. Containment reaches 3 files; the agent reaches 5. |
laundered |
A retired helper named in a compatibility note. Containment reaches it; link and directive do not. |
escape-hatch |
../shared/policy.md traversal and a curl | bash runtime fetch. |
deep-chain |
A 5-tier reference chain with a cycle between two stages. |
The adversarial fixtures contain inert, clearly-fake payloads (example.net
endpoints, no working exfiltration) whose only purpose is to be detected by
this tool's own test suite.
State plainly, because they bound what a finding means:
agentis an over-approximation, by design. It answers "what could enter context", not "what will". AWL-BLIND-01is a claim about scanner coverage, not proof that the file is ever loaded. False positives here are the intended failure direction.containmentis a model of shipping scanners, not a specific one. It is built from their documented behaviour (path-or-basename substring, transitive from theSKILL.mdbody). A given vendor may be stricter or looser; adding their exact semantics is one acceptance policy inresolvers.py.- Reference extraction is syntactic. Natural-language instruction is
approximated with a directive-verb list. Prose that directs an agent to a
file without any path-like token ("open the second file in the reference
folder") is not extracted by any resolver — a known under-approximation even
of
agent. - Capability markers are lexical and over-inclusive. They grade severity;
they never claim intent. A file discussing
curlin documentation matches. - No execution, no network, no model. Runtime-constructed paths and fetched
URLs are reported as unknowable (
WL-DARK-01/02) rather than resolved. Sealing that gap needs verified loading (the approach of arXiv 2605.05274) or runtime probing — both out of scope here. - The YAML frontmatter parser handles a documented subset. Scalars, quoted strings, block scalars, block and flow sequences, comments. Nested mappings are retained as raw text (and still scanned for references) rather than recursed into; anything unparsed is surfaced as a warning, never dropped silently.
- Binary and >2 MB files are recorded in the graph and counted in closure bytes, but their contents are not scanned for onward references.
- The score is not a verdict. It ranks bundles for human attention.
- Cycle detection is recursive and assumes bundle-scale graphs (tens to hundreds of files), which is what the Agent Skills format is for.
The audit-runtime gap is named and characterized in Sealing the Audit-Runtime
Gap for LLM Skills (arXiv 2605.05274), which proposes cryptographic verified
loading as the remedy. waterline takes the complementary position: before you
can seal a gap you have to be able to point at it, and pointing at it is a
static, offline, dependency-free computation. See RESEARCH.md for the full
signal set.
MIT — see LICENSE.