Copilot CLI and SDK: Set AI credit session limits
GitHub Copilot CLI and SDK now support setting AI credit session limits to control agent spending per session. This feature is beneficial for automation to prevent runaway costs and provides flexibility for interactive and non-interactive runs. The session limits are currently in public preview and available in Copilot CLI 1.0.66+ and SDK 1.0.5+.
- →Set AI credit session limits in Copilot CLI and SDK
- →Interactive session limit management
- →Non-interactive run limit configuration
- →Session limits are a soft cap and complement budgets
Features (1) ›
- Set AI credit session limits in Copilot CLI and SDK
New functionality allows setting AI credit session limits in Copilot CLI and GitHub Copilot SDK to cap agent spending per session, which is useful for automation. Copilot tracks AI credit usage, and upon reaching the limit, the agent concludes the session and notifies the user.
Enhancements (2) ›
- Interactive session limit management
In interactive sessions, users can view, set, or remove limits using the `/limitsto` command. When a limit is reached, Copilot will prompt the user to adjust it and then resume the task without requiring a restart.
- Non-interactive run limit configuration
For non-interactive runs, the `--max-ai-credits` flag can be used to bound a single run. The run will terminate when the specified limit is reached, making it suitable for use in scripts.
Notes (1) ›
- Session limits are a soft cap and complement budgets
Session limits act as a soft cap, as usage is only known after a response returns, meaning actual usage might slightly exceed the set limit. These session limits complement, but do not replace, overall budgets and spending limits.
https://github.blog/changelog/2026-07-01-set-ai-credit-session-limits-in-copilot-cli-and-sdk
Related releases
- GitHub improves tools for managing blocked users GitHub Changelog ·
- Shared agentic work with GitHub Copilot in Microsoft Teams GitHub Changelog ·
- GitHub Copilot Integrates with Slack for Agentic Development Workflows GitHub Changelog ·
- GitHub's Issues Sidebar Now Supports Pinned Views, Plus Other Enhancements GitHub Changelog ·
- Windows 11 ARM64 VS2026 image generally available for GitHub Actions GitHub Changelog ·
- Code scanning adds a mitigated alert dismissal reason GitHub Changelog ·