Repository navigation
Mint Ephemeral Tokens #1067
Description
I'd like to:
-
Stop relying on callers passing GH_AW_GITHUB_TOKEN via job outputs
Today consumers do:GH_AW_GITHUB_TOKEN: ${{ needs.mint-gh-aw-github-token.outputs.token }}
Masked installation tokens often do not survive as job outputs into the next job / nested workflow_call secrets: map. The product fix is not “smarter callers”, it is minting (or otherwise supplying the token) inside the lock workflow, without crossing that boundary.
-
Mint inside every job that actually uses GH_AW_GITHUB_TOKEN
The generated lock workflows (e.g. gh-aw-issue-triage.lock.yml) use secrets.GH_AW_GITHUB_TOKEN in several jobs, not only the agent container job—for example activation, agent, safe_outputs, conclusion, etc. (anything that passes github-token: or env derived from that secret).So the pending work is roughly:
For each such job: add permissions: id-token: write (minimum on that job), a first step elastic/oblt-actions/github/create-token@v1 (with the right token-policy / catalog story your org uses), and wire later steps to steps..outputs.token (or job env built from that step) instead of secrets.GH_AW_GITHUB_TOKEN when no caller secret was provided—or always prefer mint for Elastic if that is the policy.
Re-run make compile so *.lock.yml matches the edited *.md / fragments (lock files are generated; do not hand-edit as the long-term source of truth).
Importing a fragment only into runtime-setup.md is not enough by itself: that path mainly affects the agent job’s setup steps; it does not automatically fix activation / safe_outputs / conclusion unless the gh-aw pipeline applies the same bootstrap there or the compiler gains a first-class “ephemeral GitHub token step” hook for all token-consuming jobs. -
Contract / docs
Decide whether GH_AW_GITHUB_TOKEN stays as an optional override (PAT or pre-minted token) or becomes deprecated for Elastic ingress once in-workflow minting is the default.
Update gh-agent-workflows/*/README.md (and any consumer docs) so they say callers should omit GH_AW_GITHUB_TOKEN when OIDC + create-token is used inside the lock workflow. -
Same idea for other lock workflows that need ephemeral mutations
Any other gh-aw-*.md that documents GH_AW_GITHUB_TOKEN for “labels/comments must re-trigger workflows” needs the same in-workflow mint pattern (or an explicit decision that those flows only use GITHUB_TOKEN and accept no re-triggers).
Activity
github-actions commentedon May 4, 2026
3 related issues
Note
🔒 Integrity filter blocked 6 items
The following items were blocked because they don't meet the GitHub integrity level.
issue_read: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".To allow these resources, lower
min-integrityin your GitHub frontmatter:What is this? | From workflow: Trigger Duplicate Issue Detector
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
github-actions commentedon May 4, 2026
tl;dr: the repo currently does not mint ephemeral GitHub tokens for issue triage; it only accepts externally provided tokens (or falls back to
GITHUB_TOKEN), so implementing a mint step is a valid and actionable improvement.Recommendation: add an optional token-mint path (GitHub App installation token) in the trigger layer, then pass the minted token into reusable workflows via
GH_AW_GITHUB_TOKEN/GH_AW_GITHUB_MCP_SERVER_TOKEN, while preserving current secret-based override behavior.Findings
Issue-triage consumes tokens from secrets/fallbacks, not mint outputs
.github/workflows/gh-aw-issue-triage.lock.yml:695-697(GH_AW_GITHUB_MCP_SERVER_TOKEN || GH_AW_GITHUB_TOKEN || GITHUB_TOKENfor GitHub script auth).github/workflows/gh-aw-issue-triage.lock.yml:912(MCP server token comes from same fallback chain).github/workflows/gh-aw-issue-triage.lock.yml:1246,1262,1276,1290,1320,1633(safe-output/github-script handlers useGH_AW_GITHUB_TOKEN || GITHUB_TOKEN)Public contract/docs describe passing an ephemeral token, not minting one
.github/workflows/trigger-issue-triage.yml:27-33(optional commentedGH_AW_GITHUB_TOKENpass-through)gh-agent-workflows/issue-triage/README.md:38-40(optional ephemeral token example/description)gh-agent-workflows/issue-triage/example.yml:23-29(commented secret pass-through)docs/workflows/gh-agent-workflows/issue-triage.md:37,71-75(same pattern in published docs)Repo-wide setup emphasizes PAT provisioning, not runtime token minting
docs/index.md:11-15(Copilot PAT setup)docs/workflows/gh-agent-workflows.md:132-139(requiredCOPILOT_GITHUB_TOKENguidance)scripts/quick-setup.sh:215-224,248(interactive PAT capture and secret set)Constraint during triage
Verification
I ran targeted searches to verify whether minting primitives are present in source workflows and how issue-triage handles token wiring:
Detailed Action Plan
gh-agent-workflows/issue-triage/example.ymland compiled.github/workflows/trigger-issue-triage.yml.actions/create-github-app-token) and export outputs.GH_AW_GITHUB_TOKEN(and optionallyGH_AW_GITHUB_MCP_SERVER_TOKENif you want separate MCP token control).GITHUB_TOKEN, and document this precedence clearly.gh-agent-workflows/issue-triage/README.mddocs/workflows/gh-agent-workflows/issue-triage.mddocs/workflows/gh-agent-workflows.md).make compile) so.github/workflows/gh-aw-issue-triage.lock.ymlstays in sync.Related Items
GH_AW_GITHUB_TOKENto issue-triage contract/docs; pass-through support exists but no minting path.github/workflows/gh-aw-issue-triage.lock.yml.github/workflows/trigger-issue-triage.ymlgh-agent-workflows/issue-triage/README.mdNote
🔒 Integrity filter blocked 10 items
The following items were blocked because they don't meet the GitHub integrity level.
issue_read: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".issue_read: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".To allow these resources, lower
min-integrityin your GitHub frontmatter:What is this? | From workflow: Trigger Issue Triage
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
fr4nc1sc0-r4m0n commentedon May 4, 2026
/ai I'd like to explore the option about minting the token in a fragment since ephemeral token as secrets can't be shared to another jobs and therefore neither to the reusable agentic workflows. So I don't want to mint the token in the trigger but in the gh-aw-* job or in the gh-aw-fragments
github-actions commentedon May 4, 2026
Minting the GitHub API token inside the reusable
gh-aw-*workflow is a good direction, and it avoids the cross-job secret handoff problem.Today, the token is expected from the caller and then consumed inside the compiled workflow:
gh-agent-workflows/mention-in-issue/example.yml#L18-L20,trigger-mention-in-issue.yml#L24-L27).secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKENfor GitHub MCP/auth (.github/workflows/gh-aw-mention-in-issue.lock.yml#L667-L670,#L935,#L1058).GH_AW_GITHUB_TOKENas optional ephemeral/app token (gh-agent-workflows/issue-triage/README.md#L38-L40,docs/workflows/gh-agent-workflows/issue-triage.md#L36-L38).A practical design is:
GH_AW_APP_ID,GH_AW_APP_PRIVATE_KEY, optionallyGH_AW_APP_INSTALLATION_ID).gh-aw-*(or a sharedgh-aw-fragments/*auth fragment), mint the installation token at runtime (e.g. withactions/create-github-app-token) in the same job that starts MCP/safe-outputs.GH_AW_GITHUB_MCP_SERVER_TOKEN/GH_AW_GITHUB_TOKEN, thenGITHUB_TOKEN).That keeps token minting local to the called workflow execution and removes the need to pass an already-minted ephemeral token between jobs/workflows.
One important boundary: this only addresses
GH_AW_GITHUB_TOKEN/MCP GitHub API auth.COPILOT_GITHUB_TOKENis a different auth path for the Copilot engine and still needs to be provided as required byworkflow_calltoday (.github/workflows/gh-aw-mention-in-issue.md#L57-L60).Note
🔒 Integrity filter blocked 2 items
The following items were blocked because they don't meet the GitHub integrity level.
issue_read: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".issue_read: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".To allow these resources, lower
min-integrityin your GitHub frontmatter:What is this? | From workflow: Trigger Mention in Issue
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.