Repository navigation
Description
AgentStepSpec.permissions (fileGlobs, networkAllowlist, accessPreset) is carried end-to-end as data and never acted on. A spec author who declares it reasonably believes they have a sandbox they do not have.
Trace
Every reference in the stack is parse, validate, or round-trip:
| Site | What it does |
|---|---|
packages/sdk/src/spec.ts:119,431 |
type definitions |
packages/sdk/src/validate.ts:83,550 |
shape check — is it an array of strings |
packages/sdk/src/compile.ts:533,639 |
renames fileGlobs → file_globs for the kernel |
packages/sdk/src/cli/check.ts:486 |
uses key presence to detect which dialect a spec is in |
kernel/relayflowd-core/src/spec.rs:510 |
the struct; one test asserts it round-trips |
Nothing reads it to gate a file access. The kernel says so at spec.rs:506:
/// Permission model for an agent step (gate 8). Carried as data in gate 1;
/// enforcement lands with agent dispatch.
and docs/RFC-0001 states the intent as future work — "gate 8 makes this enforceable, not advisory."
So this is a known gap rather than a defect in the design. The problem is that nothing tells the author.
Why it bites
We migrated a set of verification flows from the older @relayflows/core engine, where the equivalent block was compiled and enforced (read/write split, deny list, relayfile fs:read/fs:write scopes, merged with .agentignore presets). The v2 specs declare permissions on every agent step, flows check accepts them, and they appear in the journal — so the flows look sandboxed and are not.
The agents in question run untrusted product test lanes. Under the old engine they could read the tree but write only their own evidence directory, and were denied .env, **/*secret*, **/.credentials/** and **/.git/**. On v2 none of that applies.
Suggested interim
Enforcement is the real fix, but the silent part is separately addressable and much cheaper:
- Have
flows checkemit a warning when a step declarespermissions, naming that it is not yet enforced. That alone converts a false belief into a known risk, and would have caught this for us at authoring time. - Say it in the
PermissionsSpecdoc comment on the SDK side too — the kernel comment is honest, but a TypeScript author never sees it. - Optionally, refuse
accessPreset: 'readonly'outright until enforcement lands, since that value's whole meaning is a guarantee (spec.tscalls it "provably cannot write") that currently does not hold.
Happy to send a PR for (1) and (2) if that shape is right.
Activity
docs(flows): record that v2 carries agent permissions but enforces none
Migrate all relayflows to v2 and deploy pr-proof on PR open (#1792)
AgentRelayBot commentedon Oct 5, 2026
Triage 2026-10-05: SUPERSEDED by #442 — the interim fixes (1) and (2) shipped in #488 (82ddb11):
flows checkemitspermissions_unenforced(packages/sdk/src/permissions-preflight.ts:32) and the SDK/schema docs say the field isn't enforced (spec.ts:154-160,flows.schema.json:618). The remaining work, real enforcement and possibly refusing instead of warning, is tracked in #442, which is the canonical issue (#493 is folded in too). Gap carried into #442: the check is silent for declarations inside an authored.flow.tsbody. Theauthored-worker-step.ts:187warning covers those only at run time.