Skip to content

security: Claude/App secret jobs run in the main-only mind-main environment - #573

Merged
Jammy2211 merged 2 commits into
mainfrom
feature/mind-main-environment
Nov 16, 2026
Merged

Jammy2211 merged 2 commits into
mainfrom
feature/mind-main-environment

Conversation

@Jammy2211

@Jammy2211 Jammy2211 commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Closes the main half of draft/maintenance/pyautomind/old_branch_workflow_secret_exposure.md. A workflow_dispatch runs the workflow file at the ref the caller picks, and Mind keeps about 244 old heads whose copies predate the input hardening of #565, with the org secrets in reach.

  • A new environment mind-main, restricted to deployment branch main. It was created by the lead on 2026-11-16.
  • Every job that reads CLAUDE_CODE_OAUTH_TOKEN or APP_PRIVATE_KEY now declares environment: mind-main. That is 10 jobs in 8 workflows. All are schedule, dispatch or push-to-main jobs; spawn_drift's drift job is skipped on pull_request.
  • tests/test_workflow_environment.py fails on any job that reads either secret without the environment.
  • policy/github_tokens.md: a new "Old refs" paragraph, and the secret table rows updated.

The hole closes only after the human moves the secrets. Merge this first, then:

  1. Set CLAUDE_CODE_OAUTH_TOKEN and APP_PRIVATE_KEY as mind-main environment secrets.
  2. Delete the repo-level CLAUDE_CODE_OAUTH_TOKEN.
  3. Take PyAutoMind off the org secret APP_PRIVATE_KEY's repository list.

That alone does not close it (independent security review, FINDINGS): Mind main is unprotected, and a pre-hardening mind_ledger_merge.yml on an old head has contents: write plus an injectable inputs.branch. A dispatch there can push code to main that a mind-main job later runs with the secrets. So also either prune the old heads that predate 5a5d9dd80, or protect main, which first needs the ledger pushes moved to a bypass actor. That choice is the human's. can_admins_bypass on mind-main is now false. The webhook secrets stay outside the environment, since they can only post to Slack.

Test plan

  • tests/test_workflow_environment.py fails on main (1 failed) and passes here (7 tests, including case-insensitive, indexed, toJSON(secrets) and secrets: inherit spellings), along with the 59 existing workflow-injection tests.
  • Every workflow parses as YAML.
  • After merge, a dry-run dispatch of spawn_drift on main mints the App token inside the environment.

🤖 Generated with Claude Code

Jammy2211 and others added 2 commits November 16, 2026 09:26
…nd-main environment

Old Mind heads keep pre-hardening workflow copies that a dispatch at that ref
would run with the org secrets. Every job that reads CLAUDE_CODE_OAUTH_TOKEN or
APP_PRIVATE_KEY now declares environment: mind-main (deployable from main only);
the hole closes once the human moves both secrets into that environment.
Draft: draft/maintenance/pyautomind/old_branch_workflow_secret_exposure.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he secret scan

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit f4bd954 into main Nov 16, 2026
2 checks passed
@Jammy2211
Jammy2211 deleted the feature/mind-main-environment branch November 16, 2026 09:43
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