{"id":520542,"date":"2026-07-01T21:13:09","date_gmt":"2026-07-01T21:13:09","guid":{"rendered":"https:\/\/www.newsbeep.com\/il\/520542\/"},"modified":"2026-07-01T21:13:09","modified_gmt":"2026-07-01T21:13:09","slug":"set-ai-credit-session-limits-in-copilot-cli-and-sdk","status":"publish","type":"post","link":"https:\/\/www.newsbeep.com\/il\/520542\/","title":{"rendered":"Set AI credit session limits in Copilot CLI and SDK"},"content":{"rendered":"<p>You can now set AI credit session limits in Copilot CLI and the GitHub Copilot SDK to cap the amount an agent spends in a session. This is especially useful for automation, where no one is actively monitoring the agent\u2019s work.<\/p>\n<p>Set a limit before you start work or kick off jobs, and Copilot tracks AI credit usage across the entire session, including model calls, subagents, and background work like compaction. When the limit is reached, the agent wraps up and lets you know instead of running until the task is finished or until you manually stop it.<\/p>\n<p>In an interactive session, use \/limits to view, set, or remove your limit. When it\u2019s reached, Copilot prompts you to raise or adjust it and then continues from where it stopped. There\u2019s no need to restart the task.<br \/>\nFor noninteractive runs, pass &#8211;max-ai-credits to bound a single run. The run ends when the limit is reached, so it\u2019s easy to use in scripts.<\/p>\n<p>Session limits are a soft cap. Since usage is only known after a response returns, a response that\u2019s already underway finishes before Copilot stops, so actual usage may slightly exceed the number you set. A session limit controls spend for one session\u2014it complements, but doesn\u2019t replace, your overall budgets and spending limits.<\/p>\n<p>Session limits are available in public preview for Copilot for Individuals, Business, and Enterprise, and are subject to change. They\u2019re supported in Copilot CLI 1.0.66 and later, and in Copilot SDK 1.0.5 and later.<\/p>\n<p>To get started, update GitHub Copilot CLI by running copilot update in your terminal. To learn more, see <a href=\"https:\/\/docs.github.com\/copilot\/how-tos\/copilot-cli\/use-copilot-cli\/set-session-limit\" rel=\"nofollow noopener\" target=\"_blank\">Setting a session limit in Copilot CLI<\/a> and <a href=\"https:\/\/docs.github.com\/copilot\/tutorials\/optimize-ai-usage\" rel=\"nofollow noopener\" target=\"_blank\">Optimize AI usage<\/a>.<\/p>\n<p>Share feedback with the \/feedback command in a CLI session or open an issue in <a href=\"https:\/\/github.com\/github\/copilot-cli\" rel=\"nofollow noopener\" target=\"_blank\">our public repository<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"You can now set AI credit session limits in Copilot CLI and the GitHub Copilot SDK to cap&hellip;\n","protected":false},"author":2,"featured_media":113920,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[345,343,344,85,46,125],"class_list":["post-520542","post","type-post","status-publish","format-standard","has-post-thumbnail","category-artificial-intelligence","tag-ai","tag-artificial-intelligence","tag-artificialintelligence","tag-il","tag-israel","tag-technology"],"_links":{"self":[{"href":"https:\/\/www.newsbeep.com\/il\/wp-json\/wp\/v2\/posts\/520542","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.newsbeep.com\/il\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.newsbeep.com\/il\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/il\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/il\/wp-json\/wp\/v2\/comments?post=520542"}],"version-history":[{"count":0,"href":"https:\/\/www.newsbeep.com\/il\/wp-json\/wp\/v2\/posts\/520542\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/il\/wp-json\/wp\/v2\/media\/113920"}],"wp:attachment":[{"href":"https:\/\/www.newsbeep.com\/il\/wp-json\/wp\/v2\/media?parent=520542"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.newsbeep.com\/il\/wp-json\/wp\/v2\/categories?post=520542"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.newsbeep.com\/il\/wp-json\/wp\/v2\/tags?post=520542"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}