GitHub adds AI credit session limits to Copilot CLI and the Copilot SDK
GitHub now lets developers cap how many AI credits an agent can spend in a single session, using Copilot CLI or the GitHub Copilot SDK.
What's new
GitHub has added the ability to set AI credit session limits in Copilot CLI and the GitHub Copilot SDK, letting a developer cap the amount an agent spends in a session. GitHub says this is especially useful for automation, where no one is actively monitoring the agent's work. A developer sets a limit before starting work or kicking off a job, and Copilot then tracks AI credit usage across the whole session, including model calls, subagents, and background work like compaction. Once the limit is reached, the agent wraps up and lets the developer know, instead of running until the task finishes or until someone manually stops it.
Setting a limit in an interactive session
In an interactive Copilot CLI session, a developer can use the /limits command to view, set, or remove a session limit. When the limit is reached, Copilot prompts the developer to raise or adjust it, and then continues from where it stopped; GitHub says there's no need to restart the task from scratch.
Bounding noninteractive runs
For noninteractive runs, such as scripted or automated jobs, a developer instead passes --max-ai-credits to bound a single run. The run ends once the limit is reached, which GitHub says makes it easy to use in scripts where nobody is watching the session live.
Why it's a soft cap, not a hard stop
GitHub is explicit that session limits are a soft cap, not a hard one. Because usage is only known after a response returns, a response that's already underway finishes before Copilot actually stops, so actual usage may slightly exceed the number a developer sets. GitHub also frames a session limit as one layer among several: it controls spend for a single session, and complements, rather than replaces, a team's overall budgets and spending limits.
Availability and versions
Session limits are available in public preview for Copilot for Individuals, Business, and Enterprise, and GitHub says they're subject to change. They're supported in Copilot CLI 1.0.66 and later, and in Copilot SDK 1.0.5 and later. To get started, GitHub says to update GitHub Copilot CLI by running copilot update in a terminal, and points to its documentation on setting a session limit in Copilot CLI and on optimizing AI usage for more detail. GitHub also invites feedback through the /feedback command in a CLI session, or by opening an issue in its public repository.
Key facts
- GitHub added AI credit session limits to Copilot CLI and the GitHub Copilot SDK, letting a developer cap how much an agent spends in one session.
- In an interactive session, /limits views, sets, or removes the cap; Copilot prompts to raise it when hit, then continues without restarting the task.
- For noninteractive runs, the --max-ai-credits flag bounds a single run and ends it once the limit is reached.
- Session limits are a soft cap: usage is only confirmed after a response returns, so actual spend can slightly exceed the set number.
- Supported in Copilot CLI 1.0.66 and later, and Copilot SDK 1.0.5 and later, in public preview for Individuals, Business, and Enterprise plans.
Check your understanding
What command lets a developer view, set, or remove a session limit during an interactive Copilot CLI session? Why does GitHub describe AI credit session limits as a soft cap rather than a hard stop?