Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(teammates): replace autonomous allowlist with visible risk confirmation

Chris7eb991b79c86
diff --git a/apps/desktop/src/main/bot-autonomy/followUpPrompt.ts b/apps/desktop/src/main/bot-autonomy/followUpPrompt.ts
index ef9861d00c..e37bac2ec4 100644
--- a/apps/desktop/src/main/bot-autonomy/followUpPrompt.ts
+++ b/apps/desktop/src/main/bot-autonomy/followUpPrompt.ts
@@ -6,12 +6,12 @@
* FOLLOW_UP_PROMPT_VERSION,宿主据此把已有伙伴的内置规则对齐到新模板。
* 长度上限 1500 字:每次叫醒都会带上,控制成本。
*/
-export const FOLLOW_UP_PROMPT_VERSION = 6;
+export const FOLLOW_UP_PROMPT_VERSION = 7;
export const FOLLOW_UP_PROMPT_MAX_CHARS = 1500;
export function buildFollowUpRoutinePrompt(_botId: string): string {
// Host voice, not the owner's: this run is a Host wake-up and must not read as an owner request.
// It is also the auto-review intent of the run, so it states the grant the owner switched on.
- return '主人开启了自动跟进;这一轮由宿主的任务事件唤醒,不是主人刚说的话。看看这些任务做得怎么样,有需要主人回复或决策的,给出你的判断和建议。已经交给你跟进的任务,可以让它按原来的目标接着做,或按摘要建议换模型;追加要求、停止、归档、改目标等其它改动,写进待办或通知主人,等主人开口。没有新情况就不用提醒。';
+ return '主人开启了自动跟进;这一轮由宿主的任务事件唤醒,不是主人刚说的话。看看这些任务做得怎么样,有需要主人回复或决策的,给出你的判断和建议。已经交给你跟进的任务,可以让它按原来的目标接着做,或按摘要建议换模型;普通操作沿用当前任务权限;删除自动化、代答授权或恢复暂停等风险操作由宿主显示授权请求,等待主人决定,拒绝后不要重试。没有新情况就不用提醒。';
}
diff --git a/apps/desktop/src/main/maker-ipc/__tests__/botSystemPrompt.test.ts b/apps/desktop/src/main/maker-ipc/__tests__/botSystemPrompt.test.ts
index ffde2e6694..e34c830deb 100644
--- a/apps/desktop/src/main/maker-ipc/__tests__/botSystemPrompt.test.ts
+++ b/apps/desktop/src/main/maker-ipc/__tests__/botSystemPrompt.test.ts
@@ -51,7 +51,8 @@ describe('稳定层:能力必须写进提示词', () => {
const stable = buildBotStableTier(main);
expect(stable).toContain('你能看、能管主人的任务');
// The prompt states the same principal boundary the host gate enforces.
- expect(stable).toContain('NEEDS_OWNER_REQUEST');
+ expect(stable).toContain('同意后继续本次调用');
+ expect(stable).not.toContain('NEEDS_OWNER_REQUEST');
expect(stable).toContain('照常走当前任务的权限档');
expect(stable).not.toContain('OWNER_TURN_REQUIRED');
expect(stable).not.toContain('TASK_OUT_OF_SCOPE');
diff --git a/apps/desktop/src/main/maker-ipc/__tests__/taskActionAuthorization.test.ts b/apps/desktop/src/main/maker-ipc/__tests__/taskActionAuthorization.test.ts
index aaada52385..9a1a76087a 100644
--- a/apps/desktop/src/main/maker-ipc/__tests__/taskActionAuthorization.test.ts
+++ b/apps/desktop/src/main/maker-ipc/__tests__/taskActionAuthorization.test.ts
@@ -1,8 +1,8 @@
/**
* Value: production tool admission + queued dispatch guards, no real account or network.
* Regression: task actions added owner consent checks after the normal runtime permission flow;
- * later (#6699) any live mode admitted a teammate's own wake-ups as if the owner had asked.
- * Rule: teammate-authority.md — the Host decides the turn's principal before the permission mode.
+ * 2026-10-29: missing owner provenance silently rejected routine_save and start_session_task.
+ * Rule: teammate-authority.md — separate source identity, account access and explicit operation risks.
* Gap: workbench tests cover visibility; SDK approval tests cannot prove Host consent.
* Minimum input: non-owner provenance + runtime change; live execution modes do not review twice.
* Tier: unit. This file isolates the process-local authorization lifetime from SQLite/IPC.
@@ -19,6 +19,7 @@ import {
bindTaskActionInput,
createTaskActionAuthorizer,
taskActionInputGuard,
+ taskActionPrincipal,
hasTaskActionAuthorization,
TASK_ACTION_TOOLS,
ORCA_TASK_ACTION_TOOLS,
@@ -289,11 +290,10 @@ function desktopFixture(kind: 'private' | 'group' | 'automatic' = 'group') {
reviewHostPermissionAction: vi.fn(async (): Promise<AutoReviewDecision> => ({ verdict: 'allow' })),
};
const getSession = vi.fn((): typeof runtime | undefined => runtime);
- const entrusted = vi.fn(async () => false);
const authorize = createDesktopTaskActionAuthorizer({
- input: () => ({ ...activeInput }), confirm, getSession, isEntrustedTask: entrusted,
+ input: () => ({ ...activeInput }), confirm, getSession,
});
- return { authorize, confirm, activeInput, caller, rows, runtime, getSession, entrusted };
+ return { authorize, confirm, activeInput, caller, rows, runtime, getSession };
}
const ownerWrites = [
['cindy_helper', 'start_session_task'],
@@ -763,17 +763,17 @@ describe('teammate turn principal', () => {
helper('set_workbench_task_responsibility', { task_id: 'owner-task', responsible: true }),
];
- // The 2026-10-22 behavior: Full Access admitted a follow-up wake-up as the owner.
- it.each(['bypassPermissions', 'auto', 'ask'])('rejects an autonomous turn acting on the owner\'s tasks under %s', async mode => {
+ // Ordinary actions retain the autonomous principal and use the existing permission mode.
+ it.each(['bypassPermissions', 'auto', 'ask'])('uses ordinary permissions without an extra provenance gate under %s', async mode => {
const h = desktopFixture('automatic');
live(h, mode);
for (const request of [...ownerTaskWrites, { ...call('create_worker'), server: 'cindy_orca' as const }]) {
const effect = vi.fn(async () => 'changed');
const result = await withToolCallAuthority(h.authorize, request, effect);
- expect(JSON.stringify(result)).toContain('NEEDS_OWNER_REQUEST');
- expect(effect).not.toHaveBeenCalled();
+ expect(result).toBe('changed');
+ expect(effect).toHaveBeenCalledTimes(1);
}
- expect(h.confirm).not.toHaveBeenCalled();
+ expect(h.confirm).not.toHaveBeenCalled(); // reversible task controls are ordinary work
});
it('keeps the teammate\'s own scope on its own initiative', async () => {
@@ -785,9 +785,7 @@ describe('teammate turn principal', () => {
expect(await admitted(helper('continue_workbench_task', { task_id: 'handed', message: 'Carry on' }))).toBe('changed');
expect(await admitted(helper('set_workbench_task_responsibility', { task_id: 'handed', responsible: false }))).toBe('changed');
expect(await admitted(helper('set_session_runtime', { model: 'self' }))).toBe('changed');
- h.entrusted.mockResolvedValue(true);
expect(await admitted(helper('set_session_runtime', { session_id: 'handed', model: 'next' }))).toBe('changed');
- expect(h.entrusted).toHaveBeenCalledWith('companion', 'handed');
h.rows.delegation = { status: 'completed', runSequence: 1, permissionSnapshotJson: '{}' };
expect(await admitted(helper('message_session_task', { task_id: 'own', message: 'Fill the gap' }))).toBe('changed');
expect(await admitted(helper('message_session_task', { task_id: 'own', answers: { q: 'a' } }))).toBe('changed');
@@ -795,18 +793,19 @@ describe('teammate turn principal', () => {
expect(await admitted(helper('send_to_session', { target_session_id: 'own-child', message: 'Fix it' }))).toBe('changed');
// Permission decisions and resuming a pause stay with the owner, even on its own task.
for (const args of [{ task_id: 'own', decision: 'approve' }, { task_id: 'own', mode: 'resume' }])
- expect(JSON.stringify(await admitted(helper('message_session_task', args)))).toContain('NEEDS_OWNER_REQUEST');
+ expect(await admitted(helper('message_session_task', args))).toBe('changed');
+ expect(h.confirm).toHaveBeenCalledTimes(2);
});
- it('continues its own Orca team from a Worker report, but cannot start a team', async () => {
+ it('uses normal permissions for Orca writes without a second team allowlist', async () => {
const h = desktopFixture('automatic');
live(h);
h.activeInput.orcaSenderSessionId = 'worker-session';
h.rows.team = { id: 'team' };
const orca = (tool: string) => ({ ...call(tool), server: 'cindy_orca' as const });
expect(await withToolCallAuthority(h.authorize, orca('send_to_worker'), async () => 'changed')).toBe('changed');
- expect(JSON.stringify(await withToolCallAuthority(h.authorize, orca('start_team'), async () => 'changed')))
- .toContain('NEEDS_OWNER_REQUEST');
+ expect(await withToolCallAuthority(h.authorize, orca('start_team'), async () => 'changed')).toBe('changed');
+ expect(h.confirm).not.toHaveBeenCalled();
});
it.each([
@@ -817,9 +816,9 @@ describe('teammate turn principal', () => {
const h = desktopFixture('automatic');
live(h);
h.runtime.getCurrentTurnOrigin = () => ({ kind: 'scheduler', scheduleId, runId: 'run' });
- const result = await withToolCallAuthority(h.authorize, ownerTaskWrites[0], async () => 'changed');
- if (entrusted) expect(result).toBe('changed');
- else expect(JSON.stringify(result)).toContain('NEEDS_OWNER_REQUEST');
+ const result = await withToolCallAuthority(h.authorize, ownerTaskWrites[0], async () => taskActionPrincipal('companion'));
+ expect(result).toBe(entrusted ? 'entrusted' : 'autonomous');
+ expect(h.confirm).not.toHaveBeenCalled();
});
it.each([true, false])('lets the IM lane requester decide (owner=%s)', async requesterIsOwner => {
@@ -833,35 +832,33 @@ describe('teammate turn principal', () => {
}));
const result = await withToolCallAuthority(h.authorize, ownerTaskWrites[0], async () => 'changed');
if (requesterIsOwner) expect(result).toBe('changed');
- else expect(JSON.stringify(result)).toContain('NEEDS_OWNER_REQUEST');
+ else expect(JSON.stringify(result)).toContain('TASK_ACTION_SOURCE_UNAUTHORIZED');
});
- // A teammate must not create or fire an owner routine on its own: the next run would be
- // entrusted, turning its own initiative into a standing grant.
+ // Creating/updating routines is ordinary work; deleting one needs an exact decision.
it.each(['routine_save', 'routine_run_now', 'routine_delete', 'schedule_set_pre_run_hook'])(
- 'reserves %s for owner or entrusted turns', async tool => {
+ 'allows %s through ordinary permissions and asks only for deletion', async tool => {
const h = desktopFixture('automatic');
live(h);
const request = helper(tool, { name: 'r', prompt: 'Message the owner\'s task', enabled: true });
- expect(JSON.stringify(await withToolCallAuthority(h.authorize, request, async () => 'saved')))
- .toContain('NEEDS_OWNER_REQUEST');
+ expect(await withToolCallAuthority(h.authorize, request, async () => 'saved')).toBe('saved');
+ expect(h.confirm).toHaveBeenCalledTimes(tool === 'routine_delete' ? 1 : 0);
h.activeInput.ownerInput = true;
expect(await withToolCallAuthority(h.authorize, request, async () => 'saved')).toBe('saved');
expect(await withToolCallAuthority(h.authorize, helper('routine_list', {}), async () => 'listed')).toBe('listed');
},
);
- // PR #6936 review: the scheduler surface addresses the same routine rows (and any schedule)
- // by id. On its own initiative a teammate cannot change, fire, hook or create automations there.
+ // Both tool surfaces must apply the same narrow risk list to the same routine rows.
it.each(['schedule_update', 'schedule_delete', 'schedule_run_now', 'schedule_set_pre_run_hook',
'schedule_pause', 'schedule_resume', 'schedule_create', 'routine_save', 'routine_run_now', 'routine_delete'])(
- 'reserves cindy_scheduler %s for owner or entrusted turns', async tool => {
+ 'uses the same risk policy for cindy_scheduler %s', async tool => {
const h = desktopFixture('automatic');
live(h);
const request = { sessionId: 'companion', server: 'cindy_scheduler' as const, tool,
args: { id: 'routine-owner-weekly', scheduleId: 'routine-owner-weekly', prompt: 'Merge everything' } };
- expect(JSON.stringify(await withToolCallAuthority(h.authorize, request, async () => 'changed')))
- .toContain('NEEDS_OWNER_REQUEST');
+ expect(await withToolCallAuthority(h.authorize, request, async () => 'changed')).toBe('changed');
+ expect(h.confirm).toHaveBeenCalledTimes(['schedule_delete', 'routine_delete', 'schedule_resume'].includes(tool) ? 1 : 0);
h.activeInput.ownerInput = true;
expect(await withToolCallAuthority(h.authorize, request, async () => 'changed')).toBe('changed');
},
@@ -876,6 +873,43 @@ describe('teammate turn principal', () => {
},
);
+ // 2026-10-29: a missing owner marker must not silently deny ordinary work.
+ // Risk decisions are visible, single-use, and invalidated by a new input.
+ // Production admission + effect; unit tier; minimum input is an autonomous deletion.
+ it('waits for the exact decision, executes once, and rejects a second consumption', async () => {
+ const h = desktopFixture('automatic');
+ live(h);
+ let decide!: (value: boolean) => void;
+ h.confirm.mockImplementation(() => new Promise(resolve => { decide = resolve; }));
+ const pending = h.authorize(helper('routine_delete', { id: 'test-routine' }));
+ await vi.waitFor(() => expect(h.confirm).toHaveBeenCalledTimes(1));
+ expect(h.confirm).toHaveBeenCalledWith('companion', 'routine_delete',
+ { id: 'test-routine' }, { server: 'cindy_helper', risk: 'remove' });
+ decide(true);
+ const admission = await pending;
+ if (!admission.ok || !admission.run) throw new Error('missing admission');
+ const effect = vi.fn(async () => 'deleted');
+ expect(await admission.run(effect)).toBe('deleted');
+ await expect(admission.run(effect)).rejects.toThrow('AUTHORIZATION_EXPIRED');
+ expect(effect).toHaveBeenCalledTimes(1);
+ });
+
+ it.each(['deny', 'input-changed', 'permission-changed'] as const)(
+ 'does not execute after confirmation %s', async change => {
+ const h = desktopFixture('automatic');
+ live(h);
+ h.confirm.mockImplementation(async () => {
+ if (change === 'input-changed') h.activeInput.key = 'new-input';
+ if (change === 'permission-changed') h.activeInput.permission!.isCurrent = () => false;
+ return change !== 'deny';
+ });
+ const effect = vi.fn(async () => 'deleted');
+ const result = await withToolCallAuthority(h.authorize,
+ helper('routine_delete', { id: 'test-routine' }), effect);
+ expect(JSON.stringify(result)).toContain(change === 'deny' ? 'USER_CANCELLED' : 'AUTHORIZATION_EXPIRED');
+ expect(effect).not.toHaveBeenCalled();
+ });
+
it('keeps the owner principal through an automatic resume of the owner\'s input', async () => {
const h = desktopFixture('automatic');
live(h);
@@ -934,7 +968,7 @@ describe('independent Desktop tool invocation', () => {
const effect = vi.fn(async () => 'sent');
await withToolCallAuthority(outer.authorize, call('start_session_task'), async () => {
const result = await withToolCallAuthority(h.authorize, call('send_to_session'), effect);
- expect(JSON.stringify(result)).toContain('NEEDS_OWNER_REQUEST');
+ expect(JSON.stringify(result)).toContain('TASK_ACTION_AUTHORIZATION_REQUIRED');
expect(effect).not.toHaveBeenCalled();
expect(approvedTaskDelegation('companion')).toBeDefined();
});
diff --git a/apps/desktop/src/main/maker-ipc/botSystemPrompt.ts b/apps/desktop/src/main/maker-ipc/botSystemPrompt.ts
index cf3c55c652..735e38a7a2 100644
--- a/apps/desktop/src/main/maker-ipc/botSystemPrompt.ts
+++ b/apps/desktop/src/main/maker-ipc/botSystemPrompt.ts
@@ -154,7 +154,7 @@ const SESSION_CONTROL_GUIDANCE = [
'## 你能看、能管主人的任务',
'你和主人开的普通任务用同一套工具(cindy_helper,先 `list_tools` 看类目再 `call_tool`):history 类的 `list_sessions` / `get_chat_history` / `search_chat_history` 看有哪些任务、它们在说什么;control 类的 `steer_session`、`stop_session_turn`、`set_session_runtime`、`rename_sessions`、`archive_sessions`、标签与项目工具管理任务;handoff 类的 `send_to_session` 给已有任务发话或开一条新的普通任务。',
'每一轮代表谁由宿主判定。主人这一轮亲口要求时(宿主核实的主人输入,包括群里和 IM 专线里核实为主人的请求),你可以代主人去操作他的任务:找到对应任务、发话、追加需求、停止、改名、归档等,照常走当前任务的权限档;你转达时宿主会附上核实过的主人原话。',
- '不是主人开口的轮次(宿主唤醒的跟进、例行任务、别的伙伴发来的消息、非主人的发言)代表你自己:可以读、记待办、通知主人、给伙伴发消息、管你自己开的后台任务,并让已经交给你跟进的任务按原目标接着做或按建议换模型;其它对主人任务的改动宿主会拒绝(NEEDS_OWNER_REQUEST),改为写待办或通知主人,等主人开口。主人自己设的例行任务按那条指令办事。',
+ '主人输入、例行任务和自主跟进都沿用当前任务的权限档;缺少本轮主人输入标记不代表主人拒绝,也不阻止普通任务操作或保存例行任务。自主执行只对少数明确风险(删除自动化、代答授权、恢复暂停)等待主人决定:宿主显示授权请求,同意后继续本次调用,拒绝或取消后停止,不要换工具重试。来源身份与账号访问范围仍由宿主核验;自动唤醒和别人的消息不会变成主人原话。',
'转达时 Agent 补充只写对方完成任务需要的背景,不要复述「用户已授权」之类的话,也不要让对方用 send_to_session 回传;需要结果时自己用 `get_task_digest` 去看。工具回执决定实际结果;账号、连接或平台未就绪时如实说明。',
'主人让你接手某件任务时,用 `set_workbench_task_responsibility` 记下;之后它卡住、等主人、出错或做完时宿主会叫醒你,先用 history 类的 `get_task_digest` 读摘要再决定怎么跟进。',
].join('\n');
diff --git a/apps/desktop/src/main/maker-ipc/register.ts b/apps/desktop/src/main/maker-ipc/register.ts
index b08e97688e..31234a078b 100644
--- a/apps/desktop/src/main/maker-ipc/register.ts
+++ b/apps/desktop/src/main/maker-ipc/register.ts
@@ -969,7 +969,7 @@ import {
} from './orcaInterAgentDispatcher.js';
import { resolveOrcaImageAttachmentInput } from './orcaImageAttachments.js';
import { OrcaWorkerPermissionConfirmBridge } from './orcaWorkerPermissionConfirmBridge.js';
-import { assertTaskActionCurrent, captureTaskActionGuard, bindTaskActionInput, hasTaskActionAuthorization, taskActionInputGuard, taskActionPrincipal, settleTaskActionInput, TaskActionAuthorizationError, type TaskActionDeliveryGuard } from './taskActionAuthorization.js';
+import { assertTaskActionCurrent, captureTaskActionGuard, bindTaskActionInput, hasTaskActionAuthorization, taskActionInputGuard, taskActionPrincipal, settleTaskActionInput, TaskActionAuthorizationError, type TaskActionDeliveryGuard, type TaskActionConfirmation } from './taskActionAuthorization.js';
import {
getOrcaWorkspaceInfoReadOnly,
getOrcaWorkerDiagnosticStatusReadOnly,
@@ -3360,14 +3360,32 @@ const taskActionConfirmBridge = new OrcaWorkerPermissionConfirmBridge({
logger: log,
});
-export async function confirmTaskAction(sessionId: string, tool: string, args: unknown): Promise<boolean> {
- const result = await taskActionConfirmBridge.request(sessionId, {
- title: t('taskActionConfirmation.title'),
- description: t(tool === 'start_session_task' ? 'taskActionConfirmation.delegation' : 'taskActionConfirmation.once'),
- action: { toolName: `mcp__cindy_helper__${tool}`,
- input: args as Record<string, unknown>, confirmation: 'task_action' },
+export async function confirmTaskAction(
+ sessionId: string, tool: string, args: unknown, context?: TaskActionConfirmation,
+): Promise<boolean> {
+ const session = getMakerIfReady()?.getSession(sessionId);
+ if (!session) return false;
+ const controller = new AbortController();
+ const unsubscribe = session.onStatusChange(status => {
+ if (status !== 'active') controller.abort();
});
- return result.confirmed;
+ const request: Extract<InteractionRequest, { kind: 'permission' }> = {
+ kind: 'permission', requestId: randomUUID(),
+ title: t('taskActionConfirmation.title'),
+ description: t(context?.risk ? `taskActionConfirmation.${context.risk}` : 'taskActionConfirmation.once'),
+ toolName: `mcp__${context?.server ?? 'cindy_helper'}__${tool}`,
+ input: structuredClone(args) as Record<string, unknown>,
+ metadata: { hostOwnedConfirmation: 'task_action' },
+ };
+ try {
+ // Publish the ordinary waiting/permission lifecycle before awaiting a decision.
+ // Desktop, remote phone and IM resolve the same pending request, never a retry.
+ const result = await session.runHostInteraction(request,
+ () => requestHostInteraction(session, request, controller.signal));
+ return result.kind === 'permission' && result.behavior === 'allow';
+ } finally {
+ unsubscribe();
+ }
}
/**
diff --git a/apps/desktop/src/main/maker-ipc/taskActionAuthorization.ts b/apps/desktop/src/main/maker-ipc/taskActionAuthorization.ts
index b60ced7496..4c649d8dd1 100644
--- a/apps/desktop/src/main/maker-ipc/taskActionAuthorization.ts
+++ b/apps/desktop/src/main/maker-ipc/taskActionAuthorization.ts
@@ -100,13 +100,34 @@ const denied = (errorCode = 'TASK_ACTION_AUTHORIZATION_REQUIRED'): Decision => (
'The host could not admit this action for the current turn. Prepare the target, action and content for the owner instead of retrying.',
});
-/** A teammate acting on its own initiative must not act as the owner on the owner's tasks. */
-export const NEEDS_OWNER_REQUEST: Decision = {
- ok: false,
- errorCode: 'NEEDS_OWNER_REQUEST',
- message:
- 'The owner did not ask for this in the current turn (host-verified). On your own initiative you may read, keep Todos, notify the owner, message teammates, manage background tasks you started and continue tasks already handed to you; changing the owner’s other tasks needs the owner’s request. Do not retry: record a Todo or notify the owner with the concrete task, action and reason so they can ask you to do it.',
-};
+export const HELPER_AUTOMATION_ACTION_TOOLS: ReadonlySet<string> = new Set([
+ 'routine_save', 'routine_delete', 'routine_run_now', 'schedule_set_pre_run_hook',
+]);
+
+/** Side-effect coverage, not an allowlist of what autonomous teammates may do. */
+export const SCHEDULER_TASK_ACTION_TOOLS: ReadonlySet<string> = new Set([
+ 'routine_save', 'routine_delete', 'routine_run_now',
+ 'schedule_create', 'schedule_update', 'schedule_delete', 'schedule_run_now',
+ 'schedule_pause', 'schedule_resume', 'schedule_set_pre_run_hook',
+]);
+
+export type TaskActionRisk = 'remove' | 'permission' | 'resume';
+export interface TaskActionConfirmation {
+ server: string;
+ risk?: TaskActionRisk;
+}
+
+/** A small, explicit risk list. Everything else follows the task's normal permissions. */
+export function taskActionRisk(call: Pick<Call, 'server' | 'tool' | 'args'>): TaskActionRisk | undefined {
+ const args = call.args && typeof call.args === 'object' && !Array.isArray(call.args)
+ ? call.args as Record<string, unknown> : {};
+ if (call.tool === 'routine_delete' || call.tool === 'schedule_delete')
+ return 'remove';
+ if (call.tool === 'message_session_task' && args.decision !== undefined) return 'permission';
+ if ((call.tool === 'message_session_task' && args.mode === 'resume') || call.tool === 'schedule_resume')
+ return 'resume';
+ return undefined;
+}
export function taskActionFingerprint(call: Pick<Call, 'tool' | 'args'>): string {
return createHash('sha256')
@@ -122,7 +143,8 @@ export function createTaskActionAuthorizer(deps: {
return async (call) => {
const protectedAction =
call.server === 'cindy_helper'
- ? TASK_ACTION_TOOLS.has(call.tool)
+ ? TASK_ACTION_TOOLS.has(call.tool) || HELPER_AUTOMATION_ACTION_TOOLS.has(call.tool)
+ : call.server === 'cindy_scheduler' ? SCHEDULER_TASK_ACTION_TOOLS.has(call.tool)
: call.server === 'cindy_orca' && ORCA_TASK_ACTION_TOOLS.has(call.tool);
if (!protectedAction) return { ok: true };
const scope = await deps.capture(call);
diff --git a/apps/desktop/src/main/maker-ipc/taskActionHost.ts b/apps/desktop/src/main/maker-ipc/taskActionHost.ts
index a7f03339a3..9950003304 100644
--- a/apps/desktop/src/main/maker-ipc/taskActionHost.ts
+++ b/apps/desktop/src/main/maker-ipc/taskActionHost.ts
@@ -19,7 +19,8 @@ import {
isolateTaskActionAuthorizer,
createTaskActionAuthorizer,
DELEGATED_TASK_ACTIONS,
- NEEDS_OWNER_REQUEST,
+ taskActionRisk,
+ type TaskActionConfirmation,
taskActionFingerprint,
type TaskActionPrincipal,
type TaskActionScope,
@@ -52,25 +53,6 @@ export function teammateTurnPrincipal(facts: {
return 'autonomous';
}
-/**
- * Owner-created routines run as standing grants, so changing or firing one is itself an
- * owner decision: on its own initiative a teammate must not mint the grant it then runs under.
- */
-export const TEAMMATE_STANDING_GRANT_TOOLS: ReadonlySet<string> = new Set([
- 'routine_save', 'routine_delete', 'routine_run_now', 'schedule_set_pre_run_hook',
-]);
-
-/**
- * The same standing grants through the scheduler surface, which addresses any schedule
- * (including `routine-*` rows) by id and can create new automations. Reads and the
- * current run's own notify/silence stay available.
- */
-export const TEAMMATE_SCHEDULER_WRITE_TOOLS: ReadonlySet<string> = new Set([
- 'routine_save', 'routine_delete', 'routine_run_now',
- 'schedule_create', 'schedule_update', 'schedule_delete', 'schedule_run_now',
- 'schedule_pause', 'schedule_resume', 'schedule_set_pre_run_hook',
-]);
-
/** The live turn identifies a continuation, not consent. Only its existing
* permission reviewer may approve the exact action against restored user intent. */
function captureScheduledRuntime(
@@ -125,106 +107,15 @@ export function createDesktopTaskActionAuthorizer(deps: {
boundary: string;
};
getSession(sessionId: string): TaskActionSession | undefined;
- confirm(sessionId: string, tool: string, args: unknown): Promise<boolean>;
- /** The task is handed to this teammate (workbench continue scope); never inferred from args. */
- isEntrustedTask?(callerSessionId: string, taskId: string): Promise<boolean>;
+ confirm(sessionId: string, tool: string, args: unknown, context?: TaskActionConfirmation): Promise<boolean>;
}): ToolCallAuthorizer {
- /**
- * What a teammate may do on its own initiative: its own communication and background
- * tasks, tasks already handed to it, and its own Orca team. Everything else on the
- * owner's tasks needs the owner's request. Content scope stays with the permission mode.
- */
- const autonomousActionAllowed = async (
- call: Parameters<ToolCallAuthorizer>[0],
- sessionId: string,
- botId: string,
- orcaSenderSessionId: string | undefined,
- ): Promise<boolean> => {
- const db = tryGetDbClient();
- if (!db) return false;
- const args = call.args && typeof call.args === 'object' && !Array.isArray(call.args)
- ? (call.args as Record<string, unknown>) : {};
- const ownDelegation = async (column: 'id' | 'childSessionId', value: unknown) => {
- if (typeof value !== 'string' || !value) return false;
- const [row] = await db.drizzle.select({ id: botDelegations.id }).from(botDelegations)
- .where(and(eq(botDelegations[column], value), eq(botDelegations.requestingBotId, botId))).limit(1);
- return !!row;
- };
- if (call.server === 'cindy_orca') {
- if (call.tool === 'start_team' || !orcaSenderSessionId) return false;
- const [team] = await db.drizzle.select({ id: orcaTeams.id }).from(orcaTeams)
- .innerJoin(orcaWorkers, eq(orcaWorkers.teamId, orcaTeams.id))
- .where(and(eq(orcaTeams.leadSessionId, sessionId), eq(orcaTeams.status, 'active'),
- eq(orcaWorkers.sessionId, orcaSenderSessionId)))
- .limit(1);
- return !!team;
- }
- switch (call.tool) {
- case 'send_to_agent':
- return true;
- // The workbench service enforces which tasks are handed to this teammate.
- case 'continue_workbench_task':
- return true;
- case 'set_workbench_task_responsibility':
- return args.responsible === false;
- case 'message_session_task':
- // Permission decisions and resuming a pause stay with the owner.
- return args.decision === undefined && args.mode !== 'resume' && ownDelegation('id', args.task_id);
- case 'stop_session_task':
- case 'advance_session_task_route':
- return ownDelegation('id', args.task_id);
- case 'send_to_session':
- return ownDelegation('childSessionId', args.target_session_id);
- case 'set_session_runtime': {
- const target = args.session_id;
- if (target === undefined || target === sessionId) return true;
- if (await ownDelegation('childSessionId', target)) return true;
- return typeof target === 'string' && (await deps.isEntrustedTask?.(sessionId, target)) === true;
- }
- default:
- return false;
- }
- };
- /** The principal of a teammate caller's current turn; undefined for non-teammate callers. */
- const callerTeammatePrincipal = async (sessionId: string): Promise<TaskActionPrincipal | undefined> => {
- const db = tryGetDbClient();
- if (!db || isAppSessionBoundaryPending()) throw new Error('HOST_NOT_READY');
- const [caller] = await db.drizzle
- .select({ botId: botSessionLinks.botId, role: botSessionLinks.role })
- .from(botSessionLinks)
- .where(eq(botSessionLinks.sessionId, sessionId))
- .limit(1);
- if (!caller?.botId) return undefined;
- let groupOwner = false;
- if (caller.role === 'group') {
- try {
- await authorizeGroupTool(sessionId, caller.botId, 'owner-action');
- groupOwner = true;
- } catch { /* Not a verified owner request: the teammate acts on its own. */ }
- }
- const input = deps.input(sessionId);
- const live = deps.getSession(sessionId);
- const origin = live?.getCurrentTurnOrigin();
- return teammateTurnPrincipal({
- groupOwner,
- laneRequesterIsOwner: readChannelToolScope({ sessionId, sessionInstanceId: live?.instanceId })?.requesterIsOwner,
- ownerInput: input.ownerInput,
- ownerContinuation: input.ownerContinuation,
- scheduleId: origin?.kind === 'scheduler' ? origin.scheduleId : undefined,
- });
- };
return isolateTaskActionAuthorizer(async (call) => {
- if ((call.server === 'cindy_helper' && TEAMMATE_STANDING_GRANT_TOOLS.has(call.tool))
- || (call.server === 'cindy_scheduler' && TEAMMATE_SCHEDULER_WRITE_TOOLS.has(call.tool))) {
- if (!call.sessionId) return { ok: true };
- return (await callerTeammatePrincipal(call.sessionId)) === 'autonomous' ? NEEDS_OWNER_REQUEST : { ok: true };
- }
// Per invocation: a concurrent automatic call must never inherit owner evidence.
let admittedScope: TaskActionScope | null = null;
let rejectedDecision: Awaited<ReturnType<ToolCallAuthorizer>> | null = null;
const fingerprint = taskActionFingerprint(call);
const decision = await createTaskActionAuthorizer({
- confirm: deps.confirm,
+ confirm: (sessionId, tool, args) => deps.confirm(sessionId, tool, args, { server: call.server }),
capture: async (call) => {
if (!call.sessionId) throw new Error('TASK_UNAVAILABLE');
const sessionId = call.sessionId;
@@ -277,8 +168,11 @@ export function createDesktopTaskActionAuthorizer(deps: {
ownerContinuation: input.ownerContinuation,
scheduleId: origin?.kind === 'scheduler' ? origin.scheduleId : undefined,
});
- if (principal === 'autonomous' && !(await autonomousActionAllowed(call, sessionId, caller.botId, input.orcaSenderSessionId))) {
- rejectedDecision = NEEDS_OWNER_REQUEST;
+ // An authenticated external speaker is an access boundary, not an operation
+ // risk. Never turn missing source authority into a claim that the owner refused.
+ if (lane && !lane.requesterIsOwner) {
+ rejectedDecision = { ok: false, errorCode: 'TASK_ACTION_SOURCE_UNAUTHORIZED',
+ message: 'This channel speaker cannot manage the owner’s tasks. Use the owner’s private conversation.' };
return null;
}
}
@@ -437,6 +331,22 @@ export function createDesktopTaskActionAuthorizer(deps: {
assertCurrentSync();
},
};
+ // Missing owner provenance no longer disables ordinary work. Only explicit
+ // risks on autonomous turns need an exact, visible owner decision. The decision
+ // does not change the principal or grant future calls; admission stays single-use.
+ const risk = principal === 'autonomous' ? taskActionRisk(call) : undefined;
+ if (risk && runtimePermissionApplies) {
+ await scope.assertCurrent();
+ const confirmed = await deps.confirm(sessionId, call.tool, structuredClone(call.args),
+ { server: call.server, risk });
+ if (!confirmed) {
+ rejectedDecision = { ok: false, errorCode: 'USER_CANCELLED',
+ message: 'The action was not approved. Do not execute or retry it without a new request.' };
+ return null;
+ }
+ admittedScope = scope;
+ return null;
+ }
if (useRuntimePermissions) {
// Owner requests and live execution modes use the normal Agent permission flow.
// Retain delivery evidence so workbench, queues and new delegations work too.
diff --git a/apps/desktop/src/main/maker-ipc/teammateGuide.ts b/apps/desktop/src/main/maker-ipc/teammateGuide.ts
index 06a0d62e5e..3b3bb16902 100644
--- a/apps/desktop/src/main/maker-ipc/teammateGuide.ts
+++ b/apps/desktop/src/main/maker-ipc/teammateGuide.ts
@@ -29,7 +29,7 @@ export function buildTeammateGuide(
...(helperAvailable ? [
TEAMMATE_CONTROL_GUIDANCE,
'Merge reminders for the same issue using existing events and records. Notify only on an important new change; do not repeat a task’s completion reply or duplicate an existing follow-up. Automatically discovered affairs are discovered, never assigned by the user. Keep sent history intact; an expired queued input is not a retraction of an already delivered message.',
- 'Your workbench (`get_workbench`) is for observation within its existing visibility scope. Read get_task_digest and, only when needed, relevant history. On your own initiative (a host wake-up or progress check), you may continue a task handed to you toward its original goal or re-route it per suggested_route; adding requirements, stopping, archiving or changing its goal needs a request from the owner, so prepare the exact target, action and message for the owner instead. Re-read current state before acting; a long build, a paused task or an already recovered task is not a reason to intervene. Take responsibility for a task only when the owner asks you to.',
+ 'Your workbench (`get_workbench`) is for observation within its existing visibility scope. Read get_task_digest and, only when needed, relevant history. On your own initiative (a host wake-up or progress check), you may continue a task handed to you toward its original goal or re-route it per suggested_route; ordinary actions follow the current task permissions. Explicit risk actions wait for the owner through the shared permission request; do not work around a refusal. Re-read current state before acting; a long build, a paused task or an already recovered task is not a reason to intervene. Take responsibility for a task only when the owner asks you to.',
'For recurring work, first call routine_list and reuse the existing rule. Prefer an available event source, or a deterministic command/script pre-run check, over waking a model just to poll. Install and test scripts through schedule_set_pre_run_hook, then save its command as routine_save.preRunHook and read back with routine_list. Exit 2 means skip the model; exit 0 supplies a concise change summary; errors/timeouts must be nonzero failures, never fabricated no-change results. Use stable upstream event IDs or durable cursors and acknowledge only successfully handled changes; do not add arbitrary time windows or advance a cursor before delivery succeeds. For a check, explicitly set silentWhenIdle=true: no preamble, progress or no-change report. Call schedule_notify_current_run only for a new actionable result or a check failure requiring attention, then write one concise final report. Explicit reminders and scheduled sends are the work itself: set silentWhenIdle=false when creating those rules, preserve existing user choices, and never swallow their intended delivery. Omitted quiet settings preserve delivery. Advanced settings expose the saved quiet/check configuration; the user need not edit files. Preserve the standing authorization, owner and failure visibility.',
'The preloaded teammate-guide is itself your shared baseline Skill. When asked which Skills or capabilities you have, identify this shared Skill and distinguish it from optional external references returned by `get_teammate_state`. Empty references or an empty personal shelf never mean that you lack the shared teammate Skill or its operating procedures.',
'When the user wants another teammate, call `create_teammate` with a name and any identity details the user supplied. New teammates receive this same baseline and follow the user’s available default model; do not generate a fixed number of role Skills, prewrite a greeting, or require a profile form. Their personality, personal learning and memory remain independent.',
diff --git a/apps/desktop/src/main/mcp-integrations/mcp-providers.ts b/apps/desktop/src/main/mcp-integrations/mcp-providers.ts
index b44e4ecbc7..f8670ac8d0 100644
--- a/apps/desktop/src/main/mcp-integrations/mcp-providers.ts
+++ b/apps/desktop/src/main/mcp-integrations/mcp-providers.ts
@@ -87,7 +87,6 @@ import {
saveBotSkillForSession,
} from '../maker-ipc/botSkillService.js';
import {
- canBotContinueWorkbenchTask,
captureBotCreatedTaskResponsibility,
runBotWorkbenchTool,
runBotProjectsTool,
@@ -312,7 +311,6 @@ export function createDesktopMcpProviders(deps: DesktopMcpProvidersDeps): LiziMc
isScopeCurrent: (db) => !isAppSessionBoundaryPending() && db === tryGetDbClient(),
authorizeAction: createDesktopTaskActionAuthorizer({
input: getTaskActionInputState, getSession: getTaskActionSession, confirm: confirmTaskAction,
- isEntrustedTask: canBotContinueWorkbenchTask,
}),
});
// Companion history uses the same account scope as ordinary task history.
diff --git a/apps/desktop/src/renderer/i18n/locales/en/common.json b/apps/desktop/src/renderer/i18n/locales/en/common.json
index cb6cf20d8d..d10adeda1e 100644
--- a/apps/desktop/src/renderer/i18n/locales/en/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/en/common.json
@@ -113,7 +113,9 @@
"taskActionConfirmation": {
"title": "Confirm session action",
"once": "Review the target, action and full content below. Allow applies to this action once.",
- "delegation": "Review this independent session’s objective and settings. Allow starts it and permits messages and stopping within this delegation until it ends. Answering questions, resuming a pause or changing models still requires a separate confirmation."
+ "remove": "This deletes automation. Review the target; approval applies only once.",
+ "permission": "This answers a permission request in another task on your behalf. Review the action; approval applies only once.",
+ "resume": "This resumes paused execution. Review the target; approval applies only once."
},
"logSupport": {
"title": "Logs and Feedback",
diff --git a/apps/desktop/src/renderer/i18n/locales/ja/common.json b/apps/desktop/src/renderer/i18n/locales/ja/common.json
index cda1317a8b..5bd2876497 100644
--- a/apps/desktop/src/renderer/i18n/locales/ja/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/ja/common.json
@@ -113,7 +113,9 @@
"taskActionConfirmation": {
"title": "セッション操作の確認",
"once": "以下の対象、操作、全文を確認してください。許可は今回の操作にのみ適用されます。",
- "delegation": "独立セッションの目的と設定を確認してください。許可すると開始し、この委任が終了するまで範囲内のメッセージ送信と停止が可能になります。代理回答、一時停止の解除、モデル変更は別途確認が必要です。"
+ "remove": "自動化を削除します。対象を確認してください。許可は今回のみ有効です。",
+ "permission": "別のタスクの権限リクエストに、あなたに代わって回答します。操作を確認してください。許可は今回のみ有効です。",
+ "resume": "一時停止中の実行を再開します。対象を確認してください。許可は今回のみ有効です。"
},
"logSupport": {
"title": "ログとフィードバック",
diff --git a/apps/desktop/src/renderer/i18n/locales/ko/common.json b/apps/desktop/src/renderer/i18n/locales/ko/common.json
index 37e48bac80..32de16acc2 100644
--- a/apps/desktop/src/renderer/i18n/locales/ko/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/ko/common.json
@@ -113,7 +113,9 @@
"taskActionConfirmation": {
"title": "세션 작업 확인",
"once": "아래 대상, 작업과 전체 내용을 확인하세요. 허용은 이번 작업에 한 번만 적용됩니다.",
- "delegation": "독립 세션의 목표와 설정을 확인하세요. 허용하면 세션을 시작하고 위임이 끝날 때까지 범위 내 메시지 전송과 중지가 가능합니다. 대신 답변하기, 일시 정지 해제와 모델 변경은 별도 확인이 필요합니다."
+ "remove": "자동화를 삭제합니다. 대상을 확인하세요. 허용은 이번 작업에만 적용됩니다.",
+ "permission": "다른 작업의 권한 요청에 사용자를 대신해 답합니다. 내용을 확인하세요. 허용은 이번 작업에만 적용됩니다.",
+ "resume": "일시 중지된 실행을 재개합니다. 대상을 확인하세요. 허용은 이번 작업에만 적용됩니다."
},
"logSupport": {
"title": "로그 및 피드백",
diff --git a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
index e0f8bed78e..df7082d1e9 100644
--- a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
@@ -113,7 +113,9 @@
"taskActionConfirmation": {
"title": "确认任务操作",
"once": "请核对下面的目标、动作和完整内容。允许仅对本次操作生效。",
- "delegation": "请核对独立任务的目标和设置。允许后将启动任务,并可在本次委托结束前发送范围内的消息或停止任务。代答、恢复暂停和切换模型仍需单独确认。"
+ "remove": "这会删除自动化。请核对目标,仅允许这一次。",
+ "permission": "这会代你回答另一个任务的授权请求。请核对操作,仅允许这一次。",
+ "resume": "这会恢复已暂停的执行。请核对目标,仅允许这一次。"
},
"logSupport": {
"title": "日志与反馈",
diff --git a/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json b/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json
index 7347b832c8..4b7c3a8e4b 100644
--- a/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json
@@ -113,7 +113,9 @@
"taskActionConfirmation": {
"title": "確認任務操作",
"once": "請核對下方的目標、動作與完整內容。允許僅對本次操作生效。",
- "delegation": "請核對獨立任務的目標與設定。允許後將啟動任務,並可在本次委託結束前傳送範圍內的訊息或停止任務。代答、恢復暫停與切換模型仍需另行確認。"
+ "remove": "這會刪除自動化。請核對目標,僅允許這一次。",
+ "permission": "這會代你回答另一個任務的授權請求。請核對操作,僅允許這一次。",
+ "resume": "這會恢復已暫停的執行。請核對目標,僅允許這一次。"
},
"logSupport": {
"title": "日誌與回饋",
diff --git a/docs/product-rules/agent-user-parity.md b/docs/product-rules/agent-user-parity.md
index 01e90acb09..f5c6d91b14 100644
--- a/docs/product-rules/agent-user-parity.md
+++ b/docs/product-rules/agent-user-parity.md
@@ -132,9 +132,10 @@ Session 识别定时轮次,并对准确工具、目标和正文调用
Ask 或审核要求确认时复用现有确认入口;Plan 不允许副作用。来源标签本身不提供授权。
审核到执行及延迟投递均保留账号、实例、权限/Plan 代次与输入边界校验,
不得借定时工作扩大原授权范围。
-2026-10-23 修订:调用方是伙伴时,下文的权限档只审风险;宿主先按
-[伙伴代表谁](teammate-authority.md) 判定本轮是主人代办、受托还是自主,自主轮不能以主人身份
-操作主人的其它任务。普通任务、Orca 普通 Lead 与普通定时任务不受影响。
+2026-10-29 修订:伙伴的来源记录与访问权限、操作风险分开。移除自主工具白名单与
+例行任务的静默 `NEEDS_OWNER_REQUEST`;普通操作沿用任务权限,仅对自主删除自动化、
+代答授权、恢复暂停等明确风险显示可操作的一次性授权请求与等待状态。
+确认、拒绝与取消共用桌面/手机原交互通道。见 [伙伴操作权限](teammate-authority.md)。
2026-10-22 修订:伙伴、转入消息与定时跟进的任务操作
统一沿用普通任务权限流程:Full Access 免审、Auto 使用原有自动审核、Ask 使用原有确认。
helper 任务写工具与 Orca 协作写工具均逐次进入该流程,不能借可信 server 静默跳过;Orca 只读查询保持免审。
diff --git a/docs/product-rules/bot-routines.md b/docs/product-rules/bot-routines.md
index 3930de18f1..f996c0c83c 100644
--- a/docs/product-rules/bot-routines.md
+++ b/docs/product-rules/bot-routines.md
@@ -147,10 +147,10 @@ const receipt = await cindy.routines.request({
旧版带的 2 小时间隔条件在下一次 ensure 时被对齐掉。`silentWhenIdle` 开启,
这一轮的回复不自动发给主人,要主人知道的事显式通知。
- 指令由宿主模板生成(`apps/desktop/src/main/bot-autonomy/followUpPrompt.ts`),伙伴与主人都不能编辑。
- v6 正文改为宿主口吻(不冒用主人第一人称):「主人开启了自动跟进;这一轮由宿主的任务事件唤醒,不是主人刚说的话。看看这些任务做得怎么样,有需要主人回复或决策的,给出你的判断和建议。已经交给你跟进的任务,可以让它按原来的目标接着做,或按摘要建议换模型;追加要求、停止、归档、改目标等其它改动,写进待办或通知主人,等主人开口。没有新情况就不用提醒。」
+ v7 正文改为宿主口吻(不冒用主人第一人称):「主人开启了自动跟进;这一轮由宿主的任务事件唤醒,不是主人刚说的话。看看这些任务做得怎么样,有需要主人回复或决策的,给出你的判断和建议。已经交给你跟进的任务,可以让它按原来的目标接着做,或按摘要建议换模型;普通操作沿用当前任务权限;删除自动化、代答授权或恢复暂停等风险操作由宿主显示授权请求,等待主人决定,拒绝后不要重试。没有新情况就不用提醒。」
升级仍由 `ensureBuiltin` 对齐模板并保留 `enabled=false`;不创建行动授权,也不迁移 follower 为执行委托。
内置例行任务的轮次是「自主」身份:可观察、提醒、写待办,并让已交给它跟进的任务按原目标继续或按建议换模型;
- 追加要求、代答权限、停止等需要主人开口。主人自己设的例行任务是「受托」,按其指令办事。
+ 普通工作沿用当前权限,少数明确风险通过可见授权交给主人判断。主人自己设的例行任务是「受托」,按其指令办事。
正本见 [伙伴代表谁](teammate-authority.md)。
- 宿主在例行任务引擎每次启动、伙伴新建(资料广播后立即重读归属)与恢复时幂等 ensure,事件发布前也先确认跟进者的规则已落地
(否则首次安装时的早期事件会被记下回执却没人接收):不存在就建;指令、触发条件或模板版本(`builtinVersion`,随
diff --git a/docs/product-rules/cindy-bots-runtime.md b/docs/product-rules/cindy-bots-runtime.md
index d26a585fed..1df67b12c4 100644
--- a/docs/product-rules/cindy-bots-runtime.md
+++ b/docs/product-rules/cindy-bots-runtime.md
@@ -595,7 +595,7 @@ SSH Codex 不提供这项本机原生能力,目录如实标为不可用。
恢复后只生效一次,取消优先撤销暂存回答。恢复依据宿主实际应用回执清理等待状态,
已应用的回答不再通知发起伙伴;确实未答的交互仍重新通知。渠道卡片的回答状态不表示引擎已恢复。
这些模式都只作用于调用伙伴拥有的后台任务。本机伙伴主任务另外拿到和普通任务同一套通用 Session
- 工具,沿用当前 Agent 的权限档,见 6.4;任务写工具先按 [伙伴代表谁](teammate-authority.md) 判定身份。
+ 工具,沿用当前 Agent 的权限档,见 6.4;任务写工具按 [伙伴操作权限](teammate-authority.md) 分开核验来源、访问范围和操作风险。
主人通过工作台交给伙伴的项目里的原有任务,另走 6.3 的工作台工具,不经过这些后台任务入口。
伙伴可以登记、列出、重命名和隐藏账号项目,也可以把已有的非伙伴任务移入或移出项目。
移动任务先用 `list_sessions` 找到 session id,再走普通任务的移动规则;SSH 任务仍受该传输的能力范围约束。
@@ -960,9 +960,9 @@ Host 在直接工具和渐进调用共用的执行入口核验身份与执行范
不因此获得主人权限;`GROUP_AUTHORIZATION_UNAVAILABLE` 也不能视为主人输入。
2026-10-22 修订:所有实时执行权限档覆盖伙伴任务操作;Full Access 免审、Auto 使用原有自动审核、
Ask 使用原有确认,不再因转入、自动唤醒或主人输入标记缺失追加行动同意判定。
-2026-10-23 修订:权限档只审风险。伙伴调用方先由宿主判定本轮代表谁(主人代办 / 受托 / 自主),
-自主轮只能动自己的东西和已交给它跟进的任务,其它返回 `NEEDS_OWNER_REQUEST`,不弹卡;
-正本见 [伙伴代表谁](teammate-authority.md),本节与它冲突时以它为准。
+2026-10-29 修订:删除自主工具白名单与静默拒绝。来源只决定原话归属,普通工作沿用现有权限。
+自主删除自动化、代答授权、恢复暂停进入普通授权交互,等待状态与操作卡在桌面、手机可见,
+同意后继续当前调用,拒绝后停止;正本见 [伙伴操作权限](teammate-authority.md)。
helper 与 Orca 的写操作均使用同一逐次审批策略;Orca 的只读操作仍沿用可信查询策略。
权限只读运行中任务的稳定状态;从 Host 接收调用并捕获快照起,权限切换、计划模式、实例变化
使该调用的执行与排队投递失效。Agent 审批结束到进入 Host 之前的交接窗口沿用普通任务语义,
@@ -1049,7 +1049,7 @@ Todo 在桌面与手机都只在伙伴近况(6.3.4)里展示,两端共享
不强制升级已有权限档,也不新增伙伴来源分档。宿主继续检查真实调用任务、当前账号、实例代次、
目标状态、队列归属及业务对象归属;这些是操作正确性,不是伙伴专属工具权限。
- 非主人触发(宿主唤醒、其他伙伴、群成员、IM 外人)不降权限档,但在任务写工具上先按
- [伙伴代表谁](teammate-authority.md) 判定身份:自主轮不能以主人身份操作主人的其它任务。
+ [伙伴操作权限](teammate-authority.md) 核验真实访问范围;自主普通操作不因缺少主人输入标记而拒绝。
命令行、文件与其它 MCP 工具仍只按权限档处理,本次不悄悄改权限档。
- 归档不等于停止运行,已在运行的轮次归档后仍可调用通用工具;共享入口拒绝已删除或不存在的
调用任务,具体操作的目标状态要求保持原样。
diff --git a/docs/product-rules/teammate-authority.md b/docs/product-rules/teammate-authority.md
index 6a9dd7db3c..bab2c332b1 100644
--- a/docs/product-rules/teammate-authority.md
+++ b/docs/product-rules/teammate-authority.md
@@ -1,54 +1,40 @@
-# 伙伴代表谁:主人代办、受托与自主
+# 伙伴的来源与操作权限
-2026-10-23 裁决,取代 2026-10-19 至 2026-10-22 之间几次互相翻转的「行动授权」说法。
-范围只到伙伴:调用方是伙伴任务(主任务、群专线、IM 专线、私聊话题等带伙伴关联的任务)时适用;
-普通任务、Orca 普通 Lead / Worker、普通定时任务与共享任务的放行逻辑不变。
+2026-10-29 用户裁决:普通工作默认沿用任务权限,只拦少数明确风险;受阻时必须显示可操作的授权请求,不能静默拒绝,也不能逐入口增加放行例外。
+本条取代 2026-10-23 的自主工具白名单和 `NEEDS_OWNER_REQUEST` 规则。
-## 一条规则
+## 三件事分开
-伙伴每次调用任务写工具,宿主**先判这一轮代表谁,再交给权限档审风险**。两件事分开:
+1. **访问边界**:账号归属、共享访客、插件范围、群与 IM 的真实发言人仍由宿主核验。
+ 非主人渠道发言不能借授权卡获得主人账号操作权。验证失败说明来源或连接问题,不能说成主人拒绝。
+2. **请求来源**:`owner`、`entrusted`、`autonomous` 只记录主人输入、常驻指令或自主触发。
+ 缺少主人输入标记不会使普通任务操作失效,也不伪造 `ownerVerified`;应用更新等本人专属入口不变。
+3. **操作风险**:普通任务控制、新建任务、模型选择、保存或修改例行任务等沿用当前任务权限。
+ Full Access 免普通风险审核,Auto 使用原意图审核,Ask 请用户决定;Plan 不执行副作用。
+ helper / scheduler 两个工具面与直接/渐进调用使用同一判据。
-1. **身份**:由宿主按输入来源确定,不看模型怎么说,也不看工具参数。
-2. **风险**:身份放行后照常走当前任务的权限档——Full Access 免审,Auto 由 AI 审,Ask 请主人确认。
- 不另加确认卡。
+## 少数明确风险
-以前用同一个开关同时回答「谁的意思」和「风险多大」:10-20 的版本让主人那一轮还要多弹一张卡,
-10-22 的版本为了不重复弹卡把身份判断整个拿掉,自动唤醒在 Full Access 下等同主人本人。
+自主触发时只额外确认下列操作,不通过目标是否“自己的任务”逐项放行:
-## 三种身份
-
-| 身份 | 宿主依据 | 能做什么 |
-| --- | --- | --- |
-| 主人代办 | 本轮是主人亲手输入(含同账号手机 / 另一台电脑);群里经 Chat Server 实时核验为主人;IM 专线逐轮租约的 `requesterIsOwner`;主人这一轮被自动续跑或零输出重试;当前已接受输入携带宿主核实的主人原话回执 | 像主人本人一样操作主人的任务:找到任务、发话、追加需求、停止、改名、归档、开后台任务等 |
-| 受托 | 主人自己设的例行任务(含导入的自动化);伙伴自己当 Lead 时收到本团队 Worker 的回报 | 按那条常驻指令或那个团队办事;Auto 审核以例行任务的指令为意图 |
-| 自主 | 其它一切:宿主唤醒的跟进与查待办、没有主人请求凭证的伙伴来信、群成员 / IM 外人、无法核实的转入 | 只动自己的东西,见下表 |
-
-IM 专线有逐轮租约时以租约为准,桌面看起来像主人的输入不能覆盖它。群专线没有实时主人核验时,
-写工具照旧直接失败。
-
-## 自主身份能做的事
-
-| 工具 | 条件 |
+| 风险 | 实际入口 |
| --- | --- |
-| `send_to_agent` | 伙伴之间通话,防循环沿用现有上限 |
-| `continue_workbench_task` | 目标必须已交给它跟进(工作台服务按接手、总调度和「别的伙伴开的任务」规则判定);用来按原目标接着做,不借它追加新要求 |
-| `set_session_runtime` | 自己的任务、自己开的后台任务,或已交给它跟进的任务(按摘要建议换模型) |
-| `message_session_task` / `stop_session_task` / `advance_session_task_route` | 只限自己开的后台任务;不能替主人回答权限请求(`decision`),也不能恢复暂停(`mode=resume`) |
-| `send_to_session` | 只限发给自己开的后台任务 |
-| `set_workbench_task_responsibility` | 只能解除;接手需要主人开口 |
-| Orca 写工具 | 只限自己当 Lead 的现有团队,且本轮来自该团队的 Worker;不能新开团队 |
+| 删除自动化 | `routine_delete`、`schedule_delete` |
+| 代用户回答权限请求 | `message_session_task` 携带 `decision` |
+| 恢复暂停执行 | `message_session_task(mode=resume)`、`schedule_resume` |
-例行任务与定时任务的写操作只在主人代办或受托轮里可用:主人设的例行任务会以受托身份运行,伙伴不能在
-自主轮里自己造出或改写这份授权。覆盖两个工具面:`cindy_helper` 的 `routine_save` / `routine_delete` /
-`routine_run_now` / `schedule_set_pre_run_hook`,以及按 id 直达任意定时任务(含 `routine-*`)的
-`cindy_scheduler` 写工具(新建、修改、删除、立即运行、暂停、恢复、安装前置脚本,及其 `routine_*` 写工具)。
-读取类与本轮自身的 `schedule_notify_current_run` / `schedule_silence_current_run` 不受限。
+其余操作不命中风险表就继续现有权限流程。新增普通工具不需要另开“自主解锁”例外。
+主人输入、已核实的主人转达和受托指令沿正常权限审核,不再加第二张行动确认卡。
+风险表不是平台权限、账号访问或消息来源认证的替代品。
-其它对主人任务的写操作返回 `NEEDS_OWNER_REQUEST`,不弹卡。伙伴应改为写待办或通知主人,
-写清目标、动作和理由;主人在近况里点那条待办、说一句话,就成为主人代办轮。
+## 等待、决定与恢复
-已知边界:宿主只能确定性地限定**目标**。「按原目标接着做」还是「追加新要求」属于消息内容,
-Auto 档由审核器结合例行任务指令判断,Full Access 不审,靠伙伴指引约束。
+- 风险确认进入普通 `Session.runHostInteraction` 和 `requestHostInteraction`,发布等待授权状态,
+ 桌面、同账号手机/远控与已绑定 IM 共用同一请求。卡片说明目标、动作和本次影响,只允许这一次。
+- 执行调用等待决定;允许后在原调用继续,无需 Agent 重发。同一次放行只能消费一次。
+- 拒绝、取消、停止或任务关闭不执行;晚到回答不恢复旧操作。断线重连读取既有待处理请求,不重新派发操作。
+- 同意到执行及延迟投递仍校验账号、实例、输入、权限与 Plan 代次;变更使旧放行失效。
+- 来源判定与操作决定分别保留。获准自主操作不会给后续转达生成主人原话凭证。
## 转达主人原话(请求来源)
@@ -84,7 +70,7 @@ Auto 档由审核器结合例行任务指令判断,Full Access 不审,靠伙
## 实现入口
- 身份判定与自主范围:`apps/desktop/src/main/maker-ipc/taskActionHost.ts`
- (`teammateTurnPrincipal`、`autonomousActionAllowed`);回执用的身份经
+ (`teammateTurnPrincipal`);明确风险表在 `taskActionAuthorization.ts` 的 `taskActionRisk`;回执用的身份经
`taskActionAuthorization.ts` 的 `taskActionPrincipal` 读取。
- 主人输入与自动续跑:`agent-input-coordinator.ts` 的 `isActiveInputOwnerAuthored` /
`isActiveInputOwnerContinuation`。
diff --git a/packages/lizi-mcps/src/xdt-helper/bot_capabilities.ts b/packages/lizi-mcps/src/xdt-helper/bot_capabilities.ts
index a8a3afb676..96202e3ce3 100644
--- a/packages/lizi-mcps/src/xdt-helper/bot_capabilities.ts
+++ b/packages/lizi-mcps/src/xdt-helper/bot_capabilities.ts
@@ -77,7 +77,7 @@ export const TEAMMATE_CONTROL_GUIDANCE = [
'For project work, set working_dir to the actual project and use_worktree=true for isolation before starting. check_session_task returns the registered directory. Shell cd/worktree creation does not relocate a Session. timeout_ms defaults to 30 minutes and supports up to 24 hours at creation; terminal follow-up inherits the original budget. Do not claim an existing deadline was extended without a verified host response.',
'message_session_task returns queued_message_id for queued or steered input. check_session_task exposes only your own queue; optionally query queued_message_id for queued/consuming/dispatched/not-found/unavailable; queue restore errors preserve task results and cannot prove a message is missing. Dispatched means accepted into host history, not proof of model action. Use mode=edit with message or mode=withdraw for your own unconsumed item; consuming input cannot be edited or withdrawn.',
'Control your own background tasks with `message_session_task` (mode=queue by default, mode=steer for same-turn input, mode=resume for a reversible pause) and `stop_session_task` (mode=cancel by default, request-stop for a graceful stop request, pause to hold execution and queued input). General control tools are not part of the teammate toolset. After an execution ends, inspect_session_task_route and advance_session_task_route let you decide whether to use the next already-configured model route; switching alone does not retry or replay any work. A successful queue receipt is not a steer, and pausing/requested/unconfirmed is not proof the engine stopped. Check the returned control state; unsupported engines fail explicitly. Pause preserves the same task and Session, holds timers and automatic input, and resumes without replaying completed work. If paused, resume without a message before answering a pending interaction. Only tasks owned by your teammate are controllable.',
- 'The host decides whom each turn speaks for. When the owner asked in this turn (typed it, or the host verified an owner request in a group or IM lane), act for the owner on their tasks under the task\'s ordinary permissions; the host attaches the owner\'s verified words when you relay them. An owner-created routine carries its standing instruction. Every other turn is your own initiative: host wake-ups and the built-in follow-up, teammate messages, guests, forwarded input and unavailable group verification. Then you may read, keep Todos, notify the owner, message teammates, control background tasks you started, and continue or re-route tasks already handed to you (continue_workbench_task to carry on the original goal, set_session_runtime per suggested_route). Other changes to the owner\'s tasks, and saving, deleting, running or creating routines and schedules, return NEEDS_OWNER_REQUEST: do not retry; propose the task, action and content in a Todo or notification so the owner can ask. When relaying, keep your supplement to the background the task needs; do not restate authorization or ask the task to send results back. When the host wakes you, inspect get_task_digest and report only important new facts or decisions. Check current state: long tools, pauses and recovered tasks do not need automatic nudges. Observation does not expand private-data access.',
+ 'Ordinary task operations and routine updates use the current task permissions, including autonomous and scheduled turns. Missing owner-input provenance is not an owner refusal. On autonomous turns the host asks for an exact, one-time decision only for explicit risks: deleting automation, answering permissions, and resuming paused execution. The pending permission is visible; approval continues that invocation, while rejection or cancellation stops it. Do not retry through another tool. Source identity and account access remain separate checks; automation and other speakers never become verified owner words. Relay only necessary background alongside the host-verified request, without inventing authorization. Inspect get_task_digest before intervening; a long-running, paused or already recovered task does not need automatic nudges.',
'Use `get_capabilities` for application features, and `get_capabilities` with scope `help` for where things are in the UI and how to use them. It describes the product, not a permission grant or proof that every feature is available here. Use the matching live tool to act, and verify its result before claiming success.',
].join('\n');