Repository navigation
fix(sentry): Deny organization, project, and user deletion on egress - #3550
Merged
Merged
Conversation
Sentry egress now rejects DELETE /api/0/organizations/{org}/ and
DELETE /api/0/projects/{org}/{project}/ on every Sentry domain, before
any grant is chosen. Junior never deletes these, whatever the
credential or the Actor's role.
Co-Authored-By: David Cramer <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Member
|
add the user deletion endpoint too |
Reject DELETE /api/0/users/{user}/, including users/me, with the same
policy as organization and project deletion.
Contributor
Author
|
Done in 28c3b670: user deletion now gets the same deny as org and project deletion. |
Member
|
and fix our lint failures |
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]>
dcramer
enabled auto-merge (squash)
November 17, 2026 08:11
24 tasks done
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Junior must never delete a Sentry organization or project. Deletion can't be undone, so a person should always do it in Sentry. Today nothing stops it: a Sandbox command with a requester who has enough access could send the request.
Sentry egress now rejects these requests with an
EgressPolicyDenied(403) before a grant is chosen. The rejection holds for any credential and any Actor role. It coverssentry.io,us.sentry.ioandde.sentry.io:DELETE /api/0/organizations/{org}/DELETE /api/0/projects/{org}/{project}/These are Sentry's only org and project delete routes. Matching uses the decoded path segments, so variants that Django routes to the same endpoint are caught too. Deletes of child resources, such as project keys or issues, are not affected. The denial message says this is a Junior policy, so the agent doesn't ask for more Sentry scopes.
Object-link card resolution uses
userOAuthOnlyegress, which skips plugin grant hooks. That path is read-only host code, not Sandbox egress, so it stays as is.via @dcramer.
--
View Session [Sentry]