docs: add Cost Management reference page#20078
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
| | Pre-activation / detection | Validates the trigger, runs membership checks, evaluates `skip-if-match` conditions | 10–30 seconds | | ||
| | Agent | Runs the AI engine and executes tools | 1–15 minutes | | ||
|
|
||
| Detection runs on every trigger regardless of whether the agent job proceeds, so high-frequency triggers multiply Actions minutes quickly even when the agent is skipped. |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Added a note about the ~1.5min runner setup overhead per job in 57bf9a0. The TIP already described 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:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot add section on Agentic cost optimization. AW can be inspected and optimization automatically by socialized agents that aim at reducing AW overall cost. |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Added in 8cea974 — new Agentic Cost Optimization section that explains how a scheduled meta-agent can use the 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:
If you need me to access, download, or install something from one of these locations, you can either:
|
| 2. Deep-dive into individual runs with the `audit` tool (equivalent to `gh aw audit <run-id>`). | ||
| 3. Propose or directly apply frontmatter changes (cheaper model, tighter `skip-if-match`, lower `rate-limit`) via a pull request. | ||
|
|
||
| ### Example Optimizer Workflow |
There was a problem hiding this comment.
Removed in 262d00f. The "How It Works" description and the "What to Optimize Automatically" signal-to-action table are retained; only the example frontmatter block and its surrounding prose were deleted.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. 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:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
Adds a new reference page describing how costs accumulate when running GitHub Agentic Workflows, and links it from the docs sidebar so it’s discoverable.
Changes:
- Introduces a new
reference/cost-managementpage covering cost components, trigger risk, reduction strategies, and scenario-based estimates. - Adds “Cost Management” to the Reference section of the Starlight sidebar.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| docs/src/content/docs/reference/cost-management.md | New documentation page explaining cost drivers and optimization approaches for agentic workflows. |
| docs/astro.config.mjs | Adds the new page to the Reference sidebar navigation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| Every workflow job consumes Actions compute time billed at standard [GitHub Actions pricing](https://docs.github.com/en/billing/managing-billing-for-your-products/managing-billing-for-github-actions/about-billing-for-github-actions). A typical agentic workflow run includes at least two jobs: | ||
|
|
||
| | Job | Purpose | Typical duration | | ||
| |-----|---------|-----------------| | ||
| | Pre-activation / detection | Validates the trigger, runs membership checks, evaluates `skip-if-match` conditions | 10–30 seconds | | ||
| | Agent | Runs the AI engine and executes tools | 1–15 minutes | |
There was a problem hiding this comment.
The job breakdown here doesn’t match the documented compiled workflow structure. In reference/compilation-process.md the core jobs are activation (always) and agent (always), pre_activation is conditional, and detection only exists when safe-outputs.threat-detection is enabled. Consider updating the text/table to reflect the actual job names and which jobs are always present vs optional (and avoid combining pre-activation and detection into one row).
| Every workflow job consumes Actions compute time billed at standard [GitHub Actions pricing](https://docs.github.com/en/billing/managing-billing-for-your-products/managing-billing-for-github-actions/about-billing-for-github-actions). A typical agentic workflow run includes at least two jobs: | |
| | Job | Purpose | Typical duration | | |
| |-----|---------|-----------------| | |
| | Pre-activation / detection | Validates the trigger, runs membership checks, evaluates `skip-if-match` conditions | 10–30 seconds | | |
| | Agent | Runs the AI engine and executes tools | 1–15 minutes | | |
| Every workflow job consumes Actions compute time billed at standard [GitHub Actions pricing](https://docs.github.com/en/billing/managing-billing-for-your-products/managing-billing-for-github-actions/about-billing-for-github-actions). A typical agentic workflow run includes at least two core jobs, with additional optional jobs depending on your configuration: | |
| | Job | Purpose | Typical duration | | |
| |-----|---------|-----------------| | |
| | `activation` | Validates the trigger, runs membership checks, evaluates `skip-if-match` conditions | 10–30 seconds | | |
| | `agent` | Runs the AI engine and executes tools | 1–15 minutes | | |
| | `pre_activation` (optional) | Runs custom pre-activation logic you define in the workflow | Varies (usually seconds) | | |
| | `detection` (optional) | Runs safe-outputs threat detection when `safe-outputs.threat-detection` is enabled | 10–60 seconds | |
| Scheduled workflows fire at a fixed cadence, making cost easy to estimate and cap: | ||
|
|
||
| ```aw wrap | ||
| schedule: daily on weekdays |
There was a problem hiding this comment.
This schedule example uses a top-level schedule: key, but the trigger syntax elsewhere in the docs uses on: schedule: … (see reference/triggers.md and reference/schedule-syntax.md). To avoid confusing readers, align this snippet with the documented trigger/frontmatter format.
| schedule: daily on weekdays | |
| on: | |
| schedule: daily on weekdays |
| These are rough estimates to help with budgeting. Actual costs vary by prompt size, tool usage, model, and provider pricing. | ||
|
|
||
| | Scenario | Frequency | Actions minutes/month | Inference/month | | ||
| |----------|-----------|----------------------|-----------------| | ||
| | Weekly digest (schedule, 1 repo) | 4×/month | ~1 min | ~4–8 premium requests (Copilot) | | ||
| | Issue triage (issues opened, 20/month) | 20×/month | ~10 min | ~20–40 premium requests | | ||
| | PR review on every push (busy repo, 100 pushes/month) | 100×/month | ~100 min | ~100–200 premium requests | |
There was a problem hiding this comment.
The Actions minutes estimates in this table appear inconsistent with the earlier statement that each job incurs ~1.5 minutes of runner setup overhead (and with workflows typically having multiple jobs beyond just the agent). For example, 4 runs/month would generally exceed ~1 minute/month even before agent execution. Please clarify the assumptions (e.g., whether setup/auxiliary jobs are excluded) or adjust the estimates to be internally consistent.
| These are rough estimates to help with budgeting. Actual costs vary by prompt size, tool usage, model, and provider pricing. | |
| | Scenario | Frequency | Actions minutes/month | Inference/month | | |
| |----------|-----------|----------------------|-----------------| | |
| | Weekly digest (schedule, 1 repo) | 4×/month | ~1 min | ~4–8 premium requests (Copilot) | | |
| | Issue triage (issues opened, 20/month) | 20×/month | ~10 min | ~20–40 premium requests | | |
| | PR review on every push (busy repo, 100 pushes/month) | 100×/month | ~100 min | ~100–200 premium requests | | |
| These are rough estimates to help with budgeting. Actual costs vary by prompt size, tool usage, model, and provider pricing. Estimates include runner setup overhead (~1.5 minutes per job) and both the pre-activation and agent jobs. | |
| | Scenario | Frequency | Actions minutes/month | Inference/month | | |
| |----------|-----------|----------------------|-----------------| | |
| | Weekly digest (schedule, 1 repo) | 4×/month | ~10 min | ~4–8 premium requests (Copilot) | | |
| | Issue triage (issues opened, 20/month) | 20×/month | ~30 min | ~20–40 premium requests | | |
| | PR review on every push (busy repo, 100 pushes/month) | 100×/month | ~200 min | ~100–200 premium requests | |
No existing documentation explained the cost model for running agentic workflows — how charges accumulate, which triggers are expensive, or how to reduce spend.
New page:
reference/cost-managementCOPILOT_GITHUB_TOKENowner's premium request quotapush,check_run, andissuesas high-frequency/high-cost;scheduleandworkflow_dispatchas predictable/low-riskskip-if-match/skip-if-no-matchto bypass the agent job entirely, lighter model selection (gpt-4.1-mini,claude-haiku-4-5), prompt/context scoping,rate-limit, andschedule-based runs using fuzzy syntax (daily on weekdays)agentic-workflowsMCP tool (logs+audit) to self-inspect running workflows, identify expensive or inefficient ones, and apply targeted optimizations (model downgrade, tighter skip conditions, rate limits, trigger changes); includes a signal-to-action tableastro.config.mjsbetween Concurrency and Copilot Agent Filesagentic-workflowstool referenceOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.