Skip to content

feat(github): Create repositories from operator profiles - #3319

Draft
sentry-junior[bot] wants to merge 4 commits into
mainfrom
feat/github-create-repository
Draft

sentry-junior[bot] wants to merge 4 commits into
mainfrom
feat/github-create-repository

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Junior can now create GitHub organization repositories with github_createRepository. Every setting comes from an operator-owned repository profile, so each creation is predictable.

Profiles

githubPlugin({ repositoryProfiles }) defines the kinds of repositories that Junior may create. If no profiles are configured, the tool is not offered. Junior validates the profiles at startup and rejects unknown fields.

githubPlugin({
  repositoryProfiles: {
    service: {
      org: "getsentry",
      teams: ["engineering"], // optional allowlist of owning teams
      settings: {
        visibility: "private", // required
        auto_init: true,
        has_wiki: false,
        allow_merge_commit: false,
        allow_rebase_merge: false,
        allow_squash_merge: true,
        squash_merge_commit_title: "PR_TITLE",
        squash_merge_commit_message: "PR_BODY",
      },
    },
  },
});

settings uses the exact field names of POST /orgs/{org}/repos: visibility, has_issues, has_projects, has_wiki, auto_init, gitignore_template, license_template, allow_squash_merge, allow_merge_commit, allow_rebase_merge, allow_auto_merge, squash_merge_commit_title/_message, and merge_commit_title/_message. A commit message default needs its title default, as GitHub requires. Each profile has exactly one org. To use more than one org, define one profile per org.

delete_branch_on_merge is left out on purpose. GitHub documents that only an organization owner can set it to true, and an App installation token is not an org owner.

Tool input and membership

  • The input is only profile, name, team (slug), and description. The model cannot choose the org, the visibility, or any other setting.
  • Before the create, code checks the following:
    • The profile allows the team.
    • The requester has a linked GitHub login. If not, the tool returns a PluginToolInputError that asks them to connect GitHub.
    • The team exists in the org: GET /orgs/{org}/teams/{slug}.
    • The login is an active member of the team: GET /orgs/{org}/teams/{slug}/memberships/{login}. GitHub also counts members of child teams.
  • The team gets access through team_id in the create request. Junior adds no person.
  • Guardian reviews each creation, because the tool uses the default auto mode with write annotations. describeProposal names the visibility, org/name, the profile, and the team. Stronger always-confirm controls are tracked separately in Require deterministic user confirmation for tool actions #3320.

Unchanged

  • The tool is idempotent per conversationId:toolCallId. The completed result replays, and a 5xx keeps the pending state.
  • It creates org repositories only.
  • No user OAuth fallback.
  • The egress carve-out: POST /orgs/{org}/repos is allowed only with the tool's operation, whose owner must match the URL org. Sandbox gh/curl creates and POST /user/repos stay denied.

GitHub App permissions

  • Repository creation: Read and write (organization). This is new, and it needs a Security-reviewed App change before the tool works in prod. The create mints an installation token that has only repository_creation: write. This PR does not use Administration: write, which also allows deleting, transferring, and reconfiguring repositories.
  • Members: Read (organization), for the team and membership reads. The App appears to have it already: from the sandbox, GET /orgs/getsentry/teams/engineering/memberships/dcramer returned 200 through the installation read token, and GitHub reported X-Accepted-GitHub-Permissions: members=read. These reads use the existing read-only installation token. A members-only token would add no isolation, because the sandbox can already read the same endpoints.
  • To turn the tool on in prod, getsentry/junior-prod must configure repositoryProfiles.

Out of scope for v1

  • Template repositories. POST /repos/{template}/generate cannot set team_id or the repository settings in the same call. Fixing them afterwards needs Administration.
  • custom_properties. getsentry defines none today (GET /orgs/getsentry/properties/schema returns []).
  • Branch rules and rulesets, plus any other setup after the create. It is skipped for now and would need Administration.

Open questions

  • Which access level does team_id give the team at creation? GitHub's docs only say that the team "will be granted access". Would a higher level, such as maintain or admin, need a follow-up call that requires Administration? This needs a test on a real org before we depend on it.
  • Security must confirm repository_creation: write (instead of Administration) and the App permission change.
  • Behavior on installations that are limited to selected repositories is not verified.

via @dcramer.

--

View Session [Sentry]

@vercel

vercel Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 14, 2026 12:33am UTC

Request Review

@sentry-junior sentry-junior Bot changed the title feat(github): Create repositories after the user confirms each one feat(github): Add github_createRepository Nov 13, 2026
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

16 screenshot changes — 16 changed · 0 added · 0 removed

Review screenshots in Frameshift

Automation Skill Editor · Desktop
Automation Skill Editor · Desktop
Changed
Automation Skill Editor · Mobile
Automation Skill Editor · Mobile
Changed
Conversation Attachment Zoom · Desktop
Conversation Attachment Zoom · Desktop
Changed
Conversation Attachment Zoom · Mobile
Conversation Attachment Zoom · Mobile
Changed
Conversation Child Agents · Desktop
Conversation Child Agents · Desktop
Changed
Conversation Details Watched Linked Work · Desktop
Conversation Details Watched Linked Work · Desktop
Changed
Show 10 more changed screenshots
Conversation Event Log Virtual · Desktop
Conversation Event Log Virtual · Desktop
Changed
Conversation Long Transcript Touch · Mobile
Conversation Long Transcript Touch · Mobile
Changed
Conversation Object Links Light · Desktop
Conversation Object Links Light · Desktop
Changed
Conversation Question Picks And Text · Desktop
Conversation Question Picks And Text · Desktop
Changed
Conversation Share Details · Desktop
Conversation Share Details · Desktop
Changed
Conversation Task Line · Desktop
Conversation Task Line · Desktop
Changed
Conversation Text Attachment · Desktop
Conversation Text Attachment · Desktop
Changed
Conversations Sections Collapsed · Desktop
Conversations Sections Collapsed · Desktop
Changed
Person Profile · Desktop
Person Profile · Desktop
Changed
Push Notifications Tip · Desktop
Push Notifications Tip · Desktop
Changed

sentry-junior Bot and others added 4 commits November 14, 2026 00:28
Add the confirm approval mode. Core sends each confirm action to Guardian,
and allows it only when an earlier Turn asked about the exact input, a
person is the Actor, and Guardian rates their authorization high. An
Automation run denies it.

Add github_createRepository. It creates organization repositories through
host egress with an installation token that has only Repository creation:
write. Sandbox egress cannot create repositories.

Co-Authored-By: David Cramer <[email protected]>
Drop the confirm approval mode and its core support. github_createRepository
uses the default auto mode with write annotations, so Guardian reviews each
creation. Stronger always-confirm controls are tracked in #3320.

Co-Authored-By: David Cramer <[email protected]>
Repository creation now uses operator-owned repositoryProfiles. A profile
fixes the organization and the create settings. The agent picks only the
profile, the name, the owning team, and the description. Code checks that
the requester's linked GitHub account is an active member of the team, and
the team gets access through team_id. Without profiles, the tool is not
offered.

Co-Authored-By: David Cramer <[email protected]>
@dcramer

dcramer commented Nov 14, 2026

Copy link
Copy Markdown
Member

im not yet 100% sure how what i want to do here. def wanna give it the capabilities but theres a lot of nuance so holding pattern atm

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 872417b7 Deployed Nov 14, 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.

1 participant