Skip to content

Infra GA5: the token service runs as a main-only Actions workflow in the owner's private repository, sealed per #3085 #3235

Backlog

Description

@jparker2006

Parent

GA5 (#1849) of spec #1837 (Infra). The orchestrator ruled (2026-11-24) that the token service moves off the owner's PC to GitHub Actions minting in a private repository, sealed per #3085. Private record. GA5's live check runs on this route. Bot-token priority. Size: M. Security-relevant.

What to build

A third route to the token service, actions. A workflow in the owner's private repository mints each agent's token and seals it to that agent's one-time key with #3094's code. The helper dispatches the request and opens the sealed answer.

  • The workflow template (tools/github-app/mint-workflow.yml, which the owner copies into the private repository's .github/workflows/):

    • workflow_dispatch only. The job refuses unless github.ref is refs/heads/main.
    • The key job runs in an environment, token-service, whose deployment branches are main only. The App key is that environment's secret OPENWIZ_GITHUB_APP_KEY (base64 of the PEM), never a repository secret.
    • Inputs, all untrusted data and reaching the script only through env:: request, the token-service request JSON with its answer_key, and nonce, a random id that names the run (run-name) and its artifact.
    • It checks out openwizdev/OpenWiz at a pinned commit sha written in the workflow, never a branch, and runs that commit's tools/github-app/token-service.py mint. The key goes to it through a pipe or descriptor, never a file.
    • The sealed answer, or the refusal, is uploaded as one artifact named by the nonce, with a 1-day retention. Nothing else is uploaded. The job summary carries the mint-log fields only.
    • It uses no third-party action beyond actions/checkout and actions/upload-artifact at the shas OpenWiz already pins.
  • The helper (agent-token.py): with OPENWIZ_TOKEN_SERVICE_ROUTE=actions and OPENWIZ_TOKEN_SERVICE_REPOSITORY=<owner/name> (public settings), it:

    • dispatches the workflow on main with the request and a fresh nonce, using today's account;
    • finds the run by its name and waits for it (the contract's 60 s timeout, raised to 120 s for this route);
    • downloads the artifact, deletes it, opens the sealed answer and checks it as today.

    Any failure falls back with the existing note (unreachable or bad-answer). No plaintext token is ever in a request, a run's logs, an artifact or the helper's output. Keep the dispatch-and-poll calls few, and back off on 403 or 429.

  • The contract (contracts/token-service.v1.md, schema and fixtures): add the actions route. Where the key lives becomes "the owner's machine (pairing and local), or the token-service environment secret of the owner's private repository (actions)". Set out the main-only rule and why a branch-triggered workflow must never read the key.

  • Docs (docs/github-app.md): the owner's steps:

    1. Create the token-service environment with deployment branches set to main only.
    2. Make a fresh App key into its secret, through GitHub's own form.
    3. Protect main with a ruleset so only the owner can change it.
    4. Copy the template.
    5. Delete the old key in the App's settings.

Owned paths

  • tools/github-app/mint-workflow.yml (new), tools/github-app/agent-token.py (shared: the actions route only), tools/github-app/test_agent_token.py (shared: the new cases), and a new tools/github-app/test_mint_workflow.py
  • contracts/token-service.v1.md, contracts/token-service.v1.schema.json, contracts/fixtures/token-service/ (shared: the actions route only)
  • docs/github-app.md (only the new route's section)
  • changes/ (one new line)

Relies on: contracts/token-service.v1.md; #3085 merged

Acceptance criteria

  • Red first. Offline tests with a fake GitHub (dispatch, runs, artifacts) prove:
    • the round trip over the actions route;
    • a missing run, a timeout, a failed run, a missing or tampered artifact, and an unopenable answer each fall back with the right reason;
    • the artifact is deleted after download.
      Each test says catches: <the bug>.
  • The plaintext token never appears in the dispatch inputs, the fake run's logs or summary, the artifact, or the helper's stdout or stderr.
  • A check over the template proves:
    • the trigger is workflow_dispatch only, and the key job names token-service and refuses a ref other than main;
    • the OpenWiz checkout is a pinned sha;
    • no input appears inside ${{ }} in a run:;
    • every uses: is pinned at a sha OpenWiz already uses.
  • No live call and no secret in CI. The live first run is GA5's, after the owner's steps.

Activity

  1. added this to the 0.1.2 milestone on Nov 24, 2026
  2. added
    ready-for-agent
    on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agent

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions