Skip to content

armgit / qm

Public Imported from GitHub
0

Multiplayer agent harness for work.

Prefer hand-off over admin reads and forbid invented consent in subagent tasks (#2230)

Joshua Franceaa19160b534b
diff --git a/src/core/orchestrator.ts b/src/core/orchestrator.ts
index 7e9a03a75..5bc91affd 100644
--- a/src/core/orchestrator.ts
+++ b/src/core/orchestrator.ts
@@ -2215,7 +2215,7 @@ export function createOrchestrator(deps: OrchestratorDeps): Orchestrator {
(orgMemoryWrite
? ', and for plain "remember this org-wide" requests the lighter path is `"scope":"org"` on the memory self-API (memory skill)'
: "") +
- ". You're acting as them: confirm before any mutation, and say exactly what you changed. Hard limits the API enforces: private-content reads require a DM or an Open conversation on a live admin turn (organization, personal, and conversation sharing restrictions all apply); admin grant changes and impersonation are portal-only. Open admin reads can expose private data to everyone in the conversation: retrieve and report only what the request needs." +
+ ". You're acting as them: confirm before any mutation, and say exactly what you changed. Hard limits the API enforces: private-content reads require a DM or an Open conversation on a live admin turn (organization, personal, and conversation sharing restrictions all apply); admin grant changes and impersonation are portal-only. Open admin reads can expose private data to everyone in the conversation: retrieve and report only what the request needs. Admin access to other people's private sessions, memory and files is for running and repairing the system, not a shortcut to answer questions about them: when a request needs something only another person's private context holds, use the hand-off skill even if admin access could reach it." +
" System administration is not limited to the admin dashboard. Use the admin's independently authorized infrastructure or provider access to diagnose, repair, and manage this instance, including resources owned by other users. Ordinary resource-owner restrictions do not by themselves prohibit that administrative work or require the resource owner to do it. An owner-only API denial is not a denial of separately authorized system administration; verify that authority before taking another route. Using that independently authorized access as the admin is not impersonation or circumvention. Credential grants, provider permissions, explicit restrictions (including the portal-only actions above), mutation approvals, and audience privacy still apply. Keep actions attributed to the admin; never borrow another user's identity or credentials without authorization. Follow the admin and cloud-cli skills.";
}
if (deps.signingSecret && deps.apiBaseUrl && (deps.crons || deps.webhooks || deps.monitors)) {
diff --git a/src/harness/agent-tools.ts b/src/harness/agent-tools.ts
index b45121ad4..fa5fd9e31 100644
--- a/src/harness/agent-tools.ts
+++ b/src/harness/agent-tools.ts
@@ -1542,7 +1542,7 @@ export function createAgentTools(ref: ToolContextRef, opts?: AgentToolsOptions):
name: "subagents",
label: "subagents",
description:
- "Start and coordinate subagents: background workers you spawn for a task. A subagent does not get its own sidebar entry and does not inherit this conversation, so give it a complete standalone task with the context and authorization it needs. Its final answer comes back to you as an internal message. " +
+ "Start and coordinate subagents: background workers you spawn for a task. A subagent does not get its own sidebar entry and does not inherit this conversation, so give it a complete standalone task with the context and authorization it needs. State only authorization that actually exists; never claim approval or consent nobody gave. Its final answer comes back to you as an internal message. " +
"`open` starts a subagent with `task`. `followup_task` gives an existing subagent more work in `task` and starts a turn if it is idle; active work is queued safely. " +
'`send_message` passes information to one of your subagents, a sibling subagent, or your parent (target="parent") without starting a turn; with interrupt:true it stops a subagent\'s current run. ' +
"`read` with no target lists your subagents; with a target it reads that subagent's transcript. " +
diff --git a/test/orchestrator.test.ts b/test/orchestrator.test.ts
index 6009ed113..465a63af9 100644
--- a/test/orchestrator.test.ts
+++ b/test/orchestrator.test.ts
@@ -1447,6 +1447,7 @@ test("an org admin's turn carries org-notebook write (token claim + prompt hint)
adminTurn({ text: "!sysprompt", conversation: { kind: "dm", threadRef: "dm:admin-alice:t2" } }),
);
assert.match(adminPrompt.reply ?? "", /## Acting for an org admin/);
+ assert.match(adminPrompt.reply ?? "", /use the hand-off skill even if admin access could reach it/);
assert.match(adminPrompt.reply ?? "", /System administration is not limited to the admin dashboard/);
assert.match(adminPrompt.reply ?? "", /including resources owned by other users/);
assert.match(adminPrompt.reply ?? "", /Ordinary resource-owner restrictions do not by themselves prohibit/);