Offline, LLM-free, dependency-free (pure-stdlib) static auditor for the AGENT DELEGATION PLANE — who may spawn whom, holding what authority, and what comes back.
A satrap was a provincial governor of the Persian empire: authority delegated outward from a centre that could not see what was being done with it. The failure was structural, not personal — the further authority travelled from the throne, the less the throne could tell what it had actually authorised.
Every finding in the authority and flow families ships with a witness: a concrete delegation path, replayed from the root principal through an independent code path before the finding is emitted. A claim that does not replay is suppressed and counted, never reported.
Experiments 001–033 all audit an artifact at the agent's perimeter: a static manifest (001–010), one MCP message channel (011–022), the HTTP transport (023), terminal rendering (024), A2A (025–026), an MCP Apps bundle (027), the caching timeline (028), the telemetry envelope (029), the header-mirroring plane (030), an Agent Skill's reachable file closure (031), the permission policy the agent consults before acting (032), or the memory store it writes for its own future self (033).
satrap audits the plane inside the agent system — the one where an agent is both author and audience. When an agent delegates, it writes a task for another agent and then reads back whatever that agent says. Both halves are trust boundaries, and neither is covered by anything upstream of them.
Today's research says the same thing from three directions. Capability Gates Are Not Authorization (arXiv:2606.28679) separates "what tools exist" from "who may use them and when", and shows frameworks conflating the two. The delegation-chain literature states the design principle plainly — authority can only decrease along a delegation chain (CSA, Microsoft Agent Governance Toolkit). And the confused-deputy work shows what happens when it does not: untrusted agents "launder the adversary's requests so they appear as trusted outputs of trusted agents" (arXiv:2603.09002, Prompt Infection).
Every enforcement mechanism proposed for this is a runtime one — admission control, System View graphs, cryptographic delegation tokens with parent_hash chains. All of them need a live call to inspect. Nobody audits the declaration. Yet the corpus of agent definitions sitting in .claude/agents/ is a complete, static description of the delegation topology, and it is reviewed the way it is written: one file at a time, by someone reading a tool list.
That review misses two things, and satrap exists to prove both:
- Authority is two-dimensional. A child whose tool list is a strict subset of its delegator's can still be strictly more authorised, because it declares a wider consent posture.
tools: [Read]atbypassPermissionsbeatstools: [Read, Write, Bash]atdefaulton the axis that decides what actually executes. Subset-checking a tool list cannot see this. - Delegation is not narrowing. Omitting
toolsdoes not mean "no tools" — it means inherit the delegator's entire set. The principle says authority decreases along the chain; the default says it is copied.
The smallest thing that proves the idea is a tool that reads the definitions you already have, computes what authority is actually reachable from the principal a human approved, and hands you the delegation path that gets there.
25 finding codes in 5 families. satrap explain <code> documents any of them.
| Family | Question it asks |
|---|---|
AU |
Does delegation preserve the (capabilities × posture) order? |
TP |
Is the delegation graph itself well-formed? |
SC |
Is the definition that wins resolution the one that was reviewed? |
FL |
Does the return channel launder untrusted content? |
DC |
Does the file mean what its author believes it means? |
Full catalog (25 codes)
| Code | Sev | Finding |
|---|---|---|
AU01 |
CRIT/HIGH | Capability escalation across a delegation edge |
AU02 |
CRIT/HIGH | Consent-posture escalation across a delegation edge |
AU03 |
CRIT/HIGH | Delegation chain amplifies authority beyond the root principal |
AU04 |
HIGH | Omitted tool list inherits high-risk authority |
AU05 |
HIGH | Agent is granted the entire tool universe |
AU06 |
MEDIUM | disallowedTools entry denies a capability the agent never had |
AU07 |
HIGH | Tool restriction is defeated by onward delegation |
TP01 |
HIGH/MED | Delegation cycle |
TP02 |
HIGH/MED | Open delegation: no delegatesTo allowlist |
TP03 |
INFO | Agent is defined but unreachable from the root |
TP04 |
MEDIUM | Delegation depth exceeds the configured maximum |
TP05 |
MEDIUM | delegatesTo names an agent that does not exist |
SC01 |
HIGH/MED/LOW | Agent name is defined at several scopes |
SC02 |
HIGH/MED | Plugin-scope definition declares controls the runtime discards |
SC03 |
HIGH/MED/LOW | Agent name is defined in several project directories |
SC04 |
HIGH | Plugin-supplied agent is reachable with effector authority |
FL01 |
CRIT/MED | Untrusted content launders across the return channel |
FL02 |
HIGH | Ingest-capable agent runs at an auto-approving posture |
FL03 |
MEDIUM | Report crosses two raw return boundaries |
FL04 |
HIGH | Remote delegatee returns raw text into an effector delegator |
DC01 |
HIGH | Misspelled restriction key is silently ignored |
DC02 |
INFO | Unrecognised frontmatter key |
DC03 |
MED/INFO | Declared tool name does not exist, or is unclassified |
DC04 |
LOW | Agent declares no description |
DC05 |
LOW | Definition is not fully parsable |
AU02 — the escalation a subset check cannot see. deployer declares tools: [Bash, Write] and permissionMode: bypassPermissions. Reviewing the tool list tells you nothing; the posture is what decides whether those calls stop for a human.
AU07 — the restriction that is only a redirection. reviewer deliberately holds no write or shell tools, which is the whole point of a reviewer. It also holds Task and delegatesTo: [deployer]. The capability is still reachable; only the audit trail changed.
FL01 — the provenance that dies at the boundary. Inside one agent, a WebFetch result arrives tagged: the harness knows this block is untrusted data, not instruction. Cross a delegation boundary and the tag is gone — the delegator receives prose attributed to its own subagent, a component it trusts by construction. satrap tracks that, and the fix it proposes is not to sever the edge but to mark it.
Python 3.11+. No dependencies, no network, no model calls.
python -m satrap audit fixtures/vulnerable # the full report
python -m satrap audit fixtures/sound # scores 100/A
python -m satrap audit ./my-corpus --json # machine-readable
python -m satrap graph ./my-corpus # Mermaid flowchart
python -m satrap explain AU07 # what a code meansOr make run, make test, make demo.
In CI:
python -m satrap audit .claude --fail-on high| Exit | Meaning |
|---|---|
0 |
clean, or all findings below --fail-on |
1 |
at least one finding at or above the threshold |
2 |
the corpus could not be loaded |
--fail-on none reports without ever failing. --max-depth N sets the acceptable delegation depth (default 3). --taxonomy t.json reclassifies tools. --output FILE writes the report to disk. --verbose prints the suppressed list.
A directory of agent definitions, in either dialect:
---
name: reviewer
description: Reads a diff and reports problems. Never edits.
tools: [Read, Glob, Grep]
delegatesTo: [formatter]
returnContract: attributed
permissionMode: default
---
You review code and report problems.or the framework-neutral JSON form, which is how handoff-style SDKs and remote A2A delegatees express the same thing:
{ "name": "reviewer", "tools": ["Read"], "handoffs": ["formatter"],
"endpoint": "https://vendor.example/.well-known/agent-card.json" }With a corpus.json, you declare the root principal and where each scope lives:
{
"root": { "tools": ["Read", "Grep", "Edit", "Write", "Task"],
"permissionMode": "default", "delegatesTo": ["orchestrator"] },
"scopes": [
{ "scope": "project", "path": "agents", "dir": "." },
{ "scope": "plugin", "path": "plugins/acme/agents", "plugin": "acme" }
]
}Without one, satrap discovers **/agents/*.{md,json} and infers scope from the path (plugins/<name>/ → plugin, user/ → user, otherwise project), assuming a default root principal and saying so in the notes.
loaders.py two dialects -> one AgentDef model (never raises on a bad definition)
frontmatter.py the YAML subset, and what it refuses to guess
taxonomy.py what each tool DOES: ingest? effect? risk? (data, overridable)
model.py Authority = (capabilities x posture), the product order
graph.py scope resolution, the combined edge/authority fixpoint, witness replay
flow.py the return channel: laundering paths, attribution plan
rules.py 25 checks; suppresses anything whose witness does not replay
report.py score, text, JSON, Mermaid
Which agents a node can delegate to depends on whether it holds a delegation tool. Whether it holds a delegation tool depends on what it inherited along the delegation path. Neither can be computed first, so both are grown together to a least fixpoint:
eff[root] = the human-approved root authority
eff[child] = join over parents p of transfer(child, eff[p])
edges = { (p,c) : eff[p] holds a delegation tool and p's allowlist admits c }
transfer and join are monotone and the lattice (2^universe × 4 postures) is finite, so the iteration terminates at the least fixpoint. Edges only ever get added, so the combined iteration is monotone too.
The property that matters is that transfer is not decreasing. tools omitted inherits the delegator's whole set; permissionMode omitted inherits its posture; at plugin scope a declared permissionMode is dropped by the runtime and inherits anyway. Delegation copies authority unless a definition actively narrows it.
eff[x] is a join — the envelope of what x can hold across all paths that reach it. That is the right thing for enumeration and the wrong thing for a claim. An agent reached from a Bash-holding delegator and from a WebFetch-holding one has both in its envelope, but no single session gives it both.
So no finding is emitted from the envelope. Each one is backed by a BFS over (node, authority) states — the same agent reached two ways is two states, which is exactly the distinction the join throws away — and the resulting path is replayed from the root through independent code that re-checks every hop. The vulnerable fixture exercises this: helper ingests untrusted content in the envelope, no single path gives it an ingest tool, and the laundering finding is suppressed with the reason recorded.
Materialised sets vs. symbolic patterns. Tool grants are matched symbolically (mcp__db__*) but expanded to concrete sets before any algebra. Subset tests become exact and witnesses can name the tool that was gained, at the cost of being relative to the observed tool universe. The alternative — a symbolic subsumption lattice — is exact for unbounded universes but cannot answer "which tool did this child gain", which is the whole content of an AU01 finding.
Wildcards expand over grantable, not universe. A misspelled tool name is in the universe so DC03 can report it, but it is not something a runtime can hand out. Letting tools: "*" materialise a typo would put a nonexistent capability into an agent's effective authority and then quote it back in findings.
Aggregation past a threshold. An agent with no delegatesTo makes the delegation graph complete, so a naive per-edge report emits the same escalation once per registry entry — the first working version produced 133 findings for a 13-agent corpus, of which perhaps 20 were distinct. Escalation is now reported per child definition (that is where the defect lives), laundering per absorber, and systemic classes past two instances fold into one finding naming every subject. Synthesised edges are marked as such and point at the TP02 that caused them.
Under-report over over-report. Suppressed claims are counted and printed with --verbose rather than downgraded to "possible". A security tool that cries wolf gets muted, and a muted tool finds nothing.
$ python -m satrap audit fixtures/vulnerable
==============================================================================
satrap - delegation-plane audit
==============================================================================
corpus : fixtures/vulnerable
agents defined : 16
agents resolved : 13
reachable from root: 13
delegation edges : 45
tool universe : 15 tools
root authority : posture=default caps={Edit, Glob, Grep, Read, Task, Write}
SCORE 0/100 GRADE F
CRITICAL:18 HIGH:16 MEDIUM:7 LOW:2 INFO:2
[AU03] Delegation chain amplifies authority beyond the root principal
subject : deployer
source : agents/deployer.md
detail : a 2-hop delegation chain reaches an authority the root
principal never held: capabilities Bash; posture default ->
bypassPermissions
witness : __root__ -> orchestrator -> deployer
verified : yes (replayed from root)
[AU07] Tool restriction is defeated by onward delegation
subject : orchestrator
source : agents/orchestrator.md
detail : 'orchestrator' is denied Bash by its own tool list, but can
delegate to 'deployer', which holds it
witness : __root__ -> orchestrator -> deployer
verified : yes (replayed from root)
[FL01] Untrusted content launders across the return channel
subject : web-researcher ==> helper
detail : content ingested by 'web-researcher' via WebFetch, WebSearch
returns unattributed through 1 delegation boundary into
'helper', which holds Bash, Edit, Execute, NotebookEdit, Write
witness : __root__ -> orchestrator -> helper -> web-researcher
verified : yes (replayed from root)
[SC02] Plugin-scope definition declares controls the runtime discards
subject : formatter
detail : 'formatter' is defined at plugin scope and declares
permissionMode, which is not applied for plugin definitions.
It declares permissionMode: 'plan', which is discarded — the
agent runs at whatever posture it inherits, which may be wider.
------------------------------------------------------------------------------
RETURN-CHANNEL ATTRIBUTION PLAN
------------------------------------------------------------------------------
12 laundering path(s); attributing 12 return edge(s) breaks all of them:
returnContract: attributed on deployer (report reaches helper)
returnContract: attributed on web-researcher (report reaches helper)
...
(greedy hitting set - a small covering set, not a proven minimum)
------------------------------------------------------------------------------
SUPPRESSED (1)
------------------------------------------------------------------------------
- FL01 helper=>orchestrator: absorber lacks the ingest tool on this path
The sound corpus, same tool:
$ python -m satrap audit fixtures/sound
SCORE 100/100 GRADE A
CRITICAL:0 HIGH:0 MEDIUM:0 LOW:0 INFO:0
No findings. Every delegation edge preserves the product order, no
return channel launders untrusted content, and every definition that
wins resolution is the one that was written.
$ python -m pytest tests -q
127 passed
$ python scripts/verify_isolated.py
OK interpreter : C:\Python313\python.exe
OK satrap : 0.1.0
OK all three fixtures audited in every output mode
OK zero non-stdlib imports
scripts/verify_isolated.py (also make verify) is how the dependency-free
claim is checked: it imports every module, audits all three fixtures in every
output mode, then walks sys.modules and fails if anything outside the
standard library and the package itself was loaded. Not "the lockfile is
empty" — "the process never loaded anything else".
fixtures/sound is a reference architecture that must produce zero findings — an auditor that cannot be satisfied is one people turn off. fixtures/vulnerable carries one documented defect per agent (GROUND_TRUTH.md), asserted code-by-code and subject-by-subject. fixtures/deepchain isolates the topology checks. One test asserts that the three fixtures between them exercise every code in the catalog, so a rule cannot be added without a fixture that triggers it.
Runtime semantics are modelled, not observed. satrap encodes the documented resolution and inheritance rules — precedence managed > cli > project (nearest directory) > user > plugin, tools omitted means inherit, disallowedTools subtracts last, and plugin-scope definitions have permissionMode / hooks / mcpServers dropped. Where a runtime differs, satrap is wrong in the direction of its model. The model lives in one function (graph.transfer) and one constant (model.PLUGIN_DROPPED_FIELDS).
delegatesTo and returnContract are satrap's extensions. No shipping runtime has a per-agent delegation allowlist or a declared return contract. They are how satrap expresses "this agent may only call these" and "this agent's report is quoted, not spliced". Without a delegatesTo, any agent holding a delegation tool is assumed to reach the entire registry, which is what the runtimes actually do — hence TP02 on almost every real corpus. Reading them as proposed fields rather than existing ones is the honest reading.
The analysis is relative to the observed tool universe. Tools nobody names anywhere cannot be reasoned about. Unknown tools — notably server-defined mcp__* names — are assumed to both ingest external content and produce effects, and reported as unclassified. Assuming them inert would let one unaudited MCP server erase every flow finding.
Frontmatter is parsed as a documented subset, not as YAML. Nested mappings, multi-line scalars, anchors and flow mappings are reported (DC05) rather than guessed. A full YAML parser would accept constructs the runtimes themselves reject, which is a worse failure than refusing to read them.
The attribution plan is greedy. Minimum hitting set is NP-hard; the plan is the standard greedy approximation with its H(n) bound, and the report says so rather than claiming an optimum.
Static means static. satrap sees declarations. It cannot see a delegation the model declines to make, an agent spawned from a name computed at runtime, or a tool call that never happens. It answers what the corpus admits, not what a given session did — the same relationship #032 warrant has to permission policies, and for the same reason.
No evidence any of this is exploited in the wild. The corpora here are constructed. The mechanisms are documented behaviour and the confused-deputy literature; the fixtures are demonstrations, not incident reports.
#009 trifecta computes capability flow across an MCP toolset within one agent; satrap's flow plane crosses agent boundaries and its subject is the return channel, which #009 has no notion of. #032 warrant audits the permission-rule language — satrap consumes a root policy as given and asks a different question about it. #003 skill-collider analyses routing collisions between skill descriptions; satrap deliberately does not score description overlap, to stay out of that space.
MIT. See LICENSE.