You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Set up [email protected] on company-wide services to provide default read access through the egress proxy.
Initial services raised: Notion and Linear.
PagerDuty access was requested to support on-call handoffs (who is rotating in and out); plugin availability is unverified and may warrant a child issue.
Identify any other services that can use this access.
Status update from the work in #2245. This records the agreed model and the part that is harder for regular OAuth plugins.
Model
Per-user OAuth is the default.
A plugin can have an optional shared service account (for example [email protected]). An admin connects it from the dashboard Admin page. The CLI is a fallback.
The service account lists exactly what it may use. A person's own connection always wins.
user-oauth: false turns off personal OAuth. Junior then hides everything the service account does not list.
MCP plugins that register their own OAuth client, such as Notion. Junior's server makes these MCP calls, so the tool manager enforces service-account.tools there. Linear also uses a hosted MCP server, so it should fit the same path with only a tools list.
PagerDuty already uses one deployment-level API key (PAGERDUTY_API_KEY). It does not need a service account.
Why plain OAuth plugins are harder
Plain oauth: plugins send requests through the egress proxy. For MCP, a tool name is a clear unit to allow. Egress requests have no such unit:
Only custom plugins name their grants. GitHub (user-read, user-write, installation-read, installation-write), Sentry (org-read) and Google (one grant per operation) define grants in a grantForEgress hook.
Plain oauth: plugins have no grant names. Core gives every request one grant named default. Its access is read for GET, HEAD and OPTIONS, and write for all other methods (defaultGrantForProvider in packages/junior/src/chat/sandbox/egress/credentials.ts). A grants: [default] list would allow every request.
Proposed path
Core names its built-in grants read and write, based on the HTTP method, instead of default. Then service-account: { grants: [read] } works for every OAuth plugin. Custom plugins list their own grant names. One rule covers both cases.
Pass the request's grant to the credential broker. The broker uses the service account only when the person has no token and the grant is in service-account.grants. Today CredentialBroker.issue() does not get this value. grantAccess in egress/credentialed.ts already works it out.
Add a regular OAuth connect flow to chat/credentials/service-account.ts. It uses the plugin's existing endpoints and client secret. The dashboard routes and UI do not change.
Store service-account tokens per provider. Renew them under the same lock as personal tokens.
Caveats
The HTTP method does not always match the action. GraphQL APIs and many search endpoints read with POST. A [read] service account refuses these requests. That failure is safe, but a read-only account is then almost useless for these providers. Each such provider needs a small grantForEgress hook that labels its read requests. The method also cannot catch a GET that writes, but that is rare.
Callback URLs. Regular OAuth apps do not register their own client. Each provider's OAuth app must add /api/service-accounts/<plugin>/callback as an allowed callback URL.
Closing: the named services have service accounts now (Notion #2245, Linear #2249, PagerDuty #2236). Service accounts for plain OAuth plugins aren't built; open a narrow issue if one is needed. Always-on Slack search is #1400.
Closed during a tracker cleanup. Reopen if this still matters.
Activity
feat(pagerduty): Add read-only PagerDuty plugin (#2236)
ref(plugins): Make service accounts a provider-neutral plugin concept
feat(dashboard): Connect plugin service accounts from the Admin page
feat(plugins): Add service-account-only mode
ref(plugins): Rename service-account mode to user-oauth
ref(plugins): Move service account config into an accounts block
sentry-junior commentedon Oct 27, 2026
Service-account model and the plain OAuth gap
Status update from the work in #2245. This records the agreed model and the part that is harder for regular OAuth plugins.
Model
[email protected]). An admin connects it from the dashboard Admin page. The CLI is a fallback.user-oauth: falseturns off personal OAuth. Junior then hides everything the service account does not list.What #2245 covers
MCP plugins that register their own OAuth client, such as Notion. Junior's server makes these MCP calls, so the tool manager enforces
service-account.toolsthere. Linear also uses a hosted MCP server, so it should fit the same path with only atoolslist.PagerDuty already uses one deployment-level API key (
PAGERDUTY_API_KEY). It does not need a service account.Why plain OAuth plugins are harder
Plain
oauth:plugins send requests through the egress proxy. For MCP, a tool name is a clear unit to allow. Egress requests have no such unit:user-read,user-write,installation-read,installation-write), Sentry (org-read) and Google (one grant per operation) define grants in agrantForEgresshook.oauth:plugins have no grant names. Core gives every request one grant nameddefault. Its access isreadforGET,HEADandOPTIONS, andwritefor all other methods (defaultGrantForProviderinpackages/junior/src/chat/sandbox/egress/credentials.ts). Agrants: [default]list would allow every request.Proposed path
readandwrite, based on the HTTP method, instead ofdefault. Thenservice-account: { grants: [read] }works for every OAuth plugin. Custom plugins list their own grant names. One rule covers both cases.service-account.grants. TodayCredentialBroker.issue()does not get this value.grantAccessinegress/credentialed.tsalready works it out.chat/credentials/service-account.ts. It uses the plugin's existing endpoints and client secret. The dashboard routes and UI do not change.Caveats
POST. A[read]service account refuses these requests. That failure is safe, but a read-only account is then almost useless for these providers. Each such provider needs a smallgrantForEgresshook that labels its read requests. The method also cannot catch aGETthat writes, but that is rare./api/service-accounts/<plugin>/callbackas an allowed callback URL.oauth-clientare also out of scope in feat(plugins): Add optional service accounts for plugins #2245. This is a smaller fix.Still open
feat(plugins): Add optional service accounts for plugins (#2245)
feat(linear): Allow an optional read-only service account (#2249)
sentry-junior commentedon Nov 9, 2026
Closing: the named services have service accounts now (Notion #2245, Linear #2249, PagerDuty #2236). Service accounts for plain OAuth plugins aren't built; open a narrow issue if one is needed. Always-on Slack search is #1400.
Closed during a tracker cleanup. Reopen if this still matters.