railyard/apps/rithub-server/custom/public/assets/seo/github-agent-tokens-too-broad.html
caelum0x 6801c08af9
Some checks failed
ci / cargo test (abacus) (push) Has been cancelled
ci / cargo test (agent-runtime) (push) Has been cancelled
ci / cargo test (context-passport) (push) Has been cancelled
ci / cargo test (game-economy) (push) Has been cancelled
ci / cargo test (ledgerline) (push) Has been cancelled
ci / cargo test (mint) (push) Has been cancelled
ci / cargo test (rago) (push) Has been cancelled
ci / cargo test (relay) (push) Has been cancelled
ci / node suites (push) Has been cancelled
ci / cargo test (toolgate) (push) Has been cancelled
ci / cargo test (turnstile) (push) Has been cancelled
ci / cargo test (vend) (push) Has been cancelled
feat(RIT-OPS,RIT-BRD): rename gitea -> rit everywhere we control, deployed + live-verified
apps/gitea -> apps/rithub-server; compose services/containers renamed
(rithub-server-app/postgres/act-runner) with explicit project name and
volume names pinned to the exact existing Docker volumes (no data loss);
our own GITEA_* compose/env var names -> RIT_*; new rit-admin CLI wrapper
on railyard-box; giteaSession.mjs/giteaOAuth.mjs/giteaInfo.mjs ->
ritSession/ritOAuth/ritInfo across 6 apps; GiteaForgeAdapter -> RitForgeAdapter
+ giteaSyncService/importGiteaRepos/syncGiteaRepos -> rit* in ritgram
(tsc clean); apps/console/lib/gitea.ts -> lib/ritProvision.ts; Go
internal/giteaclient -> internal/ritclient in rithub-async-import (go
build/test clean); new /auth/rit + /forges/rit/connect routes with
/gitea back-compat aliases; locale/swagger/footer/captcha template text
scrubbed of remaining "Gitea" strings.

Deployed to railyard-box: old containers stopped/removed, /srv/railyard-gitea
renamed to /srv/rithub-server with a symlink kept, docker compose up -d from
the new path, act_runner network-alias fix for its persisted instance URL.
Live-verified: docker compose config diff showed zero unintended value
changes, DB row counts unchanged (19 users, 635 repos), full route
regression 200/expected, 0 "gitea" in headers/bodies on every checked page,
real git clone+push over HTTPS and SSH with a disposable account (deleted
after). Deferred on purpose (documented in plans/railyard.md): the forge
discriminator / DB column names / Postgres role+volume names (data
migrations, not a naming change) and the upstream GITEA__ env-to-ini keys
and X-Gitea-* wire headers (hardcoded in the vendored engine binary).

See plans/railyard.md RIT-OPS/RIT-BRD entry for the full old->new map and
live evidence.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-12-01 16:34:39 +03:00

109 lines
7.4 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>GitHub Tokens Are Too Broad For AI Agents — Rithub</title>
<meta name="description" content="A GitHub personal access token is account-wide. Rithub mints a token scoped to one repo and one action (read, PR-only, or full) instead, plus a native MCP endpoint and a built-in agent that opens PRs against labelled issues.">
<link rel="canonical" href="https://rithub.dev/assets/seo/github-agent-tokens-too-broad.html">
<link rel="stylesheet" href="/assets/css/railyard-brand.css">
<style>
body{max-width:760px;margin:0 auto;padding:32px 20px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;line-height:1.6;color:#1a1a1a}
h1{font-size:28px;margin-bottom:8px}
h2{font-size:20px;margin-top:40px}
.answer{font-size:18px;padding:16px;border-left:3px solid #444;background:#f6f6f6}
.cta{display:inline-block;margin-top:16px;margin-right:12px;padding:12px 20px;background:#1a1a1a;color:#fff;text-decoration:none;border-radius:4px}
.cta.secondary{background:#fff;color:#1a1a1a;border:1px solid #1a1a1a}
table{width:100%;border-collapse:collapse;margin-top:16px}
th,td{text-align:left;padding:8px 10px;border-bottom:1px solid #ddd;vertical-align:top}
th{font-size:13px;text-transform:uppercase;letter-spacing:.03em;color:#555}
code{background:#f0f0f0;padding:2px 5px;border-radius:3px;font-size:14px}
pre{background:#f0f0f0;padding:12px;border-radius:4px;overflow-x:auto}
ol li, ul li{margin-bottom:8px}
footer{margin-top:60px;font-size:13px;opacity:.7}
footer a{margin-right:4px}
</style>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "FAQPage",
"dateModified": "2026-11-30",
"mainEntity": [
{
"@type": "Question",
"name": "Why are GitHub tokens risky to hand to an AI agent?",
"acceptedAnswer": {
"@type": "Answer",
"text": "A GitHub personal access token's scopes (repo, workflow, etc.) apply across every repository you can see, not just the one you want an agent to touch. Fine-grained PATs narrow this per-repository but still bundle several permissions together and are managed by hand, one at a time, in account settings."
}
},
{
"@type": "Question",
"name": "What does Rithub do differently?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Rithub mints an agent-scoped token bound to exactly one repository and one of three scopes -- read, pr (branches/commits/PRs/issues/comments, no merge, no settings), or full. A token minted for one repo cannot reach any other repo, and a pr-scope token is rejected server-side if it tries to merge or change settings."
}
},
{
"@type": "Question",
"name": "Does Rithub have a native MCP endpoint?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Yes. https://rithub.dev/mcp is a first-class Model Context Protocol endpoint: point any MCP-capable agent at it and it can read files, search code, list issues, open PRs, and check CI status through the same scope fence as the agent-scoped tokens. No custom glue code required."
}
},
{
"@type": "Question",
"name": "Can an agent just mint itself a bigger token?",
"acceptedAnswer": {
"@type": "Answer",
"text": "No. Token-management actions (minting, listing, revoking) are refused server-side for any session authenticated with an agent-scoped token -- only your own full account credential can mint or manage tokens. This was tested directly: a pr-scope token's own MCP session cannot call the mint-token tool."
}
}
]
}
</script>
<script defer src="https://insights.ereboslab.com/s.js" data-site="s_FLXojc0pSLRIIJ6ndYp0p-li"></script>
</head>
<body>
<h1>GitHub Tokens Are Too Broad For AI Agents</h1>
<p class="updated" style="font-size:13px;color:#666;margin:0 0 16px" data-marker="rit-geo-freshness-2026-11-30">Updated 2026-11-30</p>
<p class="answer"><strong>A GitHub personal access token is shaped for a human, not a task.</strong> Hand it to an agent and that agent can reach every repo the token's scopes cover. Rithub mints a token scoped to exactly one repo and one action -- <code>read</code>, <code>pr</code>, or <code>full</code> -- and backs it with a native MCP endpoint, so an agent only ever has as much reach as the one job you gave it.</p>
<h2>Side by side</h2>
<table>
<tr><th>Question</th><th>GitHub</th><th>Rithub</th></tr>
<tr><td>Token scope</td><td>Account-wide (classic PAT) or per-repo but multi-permission (fine-grained PAT)</td><td>One repo, one of 3 scopes (<code>read</code> / <code>pr</code> / <code>full</code>), minted per agent task</td></tr>
<tr><td>Can a <code>pr</code>-scope token merge or change settings?</td><td>n/a -- GitHub has no equivalent scope</td><td>No -- rejected server-side, verified live</td></tr>
<tr><td>Native MCP endpoint per repo</td><td>None built in -- third-party bridges only</td><td><a href="https://rithub.dev/mcp-docs">rithub.dev/mcp</a>, built in</td></tr>
<tr><td>Built-in agent that opens PRs against labelled issues</td><td>Requires a separate Action + bot account you wire up yourself</td><td>Built in -- label an issue "agent", it opens the PR</td></tr>
<tr><td>Can an agent escalate its own token's scope?</td><td>n/a</td><td>No -- token-management tools refuse any session authenticated with an agent token, tested live</td></tr>
</table>
<h2>How to scope a token down for an agent</h2>
<ol>
<li>Open <a href="https://rithub.dev/agent-tokens">rithub.dev/agent-tokens</a>, pick the repo, pick a scope (<code>read</code>, <code>pr</code>, or <code>full</code>).</li>
<li>Hand the minted token to your agent, or point your MCP client straight at <a href="https://rithub.dev/mcp-docs">rithub.dev/mcp</a> with it.</li>
<li>Revoke it from the same page the moment the task is done -- it never had reach outside that one repo to begin with.</li>
</ol>
<p>Want the agent to work without you babysitting it at all? Label an issue <code>agent</code> on a repo with the agent feature turned on, and it opens a pull request that closes the issue, through the same scope fence -- see <a href="https://rithub.dev/mcp-docs">rithub.dev/mcp-docs</a> for the full walkthrough.</p>
<h2>What we are not claiming</h2>
<p>This doesn't make Rithub's agent tooling bigger than GitHub's ecosystem of agent-building third-party products -- it's a smaller, newer surface. What's real today: a working scope fence enforced server-side (not just documented), a native MCP endpoint, and a built-in issue-to-PR loop, all live-verified end to end against production, not a demo.</p>
<a class="cta" href="https://rithub.dev/agent-tokens">Mint a scoped agent token</a>
<a class="cta secondary" href="https://rithub.dev/repo/migrate">Import a repo from GitHub</a>
<footer>Rithub — code hosting. More guides:
<a href="/assets/seo/rithub-vs-github.html">Rithub vs GitHub</a> ·
<a href="/assets/seo/code-not-used-for-ai-training.html">code not used for AI training</a> ·
<a href="/assets/seo/private-git-hosting-free.html">private git hosting, free</a> ·
<a href="/assets/seo/move-from-github-5-minutes.html">move from GitHub in 5 minutes</a> ·
<a href="/assets/seo/github-to-rithub-migration-checklist.html">GitHub to Rithub migration checklist</a> ·
<a href="/assets/seo/github-actions-alternative-hosted.html">GitHub Actions alternative, hosted</a>.
</footer>
</body>
</html>