Skip to content

Commit c6a1977

Browse files
authored
docs(ai-sre): reframe Apps page around app management + cloud-sandbox scenario (#98)
Three product-feedback refinements to the Apps page: 1. Lead with app management. The page is about managing authorized external apps (one card each); GitHub is the current sole app, presented under a "GitHub App" section, with room noted for GitLab etc. later. 2. Make the scenario explicit. New "Main scenario: letting the cloud sandbox reach your repositories" section — the sandbox carries no git credentials, which is what the App solves. BYOC generally doesn't need it (the runner host's own gh suffices). 3. Drop internal concepts. Removed the GitHub-App-vs-MCP comparison and the Safari token-minting internals (per-turn injection, gh credential helper, bash guard, 302/postMessage callback). Kept only the user-facing security properties (no credentials handed over, scoped to granted repos, least privilege).
1 parent 111e203 commit c6a1977

2 files changed

Lines changed: 87 additions & 115 deletions

File tree

en/ai-sre/apps.mdx

Lines changed: 43 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Apps
3-
description: Apps are authorized external applications in AI SRE — currently GitHub. Once authorized, the agent can work directly inside your code repositories: read code, investigate recent changes / commits / PRs, trace a PR from a change ticket, and (when you ask) fix a bug, open a PR, or file an issue. It all runs through plain gh / git, using a short-lived, repo-scoped GitHub App token issued per turn.
4-
keywords: ["AI SRE", "Apps", "GitHub App", "App", "gh", "git", "repository", "pull request", "issue", "installation token", "Customize"]
3+
description: Apps is where you manage authorized external applications in AI SRE. Each application appears as a card — currently GitHub (with room for GitLab and others later). Once authorized, AI SRE can work directly inside your code repositories: read code, investigate changes / commits / PRs, trace a PR, and (when you ask) fix a bug, open a PR, or file an issue. Its main job is to let the cloud sandbox reach your repositories safely.
4+
keywords: ["AI SRE", "Apps", "App", "GitHub", "GitHub App", "code repository", "gh", "git", "pull request", "issue", "cloud sandbox", "Customize"]
55
sidebarTitle: Apps
66
---
77

@@ -13,18 +13,19 @@ sidebarTitle: Apps
1313

1414
---
1515

16-
An **App** is an authorized external application — today there is exactly one, **GitHub**. Once you authorize a GitHub App, AI SRE can **work directly inside your GitHub repositories** during a session: understand and explore code, investigate recent changes / commits / PRs, trace a PR from a change ticket, answer questions about a codebase, and — when you ask — fix a bug, open a PR, or file an issue.
16+
**Apps** is where you manage **authorized external applications**. Each external application appears as a **card** you authorize it, manage its installations, and enable / disable or revoke it right from its card.
1717

18-
The mechanism is plain: the agent operates on your repository with native `gh` and `git` commands inside its own sandbox, using a GitHub App installation token that Safari issues **per turn** and scopes to **only the repositories you granted**. The agent never sees or types that token.
18+
Today there is exactly one app under Apps — **GitHub** (with room to add GitLab and other code-hosting platforms later). Once you authorize GitHub, AI SRE can **work directly inside your code repositories** during a session: understand and explore code, investigate recent changes / commits / PRs, trace a PR from a change ticket, answer questions about a codebase, and — when you ask — fix a bug, open a PR, or file an issue. It all runs through native `gh` / `git`, like an engineer working in a terminal.
1919

20-
<Warning>
21-
The **GitHub App** on this page and the **MCP server** that uses GitHub as an example in [MCP](/en/ai-sre/mcp) are **two different mechanisms** — don't confuse them:
20+
## Main Scenario: Letting the Cloud Sandbox Reach Your Repositories
2221

23-
- **GitHub App (this page)**: the agent runs `gh` / `git` **directly** in its sandbox against your repository — clone, `git log`, `gh pr diff`, open a PR — like an engineer working in a terminal.
24-
- **MCP server**: the agent makes **tool calls** to a hosted MCP server, and that server performs the operation and returns the result.
22+
---
2523

26-
One is "the agent runs git/gh in a shell"; the other is "the agent calls tools on a remote MCP server." This page covers only the former.
27-
</Warning>
24+
AI SRE sessions run in a **Flashduty cloud sandbox** by default. The sandbox is a clean, isolated, ephemeral environment that **carries none of your git credentials** — which is exactly what an App solves. Once you authorize the GitHub App, the agent inside the sandbox can clone your repositories, read diffs, and open PRs, **without you handing it any password or token**; its access is limited to the repositories you granted, with only the least privilege needed to do the work. **This is what the GitHub App is mainly for.**
25+
26+
<Note>
27+
**BYOC (self-hosted Runner) generally doesn't need it.** A Runner runs on your own machine, which usually **already has `gh` / `git` credentials configured** (you work with repositories on it every day). In that case the agent just uses the host's own `gh`**no GitHub App authorization needed**. (If the host happens to have no `gh` configured, authorizing the App lets BYOC sessions use it too.) For the differences between environments, see [Environments (BYOC)](/en/ai-sre/environments).
28+
</Note>
2829

2930
## Where to Find It
3031

@@ -36,46 +37,48 @@ Go to **Plugins → Apps**. Apps is the **first and default** tab in the Plugins
3637
Viewing the Apps tab requires the appropriate permission; without it, the tab is hidden. Authorizing, revoking, and enabling / disabling each require their own action permission — when you lack one, the corresponding button is shown disabled.
3738
</Note>
3839

39-
## Connecting a GitHub Organization
40+
## The GitHub App
4041

4142
---
4243

43-
Start the authorization from the GitHub card on the Apps page. The whole install completes in a popup through GitHub's official install page, and the list refreshes automatically after the callback.
44+
The following uses **GitHub**, the only app available today, to walk through authorization, installation management, and adjusting repository access.
45+
46+
### Connecting a GitHub Organization
47+
48+
Start the authorization from the GitHub card. The whole install completes in a popup through GitHub's official install page, and the list refreshes automatically after the callback.
4449

4550
<Steps>
4651
<Step title="Start the authorization">
47-
Click **Authorize** on the GitHub card (if the card already has an installation, the button reads **Connect another organization**). The backend returns the GitHub App's install URL, and the frontend opens a popup of roughly **1024 × 760**.
52+
Click **Authorize** on the GitHub card (if the App already has an installation, the button reads **Connect another organization**). The frontend opens a popup that loads GitHub's official install page.
4853
</Step>
4954
<Step title="Pick the organization and repositories on GitHub">
50-
The popup loads the GitHub App install page. Choose the **organization** (or personal account) to install into, and grant a repository scope — **All repositories** or **Only select repositories**. The set of granted repositories determines which repositories AI SRE can access afterward.
55+
Choose the **organization** (or personal account) to install into, and grant a repository scope — **All repositories** or **Only select repositories**. The set of granted repositories determines which repositories AI SRE can access afterward.
5156
</Step>
52-
<Step title="GitHub calls back, the frontend refreshes">
53-
After you confirm on GitHub, GitHub calls back to the backend; the backend 302-redirects to the frontend callback page `/ai-sre/app-callback`, which then forwards the result to the Apps tab via `postMessage` and closes the popup. On success, the Apps page shows **Authorized** and refreshes the installation list, and the new organization appears.
57+
<Step title="Auto-refresh after you confirm">
58+
After you confirm on GitHub, the popup closes automatically, the Apps page shows **Authorized** and refreshes the installation list, and the new organization appears.
5459
</Step>
5560
</Steps>
5661

5762
<Note>
5863
If you are not the owner of the organization, GitHub routes the request to the organization owner through its request-to-install approval flow; the installation activates only after approval. Which organization to install into and which repositories to grant are decided entirely on GitHub's install page — Flashduty does not select on your behalf.
5964
</Note>
6065

61-
## Managing Installations
62-
63-
---
66+
### Managing Installations
6467

6568
Each authorized organization adds one installation row under the GitHub card. Each row shows:
6669

6770
| Element | Description |
6871
|---|---|
69-
| Organization name | The GitHub organization / account login the installation lives on (`github_target`) |
70-
| Status dot | A colored dot plus a label: **Connected** (`active`), **Suspended** (`suspended`), **Revoked** (`revoked`) |
72+
| Organization name | The GitHub organization / account login the installation lives on |
73+
| Status dot | A colored dot plus a label: **Connected**, **Suspended**, **Revoked** |
7174
| Repository count | The number of repositories currently granted to this installation |
7275

7376
<AccordionGroup>
7477
<Accordion title="Enable / Disable (suspend / resume)" icon="toggle-on">
75-
The toggle in the top-right of the card switches between Enabled and Disabled, which moves the App's installations as a whole between **active ↔ suspended**. **Disable = suspend**: while suspended, no installation token is issued and the agent can no longer reach those repositories — but the **GitHub installation itself is kept**, so you can re-enable instantly with one click, without going through the GitHub authorization again. An App counts as "enabled" as long as it has at least one **Connected** installation.
78+
The toggle in the top-right of the card switches between Enabled and Disabled. **Disable = suspend**: while suspended, the agent can no longer reach those repositories — but the **GitHub installation itself is kept**, so you can re-enable instantly with one click, without going through the GitHub authorization again. An App counts as "enabled" as long as it has at least one **Connected** installation.
7679
</Accordion>
7780
<Accordion title="Revoke" icon="trash">
78-
Click **Revoke** on a row to open a confirmation dialog — "Revoke authorization for organization '…'? After revoking, AI SRE will no longer be able to access this organization's repositories. You can re-authorize at any time." On confirm, the installation is set to **Revoked** and no token is issued from then on; any cached token also expires naturally within its TTL of at most 1 hour. A revoked installation is hidden from the card; re-authorizing the same organization restores it.
81+
Click **Revoke** on a row; after you confirm, the installation is set to **Revoked** and AI SRE can no longer access that organization's repositories. A revoked installation is hidden from the card; re-authorizing the same organization restores it.
7982
</Accordion>
8083
</AccordionGroup>
8184

@@ -85,70 +88,53 @@ Each authorized organization adds one installation row under the GitHub card. Ea
8588

8689
### Adding or Adjusting Repository Access
8790

88-
The organization is already connected, but you want AI SRE to reach more of its repositories — you don't need to revoke and reconnect. In **Plugins → Apps**, click **Authorize / Connect another organization** again for that organization (or open the App's **Configure** page on GitHub directly). GitHub shows the **Repository access** screen; select the additional repositories and save. The callback takes the install callback's `setup_action=update` path, so AI SRE **re-syncs** the granted repository list automatically, and the new repositories become available without re-creating the connection.
91+
The organization is already connected, but you want AI SRE to reach more of its repositories — you don't need to revoke and reconnect. In **Plugins → Apps**, click **Authorize / Connect another organization** again for that organization (or open the App's **Configure** page on GitHub directly). GitHub shows the **Repository access** screen; select the additional repositories and save, and AI SRE **re-syncs** the granted repository list automatically the new repositories become available without re-creating the connection.
8992

9093
<Note>
91-
**Fallback**: if a newly added repository still reports "cannot access / 404 / 403" in a session, open the Flashduty App's page on GitHub (e.g. `github.com/apps/flashduty`) → **Configure** → select the organization → scroll to the **Danger zone****Uninstall**. Then return to **Plugins → Apps** in Flashduty and authorize the organization again, granting **all** the repositories you need in one pass.
94+
**Fallback**: if a newly added repository still reports "cannot access / 404 / 403" in a session, open the App's page on GitHub (e.g. `github.com/apps/flashduty`) → **Configure** → select the organization → scroll to the **Danger zone****Uninstall**. Then return to **Plugins → Apps** in Flashduty and authorize the organization again, granting **all** the repositories you need in one pass.
9295
</Note>
9396

94-
## How AI SRE Uses It
97+
## How AI SRE Works Inside a Repository
9598

9699
---
97100

98-
After authorization, you need no extra configuration. When you ask AI SRE to work on a task in a repository during a session, it does the work itself inside the sandbox — behavior governed by the built-in `github` Skill.
99-
100-
### The token: short-lived, repo-scoped, least-privilege
101-
102-
- **Issued per turn**: Safari injects a GitHub App installation token into the bash environment for each turn and wires `git` to use `gh`'s credential helper — `gh` reads the token automatically, and `git` HTTPS clone / push just work, with **nothing written** to `.git/config` or any URL. The token expires automatically at the end of the turn (cache TTL ≤ 1 hour); nothing to revoke.
103-
- **Least privilege**: the token carries only the permissions it needs — `contents` / `pull_requests` / `issues` are **write**, `metadata` is **read**.
104-
- **The agent never touches the token**: the agent never sees, types, pastes, or echoes it. Operations like `echo $GH_TOKEN`, `env`, `printenv`, or embedding the token in a URL (`https://x:TOKEN@github.com/...`) are blocked by the **bash guard**, so the token cannot leak into the transcript.
105-
- **Scope limited to granted repositories**: the token is scoped to the repositories granted at install. A `404` / `403` on an ungranted repository means "add that repository to the installation" — at which point the agent asks you to do so rather than trying to work around scope.
101+
After authorization, you need no extra configuration. When you ask AI SRE to work on a task in a repository during a session, it works like an engineer joining the project — understand first, then change, then verify. This behavior is governed by the built-in `github` Skill.
106102

107-
<Note>
108-
**Cloud sessions** use the account's GitHub App installation. If `gh auth status` reports not logged in, the account has no GitHub App installed — or it is not installed on the target repository — and the agent tells you to install the GitHub App from **Plugins → Apps** and grant the repository. It does **not** ask you for a token.
109-
110-
**BYOC sessions** are different: they use the runner host's **own `gh`** (you run `gh auth login` on the host, or set `GH_TOKEN` in the runner environment), **not** this App token. For differences between environments, see [Environments (BYOC)](/en/ai-sre/environments).
111-
</Note>
112-
113-
### Typical actions
114-
115-
The agent works like an engineer joining the project — understand first, then change, then verify:
103+
**Typical actions**
116104

117-
- **Enter the repository**: clone it into its own workspace (`gh repo clone OWNER/REPO`) and read the repo's own conventions first (`CLAUDE.md`, `AGENTS.md`, `README`, `CONTRIBUTING`).
118-
- **Investigate changes / PRs**: `git log`, `gh pr list`, `gh pr view <number>`, `gh pr diff <number>`, `gh search prs` to trace a PR named in an incident or change ticket, see what a release shipped, or read a diff before deciding anything.
105+
- **Enter the repository**: clone it into its own workspace and read the repo's own conventions first (`CLAUDE.md`, `AGENTS.md`, `README`, `CONTRIBUTING`).
106+
- **Investigate changes / PRs**: use `git log`, `gh pr list`, `gh pr view`, `gh pr diff`, `gh search prs` to trace a PR named in an incident or change ticket, see what a release shipped, or read a diff before deciding anything.
119107
- **Change and propose**: create a branch, make a minimal diff, open a reviewable PR with `gh pr create`, or file an issue with `gh issue create`, and report the PR / issue URL back to you.
120108

121-
### Hard guardrails
109+
**Hard guardrails** — the agent never crosses these:
122110

123-
The agent never crosses these:
124-
125-
- **Never force-push** (`git push --force` / `-f`).
126-
- **Never push the default branch directly** — always a branch + PR.
111+
- **Never force-push** (`git push --force`), and **never push the default branch directly** — always a branch + PR.
127112
- **One logical change per PR**, kept reviewable; if a change balloons beyond a focused diff, it stops and hands the analysis back to you.
128113
- Never delete branches, close others' issues / PRs, or change repository settings; never commit secrets, credentials, or build artifacts.
129114

115+
<Note>
116+
If the agent reports it cannot access a repository in a cloud session, it usually means the account has not authorized the GitHub App, or the target repository was not granted — just authorize and grant it under **Plugins → Apps**. The agent does **not** ask you for any token.
117+
</Note>
118+
130119
## Permissions & Scope
131120

132121
---
133122

134-
GitHub App **authorize** and **revoke** are **account-level** operations (`team_id = 0`). **The account is the only security boundary**; the team here is just an ownership / audit tag:
135-
136-
- **Who can authorize / revoke / enable / disable**: **any** account member with the corresponding action permission can authorize a new organization, revoke any installation, or enable / disable the whole App — these operations act on all installations in the account, not narrowed by team.
137-
- **Runtime token resolution is account-level too**: when a session needs a repository, the token is resolved and minted from **any connected installation in the account** (`ResolveSessionToken` does not filter by team). Members of an account share one authorization — consistent with AI SRE's "usage = account-level, ownership = team tag" model for other resources.
123+
GitHub App **authorize** and **revoke** are **account-level** operations. **The account is the only security boundary**; the team here is just an ownership / audit tag: any account member with the corresponding permission can authorize a new organization, revoke any installation, or enable / disable the whole App; when a session needs a repository, it obtains access from **any connected installation in the account**. Members of an account share one authorization — consistent with AI SRE's "usage = account-level, ownership = team tag" model for other resources.
138124

139125
## Related Pages
140126

141127
---
142128

143129
<CardGroup cols={2}>
144130
<Card title="MCP (External Tools)" icon="plug" href="/en/ai-sre/mcp">
145-
The other way to connect external capabilities: tool calls to a hosted MCP server.
131+
Connect external tools and data sources via the Model Context Protocol.
146132
</Card>
147133
<Card title="Console" icon="comments" href="/en/ai-sre/sessions">
148134
Watch the agent clone a repo, read a diff, and open a PR during a session.
149135
</Card>
150-
<Card title="BYOC" icon="server" href="/en/ai-sre/environments">
151-
BYOC sessions use the runner host's own gh, not the account's GitHub App token.
136+
<Card title="Environments (BYOC)" icon="server" href="/en/ai-sre/environments">
137+
BYOC sessions use the runner host's own gh and generally don't need the GitHub App.
152138
</Card>
153139
<Card title="Skills" icon="wrench" href="/en/ai-sre/skills">
154140
The built-in github Skill governs how the agent works inside a repository.

0 commit comments

Comments
 (0)