Install the GitHub or GitLab App once, and AI SRE can read your code. During an investigation it checks recent commits. When CI goes red, it reads the failing logs. For small fixes, it opens a PR for you to review. You never paste a token.
Metrics and logs tell you what is broken right now. "Why did it start now?" usually has its answer in a recent commit. That's why we connected the repo.
The cloud sandbox and self-hosted runners both work. Both make outbound connections only, so you open no inbound firewall ports.
Three things to ask it
Match a commit to an incident. You used to paste diffs into the chat yourself. Now you ask:
Check the commits on payment-service from the last 24 hours against the window of this morning's incident, and tell me which change is the most suspect and why.
Our RUM case study went from user error to fix only because the agent could read the repository.
Let it look first when CI fails. You used to open the logs and scroll to the failed step. Now:
CI on main is red. Read the logs of the failed step and tell me why. If it's a code problem, open a PR with the fix.
Checks and commit statuses tell it whether CI passed. Read access to Actions gives it the full log of the failed step. So it can tell you why the build failed.
Delegate small fixes. Doc updates, stale examples, and typos aren't worth breaking your focus:
Update every example that still uses the old config keys and open a PR.
The PR author is a bot account created during setup, not you. The change goes through your normal review, and a person always decides whether to merge. Fixes can touch CI config too. The token can write workflows, so code and CI changes land in one PR and get reviewed together.
Install once, no token to paste
On GitHub, you install our App in your organization and pick which repositories it can see. That's all. You don't create a Personal Access Token.
We avoided PATs on purpose. A PAT carries one person's identity. It reaches every repository that person can see, it usually lives for months, and someone has to clean it up when that person leaves. The App has none of these problems. You can connect several GitHub organizations, and each one gets its own token.

On GitLab, an administrator approves one standard OAuth request. The platform then creates a bot account. It tries a service account first, then a group token, then a project token. The bot ends up with the Developer role. gitlab.com, JiHu GitLab, and self-managed instances all work.

The platform uses the administrator's approval once, at setup. After that, the agent acts as the bot, and the audit log records its actions under the bot. Tokens rotate automatically before they expire.
The App doesn't add tools. The agent runs the same git commands as before. Those commands can now reach your repositories.
How credentials work
We mint a fresh credential each time we dispatch a command. We inject it into the git, gh, and glab tools the agent already uses. It works only for the repositories you granted. We never write it to a database, and it expires when that round of commands ends. Repositories you didn't grant are invisible to the agent.
Keep sensitive secrets behind GitHub environment protection rules. They then open only in a protected environment, and the repository owner controls that gate.
Without an App, a cloud session has no repository access. There's no hidden fallback. A self-hosted runner uses whatever credentials already exist on that host, which you control.
One GitHub quirk: a missing repository and an ungranted one both return the same 404. So if the agent says it can't see a repository, check the grant first.
Getting started
In the console, open AI SRE → Apps. Install the GitHub App or connect GitLab (gitlab.com, JiHu GitLab, and self-managed instances all work). Setup steps are in the documentation.


