Skip to content

MANUAL RUN: give agents their own GitHub identity, then require review #754

Closed as not planned

Description

@QuinnsCode

Agents push, open PRs and merge as QuinnsCode. That's your own token: it has repo and workflow scopes and admin rights on the repo. So:

  • an agent could edit or delete the main ruleset (.claude/hooks/guard.ts now blocks the obvious gh api calls, but it's a speed bump, not a sandbox);
  • since every PR is by you, no review can be required, and CODEOWNERS can't gate anything.

Fix: agents get their own identity.

  1. Create a GitHub App (preferred; tokens are short-lived) or a bot account, installed on RustyBuns only. Grant Contents: write, Pull requests: write, Issues: write, Checks: read, Metadata: read. Grant no Administration, Workflows, Actions write, Secrets or Environments.
  2. Point Agent Office's workers at that identity, i.e. the gh/git credentials in their environment, instead of your keyring login.
  3. Then tighten the main ruleset, and update .github/rulesets/main.json to match:
    • required_approving_review_count: 1
    • require_code_owner_review: true (CODEOWNERS already covers .github/, .claude/, scripts/, AGENTS.md and the deploy/auth files)
    • require_last_push_approval: true
  4. Optional: Settings → Code security → turn on secret scanning for non-provider patterns. It's off now, and the repo is public.

Don't do step 3 before steps 1 and 2. While agents are still you, you can't approve your own PRs and every merge would block.

Activity

  1. added
    manual runNeeds the owner to run it by hand (tokens, sign-ins); agents can't close it
    on Oct 11, 2026
  2. QuinnsCode commented on Oct 12, 2026

    @QuinnsCode
    OwnerAuthor

    Progress 11 Oct:

    • Bot account quinnscode-bot, collaborator with Write (not Admin). Login in 1Password codesplitters/github-bot.
    • Classic token (repo + workflow, 90 days, so it expires ~9 Jan 2027) in the same item, field token. Fine-grained tokens can't reach a repo the bot doesn't own.
    • Start the office with zsh ~/office-as-bot-754.sh (from apps/agent-office) instead of bun run office. It reads the token via op, passes GH_TOKEN to workers (AGENT_OFFICE_ENV_PASS), and swaps git's keychain helper for gh auth git-credential, so pushes and PRs go as the bot. Checked: with those settings git only calls gh auth git-credential.
    • Check: a worker's gh api user --jq .login says quinnscode-bot and its next PR is authored by the bot.
    • Only then: main ruleset requires 1 approving review, code-owner review and last-push approval, plus a PR updating .github/rulesets/main.json to match.
    • Optional: secret scanning for non-provider patterns.
  3. self-assigned this
    on Oct 12, 2026
  4. QuinnsCode commented on Oct 12, 2026

    @QuinnsCode
    OwnerAuthor

    Status check 12 Oct (Byte):

    Next step (manual run): restart the office from apps/agent-office with zsh ~/office-as-bot-754.sh, then check that a new worker's gh api user --jq .login prints quinnscode-bot. After that, an agent can open the PR that sets main.json to 1 approval, code-owner review and last-push approval. The owner then applies the same settings to the live ruleset.

  5. QuinnsCode commented on Oct 12, 2026

    @QuinnsCode
    OwnerAuthor

    Next step is tracked in #819: restart the office as the bot when no work would be lost. The ruleset PR waits on it.

  6. QuinnsCode commented on Oct 14, 2026

    @QuinnsCode
    OwnerAuthor

    Folded into the one manual-run list, section 9 of #609 (easiest first, with times). This issue's steps stay here; tick the item in #609.

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

Metadata

Metadata

Assignees

Labels

manual runNeeds the owner to run it by hand (tokens, sign-ins); agents can't close it

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions