feat: GitHub service — scoped token minting and credential helper#22
Merged
pranavpatilsce merged 1 commit intomainfrom Mar 25, 2026
Merged
feat: GitHub service — scoped token minting and credential helper#22pranavpatilsce merged 1 commit intomainfrom
pranavpatilsce merged 1 commit intomainfrom
Conversation
Add services/github/ with: - Token minting via Vers API (POST /api/github/installation-token) - 4 profiles: read, develop, clone, ci — each with scoped permissions - In-memory token cache with auto-refresh before expiry - Credential helper script for transparent git clone/push - reef_github_token tool with behavioral guardrails (no repo deletion, no direct push to main, always create PRs) Also surface LLM errors (e.g. 429 no credits) in reef agent responses instead of returning empty output. Verified end-to-end on provisioned fleet: create branches, push commits, create/close PRs, read CI status — across reef and vers-landing repos.
5 tasks
nsluss
approved these changes
Mar 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
githubreef service that gives agents programmatic access to the org's GitHub repositories via short-lived, scoped installation tokens. Uses the Vers API key (already injected into all VMs) to mint tokens through vers-landing'sPOST /api/github/installation-tokenendpoint (vers-landing PR #264).Two layers:
git-credential-vers) — transparentgit clone/git pushusing full-org tokens, installed at build time on root and golden imagesservices/github/) — scoped tokens for in-repo work via API routes andreef_github_tokentoolAlso surfaces LLM errors (e.g. 429 no credits) in agent chat responses instead of showing blank output.
New files
services/github/index.tsservices/github/credential-helper.shVERS_API_KEYfrom env at runtimeToken profiles
readdevelopcloneciAgents can also pass custom
repositoriesandpermissionsfor fine-grained control beyond profiles.Behavioral guardrails
Enforced via tool descriptions injected into every agent (root + golden child VMs):
reef_github_tokenwith scoped profiles for all in-repo workSecurity
VERS_API_KEYfrom env at runtimeadministration:write— agents cannot delete reposRoutes
POST/github/tokenGET/github/profilesGET/github/statusGET/github/_panelVerified end-to-end
Tested on a provisioned fleet against
hdresearch/reefandhdresearch/vers-landing:read— list PRs, issues, workflow runs, branch protectiondevelop— create branch, push commit, create/update PR, write commentsci— read check runs and workflow statusCompanion PR
githubto shared operational DNA, installs credential helper in root + golden image build scriptsTest plan
bun testpasses (329 tests, 0 failures)--reef-pathpointing to this branchdeveloptoken, verify CI runs