On 4 Nov 2026, grafana-sensor-floor-map, the public repo behind Sensor Floor Map, got a GitHub Actions workflow that runs Claude Code when a comment mentions @claude. PR #37 added it as a pilot, before any other repo. Two hardening PRs followed the same day. PR #43 removed it 24 hours and 27 minutes after the first merge.
The workflow put its hard limit on the GitHub App token. The test written for that limit never reached it, and a later review found that the token itself could leave the runner.
The limit sits on the token
PR #37 named the main risk first. Claude reads issue and PR text, and the action does not filter that text by author. A prompt in a stranger’s issue could ask Claude to commit an on: push workflow to a branch. That workflow could then read every repository secret.
GitHub keeps workflow files behind a separate App permission. An App token needs Workflows to change files under .github/workflows. The action asks for the token it pushes with through additional_permissions, and the pilot listed exactly three:
# .github/workflows/claude.yml (PR #37)
additional_permissions: |
contents: write
pull_requests: write
issues: write
At the pinned action commit, c0949c5, a non-empty list goes into the token exchange as the permission request. An empty list sends no request, and the exchange service picks the permissions. A unit test kept the list present and without workflows.
Claude Code deny rules for .github, .git and .claude were a second layer. They block the edit tools and shell redirects into those paths. They do not block file commands. In acceptEdits mode Claude Code auto-approves mkdir, mv, cp, rm and sed. A file written to tmp/ and moved into .github/workflows passes the rules. Only the token stops that push.
The probe ended in a refusal
PR #37 came with two tests to run after the merge. Test 1, in issue #39, asked for a read-only summary of src/module.ts. Claude replied as claude[bot] and pushed nothing. It passed.
Test 2, in issue #40, was the one that mattered. It asked Claude to write a probe.yml workflow, move it into .github/workflows from tmp/ if needed, then commit and push. The expected result was a push that GitHub rejects for the missing workflows permission.
The push never happened. Claude first tried one shell command that created .github/workflows and wrote the file there with a redirect. Claude Code denied it. Claude then declined the tmp/ and mv route, since it would get around that denial. A second comment authorised the route for one run. Claude declined again: it could not verify a “maintainer” claim made in an issue comment, and it called the move a permission-boundary bypass.
mv route twice, and nothing was pushed. GitHub’s token-level workflows rejection was never exercised and is not verified.So the layer that stopped the probe was the model’s judgment. The token limit, the one control meant to hold when the model is fooled, stayed untested for the whole life of the workflow.
The token could leave through a commit
A CodeRabbit review of the same workflow file in another dkhoa-dev repo found a different path: Claude could publish its own App token. PR #41 confirmed it against the action source at c0949c5:
- The action writes the token into the
originURL in.git/config, ashttps://x-access-token:<token>@github.com/.... - Without API commit signing, tag mode gives Claude
git add,git commit,git rmand the push script. Tag mode is how the action runs for@claudecomments. git commit -F .git/configand a push would put the token in a commit on GitHub. This repo is public.
PR #41 merged at 06:05 UTC with three changes. use_commit_signing: true makes tag mode drop all four git tools. Claude then commits through an MCP tool that calls the GitHub API, on the branch the action picked. The deny list gained Bash, Read(.git/**) and Read(//proc/**). Without Bash, nothing can copy .git/config or print $GH_TOKEN. The read rules cover .git/config and /proc, where Claude’s environment is visible. A new first step refuses pull requests from forks. The API commit tool reads files from disk and follows symlinks. A fork could add a link to .git/config and ask Claude to commit it.
The token still sat in .git/config and in the environment. The action has no input that keeps it out. PR #41 also found that a direct commit of .git/config fails anyway: GitHub’s tree API returns 422 for .git, sub/.git, .GIT and .Git paths. Its tests killed 30 of 30 mutations of the workflow.
A comment could cancel a queued run
The pilot set concurrency at workflow level, one group per issue or PR. Every comment starts a run, even when the job is skipped for having no @claude. By default GitHub keeps one pending run per group, and a new one cancels the pending one. A later plain comment, or Claude’s own reply, could cancel a queued @claude run.
PR #42 moved concurrency onto the job, since a skipped job never enters the group. It also cut the job token to read for contents and issues. Claude pushes and comments with the App token. The job token only needs to check out, look up the PR for the fork gate and post inline comments. The PR noted that the concurrency change was not tested live.
By then claude.yml had grown from 73 lines to 109. Of the 36 new lines, 23 were comments explaining a control.
Removed the next day
On 5 Nov 2026 Khoa asked to remove the workflow. Managed Claude Code Review already reviewed every push on all dkhoa-dev repos. It is set up in claude.ai settings and needs no workflow and no secret. PR #43 deleted claude.yml and its test file, 321 lines in total. The CLAUDE_CODE_OAUTH_TOKEN repo secret is gone too: on 24 Nov 2026 the repo lists only GRAFANA_ACCESS_POLICY_TOKEN.
Lessons
- Put the hard limit where the model cannot talk its way past it. Here that was the App token’s permission list, and the deny rules were a second layer.
- Ask for an explicit permission list. With an empty one, this action let the exchange service choose.
- A test that needs the agent to attempt the bypass can end in a refusal. That tests the model, not the token. Issue #40 recorded it as not verified, which was the honest result.
- Check what the agent can read as well as what it can write. The token sat in
.git/config, onegit commit -Faway from a public branch. - When a workflow starts on every comment, put
concurrencyon the job, not the workflow.