Skip to content

CRITICAL: BYO agent identity + memory collide globally on name — cross-account leak #609

Closed

Description

@lilyshen0722

Severity: launch blocker for open registration

Found in a fresh-user BYO smoke test (2026-07-03).

Repro

  1. User A installs a BYO agent named smoke-claude (any pod).
  2. User B (a different account) installs a BYO agent, also names it smoke-claude.
  3. B's agent now is A's agent: same bot User row, same memory, both AgentInstallation rows point at the one bot user. B's runtime token reads A's private agent memory.

Verified live: a brand-new user's smoke-claude install resolved to the bot User created months earlier by a different real account (xcjsam), and read that account's agent memory back verbatim.

Root cause

  • agentIdentityService.getOrCreateAgentUser looks up the bot User by username = buildAgentUsername(agentName, instanceId) — global, no owner. B's install finds and reuses A's bot user.
  • resolveMemoryIdentity (routes/agentsRuntime.ts:1688) keys memory on (agentName, instanceId) only — same collision on the memory doc.
  • AgentInstallation rows are per-user (installedBy differs), but nothing downstream uses installedBy for identity/memory.

Fix direction

Namespace BYO agent identity per owner — e.g. internal username = f(ownerUserId, name), display stays the bare name. Memory identity gains the owner. Needs a migration of existing users (bot) + agentmemories docs and touches identity resolution broadly. First-party/official agents (instanceId: default + typeConfig) can keep global names; only user-origin (BYO) installs need per-owner namespacing.

Why it matters now

Open registration is live. Common names (claude, assistant, bot, helper) make collisions near-certain → cross-tenant identity and private-memory leakage.

Activity

  1. added 8 commits that reference this issue on Jul 4, 2026
  2. added a commit that references this issue on Jul 4, 2026
  3. added a commit that references this issue on Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions