From d31081ef1aed3df503788a721f25768546d76fee Mon Sep 17 00:00:00 2001 From: Dotta Date: Sat, 10 Oct 2026 07:11:04 -0500 Subject: [PATCH] fix(runner): require repository acquisition permission in restrictive modes Co-Authored-By: Paperclip --- packages/paperclip-runner/README.md | 5 +++++ .../src/drivers/acpx/permission-policy.test.ts | 10 ++++++++++ .../src/drivers/acpx/permission-policy.ts | 6 ++++-- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/paperclip-runner/README.md b/packages/paperclip-runner/README.md index f87a1d07652..b4df933cfe0 100644 --- a/packages/paperclip-runner/README.md +++ b/packages/paperclip-runner/README.md @@ -245,6 +245,11 @@ do not change workspace isolation or grant credentials or connection access. task tools; `approve-reads` allows assigned reads; `deny-all` rejects requests. None of these restrictive modes is the default. +`prepare_repository` requires a provider permission decision in restrictive +modes, including `approve-paperclip`: repository acquisition can clone onto the +controller and is not automatically approved as a planning action. Full auto +still allows it; repository acquisition currently has no cumulative disk quota. + Restrictive profiles route supported permission decisions through durable runtime requests and the existing task interaction controls. Requests are persisted before presentation; answers are checked against the offered decisions and diff --git a/packages/paperclip-runner/src/drivers/acpx/permission-policy.test.ts b/packages/paperclip-runner/src/drivers/acpx/permission-policy.test.ts index 85241d43444..833c17bd667 100644 --- a/packages/paperclip-runner/src/drivers/acpx/permission-policy.test.ts +++ b/packages/paperclip-runner/src/drivers/acpx/permission-policy.test.ts @@ -53,6 +53,16 @@ describe("ACPX permission policy", () => { }); }); + it.each(["approve-reads", "approve-paperclip"] as const)("requires repository acquisition approval in %s", (mode) => { + const tools = ["prepare_repository", "paperclip__prepare_repository", "mcp__paperclip__prepare_repository"] + .map(name => ({ name, annotations: { readOnlyHint: true, effect: "read" } })); + expect(claudePaperclipPermissionRules(tools, mode)).toEqual([]); + expect(decideAcpxPermission("claude", mode, { + inferredKind: "read", + raw: { toolCall: { name: "mcp__paperclip__prepare_repository" } }, + })).toBe("delegate"); + }); + it.each([ ["approve-all", "execute", "allow_once"], ["approve-reads", "read", "delegate"], diff --git a/packages/paperclip-runner/src/drivers/acpx/permission-policy.ts b/packages/paperclip-runner/src/drivers/acpx/permission-policy.ts index 37785b61c0d..c9277e8c6d4 100644 --- a/packages/paperclip-runner/src/drivers/acpx/permission-policy.ts +++ b/packages/paperclip-runner/src/drivers/acpx/permission-policy.ts @@ -19,12 +19,14 @@ export class AcpxApprovalRequiredError extends Error { // Review additions explicitly: a newly catalogued mutation must not inherit // automatic provider permission. These operations implement the bounded plan, // task, and handoff workflow; governance decisions, generic APIs, and workspace -// controls deliberately stay outside it. Asking a human does not approve work. +// controls deliberately stay outside it. Repository acquisition also stays +// outside: it can trigger host-side clones with unbounded cumulative disk use. +// Asking a human does not approve work. const AUTOMATIC_PAPERCLIP_WORKFLOW_ACTIONS = new Set([ "report_progress", "answer_status_question", "write_document", "request_human_input", "register_deliverable", "finish_task", "block_task", "set_task_title", "request_review", "create_task", "reassign_task", "set_dependencies", - "create_project", "select_workspace", "prepare_repository", "request_approval", + "create_project", "select_workspace", "request_approval", ]); /** Exact SDK rules for the run's runner-owned Paperclip MCP connection. */