Skip to content

ref(auth): Make plugin auth implicit and turn-scoped - #210

Merged
dcramer merged 9 commits into
mainfrom
dcramer/ref/implicit-plugin-auth
Apr 17, 2026
Merged

dcramer merged 9 commits into
mainfrom
dcramer/ref/implicit-plugin-auth

Conversation

@dcramer

@dcramer dcramer commented Apr 17, 2026 •

Copy link
Copy Markdown
Member

Make plugin-backed authentication implicit and requester-bound for each turn.

This backs away from command-level auth management and credential-scoping. When a turn loads plugin skills, the runtime provisions the full provider credential set declared by those plugins for the current requester and only for that turn. OAuth starts on demand through the normal callback flow, and resumed turns re-provision credentials from their restored loaded-skill set.

That keeps the security boundary on the parts that actually matter here: credentials stay hidden from the model unless a plugin broker injects them, they are never shared across users, and they are re-issued per turn instead of living as ambient process state. Wrong-target safety now lives in provider-targeted auth-failure detection instead of token shaping. I intentionally removed the low-level auth command surface and the capability-specific or repo-specific shaping because it added policy surface and dead code without meaningful protection.

The docs and eval fixtures are updated to match that model. I also added explicit coverage around auth-pause resume behavior, including a direct checkpoint fallback test for the case where a plugin auth pause happens before new Pi messages are captured.

Fixes GH-209

Remove the explicit auth-management and credential-scope surfaces from plugin-backed skills. Provider credentials are now issued implicitly for the requesting user and only for the active turn, with callback resume handling, docs, and evals updated to match the smaller model.

Fixes GH-209

Co-Authored-By: GPT-5 <[email protected]>
@vercel

vercel Bot commented Apr 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
junior-docs Ready Ready Preview, Comment Apr 17, 2026 8:08pm

Request Review

cursor[bot]

This comment was marked as resolved.

Stop routing plugin authorization pauses through generic tool-failure logging so expected OAuth handoff does not create error noise. Remove the last command-scoped credential runtime alias and update the affected tests to match the turn-scoped auth model and subscribed-thread heuristics.

Refs GH-209
Co-Authored-By: GPT-5 <[email protected]>
cursor[bot]

This comment was marked as resolved.

Delay unlinking the stored provider token until the OAuth restart path has successfully launched. This keeps a user's existing credential in place when the reconnect flow cannot be started and adds unit coverage for both the success and failure paths.

Refs GH-209
Co-Authored-By: GPT-5 <[email protected]>
cursor[bot]

This comment was marked as resolved.

Move per-turn plugin credential provisioning out of the bash execution path and into skill activation. This keeps the implicit auth model intact while avoiding unnecessary token minting for unrelated shell commands and ensuring checkpoint-loaded skills are reprovisioned at the start of each turn.

Refs GH-209
Co-Authored-By: GPT-5 <[email protected]>
cursor[bot]

This comment was marked as resolved.

Only trigger plugin OAuth recovery when an auth-like bash failure actually targets the active provider. This avoids false reconnect flows for unrelated 401s and folds in the small follow-up cleanups to auth-pause log text and side-effect-only turn warnings.

Refs GH-209
Co-Authored-By: GPT-5 <[email protected]>
cursor[bot]

This comment was marked as resolved.

Remove the unused Sentry-specific command branch from plugin auth recovery.
The generic provider matching already covers real sentry CLI commands,
so keeping the extra special case only adds surface without adding
behavior.

Add a focused unit test to prove sentry bash commands still trigger the
same OAuth recovery path.

Refs GH-209
Co-Authored-By: GPT-5 Codex <[email protected]>
cursor[bot]

This comment was marked as resolved.

Lock the auth checkpoint fallback that reuses the latest stored
transcript when a resume pause happens before new Pi messages are
captured.

This makes the resolved Bugbot report provably non-regressing instead of
relying on code inspection alone.

Refs GH-209
Co-Authored-By: GPT-5 Codex <[email protected]>
@dcramer dcramer changed the title ref(auth): Make plugin credentials implicit per turn ref(auth): Make plugin auth implicit and turn-scoped Apr 17, 2026
Only suppress thread text when a reaction turn resolves to no outbound
text at all.

That preserves real assistant replies for turns that both acknowledge with
a reaction and return useful text, while keeping pure reaction-only turns
silent.

Refs GH-209
Co-Authored-By: GPT-5 Codex <[email protected]>
Keep the OAuth resume evals focused on the same-thread connection notice and resumed answer instead of asking the judge to infer callback-path internals.

The callback and resume mechanics are already covered by deterministic integration tests, so the eval should only score the user-visible thread behavior.

Refs GH-209
Co-Authored-By: GPT-5 Codex <[email protected]>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 9 additional findings.

Open in Devin Review

@dcramer
dcramer merged commit 00781ba into main Apr 17, 2026
13 checks passed
@dcramer
dcramer deleted the dcramer/ref/implicit-plugin-auth branch April 17, 2026 20:17
dcramer added a commit that referenced this pull request Nov 17, 2026
Sandbox egress credentials have no design doc yet, so changes have no
stated intent to check against. This PR adds
`design/sandbox-credentials.md` and lists it in the `design/README.md`
index.

The doc sets these goals:
- No real credentials in the Sandbox.
- Inject a credential only into requests that send the plugin
placeholder.
- Never replace a credential that a request already carries.
- Use the least access that works.
- Each plugin owns its own write policy.

It also sets the Sentry rules: Sandbox code cannot create releases or
uploads with the Actor's account, and cannot delete orgs or projects
(see #3550).

The intent comes from `policies/security.md`, from #210,
#381, #490 and #536, and from the comments in
`junior-github/src/egress-policy.ts`,
`chat/sandbox/noninteractive-command.ts` and
`chat/sandbox/prepare-workspace.ts`.

**Open intent questions**
- **Missing auth header:** fill one only when the plugin says its tools
send none, as git does today. Sentry stays strict. The alternative is to
never fill it.
- **Child agents:** Threads and Tasks use the parent Turn's Actor
credentials. I treated that as intended and left it out of the doc.

<!-- junior-request-attribution:start -->
via @dcramer.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3Ac9056086d12016c72d052e066ae38509 -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent%3Ac9056086d12016c72d052e066ae38509)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3Ac9056086d12016c72d052e066ae38509/?project=4510944073809921)

<!-- junior-session-footer:end -->

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: David Cramer <[email protected]>

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 41710469 Deployed Apr 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove explicit issue-credential from plugin auth

1 participant