Spend limits
Spend limits stop runaway sessions. Inspect has two kinds: per-session limits that apply to every session in your organization, and a Review agent cost limit that applies to the automated reviews of each pull request. Set both at Usage & Limits → Limits.
Requirements
- Session soft limit and Session hard limit can be changed by Manage security or Admin.
- Review agent cost limit can be changed by Manage code review or Admin. It's also under Settings → Review agent as Cost limit.
The Limits tab only appears for people who can change at least one of these. Every change to the session limits is recorded in the audit log as session_cost_limits.updated.
Session limits
Both session limits are off until someone sets them. Amounts are in US dollars and must be positive, and the soft limit must be lower than the hard limit.
- Session soft limit: the session pauses. Anyone who can work in the session can choose Continue on the session page, which lets it run until the hard limit.
- Session hard limit: the session stops and can't continue. Start a new session to keep working.
How enforcement works
- Inspect checks a running session's spend about every 30 seconds and stops the current turn once it reaches a limit. A turn can run slightly past the amount before the check catches it.
- When a session first reaches a limit, Inspect adds a note to the transcript and tells the session owner once: in the session's Slack thread if it has one, otherwise in a Slack DM. Owners without a linked Slack account get no Slack message.
- New prompts to a session at a limit are rejected, whichever channel they come from. The API returns
409with codesession_cost_limit_reached. - Approving a soft limit applies only to that session. The hard limit still applies.
- If an admin raises or removes a limit, a stopped session can take prompts again once its spend is under the new limit.
- Project coordinator sessions and Operate home sessions are exempt, because they run for weeks.
Review agent cost limit
The Review agent cost limit is on by default at $10. When the automated reviews of one pull request reach it, the Review agent pauses re-reviews on that pull request and skips new commits. The pause comment on the pull request includes a checkbox to resume; checking it resumes reviews if you have permission on the repository. You can also resume from the pull request's review panel in Inspect.
Turning the switch off removes the limit, so automated reviews never pause for cost. See Review agent.
Usage
Usage & Limits shows sessions, spend, and token usage by period and repository. Everyone can see their own spend. Seeing other people's cost requires the View audit logs and usage role or Admin.
A session's own cost appears in the session once it passes $5. Sessions started with a system API key always show their cost.