Record which account made each MCP call

Aperta
#2,414 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
api, backend

Direzione di ricerca

Start with chat/mcp/tool-manager.ts to trace how serviceAccountProviders records whether a tool uses the actor connection or a service account, then follow how tool results and conversation events are assembled. Check the related issues and policies/provider-boundaries.md for constraints. Done means both the model-visible result and call event record only the account kind, without personal data, across both account paths.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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]

Lingua principale
TypeScript
Stelle
385
Fork
42
Merge medio
10h 4m
PR unite (30g)
361

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di getsentry/junior

Tutte le issue di getsentry/junior

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.