Skip to content

About

sluice - offline static auditor for the agent network-egress plane: the allow/deny domain lists that decide where an agent's bytes may go. The allowlist grants the suffix; the attacker rents the leaf.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Development Experiment 036 — sluice

An offline, LLM-free, dependency-free static auditor for the agent network-egress plane: the allow/deny domain lists that decide where an agent's bytes may go.

The allowlist grants the suffix. The attacker rents the leaf.


Thesis

An egress allowlist is the last control standing between a prompt-injected agent and the internet. Every other defence in the stack is probabilistic — the model might notice the injection, the classifier might flag the content, the operator might read the diff. The domain list is the one place where a refusal is mechanical.

It is also the one place nobody grades. An allowlist is written by asking does the build still work?, and it is shipped the moment the answer is yes. The question it is never asked is the one that decides whether it is a control at all: does every entry on it actually terminate an exfiltration?

Usually not, and the reason is structural rather than careless. *.amazonaws.com is every S3 bucket on Earth, including the attacker's. github.com is every gist. docs.google.com is a Google Forms prefilled-submission URL, which turns a plain GET into a write into somebody else's spreadsheet. cdn.jsdelivr.net is all of npm and all of GitHub behind one hostname. dns.google is a channel the allowlist cannot even see, because a destination list constrains the host you connect to and never the name you ask about.

Each of those entries passes every test its author runs, because the author verifies that the dependency still downloads, not that the channel is closed.

sluice measures the second thing. It reads the declared policy, reproduces the matcher semantics of the runtime that will enforce it, and computes which attacker-plausible destinations survive — mechanically, offline, and with no model in the loop.

The idea that makes it more than a blocklist

The flagship rule family rests on an observation about the Public Suffix List rather than on a curated list of bad domains.

The PSL has two sections. The ICANN section records boundaries below which names are bought from a registrar (com, co.uk). The PRIVATE section records boundaries below which names are handed out by a single vendor (s3.amazonaws.com, workers.dev, github.io, blob.core.windows.net).

Both sections exist to answer exactly one question: below this point, who controls the name? And in both cases the answer is "somebody other than the owner of the parent."

So the PSL private section is, read sideways, a registry of namespaces whose leaves are rented — which makes a wildcard egress entry written at a public-suffix boundary not a narrow grant that happens to look broad, but mechanically a grant of a namespace a third party can obtain a name in. That is the definition of an open exfiltration channel.

This turns *.amazonaws.com and *.com into the same finding at different severities rather than two hand-maintained special cases, and it means the rule is derived from published data instead of from opinion. The curated corpus then supplies what the PSL cannot: how cheaply a leaf is obtained, and the cases where tenancy is a URL path rather than a DNS label (a GitHub gist has no subdomain).

What it finds

57 rules in 12 families.

Family What it is about
TENANCY the flagship — the entry grants a namespace whose leaves are rented, free (workers.dev, CRITICAL) or purchasable (blob.core.windows.net, HIGH), at an exact boundary or nested beneath one (*.amazonaws.com)
WRITABLE named hosts that accept third-party content: forges, package registries, paste and file-drop sites
CHANNEL request collectors, chat webhooks, form sinks, mail relays — destinations where one request completes an exfiltration
MIRROR CDNs that re-serve whole ecosystems, and general fetch proxies that restore the entire internet through a single approved hostname
REDIRECT shorteners and open redirectors under a runtime that follows 3xx without re-checking the list
RESOLVER DNS-over-HTTPS endpoints, and the fact that refused connections are still resolved
INTERNAL the side of the boundary nobody writes rules for: instance metadata, loopback, the in-cluster API server
PRECEDENCE deny entries defeated by broader allows, entries on both lists, denials that block nothing
FAILMODE the control is configured and not in force: prompting instead of refusing, disabled filters, policy at a scope the runtime never reads, unanchored suffix matching
COVER equivalence classes left half-closed — you denied one paste site and nine siblings remain
SHAPE the entry does not mean what its author typed: discarded paths, inner wildcards that match nothing, null bytes, dotless names
REACH what the simulation measured

Sample run

$ python -m sluice scan examples/porous --host claude-code
sluice — egress policy audit under host profile 'claude-code'
==============================================================================
surface: 25 allow / 3 deny entries from 1 file(s) under examples/porous
effective reach: 24 of 260 attacker-plausible destinations admitted (9%)

39 finding(s)   CRITICAL:8  HIGH:17  MEDIUM:9  LOW:5

[CHANNEL]
!!CHN001  CRITICAL / CERTAIN  (webhook.site)
    Reaches webhook.site, a service that exists to record requests
      | 'webhook.site' -> webhook.site
      | grants: webhook.site

[FAILMODE]
!!FAIL001  CRITICAL / CERTAIN
    Out-of-allowlist destinations are asked about, not refused
      | profile: claude-code
      | unmatched behaviour: prompt
      | sandbox.network.strictAllowlist: not set

[INTERNAL]
!!INT001  CRITICAL / CERTAIN
    Instance metadata endpoint 169.254.169.254 is reachable

[TENANCY]
!!TEN001  CRITICAL / CERTAIN  (*.workers.dev)
    Grants a rented namespace: anyone can obtain a name under workers.dev
      | '*.workers.dev' -> *.workers.dev
      | public suffix rule: workers.dev (PRIVATE section)
      | admitted by this entry: exfil.workers.dev

! TEN006  HIGH / CERTAIN  (*.amazonaws.com)
    Grants 6 rented namespace(s) nested beneath amazonaws.com
      | '*.amazonaws.com' -> *.amazonaws.com
      | rented namespaces below it: amplifyapp.com, execute-api.amazonaws.com,
        s3.amazonaws.com, s3.dualstack.amazonaws.com, ...
      | admitted by this entry: exfil.s3.amazonaws.com

And the differential, which is the mode this experiment was really built for:

$ python -m sluice diff examples/porous
profile status under this configuration:
  - reference       filter in force
  - vscode          NOT IN FORCE — this configuration never sets ChatAgentNetworkFilter
  - copilot-cloud   NOT IN FORCE — this configuration never sets firewall.enabled
  - claude-code     filter in force, non-strict
  - naive-proxy     filter in force

236 destination(s) are confined differently depending on which
runtime reads this configuration. The bytes are identical; the outcome is not.

!!beeceptor.com  [CRITICAL] (COLLECTOR)
      reference=deny, vscode=allow, copilot-cloud=allow, claude-code=prompt, naive-proxy=deny
!!script.google.com  [CRITICAL] (FORM)
      reference=deny, vscode=allow, copilot-cloud=allow, claude-code=prompt, naive-proxy=deny

A policy that depends on which runtime loads it is not a policy.

How to run

Python 3.11+. No dependencies, runtime or test.

git clone https://github.com/freyesperales/dev-experiment-036
cd dev-experiment-036

python -m sluice scan examples/porous --verbose   # grade a project
python -m sluice scan examples/tight              # the same workload, closed
python -m sluice simulate examples/porous         # what does it actually admit?
python -m sluice diff examples/porous             # who disagrees about it?
python -m sluice rules                            # the catalog
python -m sluice hosts                            # the modelled semantics, with provenance

python -m sluice explain --allow '*.amazonaws.com' --allow github.com

make test        # or: python -m pytest tests
make check       # tests plus both examples

Verbs

Verb Purpose
scan read a project's policy and grade it
capture record a surface to JSON so it can be re-graded later
audit grade a captured surface, optionally under a different runtime
simulate list the attacker-plausible destinations the policy admits
diff show where runtimes disagree about the same configuration
explain grade two lists given on the command line, no files involved
rules / hosts print the catalog and the modelled semantics

CI

--format sarif emits SARIF 2.1.0 for code scanning. Exit status is 0 clean, 1 findings at or above --fail-on (default HIGH), 2 a usage or I/O error. The third is kept distinct on purpose: a CI job must be able to tell the policy is bad from the tool could not run, because the second one silently passing is how an auditor becomes decoration.

python -m sluice scan . --fail-on HIGH --format sarif > sluice.sarif
python -m sluice diff . --fail-on-divergence      # policy must mean one thing

Architecture

discover.py   the ONLY module that opens a file      ──► EgressSurface (frozen, JSON)
                                                            │
psl.py        public-suffix arithmetic                      │
corpus.py     what a destination is good for                ▼
hosts.py      per-runtime matcher semantics          analyzer.py  ──► Report
matching.py   normalization + the decision            simulate.py       │
                                                                        ▼
                                                     report.py    text / JSON / SARIF

One I/O module, everything else pure. discover.py observes and records; it never decides. Entries are copied out of settings files exactly as written — whitespace, casing, stray URL syntax and all — because what a parser silently forgives is itself evidence, and normalising at read time would discard a finding. Every judgement module is a pure function of the recorded value: no filesystem, no clock, no randomness.

That split is not stylistic, and it is not on the honour system. tests/test_architecture.py walks each module's AST and fails the build if a judgement module imports os, pathlib, time, random, socket or subprocess, or calls open. The payoff is that a surface captured from CI six months ago and a live scan today grade through byte-identical code, so an egress regression is a diff between two JSON documents rather than an argument between two people who ran the tool on different machines.

sluice never opens a network connection, and the same AST test enforces it. Auditing an egress policy by testing reachability would mean making exactly the requests the policy exists to prevent, from exactly the machine it exists to confine. Every verdict here is computed from declared configuration.

Two approaches considered

Dynamic prober. Actually attempt connections and report what succeeds. Higher fidelity, and rejected on the merits rather than on effort: a tool that demonstrates an exfiltration channel by using it is indistinguishable, to every monitoring system watching, from the attack it is warning about — and it would have to run from inside the sandbox it is grading, so a false negative would mean "the network was down", not "the policy held". Worse, it cannot answer the question that matters. Reaching webhook.site once proves the channel is open; failing to reach it proves nothing about webhook.site at 3am next Tuesday.

Static reachability over declared configuration (chosen). Deterministic, inert, runs in CI on a machine with no network at all, and gives the same answer in every month. Its cost is honest and visible: it can only reason about what the configuration declares and what the frozen tables know, which is exactly what the CERTAIN/LIKELY split exists to record.

The simulation mode is the bridge. Running a 260-destination corpus through the runtime's own matcher gets most of the value of a prober — a concrete list of admitted destinations, each naming the entry that granted it — with none of the traffic.

Certainty

Every finding declares one of two levels, and the distinction is load-bearing.

CERTAIN — decidable from the declared configuration plus the frozen tables. The reasoning is arithmetic. To disagree is to disagree with the tables: that workers.dev sits in the PSL private section, or that a wildcard one label below a public suffix grants a rented namespace.

LIKELY — additionally rests on either a classification of a name the corpus does not know, or on modelled runtime behaviour a vendor may have changed. These always quote the evidence they rest on.

The split earned its keep twice during the build. The embedded PSL is a curated subset, so an unrecognised name falls back to the implicit single-label rule — psl.lookup() marks those results low-confidence and TEN004 reports them as LIKELY with the name's shape quoted as the evidence, instead of claiming a certainty it has not earned. And every finding that depends on how a runtime matches rather than on what the file says (FAIL008, FAIL009, RSV002, INT006, RDR002) is LIKELY by construction, with sluice hosts printing the provenance of the model so a reader can check it rather than trust it.

Host profiles

Five, and they are a model assembled from vendor documentation and public disclosure, not an extraction from anyone's source:

  • reference — not a product. The strictest reading of a domain allowlist, and the semantics a policy author almost always believes they are writing against. The baseline in diff.
  • claude-code — sandbox.network.allowedDomains / deniedDomains, deny taking precedence over allow wildcards, and strictAllowlist deciding whether an out-of-list host is refused or merely asked about.
  • vscode — the chat agent network filter, where an enabled filter with both lists empty blocks everything.
  • copilot-cloud — the cloud coding agent firewall, with a recommended allowlist on by default and org policy able to lock repository edits.
  • naive-proxy — not a vendor. Models the in-house pattern of checking a hostname with a plain string suffix test. Included because that shape is common, and because a 2026 disclosure showed it admitting attacker-host.example\x00.allowed.com when the suffix test and the C resolver disagreed about where the string ended.

sluice diff grades one configuration under several of them at once. That is the mode this experiment exists for: a policy reviewed on a laptop and enforced in CI by a different runtime confines differently in the two places, with nobody having edited a line.

Worked examples

Both are real policies, and both are graded by the test suite so the README cannot drift from the behaviour.

  • examples/porous — a policy a careful engineer would ship and a reviewer would approve. Every entry was added for a real reason: the build needs its dependencies, CI posts to a channel, someone was debugging a webhook and the entry outlived the session. Nothing in it is carelessness. It trips 39 findings across all 12 families.
  • examples/tight — the same workload, closed. Not shorter: different. Every entry names a host rather than a namespace, dependency traffic goes through a mirror the organisation controls, the inside of the boundary is denied explicitly, and unmatched destinations are refused rather than asked about. Zero CRITICAL, zero HIGH, and nothing CERTAIN above LOW — what remains is advice about the runtime that no edit to the file can fix. It also confines identically under every profile, which is the property the diff mode is measuring.

A safety invariant, enforced

The examples are written in sluice's own vendor-neutral sluice.egress.json format rather than at any runtime's real settings path, and test_examples.py fails the build if a .claude/, .vscode/, or .github/copilot-firewall.json path ever appears anywhere in the tree. An auditor whose test fixtures are themselves a working permissive configuration would be an unusually embarrassing way to introduce the problem it exists to detect.

The example domains are deliberately real — naming *.amazonaws.com is the entire lesson — but a JSON file listing hostnames is inert, and sluice never contacts any of them.

Assumptions and limitations

Stated plainly, because a security tool that overstates its reach is worse than none.

  1. Host profiles are a model, not ground truth. They come from vendor documentation and public disclosure. Runtimes change. sluice hosts prints each profile with its provenance so the model can be checked, and every finding that depends on modelled behaviour is LIKELY.
  2. The embedded PSL is a curated subset, not the full ~10k-line list, because vendoring and refreshing the real one would make verdicts depend on a network fetch. Unrecognised names fall back to the implicit rule and are reported honestly as low-confidence.
  3. The corpus is a floor, not a ceiling. 111 sinks and 260 probes. A clean report means the policy closes every channel this catalog knows how to test, which is a statement about the catalog. The tool says so in those words when it finds nothing.
  4. Static only. sluice reads declared configuration. It cannot see a platform firewall underneath the harness, a proxy the runtime was pointed at by an environment variable, or a policy delivered by a management channel it never reads. A finding of "no policy found" means none was found where this profile looks.
  5. Hostnames only. Egress lists compare the host in the request. sluice inherits that limit: it cannot express or check a path, and it says so rather than pretending an entry with a path in it means something.
  6. Reach is measured against the allow list, not the default. A destination that merely produces a prompt is not counted as admitted, because on a prompting runtime that would score every policy at ~100% and bury the entries that genuinely widen it. Prompts are reported separately by FAIL001 and RCH003 — and for destinations inside the boundary a prompt does count as reachable, because "it asks first" is not a denial.
  7. Membership in the sink corpus is a judgement about capability, not reputation. None of the listed domains are malicious; most are load-bearing infrastructure. That is the point. The question is never "is this domain bad", it is "does allowing it terminate the channel".

Where this sits in the series

Experiments 001–035 audit what the other side declares — a static manifest, one MCP channel, an A2A artifact — or, latterly, structure inside the agent system: the permission policy it consults (#032 warrant), the memory it writes (#033 revenant), who it may spawn (#034 satrap), the hooks wired to its tool calls (#035 deadlatch).

sluice is the first entry on the network plane: not which tool may run, but where the bytes may go. It is distinct from #009 trifecta, which asks whether a toolset closes an exfiltration channel; here the channel is already open by construction and the question is whether the destination list names somewhere the attacker can stand. And it is distinct from #017 cordon, which audits inbound filesystem boundaries, in direction as well as in subject.

License

MIT. See LICENSE.

About

sluice - offline static auditor for the agent network-egress plane: the allow/deny domain lists that decide where an agent's bytes may go. The allowlist grants the suffix; the attacker rents the leaf.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages