Skip to content

Record which account made each MCP call #2414

Open

Description

@sentry-junior

Related: #2233 (shared service account), #773 (actor and instruction provenance).

An MCP plugin can use the actor's own OAuth connection or an optional shared service account. McpToolManager (chat/mcp/tool-manager.ts) picks the service account when serviceAccountProviderFactory returns one, and the actor's connection otherwise. It tracks this in serviceAccountProviders. But the tool result and the conversation events do not record which account made the call.

Why it matters: when an MCP call fails, the model cannot know whose access was used. In one real conversation a read failed with 404 object_not_found. The model first blamed "my connection", then "your connection", and both were guesses. Nothing in the evidence could settle it. The <evidence> rules from #2371 now tell the model to base a failure cause on the result, but the result does not have this fact.

Proposal:

  • Add the account kind (actor or service_account) to each MCP tool result that the model sees, and to the conversation event for the call.
  • Do not add the account email or other personal data to model-visible text.
  • Keep this provider-neutral in core, as policies/provider-boundaries.md requires.

Out of scope: the authority rules in #773. This issue only records which account was used.

via David Cramer.

--

View Session [Sentry]

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions