Repository navigation
Description
The enterprise controls docs say an organization can set vars.GH_AW_DEFAULT_MAX_AI_CREDITS to -1 to remove the per-run AI credit budget, and that positive values accept K/M suffixes such as 100M. The threat-detection docs say the same of vars.GH_AW_DEFAULT_DETECTION_MAX_AI_CREDITS. The AI credits specification makes the first a requirement: a runtime -1 MUST disable the budget and omit maxAiCredits from the firewall config (section 10.5, test T-AIC-PR-003).
Neither works today. Since #58116 moved the expression into the step environment, the compiled AWF step only accepts a plain whole number and resets anything else to the built-in default. Every compiled workflow has this guard, for example in smoke-copilot.lock.yml:
GH_AW_MAX_AI_CREDITS="${GH_AW_MAX_AI_CREDITS:-1000}"
if [[ ! "$GH_AW_MAX_AI_CREDITS" =~ ^[0-9]+$ ]]; then
GH_AW_MAX_AI_CREDITS="1000"
fiSo an organization that sets the variable to -1 still gets a budget of 1000 credits (400 for threat detection), and one that sets 100M gets 1000. Nothing in the run says the value was ignored. max-ai-credits: -1 in frontmatter still works, because the compiler writes the literal and AWF treats a maxAiCredits of -1 as no budget. GH_AW_DEFAULT_EVALS_MAX_AI_CREDITS goes through the same guard.
What we'd like
The runtime variables should accept what the docs and spec promise: -1 removes the budget, and K/M suffixes are expanded the same way the compiler expands them in frontmatter. Any other value should still fall back to the default, but with a warning in the step log that names the variable, so an organization can see that its setting was ignored. The spec's T-AIC-PR-003 needs a test that covers the compiled step, not just the expression.
If maintainers would rather keep the runtime variables to plain whole numbers, the docs and spec section 10.5 should say so instead, and the warning is still worth adding.
gh-aw#77087 (docs for AWF's budget notices) describes the current fallback in the enterprise controls and threat-detection pages, adds an implementation-status note to section 10.5, and marks T-AIC-PR-003 as not yet implemented. Those should be updated or removed with whichever fix lands here.
Activity
docs: update cost-management budget notice text and token-steering au…
docs: describe AWF's on-by-default budget notices for `token-steering…
rabeckett commentedon Nov 24, 2026
Closing this as done. #77479 made the compiled step accept
-1, so an organization variable of-1now removes the budget as section 10.5 requires (T-AIC-PR-003). ForK/Msuffixes we went with the second option: the enterprise controls and threat-detection docs now say the runtime variables take a plain whole number or-1, and that anything else, such as100M, falls back to the default.The one piece that didn't land is a warning in the step log when a value is ignored. It was part of #77185, which was closed without merging. If that bites anyone, I'll open a separate issue for it.