github GitHub Changelog ·

Copilot CLI and SDK: Set AI credit session limits

aiinfrapreviewengineer
feature announcement

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.

Read the original announcement →

https://github.blog/changelog/2026-07-01-set-ai-credit-session-limits-in-copilot-cli-and-sdk