Skip to content

Realtime: agent.* conversation events are delivered to the project's tasks room (bypasses conversations.read and restricted-agent access) #615

Closed

Description

@praveen-livspace

Summary

services/realtime routes every agent.* event to a project's tasks room, which is joined by anyone holding tasks.read. The agent runner publishes each conversation event to that room with the full event row — including its payload (agent messages, reasoning, tool actions and observations). So a user who can read a project's tasks receives live content of every agent conversation in that project, although the REST API only lets them read conversations with conversations.read (and, for a restricted agent, an access grant).

Checked on master at 984030d (v0.19.1).

Where

  • services/realtime/src/permissions.ts, eventNamespace:
    // agent.* events are task-scoped (conversation started/finished/events) and
    // require the same tasks:read permission.
    if (type.startsWith("agent.")) return "tasks";
  • services/agent-runner/internal/handler/handler.go (~L326): PublishRealtime(ctx, projectID, conversationID, "agent."+eventType, {id, event_index, event_type, event_source, payload, created_at}, …) — the full row, so the frontend can append it directly.
  • The REST side gates the same data more tightly: conversation routes require conversations.read (router.go), conversation handlers resolve the caller's project member, and agent chat-session routes add RequireAgentAccess for restricted agents.

Impact

  • Members whose role has tasks.read but not conversations.read (e.g. a custom or viewer-style role) still receive conversation content in real time.
  • Restricted agents (AccessModeRestricted): members without an access grant still receive those conversations' events.
  • Users granted tasks.read in a project without being members (e.g. via a global * role) receive them too.

Expected

Conversation events are delivered only to users who could read the conversation through the API: conversations.read, and for restricted agents, an access grant.

Suggested fix

Add a conversations namespace gated on conversations.read (NAMESPACE_PERMISSIONS) and route agent.* there instead of tasks. Restricted agents need more than a namespace permission — e.g. publishing restricted-agent events only to per-user rooms of granted users, or a per-agent room joined after the same access check RequireAgentAccess does. Task-level signals the board needs (e.g. "a conversation started/finished on task X", without the payload) could stay on tasks.

Found while reviewing permissions in a downstream fork; happy to help test a fix.

Activity

  1. pullfrog commented on Oct 20, 2026

    @pullfrog
    Contributor
  2. self-assigned this
    on Oct 21, 2026
  3. pikann commented on Oct 21, 2026

    @pikann
    Contributor

    Thank you for bringing this to our attention! I'll look into it and push a fix soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions