Repository navigation
💡 Agentic CI Cost Attribution and Budget Enforcement Standard #396
Replies: 3 comments
Weekly UpdateWhat ChangedThe industry-wide AI cost crisis has intensified, validating this idea's core premise:
Updated Assessment
RecommendationAdvance — urgency increased. The Copilot Actions-minutes billing change directly impacts this org (Copilot code review runs on every non-Dependabot PR). Start with: (1) measure current Actions minutes consumed by Copilot code review vs. Claude Code workflows, (2) set per-workflow cost ceilings, (3) evaluate Bifrost or Finout CostGuard for token-level enforcement on Claude Code sessions. |
|
Move this to .github-private as vendor of agents |
|
This is a well-structured proposal. The three-layer tagging architecture is exactly what organizations need once they cross from “experimenting with agents” to “agents running in CI at scale.” One thing I would add to the budget-enforcement layer: there are two ways to cap cost. The first is observability + alerts + human gate, which this proposal covers. The second is to remove the per-token variable entirely by moving some workflows to a flat-rate GPU. For agentic CI that runs on a schedule or against every PR, a rented GPU running vLLM with an open-weights model gives you a fixed monthly ceiling and the same attribution metadata. We built UltraWork (https://vibecodingagency.com/gpu-cloud/) for that pattern — flat-rate GPU-backed coding agents with predictable monthly spend. The attribution schema itself should work the same whether the model is behind Anthropic, OpenAI, or a local vLLM endpoint: repo, workflow, pr_number, and agent_step are provider-agnostic tags. |
Uh oh!
There was an error while loading. Please reload this page.
Summary
Define an org-wide standard for attributing LLM costs to specific workflows, PRs, repos, and agent steps — with hierarchical budget caps and alerting. The org runs multiple Opus 4.6-class agent workflows (dev-lead, feature-ideation, compliance-audit, pr-review) with no visibility into per-workflow or per-repo cost breakdown. As agentic CI scales, uncontrolled spend becomes the primary operational risk.
Market Signal
User Signal
feature-ideation-reusable.ymlruns Opus 4.6 weekly with deep research — a single run can consume significant tokens with no visibility into per-phase costsdev-lead-reusable.ymltriggers on every PR event across all repos — aggregate cost scales linearly with PR volumeTechnical Opportunity
A three-layer cost attribution architecture fits naturally into the org's existing infrastructure:
anthropic-ratelimit-tokens-*)The org's centralized reusable workflow architecture means cost reporting can be added once to each reusable and inherited by all callers. GitHub Actions step summaries provide a zero-infrastructure reporting surface — no external dashboard needed to start.
Starting point — add to each reusable workflow's final step:
Assessment
Adversarial Review
Strongest objection: The org is small (internal DevX infrastructure, 4-5 repos). Enterprise-grade cost attribution with gateway-level tagging and hierarchical budgets may be over-engineering. Anthropic doesn't yet expose per-request cost in a CI-friendly format.
Rebuttal: Cost surprises are more damaging to small orgs than large ones — there's no FinOps team to catch a runaway workflow. The TrueFoundry case study shows a single misconfigured step can 10x costs overnight. The standard doesn't require a gateway to start — it begins with step-summary reporting (zero infrastructure) and grows to budget enforcement as needed. Anthropic's API returns token counts per response via response headers, and a lightweight calculation against published pricing provides sufficient cost estimation. Even simple visibility (total tokens per workflow run in the step summary) would be a major improvement over the current zero-visibility state.
Suggested Next Step
Add token usage reporting to
feature-ideation-reusable.ymlanddev-lead-reusable.ymlstep summaries as a proof of concept. Define astandards/agent-cost-attribution.mdspecifying: (1) mandatory metadata fields, (2) step-summary reporting format, (3) per-workflow budget thresholds, (4) alerting mechanism for threshold breaches.Proposed by BMAD Analyst (Mary) — 2026-06-05T10:43:42Z
All reactions