⚡ Reduce token waste in secret-digger-copilot prompt#1882
Closed
⚡ Reduce token waste in secret-digger-copilot prompt#1882
Conversation
9 tasks
- Remove duplicate Run ID/Workflow/Engine/Repository from user message - Condense Investigation Workflow steps 1-4 in shared/secret-audit.md - Remove redundant Security Research Guidelines section - Recompile lock file with post-processing Agent-Logs-Url: https://github.com/github/gh-aw-firewall/sessions/71eda39c-6223-4700-abc9-563e21fcf062
Copilot
AI
changed the title
[WIP] Optimize Copilot token usage and cost
⚡ Reduce token waste in secret-digger-copilot prompt
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Secret Digger (Copilot) failure runs consume ~2.6M tokens ($5.03/run, ~$35/day across 7 daily failures). The prompt includes duplicate context and verbose instructions that inflate every turn.
Changes
Remove duplicate context from user message (
secret-digger-copilot.md):Repository,Run ID,Workflow,Engineare already in the<system>block injected by gh-aw. The duplicateRun IDalso breaks cross-run prefix caching.Condense Investigation Workflow (
shared/secret-audit.md): Replaced 4 verbose steps (Load → Select → Execute → Update Cache, ~600 chars) with 3 one-liners. Saves ~450–625 tokens/turn.Remove Security Research Guidelines (
shared/secret-audit.md): Entirely redundant with the MISSION statement. Six bullet points of "be thorough" adds nothing.Recompile + post-process lock file.
Not implemented
max-turns: 8— the highest-impact recommendation (~$25/day) — is rejected by gh-aw v0.67.4:This requires an upstream gh-aw change to add copilot engine turn-limit support.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/github/gh-aw-actions/git/ref/tags/v0.67.4/usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v0.67.4 --jq .object.sha(http block)If you need me to access, download, or install something from one of these locations, you can either: