Repository navigation
Conversation
…s can read FIX158 (RC13B on 157): in a public room, Defty's threaded reply named a restricted task. A member and a guest read it, and both get 404 on the task itself. Defty reads with the asker's access but answers to everyone who can read the conversation. These tests reproduce the leak: a public room (member and guest read the reply through the API), a thread in a room, a private room, a group DM, a DM between two people, an agent member with its own project scope, messages, notes and wiki, and the read tools that must be refused in a shared conversation. A 1:1 DM with Defty keeps today's behaviour (that test passes). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FIX158. Defty read with the asker's access but posted to the
conversation, so a reply in a public room named a restricted task that
the member and guest reading it get 404 on.
lib/defty-audience.ts works out, once per turn, who can read the
conversation: its members and, for an unarchived public room, every
active non-guest workspace member, plus agents whose employee is
active (with the employee's project scope). Defty never counts. A
conversation is shared when anyone but the asker reads it; a 1:1 DM
with Defty is unchanged. An unknown conversation id fails closed.
In a shared conversation:
- executeToolCall runs only SHARED_CONVERSATION_TOOLS. Every other tool
is refused with SHARED_CONVERSATION_READ_UNAVAILABLE ("ask me in a
direct message"), so an unchecked tool fails closed.
- The one task-read gate (taskReadConditions, every task row, title and
count) adds "every reader can see this task" under task-visibility.ts.
Projects follow agent scopes. Messages come only from rooms every
reader can read. Notes, canvases and wiki pages (tools and the
runner's automatic lookup) are checked per reader. Member match lists
are dropped. Wiki source citations are dropped.
- The room context pack resolves task keys only for tasks every reader
sees. Earlier replies are read without run details. Durable Module
results stay out. Approval and draft-compiler text names only tasks
every reader sees.
- A held read that left something out sets `withheld`, and the reply
ends with "Some items were left out because not everyone here can see
them."
Tests: defty-shared-audience-db covers a public room (a member and a
guest read the reply through the API), a thread, a private room, a
group DM, a DM between two people, a 1:1 DM (unchanged), an agent
member with and without a project scope (paused agents don't count),
messages, notes, wiki and refused tools. Three tests updated to the
new rule: W1-b wiki in a shared public room, durable results in a
public room, and two module tests now using a real DM.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rsation answers Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… Defty tool wrapper FP-004, FP-028 and FP-029 (js/insufficient-password-hash, all reviewed false positives) keep their sinks and hashed inputs. Their flow fingerprints changed only because the authenticator-object taint path now passes through the new executeToolCall wrapper in agent-context.ts. Checked against raw CodeQL run 46048903117 on 72c342b: the gate passes 29/29. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ders From the gpt-6.1-sol and Opus reviews of #629: - wiki_suggest_update no longer runs in a shared conversation: it looks a page up by slug with no visibility check and names it (both). - Room readability for the readers now uses its own aliases (roomReadableBySql). readableSpaceSql's inner spaces shadowed the outer row in the search_messages room lookup, so private rooms the asker reads were listed in SPACE_AMBIGUOUS matches (both). - The action compiler offers only projects inside every agent reader's scope, and drops a default room project outside it (gpt-6.1-sol). - The left-out line also comes from the automatic wiki lookup, the room context pack's task keys and the approval text's tasks (both). - The runner holds the canonical Defty system employee's runs too (answersAsDefty, now in defty-audience.ts) (both). - An agent is a reader through its active employee, whatever its org_members row says, and every active employee reads every public room, as MCP lets it (Opus). - In a shared conversation a post_message target is chosen from rooms the asker can read, and a "several rooms match" warning names only rooms every reader can read (Opus; pre-existing). Five regression tests, each failing before this commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In a public room the owner asked "@defty summarize Launch pilot", and Defty's threaded reply named a restricted task. A member and a guest read that reply, and both get 404 on the task itself. Defty read with the asker's access, but answered to everyone who can read the conversation. That contradicts the site's "agents use only the records their identity is allowed to see". Found live on 157 (RC13B).
Now, in any conversation someone other than the asker can read, Defty uses only records every reader can see. That covers rooms, threads, group DMs and DMs between two people. A 1:1 DM with Defty is unchanged.
Who counts as a reader (
lib/defty-audience.ts, worked out once per turn):mcp-tools/messages.ts). So a project-limited agent narrows Defty's public-room answers. A paused agent doesn't count. This fails closed (accepted by the orchestrator, 27 Nov);What changes in a shared conversation
Fail-closed allowlist.
executeToolCallruns onlySHARED_CONVERSATION_TOOLS:rememberandcreate_plan(wiki_suggest_updateis refused: it names the page it looks up).Every other tool returns
SHARED_CONVERSATION_READ_UNAVAILABLE("ask me in a direct message"). That covers team and people reports, calendar, GitHub, memory, decisions and knowledge, Modules, Apps and MCP tools.One task gate.
taskReadConditionsserves every task row, title and count inagent-context.ts. It now also requires that every reader can see the task undertask-visibility.ts. An unrestricted task is checked only against guests and agents; a restricted one against every reader.Other reads held the same way:
What goes into the answer:
post_messagetarget is chosen from rooms the asker can read, and a "several rooms match" warning names only rooms every reader can read."Left out" line. Each held read is compared with the asker's own read, whose result is never returned. The reply ends with "Some items were left out because not everyone here can see them." if they differ, or if the automatic wiki lookup, the room context pack's task keys or the approval text left something out.
Tests
defty-shared-audience-db:push-fullends with the known local stamp error):restricted-task-routes-db: "the dashboard, people directory and member detail leave out a restricted task for people it does not name"agent-run-text-audience-db: "an owner or admin cannot run a departed member's plan for them"agent-run-text-audience-db: "W2a4-B1: employee statistics return the channel error text to owners/admins only"customer-content-logs-db: "native writes, agent replies and failed writes never log customer content"guest-people-visibility-db: "GET /api/members/:id and /:id/detail: a guest reaches only people sharing a space"guest-people-visibility-db: "a guest cannot assign a hidden person, or start a conversation with a hidden agent; the agent list follows the rule"Known and left alone (scope fixed for 158):
resolvePendingActionTargetsin agent-reply.ts) still resolves task and decision ids with the asker's access. It puts no task title into the reply. A post target the asker named themselves is echoed back by name.Created with Claude Opus 5.5 in Claude Code.
🤖 Generated with Claude Code