Problem Description
There is a critical workflow block and issue in the Google AI Studio GitHub integration. The platform is not allowing me to integrate with an existing repository even though the workflow allows me to grant access to specific repository. Instead, after connecting to an existing repo, I’m only able to try to create a new repo, and it fails due to permissions issues. I do not want to give AI Studio access to all repos, I want to follow the practice of least privilege and only give my AI Studio project access to the applicable GitHub repo.
When a user attempts to practice proper security hygiene by restricting the Google AI Studio GitHub App permissions to a single repository (e.g., domain.com), the integration completely breaks. The interface provides no option to link or sync to an existing repository, forcing a “New repository” creation state that inherently triggers a permission failure.
Steps Tried & Explored
-
Initial Setup: Attempted to use the Sync to GitHub feature. During the GitHub application authorization handshake, restricted access to “Only select repositories” and chose the applicable repository (e.g.,
domain.com). -
Resulting UI Lock: Upon redirection back to Google AI Studio, the interface bypassed any repository selection options and immediately dropped into a forced “Sync to GitHub” creation screen (as shown in
the attached image). -
Outcome 1 (Failure): Attempting to type a new repository name and clicking “Create GitHub repository” fails instantly with the error: “Failed to create GitHub repository, Insufficient permissions to create the GitHub repository. Please check your permissions for the AI Studio App on GitHub.”
-
Outcome 2 (Destructive Workaround Attempt): Deleted the pre-existing repository on GitHub to see if AI Studio could initialize a fresh one under the restricted scope. The API call still failed with the identical “Insufficient permissions” error because the app lacks global creation scopes.
-
Full State Reset:
-
Uninstalled the Google AI Studio App from GitHub Applications.
-
Revoked the OAuth token/key in GitHub settings.
-
Cleared browser authentication conflicts by opening a completely fresh Incognito window.
-
Re-logged into AI Studio and re-established the GitHub link under the same scoped settings.
-
Result: Returned to the exact same broken state on the creation screen with zero ability to select the authorized repository.
-
Expected Behavior
-
The Sync to GitHub interface should provide a dropdown or selection menu allowing users to link their workspace directly to an existing, pre-authorized repository. Or just work after going through the workflow, selecting and authorizing the selected repo.
-
The integration should gracefully function under a restricted GitHub App permission scope (“Only select repositories”), allowing code exports without requiring account-wide creation privileges.
