Rate Limiting Controls
GitHub Agentic Workflows uses defense-in-depth to prevent runaway workflows: bot non-triggering, concurrency controls, timeouts, rate limiting, read-only agents, safe output limits, built-in delays, and manual review gates.
Bot Non-Triggering
Section titled “Bot Non-Triggering”The github-actions[bot] account does not trigger workflow events. When a workflow creates an issue or posts a comment via safe outputs, it won’t trigger other workflows - preventing infinite loops.
on: issues: types: [opened]This workflow won’t be triggered by issues created by safe outputs.
Concurrency Groups
Section titled “Concurrency Groups”Workflows use dual concurrency control: per-workflow (based on context) and per-engine (one agent job at a time per AI engine).
concurrency: group: gh-aw-${{ github.workflow }}
jobs: agent: concurrency: group: gh-aw-copilotThis prevents parallel execution explosions and AI resource exhaustion. See Concurrency Control for trigger-specific patterns.
Timeouts
Section titled “Timeouts”The agent step defaults to 20 minutes, set by the top-level timeout-minutes field. Other jobs default to the platform limit of 360 minutes. Custom runners support longer timeouts:
timeout-minutes: 120 # Apply 120-minute timeout to the agent execution stepstop-after limits how long a workflow can run:
stop-after: +48h # Stop after 48 hours from triggerIt is checked in the agent job’s if: condition and accepts absolute dates or relative deltas (minimum unit: hours).
Read-Only Agent Tokens
Section titled “Read-Only Agent Tokens”Agents run read-only. All writes (issues, comments, workflow triggers) go through the safe outputs system, which validates, audits, and rate-limits them.
permissions: contents: read issues: read pull-requests: readSafe Output Limits
Section titled “Safe Output Limits”High-risk operations have default max limits to prevent exponential growth:
| Operation | Default Max | Purpose |
|---|---|---|
assign-to-agent | 1 | Prevent agent cascades |
assign-to-bot | 1 | Prevent bot loops |
dispatch-workflow | 1 | Prevent workflow explosions |
safe-outputs: assign-to-agent: max: 3 # Override default if neededWithout limits, one workflow could spawn three agents, each spawning three more, creating exponential growth. The default max of 1 ensures linear progression.
Built-In Delays
Section titled “Built-In Delays”Critical operations have hardcoded, non-disableable delays:
- Agent assignments: 10-second delay between each assignment
- Workflow dispatches: 5-second delay between each dispatch
Manual Review Gates
Section titled “Manual Review Gates”Require manual approval for sensitive operations using GitHub Environments:
safe-outputs: dispatch-workflow: environment: production # Requires approvalCreate the environment under Settings → Environments with reviewers, then reference it. Use for production dispatches, cross-repo operations, or security-sensitive actions.
Rate Limiting Per User
Section titled “Rate Limiting Per User”user-rate-limit is experimental; gh aw compile emits an experimental feature warning when a workflow uses it. This limits how often each user can trigger a workflow:
user-rate-limit: max-runs-per-window: 5 # Required: Maximum runs per window (1-10) window: 60 # Optional: Time window in minutes (default: 60, max: 180) events: [workflow_dispatch, issue_comment] # Optional: Specific events (inferred from `on:` when omitted; fallback to all supported programmatic events) ignored-roles: [admin, maintain] # Optional: Roles exempt from rate limiting (default: [admin, maintain, write])The pre-activation job checks recent runs and cancels the current run if the limit is exceeded.
Role exemptions: Users with admin, maintain, or write roles are exempt by default. To rate-limit everyone, set ignored-roles: [].
Daily AI Credits Guardrail
Section titled “Daily AI Credits Guardrail”The max-daily-ai-credits frontmatter field caps the total AI Credits a workflow can consume across all runs in a rolling 24-hour window:
max-daily-ai-credits: 5000 # Block new runs once this workflow # exceeds 5000 AIC in the last 24 hoursRuns fail before the agent starts if the workflow already exceeds the threshold in the last 24 hours. The default threshold is 5000 AIC (approximately $50 USD). Set the value to -1 to disable the guardrail for a specific workflow.
Bypass exceptions: The guardrail is skipped for user-initiated and command-driven runs, so it never blocks intentional actions:
- Manual triggers:
workflow_dispatchruns from the GitHub UI or CLI. - Slash and label commands: Runs triggered by slash commands (direct or dispatcher-routed) or label commands.
- Centralized invocations:
workflow_callandrepository_dispatchevents. The calling workflow manages its own budget.
GitHub API Quota Diagnostics
Section titled “GitHub API Quota Diagnostics”GitHub API quota is separate from daily AI Credits. Daily AIC inspection reports these quota classifications:
quota_exhausted: Zero remaining requests, from a rate-limit response or protective quota stop.quota_reserve: Inspection stopped at the protective reserve.rate_limited: A rate-limit response. Missing quota headers do not imply zero remaining.authentication_failed(HTTP 401) andpermission_denied(403 without rate-limit evidence): Kept even at an empty budget.
Quota-limited accounting is unverified and blocks agent startup. It is not a measured credit overrun. Reset and Retry-After values are earliest retry times, not automatic retries. Restore failures name the stopped read (such as current_run) and attempt count in logs and the step summary.
Example: Multiple Protection Layers
Section titled “Example: Multiple Protection Layers”---name: Safe Agent Workflowengine: id: copilottimeout-minutes: 60 # Job timeouton: issues: types: [opened]user-rate-limit: max-runs-per-window: 5 window: 60stop-after: +2h # Workflow time limitsafe-outputs: assign-to-agent: max: 1 environment: production---This combines rate limiting (5/hour per user), concurrency control, timeouts (60 min job, 2h workflow), manual approval, and a max-1 agent limit.
Best Practices
Section titled “Best Practices”Start with conservative limits and raise them as needed. Use environments for high-risk operations, such as production dispatches.
Troubleshooting
Section titled “Troubleshooting”Workflow immediately cancelled: Check rate limit in pre-activation logs, verify concurrency queue, or confirm stop-after hasn’t exceeded.
Agent assignments slow: Built-in 10-second delays are intentional. Five agents = ~40 seconds total.
Workflow dispatch not triggering: Verify max dispatch limit (default: 1), check 5-second delay, confirm target workflow has on: workflow_dispatch, or check pending environment approvals.
Learn More
Section titled “Learn More”- Safe Outputs - Write operations with validation
- Concurrency Control - Execution serialization
- Frontmatter Reference - Complete configuration options
- Permissions - Token scopes and access control
- GitHub Actions Security - GitHub’s security guidance