diff --git a/packages/adapter-utils/src/sandbox-callback-bridge.test.ts b/packages/adapter-utils/src/sandbox-callback-bridge.test.ts index 028ec83407..b0300d6d7d 100644 --- a/packages/adapter-utils/src/sandbox-callback-bridge.test.ts +++ b/packages/adapter-utils/src/sandbox-callback-bridge.test.ts @@ -1252,6 +1252,13 @@ describe("sandbox callback bridge", () => { { method: "GET", path: "/api/companies/co-1/approvals" }, { method: "GET", path: "/api/companies/co-1/routines" }, { method: "GET", path: "/api/companies/co-1/skills" }, + // Hire skill (paperclip-create-agent): discovery + submit + issue linking + { method: "GET", path: "/llms/agent-configuration.txt" }, + { method: "GET", path: "/llms/agent-configuration/claude_local.txt" }, + { method: "GET", path: "/llms/agent-icons.txt" }, + { method: "GET", path: "/api/companies/co-1/agent-configurations" }, + { method: "POST", path: "/api/companies/co-1/agent-hires" }, + { method: "POST", path: "/api/issues/issue-1/approvals" }, { method: "GET", path: "/api/projects/proj-1" }, { method: "GET", path: "/api/goals/goal-1" }, { method: "GET", path: "/api/issues/issue-1" }, @@ -1308,6 +1315,12 @@ describe("sandbox callback bridge", () => { // grows new actions later. { method: "POST", path: "/api/execution-workspaces/ws-1/runtime-services/delete" }, { method: "POST", path: "/api/companies/co-1/agents" }, + // The hire allowlist must not over-match: only the exact .txt discovery + // files, only agent-hires (not /agents), and no sub-resources beyond it. + { method: "GET", path: "/llms/agent-configuration" }, + { method: "GET", path: "/llms/secrets.txt" }, + { method: "POST", path: "/api/companies/co-1/agent-hires/ap-1" }, + { method: "POST", path: "/api/issues/issue-1/approvals/ap-1" }, { method: "POST", path: "/api/agents/agent-1/pause" }, { method: "POST", path: "/api/agents/agent-1/terminate" }, { method: "POST", path: "/api/agents/agent-1/keys" }, diff --git a/packages/adapter-utils/src/sandbox-callback-bridge.ts b/packages/adapter-utils/src/sandbox-callback-bridge.ts index 4d9cd0b014..25db401931 100644 --- a/packages/adapter-utils/src/sandbox-callback-bridge.ts +++ b/packages/adapter-utils/src/sandbox-callback-bridge.ts @@ -127,6 +127,18 @@ export const DEFAULT_SANDBOX_CALLBACK_BRIDGE_ROUTE_ALLOWLIST: readonly SandboxCa // Subtasks / delegation { method: "POST", path: /^\/api\/companies\/[^/]+\/issues$/ }, + // Hiring (paperclip-create-agent skill): adapter/icon discovery, comparing + // existing agent configs, submitting the hire request, and linking the + // resulting approval to its source issue. Direct agent creation + // (POST /api/companies/:id/agents) stays denied — hires must go through the + // approval-gated agent-hires endpoint, which the server still permission-checks. + { method: "GET", path: /^\/llms\/agent-configuration\.txt$/ }, + { method: "GET", path: /^\/llms\/agent-configuration\/[^/]+\.txt$/ }, + { method: "GET", path: /^\/llms\/agent-icons\.txt$/ }, + { method: "GET", path: /^\/api\/companies\/[^/]+\/agent-configurations$/ }, + { method: "POST", path: /^\/api\/companies\/[^/]+\/agent-hires$/ }, + { method: "POST", path: /^\/api\/issues\/[^/]+\/approvals$/ }, + // Approvals (request, read, comment) { method: "GET", path: /^\/api\/approvals\/[^/]+$/ }, { method: "GET", path: /^\/api\/approvals\/[^/]+\/issues$/ },