diff --git a/.github/aw/cli-commands.md b/.github/aw/cli-commands.md index f308e1cca2b..6d9809d9bad 100644 --- a/.github/aw/cli-commands.md +++ b/.github/aw/cli-commands.md @@ -249,13 +249,13 @@ gh aw env update file.yml --scope repo --dry-run # Preview without applying Example file: ```yaml -default_max_effective_tokens: "5000000" +default_max_ai_credits: "1000" default_max_turns: "12" default_model_copilot: "gpt-5-mini" default_model_codex: null # delete this variable ``` -Recognized keys include `default_max_effective_tokens`, `default_timeout_minutes`, `default_max_turns`, `default_detection_model`, `default_model_copilot`, `default_model_claude`, `default_model_codex`. The compiler resolves model selection as `GH_AW_MODEL_*` → `GH_AW_DEFAULT_MODEL_*` → built-in engine fallback. +Recognized keys include `default_max_ai_credits`, `default_max_daily_ai_credits`, `default_timeout_minutes`, `default_max_turns`, `default_detection_model`, `default_utc`, `default_model_copilot`, `default_model_claude`, `default_model_codex`. The compiler resolves model selection as `GH_AW_MODEL_*` → `GH_AW_DEFAULT_MODEL_*` → built-in engine fallback. **MCP equivalent**: Not available — run from a local terminal. diff --git a/.github/aw/safe-outputs-runtime.md b/.github/aw/safe-outputs-runtime.md index 66fbfcdf611..2916030ce97 100644 --- a/.github/aw/safe-outputs-runtime.md +++ b/.github/aw/safe-outputs-runtime.md @@ -103,7 +103,7 @@ description: Safe-output reference for runtime defaults, custom jobs, scripts, a With `[]`, references like `#123` become `` `#123` `` and `other/repo#456` becomes `` `other/repo#456` ``, preventing timeline clutter while preserving information. - `messages:` - Custom message templates for safe-output footer and notification messages (object) - - Available placeholders: `{workflow_name}`, `{run_url}`, `{agentic_workflow_url}`, `{triggering_number}`, `{workflow_source}`, `{workflow_source_url}`, `{operation}`, `{event_type}`, `{status}`, `{effective_tokens}`, `{effective_tokens_formatted}`, `{effective_tokens_suffix}` + - Available placeholders: `{workflow_name}`, `{run_url}`, `{agentic_workflow_url}`, `{triggering_number}`, `{workflow_source}`, `{workflow_source_url}`, `{operation}`, `{event_type}`, `{status}`, `{ai_credits}`, `{ai_credits_formatted}`, `{ai_credits_suffix}` - Message types: - `footer:` - Custom footer for AI-generated content - `footer-install:` - Installation instructions appended to footer diff --git a/.github/aw/syntax-agentic.md b/.github/aw/syntax-agentic.md index f91efb1bb8f..a360d3e5f77 100644 --- a/.github/aw/syntax-agentic.md +++ b/.github/aw/syntax-agentic.md @@ -30,7 +30,7 @@ description: Agentic workflow specific frontmatter fields for GitHub Agentic Wor - Supported by all engines - **`max-turns:`** - AWF turn cap applied consistently across all agentic engines (integer or expression, e.g. `${{ inputs.max-turns }}`). The engine-level `engine.max-turns` is a deprecated alias kept for backward compatibility — prefer this top-level field. Not supported by the `gemini` engine. - **`max-ai-credits:`** - Per-run AI Credits (AIC) budget enforced by the AWF firewall (integer or `K`/`M` short-form string like `100M`; default `1000`). Set a negative value to disable enforcement and token steering. See [token-optimization.md](token-optimization.md). -- **`max-daily-ai-credits:`** - Per-user 24-hour ET guardrail: activation blocks execution once the triggering user's aggregated ET for this workflow over the last 24h exceeds the threshold (integer or `K`/`M` short-form string, or `-1`). Enabled by default with a system default threshold; set `-1` to disable or an explicit value to override. See [token-optimization.md](token-optimization.md). +- **`max-daily-ai-credits:`** - Per-user 24-hour AI Credits (AIC) guardrail: activation blocks execution once the triggering user's aggregated AI Credits for this workflow over the last 24h exceed the threshold (integer or `K`/`M` short-form string, or `-1`). Enabled by default with a system default threshold; set `-1` to disable or an explicit value to override. See [token-optimization.md](token-optimization.md). - **`user-rate-limit:`** - Rate limiting configuration to prevent users from triggering the workflow too frequently (object) - **`max-runs-per-window:`** - Maximum runs allowed per user per time window (required, integer 1-10) - **`window:`** - Time window in minutes (integer 1-180, default: 60) diff --git a/.github/aw/token-optimization.md b/.github/aw/token-optimization.md index 49513b8d54d..627d54d6210 100644 --- a/.github/aw/token-optimization.md +++ b/.github/aw/token-optimization.md @@ -33,7 +33,7 @@ gh aw audit --json Key fields in the output: -- `agent_usage.effective_tokens` — the normalized cost metric (accounts for model price differences and cache discounts) +- `agent_usage.aic` — AI Credits (AIC), the normalized cost metric (1 AIC = $0.01; accounts for model price differences and cache discounts); `agent_usage.effective_tokens` remains available as the underlying token-normalized value - `agent_usage.input_tokens` / `agent_usage.output_tokens` — raw token counts - `agent_usage.cache_read_tokens` / `agent_usage.cache_write_tokens` — tokens served from the prompt cache @@ -361,7 +361,7 @@ To maximize cache hits: ## Technique 9 — Cap Spend with AI-Credit Guardrails -Two top-level frontmatter fields enforce ET budgets directly, independent of the techniques above. Both accept an integer or a `K`/`M` short-form string (e.g. `100M`, `500K`). Typical workflow range: `100` to `2500`. +Two top-level frontmatter fields enforce AI Credit budgets directly, independent of the techniques above. Both accept an integer or a `K`/`M` short-form string (e.g. `100M`, `500K`). Typical workflow range: `100` to `2500`. - **`max-ai-credits:`** — Per-run AI credit budget enforced by the AWF firewall/API proxy (default `1000`). The agent is steered to stay within budget; set a negative value to disable enforcement and steering. - **`max-daily-ai-credits:`** — Per-user 24-hour guardrail. At activation, gh-aw sums the triggering user's AI credits across their runs of this workflow over the last 24 hours and blocks execution once the total exceeds the threshold. Enabled by default with a system default threshold; set `-1` to disable, or an explicit value to override the default.