feat: add AI budget policy and period deployment config (#25122)

Closes
https://linear.app/codercom/issue/AIGOV-283/add-deployment-config-for-ai-budget-policy-and-period

Adds `CODER_AI_BUDGET_POLICY` and `CODER_AI_BUDGET_PERIOD` deployment
options for AI Governance cost controls.
This commit is contained in:
Yevhenii Shcherbina
2026-05-12 10:48:36 -04:00
committed by GitHub
parent fabf7d31fc
commit b5e1ea33d8
11 changed files with 202 additions and 0 deletions
+15
View File
@@ -68,6 +68,11 @@ export interface AIBridgeConfig {
readonly structured_logging: boolean;
readonly send_actor_headers: boolean;
readonly allow_byok: boolean;
/**
* Budget settings for AI Governance cost controls.
*/
readonly budget_policy?: string;
readonly budget_period?: string;
/**
* Circuit breaker protects against cascading failures from upstream AI
* provider overload (503, 529).
@@ -305,6 +310,16 @@ export interface AIBridgeUserPrompt {
readonly created_at: string;
}
// From codersdk/deployment.go
export type AIBudgetPeriod = "month";
export const AIBudgetPeriods: AIBudgetPeriod[] = ["month"];
export const AIBudgetPolicies: AIBudgetPolicy[] = ["highest"];
// From codersdk/deployment.go
export type AIBudgetPolicy = "highest";
// From codersdk/deployment.go
export interface AIConfig {
readonly bridge?: AIBridgeConfig;