Repository navigation
feat: token broker mode for agents in the nono sandbox - #15
Merged
Merged
Conversation
Agents running inside the nono sandbox must not hold the GitHub App private key. With GITHUB_APP_TOKEN_BROKER=nono or github_app.token_broker: nono, the plugin skips key loading and sends the placeholder token "nono-phantom-github-app"; nono's supervisor and proxy inject the real credentials outside the sandbox. - config: add token_broker to GitHubAppConfig, validate the value (only "nono" is supported), and ignore private key settings in broker mode - auth: return brokered installation tokens without network calls, return the placeholder for app JWTs, and report token_broker in auth metadata - cli: `token` prints the placeholder with a stderr note; `doctor` shows a token broker check and an HTTPS_PROXY check; `setup --token-broker nono` writes the broker and drops private_key_path - docs: add a nono token broker section to README and the workflow skill - bump version to 0.3.0 - tests: isolate HERMES_HOME and GITHUB_APP_* per test (a developer's real ~/.hermes/config.yaml was leaking into test_load_config_from_environment)
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.
Why
Hermes agents can now run in a sandbox (PickNikRoboticsInfra/hermes-home-config#30). There, the agent never holds real credentials:
nonoproxy container keeps the GitHub App private key;GET /apponly;api.github.com,uploads.github.comand git smart-HTTP ongithub.com.Today the plugin requires the private key and mints tokens itself, so its
github_app_*tools and thegh-app/git-appwrappers fail in the sandbox.What
Token broker mode, enabled by
GITHUB_APP_TOKEN_BROKER=nonoorgithub_app.token_broker: nono:client_idand the installation IDs are still read; they are non-secret and used for owner selection and metadata.get_installation_tokenreturns the placeholdernono-phantom-github-appwithout any network call. It uses the per-owner installation ID and a 1-hour expiry, andcreate_jwtreturns the same placeholder. Requests send the placeholder, and the proxy replaces it.auth_metadatareportstoken_broker.tokenprints the placeholder, with a note on stderr.doctorreplaces the key checks with a broker check and anHTTPS_PROXYcheck.setup --token-broker nonowrites the setting withoutprivate_key_path.ConfigurationError.Also isolates tests from a developer's real
~/.hermes/config.yaml, through an autouse fixture forHERMES_HOME/GITHUB_APP_*.test_load_config_from_environmentwas reading it onmain.Testing
ruff,mypyandpytest(36 tests on Python 3.10 and 3.12) pass.Authorizationheader on requests, the invalid-value error, the doctor branch, andsetup --token-broker.gh/gitthrough the proxy authenticate as the app in two orgs. This branch is what makes the plugin's own tools work there too. hermes-home-config bumpsHERMES_GITHUB_APP_PLUGIN_REFto it once this merges.