Skip to content

Scope admin app tokens and run the weekly agent in a Docker Sandbox - #17

Open
rgarcia wants to merge 4 commits into
mainfrom
hypeship/scope-admin-app-tokens
Open

rgarcia wants to merge 4 commits into
mainfrom
hypeship/scope-admin-app-tokens

Conversation

@rgarcia

@rgarcia rgarcia commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

actions/create-github-app-token called without any permission-* inputs mints a token carrying every permission the app installation holds, including administration and workflows write. This PR requests only what each token is used for downstream. Repository scope is unchanged unless noted.

Workflow Token Before After Why
weekly-maintenance.yml agent token all app permissions on kernel-tinker-rl, plus the raw private key on disk next to the agent actions, contents, pull_requests, workflows: write on kernel-tinker-rl, and the agent never sees the token push the evergreen branch (including merges of a main that changed workflows), open and comment on the PR, rerun checks

The weekly agent now runs in a Docker Sandbox

Before this PR, the job wrote the app private key to $RUNNER_TEMP and ran pi --approve as the same user, so the agent could mint a full-permission token for any repository.

weekly-maintenance.yml now calls the shared sandboxed-agent.yml reusable workflow from kernel/security-workflows#49:

  • Isolation: Pi runs in a Docker Sandbox, a microVM with its own kernel, with sudo and Docker inside it.
  • Credentials: GitHub and model credentials are added by the sandbox proxy, so the agent only sees placeholders. That includes the OpenRouter token WebJudge reads from OPENROUTER_ACCESS_TOKEN_FILE.
  • Tool keys: KERNEL_API_KEY, TINKER_API_KEY and CURSOR_API_KEY are set inside the sandbox as before. uv and the Kernel CLI are installed there by the setup input.
  • Merging: the agent stops at ready:<pr>. The workflow merges after Cursor Bugbot and every other check pass on the head commit.
  • Pool cleanup: the smoke-test pool is deleted in a separate job that always runs.

Before merging

  • The Docker secrets aren't visible to this repo. sbx needs a signed-in Docker account. This workflow passes DOCKERHUB_USERNAME/DOCKERHUB_TOKEN, the secrets hypeship uses, but a test run from this repo got them empty. Make them, or a read-scoped Docker access token, available to kernel-tinker-rl. Until then the job fails at the sign-in step with a clear error.
  • Merge order: merge Enforce admin app token permissions and add a sandboxed agent workflow security-workflows#49 first, because this calls sandboxed-agent.yml@main.

Testing

  • The reusable workflow ran end to end on a hosted runner with the same setup this workflow uses: uv and the Kernel CLI installed, KERNEL_API_KEY and CURSOR_API_KEY present, and placeholders for GitHub and OpenAI. The sandbox couldn't see the runner state or reach outside the token's scope. gh pr checks worked through the relay and git push worked through the proxy.
  • That run was from a hypeship caller, because this repo can't read the Docker secrets yet.
  • actionlint is clean. actions.lock was regenerated with gh actions-lock; the workflow has no action steps of its own now.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@rgarcia rgarcia changed the title Scope admin app tokens to least-privilege permissions Scope admin app tokens and keep the app private key away from Pi Nov 20, 2026

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@rgarcia rgarcia changed the title Scope admin app tokens and keep the app private key away from Pi Scope admin app tokens and run the weekly agent in a Docker Sandbox Nov 22, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit cf28f74. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant