fix(core): gate respond_agent_connection behind owner approval

The respond_agent_connection builtin could flip a pending agent connection
to approved without the target owner's YES/NO DM or authenticated API
response. Treat it like other security-boundary builtins so the executor
shows an approval card before the status change runs.

Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
This commit is contained in:
Cursor Agent 2026-09-22 03:24:32 +00:00 committed by Ingo Wagner
parent f9ffe06aeb
commit ed7ba490b1
2 changed files with 4 additions and 0 deletions

View File

@ -25,6 +25,7 @@ describe("toolRequiresApproval", () => {
expect(toolRequiresApproval("delete_bot", false)).toBe(true);
expect(toolRequiresApproval("archive_bot", false)).toBe(true);
expect(toolRequiresApproval("cloud_agent_launch", false)).toBe(true);
expect(toolRequiresApproval("respond_agent_connection", false)).toBe(true);
expect(toolRequiresApproval("create_space", false)).toBe(true);
expect(toolRequiresExplicitApproval("create_space")).toBe(true);
expect(toolRequiresExplicitApproval("archive_bot")).toBe(false);

View File

@ -32,6 +32,9 @@ const APPROVAL_REQUIRED_BUILTIN_TOOLS = new Set([
"cloud_agent_launch",
"cloud_agent_reply",
"cloud_agent_cancel",
// Owner-gated: approving a pending agent connection must not bypass the
// YES/NO DM or authenticated API path via an unattended model call.
"respond_agent_connection",
]);
const EXPLICIT_APPROVAL_BUILTIN_TOOLS = new Set(["create_space"]);