Skip to content
404 linesCodeBlameRaw

Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.

Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step1/**
2 * Scopes: what an access token may do on its owner's behalf. Mirrors
3 * `crates/contracts/src/scopes.rs`, which is the source of truth; a Rust
4 * test keeps the tables here the same.
5 *
6 * A token reaches whatever its owner can reach (a workspace's token, that
7 * workspace); what a request may do is the intersection of the owner's
8 * role and the token's scopes.
9 */
10
11export type ScopeResource =
12 | "repo"
13 | "code"
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar14 | "security"
Packages, with a container registry on g1t.sh; workspaces deleted whole and kept 30 days; Members for every member15 | "packages"
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step16 | "issues"
17 | "pull_requests"
18 | "agents"
19 | "workflows"
20 | "memory"
21 | "account"
API: notifications over REST and MCP, with notifications scopes22 | "notifications"
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step23 | "workspace"
24 | "access"
25 | "webhooks"
Fast pages, required checks on the branch, self-hosted runners, honest incidents26 | "secrets"
27 | "runners";
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step28
Packages, with a container registry on g1t.sh; workspaces deleted whole and kept 30 days; Members for every member29export type ScopeLevel = "read" | "write" | "run" | "delete" | "admin";
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step30
31/** Every scope, grouped by resource, least first. */
32export const SCOPES = [
Git storage hardened, pages in tens of milliseconds, honest security alerts, and costs reconciled daily33 { scope: "repo:read", description: "See repositories, their settings, labels, timelines and security alerts, and search" },
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step34 { scope: "repo:write", description: "Create repositories, rename branches and change how pull requests merge" },
Git storage hardened, pages in tens of milliseconds, honest security alerts, and costs reconciled daily35 { scope: "repo:admin", description: "Rename, archive, transfer, delete or change who can see a repository, and dismiss security alerts" },
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step36 { scope: "code:read", description: "Clone and fetch private repositories with git" },
37 { scope: "code:write", description: "Push commits with git" },
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar38 { scope: "security:read", description: "See secret scanning, code scanning and vulnerability alerts, custom patterns, the dependency graph and SBOM, and security settings" },
39 { scope: "security:write", description: "Dismiss and reopen alerts, bypass push protection, review bypass requests, manage custom patterns, upload SARIF and change security settings" },
Packages, with a container registry on g1t.sh; workspaces deleted whole and kept 30 days; Members for every member40 { scope: "packages:read", description: "Pull container images and install private packages" },
41 { scope: "packages:write", description: "Push container images and publish packages" },
42 { scope: "packages:delete", description: "Delete packages and their versions" },
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step43 { scope: "issues:read", description: "Read issues, comments and plans" },
44 { scope: "issues:write", description: "Open, edit, close and comment on issues" },
45 { scope: "pull_requests:read", description: "Read pull requests, their changes, sessions and merge queues" },
46 { scope: "pull_requests:write", description: "Open, review, close and merge pull requests" },
47 { scope: "agents:run", description: "Put g1t agents to work and message them, which uses the workspace's money" },
48 { scope: "workflows:read", description: "Read workflows, runs and logs" },
49 { scope: "workflows:write", description: "Run, cancel, rerun and turn workflows on or off" },
50 { scope: "memory:read", description: "Recall memory and search the workspace's context" },
51 { scope: "memory:write", description: "Save memory for the next agent" },
API: pinned projects over REST and MCP52 { scope: "account:read", description: "Read your email addresses, invites, invitations and pinned projects" },
53 { scope: "account:write", description: "Change your email addresses, make invites, answer invitations and pin projects" },
API: notifications over REST and MCP, with notifications scopes54 { scope: "notifications:read", description: "See your inbox, its threads, and what you subscribe to and watch" },
55 { scope: "notifications:write", description: "Mark notifications read, done, saved or snoozed, subscribe to threads and watch repositories" },
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar56 { scope: "workspace:read", description: "Read workspace invites, integrations, model routes and teams" },
57 { scope: "workspace:admin", description: "Create and delete workspaces, invite members, connect integrations, and create, change and delete teams" },
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step58 { scope: "access:read", description: "See who has access to repositories" },
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar59 { scope: "access:admin", description: "Give and take away access to repositories, a team's included" },
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step60 { scope: "webhooks:read", description: "See webhooks and their deliveries" },
61 { scope: "webhooks:admin", description: "Create, change and delete webhooks" },
62 { scope: "secrets:read", description: "List secrets (never their values) and read variables" },
63 { scope: "secrets:admin", description: "Set and delete secrets and variables" },
Fast pages, required checks on the branch, self-hosted runners, honest incidents64 { scope: "runners:read", description: "See self-hosted runners, their groups and where agents run" },
65 { scope: "runners:admin", description: "Register and remove self-hosted runners, change their groups and settings" },
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step66] as const;
67
68export type Scope = (typeof SCOPES)[number]["scope"];
69
70/** Resources in the order settings show them, with their names for people. */
71export const SCOPE_RESOURCES: { resource: ScopeResource; label: string }[] = [
72 { resource: "repo", label: "Repositories" },
73 { resource: "code", label: "Code" },
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar74 { resource: "security", label: "Security" },
Packages, with a container registry on g1t.sh; workspaces deleted whole and kept 30 days; Members for every member75 { resource: "packages", label: "Packages" },
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step76 { resource: "issues", label: "Issues" },
77 { resource: "pull_requests", label: "Pull requests" },
78 { resource: "agents", label: "g1t agents" },
79 { resource: "workflows", label: "Workflows" },
80 { resource: "memory", label: "Memory and context" },
81 { resource: "account", label: "Your account" },
API: notifications over REST and MCP, with notifications scopes82 { resource: "notifications", label: "Notifications" },
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step83 { resource: "workspace", label: "Workspaces" },
84 { resource: "access", label: "Who has access" },
85 { resource: "webhooks", label: "Webhooks" },
86 { resource: "secrets", label: "Secrets and variables" },
Fast pages, required checks on the branch, self-hosted runners, honest incidents87 { resource: "runners", label: "Self-hosted runners" },
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step88];
89
Packages, with a container registry on g1t.sh; workspaces deleted whole and kept 30 days; Members for every member90const LEVEL_ORDER: Record<ScopeLevel, number> = { read: 0, write: 1, run: 2, delete: 3, admin: 4 };
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step91
92export function scopeResource(scope: Scope): ScopeResource {
93 return scope.split(":")[0] as ScopeResource;
94}
95
96export function scopeLevel(scope: Scope): ScopeLevel {
97 return scope.split(":")[1] as ScopeLevel;
98}
99
100export function isScope(text: string): text is Scope {
101 return SCOPES.some((row) => row.scope === text);
102}
103
104/** Changes that are hard to undo, or decide who can reach what. */
105export function isDangerous(scope: Scope): boolean {
Packages, with a container registry on g1t.sh; workspaces deleted whole and kept 30 days; Members for every member106 const level = scopeLevel(scope);
107 return level === "admin" || level === "delete";
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step108}
109
110export function describeScope(scope: Scope): string {
111 return SCOPES.find((row) => row.scope === scope)?.description ?? scope;
112}
113
114/** Whether holding `held` gives `needed`: the same resource, at its level or lower. */
115export function scopeIncludes(held: Scope, needed: Scope): boolean {
116 return (
117 scopeResource(held) === scopeResource(needed) &&
118 LEVEL_ORDER[scopeLevel(held)] >= LEVEL_ORDER[scopeLevel(needed)]
119 );
120}
121
122/** The levels a resource has, least first. */
123export function levelsOf(resource: ScopeResource): ScopeLevel[] {
124 return SCOPES.filter((row) => scopeResource(row.scope) === resource).map((row) => scopeLevel(row.scope));
125}
126
127/** Scopes from text separated by spaces or commas, in table order; unknown ones are left out. */
128export function parseScopes(text: string): Scope[] {
129 const given = new Set(text.split(/[\s,]+/).map((part) => part.trim().toLowerCase()));
130 return SCOPES.map((row) => row.scope).filter((scope) => given.has(scope));
131}
132
133/** What a token stores for full access. */
134export const FULL_ACCESS = "*";
135
136export type PresetId = "read_only" | "agent" | "ci" | "full";
137
138/** Starting points for choosing scopes. `*` is full access. */
139export const PRESET_SCOPES = {
140 read_only: [
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar141 "repo:read", "code:read", "security:read", "packages:read", "issues:read", "pull_requests:read", "workflows:read", "memory:read", "account:read", "notifications:read", "workspace:read", "access:read", "webhooks:read", "secrets:read", "runners:read",
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step142 ] as const,
143 agent: [
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar144 "repo:read", "code:read", "code:write", "security:read", "packages:read", "issues:read", "issues:write", "pull_requests:read", "pull_requests:write", "agents:run", "workflows:read", "memory:read", "memory:write", "account:read", "notifications:read", "notifications:write", "workspace:read", "access:read", "webhooks:read", "secrets:read",
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step145 ] as const,
146 ci: [
Packages, with a container registry on g1t.sh; workspaces deleted whole and kept 30 days; Members for every member147 "repo:read", "code:read", "code:write", "packages:read", "packages:write", "workflows:read", "workflows:write",
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step148 ] as const,
149 full: [
150 "*",
151 ] as const,
152};
153
154export const PRESETS: { id: PresetId; label: string; description: string }[] = [
155 { id: "read_only", label: "Read only", description: "Read everything you can read; change nothing." },
156 { id: "agent", label: "Agent", description: "Read everything, work on issues and pull requests, push code and run g1t agents." },
Packages, with a container registry on g1t.sh; workspaces deleted whole and kept 30 days; Members for every member157 { id: "ci", label: "CI", description: "Clone and push code, push and pull packages, and run workflows." },
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step158 { id: "full", label: "Full access", description: "Everything you can do, including deleting repositories and changing who has access." },
159];
160
161/** The scopes of a preset, or null for full access. */
162export function presetScopes(id: PresetId): Scope[] | null {
163 if (id === "full") return null;
164 return [...PRESET_SCOPES[id]] as Scope[];
165}
166
167/** What an OAuth client gets when it asks for nothing in particular. */
168export const OAUTH_DEFAULT_SCOPES: Scope[] = [...PRESET_SCOPES.agent];
169
170/** The operation each scope gates, by the API's operation names. */
171export const OPERATION_SCOPES = [
172 ["list_emails", "account:read"],
173 ["add_email", "account:write"],
174 ["remove_email", "account:write"],
175 ["update_email_settings", "account:write"],
176 ["list_invites", "account:read"],
177 ["create_invite", "account:write"],
178 ["revoke_invite", "account:write"],
179 ["list_my_repo_invitations", "account:read"],
180 ["accept_repo_invitation", "account:write"],
181 ["decline_repo_invitation", "account:write"],
API: pinned projects over REST and MCP182 // Your pinned projects: a preference of your account.
183 ["list_pinned_projects", "account:read"],
184 ["pin_project", "account:write"],
185 ["unpin_project", "account:write"],
186 ["reorder_pinned_projects", "account:write"],
API: notifications over REST and MCP, with notifications scopes187 // Your inbox: notifications, subscriptions and watching.
188 ["list_notifications", "notifications:read"],
189 ["get_notification_thread", "notifications:read"],
190 ["get_thread_subscription", "notifications:read"],
191 ["get_repo_subscription", "notifications:read"],
192 ["list_watched_repos", "notifications:read"],
193 ["mark_notifications_read", "notifications:write"],
194 ["mark_thread_read", "notifications:write"],
195 ["mark_thread_done", "notifications:write"],
196 ["save_thread", "notifications:write"],
197 ["snooze_thread", "notifications:write"],
198 ["set_thread_subscription", "notifications:write"],
199 ["delete_thread_subscription", "notifications:write"],
200 ["set_repo_subscription", "notifications:write"],
201 ["delete_repo_subscription", "notifications:write"],
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step202 ["create_workspace", "workspace:admin"],
203 ["delete_workspace", "workspace:admin"],
Git storage hardened, pages in tens of milliseconds, honest security alerts, and costs reconciled daily204 ["update_workspace", "workspace:admin"],
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step205 ["list_workspace_invites", "workspace:read"],
206 ["invite_member", "workspace:admin"],
207 ["revoke_workspace_invite", "workspace:admin"],
208 ["list_integrations", "workspace:read"],
209 ["connect_integration", "workspace:admin"],
210 ["disconnect_integration", "workspace:admin"],
211 ["test_integration", "workspace:admin"],
212 ["get_model_routes", "workspace:read"],
213 ["set_model_routes", "workspace:admin"],
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar214 ["list_teams", "workspace:read"],
215 ["get_team", "workspace:read"],
216 ["list_team_members", "workspace:read"],
217 ["list_child_teams", "workspace:read"],
218 ["list_team_repos", "workspace:read"],
219 ["list_user_teams", "workspace:read"],
220 ["create_team", "workspace:admin"],
221 ["update_team", "workspace:admin"],
222 ["delete_team", "workspace:admin"],
223 ["set_team_member", "workspace:admin"],
224 ["remove_team_member", "workspace:admin"],
225 ["set_team_review_assignment", "workspace:admin"],
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step226 ["list_repos", "repo:read"],
227 ["get_repo", "repo:read"],
228 ["search", "repo:read"],
229 ["list_events", "repo:read"],
230 ["list_labels", "repo:read"],
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar231 ["list_milestones", "repo:read"],
232 ["get_milestone", "repo:read"],
233 ["create_label", "issues:write"],
234 ["update_label", "issues:write"],
235 ["delete_label", "issues:write"],
236 ["add_default_labels", "issues:write"],
237 ["create_milestone", "issues:write"],
238 ["update_milestone", "issues:write"],
239 ["delete_milestone", "issues:write"],
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step240 ["get_repo_settings", "repo:read"],
Fast pages, required checks on the branch, self-hosted runners, honest incidents241 ["list_check_names", "repo:read"],
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step242 ["list_deleted_repos", "repo:read"],
Git storage hardened, pages in tens of milliseconds, honest security alerts, and costs reconciled daily243 ["list_security_alerts", "repo:read"],
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar244 ["get_codeowners_errors", "repo:read"],
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step245 ["create_repo", "repo:write"],
246 ["update_repo", "repo:write"],
247 ["update_repo_settings", "repo:write"],
248 ["rename_branch", "repo:write"],
249 ["rename_repo", "repo:admin"],
250 ["transfer_repo", "repo:admin"],
251 ["archive_repo", "repo:admin"],
252 ["unarchive_repo", "repo:admin"],
253 ["set_repo_visibility", "repo:admin"],
254 ["delete_repo", "repo:admin"],
255 ["restore_repo", "repo:admin"],
256 ["purge_repo", "repo:admin"],
Git storage hardened, pages in tens of milliseconds, honest security alerts, and costs reconciled daily257 ["dismiss_security_alert", "repo:admin"],
258 ["reopen_security_alert", "repo:admin"],
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar259 // The security suite.
260 ["list_secret_scanning_alerts", "security:read"],
261 ["get_secret_scanning_alert", "security:read"],
262 ["list_secret_scanning_locations", "security:read"],
263 ["list_bypass_requests", "security:read"],
264 ["list_custom_patterns", "security:read"],
265 ["list_code_scanning_alerts", "security:read"],
266 ["get_code_scanning_alert", "security:read"],
267 ["list_code_scanning_analyses", "security:read"],
268 ["get_sarif_upload", "security:read"],
269 ["list_vulnerability_alerts", "security:read"],
270 ["get_vulnerability_alert", "security:read"],
271 ["get_dependency_graph", "security:read"],
272 ["get_sbom", "security:read"],
273 ["compare_dependencies", "security:read"],
274 ["get_security_settings", "security:read"],
275 ["get_workspace_security_settings", "security:read"],
276 ["get_security_overview", "security:read"],
277 ["update_secret_scanning_alert", "security:write"],
278 ["bypass_push_protection", "security:write"],
279 ["check_secret_validity", "security:write"],
280 ["review_bypass_request", "security:write"],
281 ["create_custom_pattern", "security:write"],
282 ["update_custom_pattern", "security:write"],
283 ["delete_custom_pattern", "security:write"],
284 ["dry_run_custom_pattern", "security:write"],
285 ["update_code_scanning_alert", "security:write"],
286 ["upload_sarif", "security:write"],
287 ["update_vulnerability_alert", "security:write"],
288 ["fix_security_alert", "security:write"],
289 ["update_security_settings", "security:write"],
290 ["update_workspace_security_settings", "security:write"],
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step291 ["list_issues", "issues:read"],
292 ["get_issue", "issues:read"],
293 ["get_plan", "issues:read"],
294 ["create_issue", "issues:write"],
295 ["update_issue", "issues:write"],
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar296 ["list_issue_labels", "issues:read"],
297 ["add_issue_labels", "issues:write"],
298 ["set_issue_labels", "issues:write"],
299 ["remove_issue_labels", "issues:write"],
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step300 ["close_issue", "issues:write"],
301 ["reopen_issue", "issues:write"],
302 ["add_comment", "issues:write"],
303 ["import_issue", "issues:write"],
304 ["apply_plan", "issues:write"],
305 ["list_pull_requests", "pull_requests:read"],
306 ["get_pull_request", "pull_requests:read"],
307 ["get_pull_request_changes", "pull_requests:read"],
308 ["read_session", "pull_requests:read"],
309 ["get_merge_queue", "pull_requests:read"],
310 ["create_pull_request", "pull_requests:write"],
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar311 ["update_pull_request", "pull_requests:write"],
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step312 ["record_session", "pull_requests:write"],
313 ["mark_pull_request_ready", "pull_requests:write"],
314 ["close_pull_request", "pull_requests:write"],
315 ["review_pull_request", "pull_requests:write"],
316 ["merge_pull_request", "pull_requests:write"],
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar317 ["request_reviewers", "pull_requests:write"],
318 ["remove_requested_reviewers", "pull_requests:write"],
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step319 ["assign_issue", "agents:run"],
320 ["delegate", "agents:run"],
321 ["plan_work", "agents:run"],
322 ["message_agent", "agents:run"],
323 ["answer_message", "agents:run"],
324 ["take_messages", "agents:run"],
325 ["list_workflows", "workflows:read"],
326 ["list_workflow_runs", "workflows:read"],
327 ["get_workflow_run", "workflows:read"],
328 ["get_job_logs", "workflows:read"],
329 ["dispatch_workflow", "workflows:write"],
330 ["cancel_workflow_run", "workflows:write"],
331 ["rerun_workflow_run", "workflows:write"],
332 ["update_workflow", "workflows:write"],
333 ["recall", "memory:read"],
334 ["search_context", "memory:read"],
335 ["get_entity", "memory:read"],
336 ["get_context", "memory:read"],
337 ["remember", "memory:write"],
338 ["list_collaborators", "access:read"],
339 ["get_collaborator_permission", "access:read"],
340 ["list_repo_invitations", "access:read"],
341 ["list_outside_collaborators", "access:read"],
342 ["add_collaborator", "access:admin"],
343 ["update_collaborator", "access:admin"],
344 ["remove_collaborator", "access:admin"],
345 ["revoke_repo_invitation", "access:admin"],
346 ["set_base_permission", "access:admin"],
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar347 ["set_team_repo", "access:admin"],
348 ["remove_team_repo", "access:admin"],
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step349 ["list_webhooks", "webhooks:read"],
350 ["list_webhook_deliveries", "webhooks:read"],
351 ["create_webhook", "webhooks:admin"],
352 ["update_webhook", "webhooks:admin"],
353 ["delete_webhook", "webhooks:admin"],
354 ["ping_webhook", "webhooks:admin"],
355 ["redeliver_webhook", "webhooks:admin"],
356 ["list_actions_secrets", "secrets:read"],
357 ["list_actions_variables", "secrets:read"],
358 ["set_actions_secret", "secrets:admin"],
359 ["delete_actions_secret", "secrets:admin"],
360 ["set_actions_variable", "secrets:admin"],
361 ["delete_actions_variable", "secrets:admin"],
Fast pages, required checks on the branch, self-hosted runners, honest incidents362 // Self-hosted runners.
363 ["list_runners", "runners:read"],
364 ["list_runner_groups", "runners:read"],
365 ["get_runner_settings", "runners:read"],
366 ["create_runner_registration_token", "runners:admin"],
367 ["remove_runner", "runners:admin"],
368 ["create_runner_group", "runners:admin"],
369 ["update_runner_group", "runners:admin"],
370 ["delete_runner_group", "runners:admin"],
371 ["update_runner_settings", "runners:admin"],
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step372] as const;
373
374/**
375 * The scopes a token or grant holds, as stored: null for full access, or
376 * the list. `legacy` marks a token made before scopes, which has full
377 * access until someone narrows it.
378 */
379export type TokenScopes = {
380 scopes: Scope[] | null;
381 legacy: boolean;
382};
383
384/**
385 * How settings group scopes into a checklist: each group's scopes, least
386 * first. Admin scopes are not here; they are under "Dangerous" on their
387 * own (see `DANGEROUS_SCOPES`). Every other scope is in exactly one group.
388 */
389export const SCOPE_GROUPS: { id: string; label: string; scopes: Scope[] }[] = [
390 { id: "code", label: "Repositories & code", scopes: ["repo:read", "repo:write", "code:read", "code:write"] },
Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar391 { id: "security", label: "Security", scopes: ["security:read", "security:write"] },
Packages, with a container registry on g1t.sh; workspaces deleted whole and kept 30 days; Members for every member392 { id: "packages", label: "Packages", scopes: ["packages:read", "packages:write"] },
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step393 { id: "work", label: "Issues & pull requests", scopes: ["issues:read", "issues:write", "pull_requests:read", "pull_requests:write"] },
394 { id: "agents", label: "Agents", scopes: ["agents:run"] },
395 { id: "workflows", label: "Workflows", scopes: ["workflows:read", "workflows:write"] },
396 { id: "memory", label: "Memory & search", scopes: ["memory:read", "memory:write"] },
397 { id: "account", label: "Account", scopes: ["account:read", "account:write"] },
API: notifications over REST and MCP, with notifications scopes398 { id: "notifications", label: "Notifications", scopes: ["notifications:read", "notifications:write"] },
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step399 { id: "workspace", label: "Workspace", scopes: ["workspace:read", "access:read", "webhooks:read", "secrets:read"] },
Fast pages, required checks on the branch, self-hosted runners, honest incidents400 { id: "runners", label: "Runners", scopes: ["runners:read"] },
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step401];
402
Packages, with a container registry on g1t.sh; workspaces deleted whole and kept 30 days; Members for every member403/** The admin and delete scopes, shown under "Dangerous" behind a warning. */
Thirteen MCP tools and classic token scopes; agents rate their confidence and can be put on an issue in one step404export const DANGEROUS_SCOPES: Scope[] = SCOPES.map((row) => row.scope).filter(isDangerous);