Skip to content

⚡ Reduce token waste in secret-digger-copilot prompt#1882

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/optimize-copilot-token-costs
Closed

⚡ Reduce token waste in secret-digger-copilot prompt#1882
Copilot wants to merge 2 commits intomainfrom
copilot/optimize-copilot-token-costs

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 10, 2026

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, Engine are already in the <system> block injected by gh-aw. The duplicate Run ID also 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:

error: max-turns not supported: engine 'copilot' does not support the max-turns feature

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
    • Triggering command: /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:

- 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
Copilot AI requested a review from lpcox April 10, 2026 17:32
@lpcox lpcox closed this Apr 10, 2026
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.

⚡ Copilot Token Optimization2026-04-10 — Secret Digger (Copilot)

2 participants