Skip to content

Honor skip-permissions through pre-gate workspace sandboxes - #436

Merged
TheGreatAxios merged 1 commit into
mainfrom
cl-5807-agent-still-hits-permission-friction-under-dangerously-skip
Aug 9, 2026
Merged

Honor skip-permissions through pre-gate workspace sandboxes#436
TheGreatAxios merged 1 commit into
mainfrom
cl-5807-agent-still-hits-permission-friction-under-dangerously-skip

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

Under --dangerously-skip-permissions the permission gate already auto-allows every action that is not an authz hard deny, but several pre-gate workspace sandboxes still hard-denied outside-workspace paths. That left yolo mode agents stuck when reading another repo, deleting/listing outside the tree, or retaining a shell cwd that left the session root.

This change threads permissionGate.getSkipPermissions() into:

  • pathEscapePlugin (allowOutside)
  • deleteFilePlugin (allowOutside)
  • createListDirTool / listDirectory (allowOutside)
  • shellGuardPlugin / resolvePerCallShellCwd (allowOutsideCwd / allowOutsideSession)

Secret-guard path denies and authorization hard blocks remain intentional and unchanged. Auto mode without skip still asks / denies on outside-workspace access.

Test plan

  • bun run typecheck && bun run build && bun run test (4346 pass)
  • Unit coverage for skipPermissions outside-workspace read_file, git clone at the gate, path-escape allowOutside, list_dir / delete_file / shell cwd bounds with and without skip
  • Without skipPermissions, outside-workspace path-escape still blocks

Closes https://linear.app/abklabs/issue/CL-5807/agent-still-hits-permission-friction-under-dangerously-skip-permissions

Under --dangerously-skip-permissions the gate already auto-allows, but
path-escape, delete_file, list_dir, and shell cwd retention still hard-
denied outside-workspace paths. Thread getSkipPermissions into those
sandboxes so yolo mode can reach other repos and retain out-of-tree
shell cwd, while secret-guard and authz hard denies stay in force.
@linear-code

linear-code Bot commented Aug 9, 2026

Copy link
Copy Markdown

CL-5807

@TheGreatAxios

Copy link
Copy Markdown
Collaborator Author

Self-review

What this fixes. Gate already short-circuits on skipPermissions, but path-escape / delete_file / list_dir / shell cwd retention still hard-denied outside the workspace after the gate had already allowed the call. That is exactly the CL-5807 friction (other-repo path tools, git clone / network shell under yolo).

Approach. Expose immutable getSkipPermissions() on the gate and snapshot it once when building the toolset plugins. Default remains deny-outside; only the explicit yolo flag opens the fence. Secret-guard and authz stay earlier/independent middleware and still hard-deny.

Checks I care about.

  • Without skip: outside-workspace read_file still errors with path-escape (covered).
  • With skip: outside-workspace read_file, list_dir, delete_file parent bounds, and per-call / retained shell cwd all pass (covered).
  • Gate-level: skip still never invokes the approval callback; git clone and out-of-workspace path tools auto-allow without ask (covered).
  • Plugin order keeps secret-guard + authz between path-escape and execution.

Residual risk (accepted).

  • Under yolo, shell may retain a cwd outside the session root for the rest of the session — intentional for the escape hatch.
  • allowOutside is fixed at toolset construction; fine because skipPermissions is immutable after gate create.
  • Auto-shell policy denies also short-circuit under skip (pre-existing gate behavior, not introduced here).

No code changes from this review. Ready to merge.

@TheGreatAxios
TheGreatAxios merged commit aa88595 into main Aug 9, 2026
2 checks passed
@TheGreatAxios
TheGreatAxios deleted the cl-5807-agent-still-hits-permission-friction-under-dangerously-skip branch August 9, 2026 10:35
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