Repository navigation
Description
Cheap, unblocked, and it gates both #372 and any work where mecatl signs something. Run it now rather
than discovering the answer partway through.
mecatl. Output is a decision, throw the code away. Unblocked; gates #372 and the issuer work.
What it has to answer
Three questions about reachability, plus one about whether signing means anything while the answers to
the first three are unfavourable. Verify against how our deployment actually registers and runs, rather
than against how it is supposed to.
- Can a model-spawned shell fetch its own SVID from the Workload API? The claimed answer is that a
SPIRE selector pinning issuance to the binary (unix:sha256) closes it, because a model-spawned
/bin/shfails that selector. Check that this is how we register; do not assume it. - Can a shell read a key out of the agent loop's memory, or off its delivery channel? A subprocess
sharing a uid can ptrace its parent, which is the attack the broker's separateunix:uidexists to
close. But the delivery channel matters more than memory: a flag lands in/proc/<pid>/cmdline, an
env var is readable at the parent's/proc/<harness-pid>/environbecauseenvscrubstrips names
from the child's environment only, and a mounted Secret file is a fixed path thatcatreaches,
withcatclassified read-only by verb and no path predicate, so an isolated child auto-approves it.
Only/proc/pid/memneedsPTRACE_MODE_ATTACH, and no manifest here setsptrace_scope. Answer
this for any signing or MAC key the harness holds, not one specific key: the snapshot MAC in
Store hardening: auth, TLS and snapshot integrity #374 has the same custody and the same exposure. - Can a shell drive the broker into minting for an agent name the session should not get? The
claim is that the broker's policy for which agent names a session may request lives in config the
loop cannot write. Try to violate it. - If the answers to 1 to 3 are unfavourable, does a mecatl signature still buy anything? The
internal issuer's day-one payoff is that a verifier can check a delegation narrowing actually
happened rather than trusting the harness's word for it. If an injected agent can reach the signing
key it mints any chain it likes, and verifying against that key is trusting the harness again. Say
plainly whether that payoff exists as things stand, and what would have to change for it to exist.
Out of scope
- The X.509-SVID versus JWT-SVID-assertion comparison. Client auth is settled as JWT-SVID assertion,
and separately X.509-SVID is ruled out for keyless sub-principals on its own merits: its value is
proof of possession at the TLS handshake, which a goroutine holding no key cannot produce. The
parent-presents-the-child's-cert variant is bearer-equivalent security at full CA cost. - Gateway-side
cnfchecking. Different connection, tracked on The harness acts for a user against an external system #372.
Output
A decision, not code. Answers to the four questions, plus a go/no-go on whether the broker's uid
separation is the only mechanism standing between an injected shell and call 1's full registration
ceiling. The design's own sentence is the thing being tested: "Calls 2 and 3 bound children; only
reachability bounds the root."
Reasoning
The design this comes from, both on main:
- docs/agent-identity-model.md — the inbound side: who is acting, and how mecatl would identify them.
- docs/agent-identity-outbound.md — the outbound boundary: acting for a user against an external system.
Every hazard above is stated in full here rather than linked, so this issue stands on its own.
Activity
JAORMX commentedon Aug 5, 2026
(mecatl comment, posted on Juan's behalf — scope sharpening from the #377 Q1 discussion.)
The Q1 answer (JWT-SVID assertion first) narrows what this spike has to prove, and it's worth pinning the scope before the work starts so the spike doesn't re-litigate settled ground:
In scope (the load-bearing questions):
unix:sha256— which a model-spawned/bin/shfails. Verify this is actually how our deployment registers, don't assume it.)unix:uidexists to close, and it's the one the doc flags as unverified: "Whether a shell in our own deployment can reach the SVID today depends on the registration selector beingunix:uidand on the socket path being inherited. Neither is checked in our code.")Out of scope: the X.509-SVID-vs-JWT-SVID-assertion comparison. Q1 settled that for the first iteration (JWT-SVID assertion), so the spike doesn't need to price the mTLS-to-the-AS alternative — it needs to prove the uid boundary that both variants depend on. The mTLS question that remains live is gateway-side (
cnfchecking), which is a different connection and a different issue (#372's day-one checklist).The output framing already in this issue is exactly right: a decision, not code. Suggest the decision be recorded as answers to those three questions plus a go/no-go on the broker's uid separation as the only mechanism standing between an injected shell and call 1's full registration ceiling — the doc's own sentence: "Calls 2 and 3 bound children; only reachability bounds the root."
jhrozek commentedon Aug 5, 2026
Scope narrowing accepted, and the spike grows by two.
The MAC key in #374 inherits this same question. It is not only the SPIFFE key that lives in the agent-loop process. A MAC over the snapshot has to be applied on the per-turn save/load path, so its key is a live
[]bytein the same process that is the parent of the Bash tool. Worse, none of the interesting attacks need to read it out of memory: a flag lands in/proc/<pid>/cmdline, an env var is readable at the parent's/proc/<harness-pid>/environbecauseenvscrubonly strips names from the child's environment, and a mounted Secret file is a fixed path thatcatreaches, withcatclassified read-only by verb and no path predicate, so an isolated child auto-approves it. Only/proc/pid/memneedsPTRACE_MODE_ATTACH, and nothing in this repo setsptrace_scope. So this spike should answer the question for "a signing or MAC key held by the harness", not for one specific key.And the circularity question belongs here. The internal issuer's day-one payoff is supposed to be that a verifier can check a delegation narrowing actually happened rather than trusting the harness's word for it. But if the signing key is reachable from a shell the model drives, an injected agent mints whatever chain it likes, and verifying against that key is trusting the harness. So the spike's answer decides whether that payoff exists yet, which is why the issuer work is now sequenced behind this rather than ahead of it.
On the out-of-scope call: agreed the X.509-versus-JWT-SVID comparison does not belong in this spike, and separately it is settled on its own merits. X.509-SVID's whole value is proof of possession at the TLS handshake, and a keyless goroutine cannot produce that signature. The parent-holds-the-key-and-presents-the-child's-cert variant is coherent but strictly worse than a plain JWT-SVID: the handshake proves the parent's key, "this represents child X" is never reproven at use time, so it is bearer-equivalent security at full CA cost. Cost is the visible symptom, not the reason.
Filling in the body, which was a stub.
jhrozek commentedon Aug 5, 2026
In Kubernetes this is largely a pod-spec property rather than an empirical one. Containers in a pod share a network namespace but not a PID namespace, and
shareProcessNamespacedefaults to false — so a shell in the agent container cannot see,ptrace, or read/proc/<pid>/memof a process in a sidecar.That makes the spike cheaper and changes what it should test. Assert the manifest property, then attack from inside the agent container for the paths the namespace does not cover:
SO_PEERCREDreturns a pid either wayThe output is still a decision, but it is a shorter one: the namespace question is answered by the manifest, and what remains is the list above.
jhrozek commentedon Aug 12, 2026
Answers
Run in disposable kind clusters against binaries built from this repo, driven through mecatl's own tool surface by a controlled OpenAI-compatible endpoint (so the "model" is scripted and the harness is real). Tiering is explicit throughout: [product] = verified against real mecatl, [toy] = verified against a ~400-line throwaway broker written for the spike, [code] = established by reading, not executed.
1. Can a model-spawned shell fetch its own SVID from the Workload API? — Yes by default; a process-level selector closes it. [product]
Registered mecatl as a workload in SPIRE (Helm chart 0.30.0, real CSI driver), mounted the Workload API socket into its container, and had the model run
spire-agent api fetch x509 -write /tmp/svidthrough the Bash tool at--posture=auto.With pod-level selectors only (
k8s:ns,k8s:pod-label) the fetch succeeded and wrote the private key to disk:Adding
unix:path:/usr/local/bin/mecatedto the entry closed it — the shell then received onlyspiffe://<td>/ns/default/sa/default, not mecatl's identity. The calling process is resolved from/proc/<pid>/exe, and a model-spawned/bin/sh→spire-agentdoes not match.So the claim in this issue is correct in mechanism. Two caveats:
unix:path, notunix:sha256.sha256is strictly stronger (a path is defeatable by anyone who can write it; non-root plus a read-only rootfs prevents that).ClusterSPIFFEIDuses pod-level selectors, so out of the box the shell is issued a ServiceAccount-scoped SVID anyway. Selector hardening has to cover entries nobody on this team created. Any verifier that authorises on trust-domain membership rather than a specific ID is reachable without the broker.2. Can a shell read a key out of the loop's memory or off its delivery channel? — Yes, on every channel. [product]
Every prediction in the issue held. A canary standing in for a signing intermediate was seeded into mecated's process environment; PID 1 in the pod is mecated (the entrypoint
execs it).Environment —
Bash{cat /proc/1/environ}returned it, together with the provider API key:Exactly as this issue reasoned:
envscrubstrips names from the child's environment, so the shell's own env is clean and the parent's/procis not.Mounted file — the Kubernetes service-account token came out through the Read tool, no shell involved, because
--workspacedefaults to cwd (/on the ko image) anddeploy/mecak8snever sets it. Filed as #448 with the token verified live against the API server.Memory —
dd if=/proc/1/memreturned7f45 4c46(ELF magic) at mecated's text segment withCapEff: 0000000000000000./proc/sys/kernel/yama/ptrace_scopedoes not exist on the kind node's kernel, so YAMA is absent and classic same-uid rules apply. The issue's "no manifest here setsptrace_scope" was the operative detail.argv — demonstrated in the spike broker [toy]: a capability reference was recovered from
/proc/*/cmdlineat the same uid and then spent successfully. Same mechanism as a flag landing in/proc/<pid>/cmdline.A crucial asymmetry, since it explains why this is Bash-specific: the FS tools are confined by
os.Root(kernel-enforced) and by the pseudo-filesystem guard, which refusedRead{/proc/1/environ}with "never relaxed at any posture".internal/app/escapeclassifier.go'sclassifyswitches onRead/Write/Editand returnsescapeInRootfor everything else — Bash is never classified. Andosfs'sCommandRunnerhas no OS isolation at all: nochroot,unshare,seccomp,SysProcAttr, orCredential. It is/bin/sh -cwith a working directory and a scrubbed environment. Containment there is configuration, not isolation.What closes it:
--no-bashand--shell=""both remove the tool entirely (unknown tool "Bash"), verified with a positive control proving the harness still worked. The shipped distroless mecak8s image doesn't register Bash either — but accidentally, because there is no/bin/sh;--no-bashdefaults tofalseand--shellto/bin/shin every binary. A base-image change re-opens all three channels with no flag flipped and no test failing.3. Can a shell drive the broker into minting for an agent name it should not get? — Not answerable; there is no broker. [toy]
Against the spike's stand-in broker, the answer was yes for the root rather than the name:
BindRootaccepted a request with no subject reference (the check wasif req.Subject != "") and minted root authority over/withread-write, which then authorised a write to/etc/shadowthrough the broker. Resource containment was also an un-canonicalised prefix test: a grant over/repo/aauthorised/repo/a/../../etc/passwdwhile correctly refusing/repo/abc— the plausible half passing is what hid the missing half.Both are flaws in throwaway code, not in the design. Their value is the class: a precondition expressed as a struct field rather than an enforced refusal, and a comparison performed on un-normalised input. Every stated invariant in the broker design has one of those two shapes available to an implementer.
The definition axis was never tested — no registry exists — so the question as asked is open.
4. Does a mecatl signature still buy anything? — Not while a shell is present. [product] + reasoning
The day-one payoff is that a verifier can check a narrowing actually happened instead of trusting the harness. Given 2, an injected agent with a shell reaches the signing key by three independent routes, so it mints any chain it likes and verifying against that key is trusting the harness again. The payoff does not exist as things stand for a shell-bearing deployment.
It exists in two configurations:
os.Root-confined and pseudo-fs-guarded, WebFetch is an unimplemented stub, WebSearch reaches a configured provider only, and MCP is HTTP-transport-only. That property is a fact about today's tool set, not an invariant anyone declared.A third option we did not test but which would preserve both the shell and in-process custody: give
CommandRunnerreal isolation — a distinct uid viaSysProcAttr.Credential, or user/PID/mount namespaces, or Landlock plus a seccomp filter denyingptrace/process_vm_readv. Any of those closes all three channels. NotebuildSandboxedCommandRunner's "sandbox" is a git worktree today: it contains writes to the repo, not reads of the host.Go/no-go: is the broker's uid separation the only mechanism in the way?
No, and by itself it is not sufficient.
Not the only one. Process-level SPIRE selectors close question 1 with no broker at all [product].
--no-bashcloses all three of question 2's channels [product]. A sandboxed command runner would too, untested.Not sufficient. In the spike [toy], a shell at the loop's uid spoke to the broker socket directly, bypassing the client, and minted itself a root capability — peer authentication authenticates the uid, not the process, so the broker cannot distinguish trusted orchestration from a shell the model spawned. It then recovered a capability reference from another process's argv and spent it. Key custody held (nothing extracted the key); authority custody did not.
That matters for the design's rule that references must never appear in "prompts, messages, tool arguments, logs, or model-visible errors" — the list omits argv, environment, and
/proc, which are the channels that actually leak at a shared uid. An inherited file descriptor is the fix that survives a same-uid shell.The design's own sentence — "Calls 2 and 3 bound children; only reachability bounds the root" — holds, and reachability is worse than the sentence implies: the root is bounded by the absence of a shell, not by uid separation.
Recommended decisions
unix:sha256, and audit defaultClusterSPIFFEIDs — the chart's default issues an ambient SVID to every pod in the namespace.--workspaceindeploy/mecak8s), and note it is incomplete on its own: Bash bypasses workspace containment entirely, and a model can name a future session's workspace via the Schedule tool — see the hazard comment on Run scheduled tasks with bounded, revocable user authority #373.What is not answered
unix:sha256specifically, and how mecatl would actually register, since nothing registers today.cnf). Never implemented, never run — it is half of what makes a stolen credential useless, and the largest untested claim in the design.ptrace_scope=1case. The memory channel is kernel-policy-dependent; a host with YAMA at 1 would refuse a child reading its ancestor's memory. The environment and Workload API channels are unaffected.Evidence tiering and the full transcript basis:
docs/agent-identity-evidence-inventory.md.jhrozek commentedon Aug 12, 2026
Closing: the four questions and the go/no-go are answered in the comment above, which is what the Output section asked for.
Question 3 is answered only against a throwaway broker and is unanswerable for a real one, because none exists. That, and the rest of the residue, has moved somewhere it can be owned rather than living in a closed thread:
unix:sha256pinning, the ambientClusterSPIFFEIDaudit, and holder binding as a named gap on the claim-vocabulary slice.The
ptrace_scope=1case stays open as a deployment note on #478: the memory channel is kernel-policy-dependent, the environment and Workload API channels are not.Per the issue's own instruction, the spike code and its two disposable clusters are gone. Evidence tiering is in
docs/agent-identity-evidence-inventory.md.