Skip to content

Enforce inherited permissions for spawned workers - #843

Merged
TheGreatAxios merged 6 commits into
mainfrom
cl-7531-subagent-workers-bypass-permission-enforcement
Sep 10, 2026
Merged

Enforce inherited permissions for spawned workers#843
TheGreatAxios merged 6 commits into
mainfrom
cl-7531-subagent-workers-bypass-permission-enforcement

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • Spawned workers inherit the parent session's live permission policy and authorize tool calls through the same gate path as the main session.
  • Unresolved worker approvals deny instead of hanging or falling through; workers persist real audit and error records under their own audit store.
  • Integration coverage proves an unauthorized write is denied, matching and nonmatching grants behave as expected, and worker identity and audit lifecycle stay isolated from the parent.

Verification

  • bun run typecheck, bun run build, and bun run test pass
  • bun run check passes: 6,298 tests, 0 failed

Fixes CL-7531

@linear-code

linear-code Bot commented Sep 9, 2026

Copy link
Copy Markdown

CL-7531

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Critic · Comment

Independent review of 6d809a37 found no blocking defects. The worker permission bypass is closed at reactor authorize, middleware ownership, and audit persistence.

  • Workers inherit the live parent gate instead of permissiveAuthorize / noopAuditStore.
  • Unresolved asks deny without hanging or invoking an approval callback.
  • A worker-local ownership marker prevents middleware from double-evaluating or asking.
  • Worker audit records persist under a dedicated isogit store.

Residual nits are comment hygiene and extra grant-path coverage, not merge blockers. Runtime commitAudit failure remains nontransactional by existing collector design.

@TheGreatAxios
TheGreatAxios force-pushed the cl-7531-subagent-workers-bypass-permission-enforcement branch from 0fe3606 to ebc95d5 Compare September 10, 2026 01:17
An identity-store ownership flag made the permission plugin
worker-aware. A view over the parent gate reports isReactorGated
and maps unresolved asks to denials that name the subject.
Parent MCP handlers closed over a middleware-gated isReactorGated of
false, so an allowed worker call re-entered evaluate and hung on
requestApproval. Workers now wrap inherited MCP tools with the same
reactor-gated view as posix.
Workers wrap inherited MCP handlers with the reactor-gated view. If the factory stored parent-gated tools, that outer wrap would still call the parent's requestApproval.
Workers deny without asking when parent-gated MCP tools are wrapped
again. A later call id after a parent grant must still pass
gateToolCall instead of reusing the prior deny.
posix path escape rewrites workspace paths to their realpath before
gateToolCall. Comparing cache identity after the same resolve keeps a
worker allow from being re-decided as a deny on Darwin tmpdir
symlinks, without letting a reused call id inherit allow onto a
different tool or command.
@TheGreatAxios
TheGreatAxios force-pushed the cl-7531-subagent-workers-bypass-permission-enforcement branch from ebc95d5 to 384a601 Compare September 10, 2026 01:32
@TheGreatAxios
TheGreatAxios merged commit 0394c14 into main Sep 10, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant