Skip to content

Enforce proxy budgets#322

Merged
mostlydev merged 2 commits into
masterfrom
issue-310-budget-enforcement
Jun 23, 2026
Merged

Enforce proxy budgets#322
mostlydev merged 2 commits into
masterfrom
issue-310-budget-enforcement

Conversation

@mostlydev

@mostlydev mostlydev commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • add x-claw.budget / x-claw.budget-defaults parsing, validation, inheritance, and compiled cllama metadata
  • enforce per-agent spend/request caps in cllama before provider dispatch, including live governance overrides from fleet.budget.set
  • publish and pin cllama v0.7.4, and add docs, changelog, and a Docker spike example

Closes #310

Verification

  • go test ./internal/infraimages ./cmd/claw-api ./internal/pod ./cmd/claw
  • go run ./scripts/check-release-infra-tags --release-tag v0.23.1
  • npm run build in site/
  • go test ./...
  • go vet ./...
  • go test ./... in cllama/
  • go vet ./... in cllama/
  • git diff --check -- . ':!cllama' && git -C cllama diff --check
  • go test -tags spike -run TestSpikeBudgetEnforcementAndOverride -count=1 -timeout 10m ./cmd/claw
  • docker buildx imagetools inspect ghcr.io/mostlydev/cllama:v0.7.4 -> sha256:8fbbb17904a1900175859fe817ad45651f6adfcbbbd12b4d85ada39c1634c40e

Closes #306 (ADR-025 policy plane architecture ratified; #307/#308 hook implementation deferred).

Ratifies the policy-plane design (the #306 convergence gate) so #307 (the
PolicyEvaluator hook interface) and #308 (the compiled rules artifact) build
against a fixed contract: an optional PolicyEvaluator consulted over HTTP
(nil = bit-identical passthrough), the five interception points, the
{OpenAI,Anthropic}x{plain,managed}x{stream,non-stream} hook-order matrix and
its two invariants (managed mode is always non-stream upstream so it is always
hard-gateable; plain+stream is the only true streaming egress -> gate-before-
stream + score-on-complete), governor-principal non-recursion via a
policy_exempt metadata flag, the four-hook contract, CLLAMA_POLICY_* config,
and v1-vs-deferred scope. Records #310 budget enforcement as the first concrete
enforcement, shipped in cllama core independent of the policy plane.

Design only; #307/#308 implementation deferred.
@mostlydev mostlydev merged commit f50f3e1 into master Jun 23, 2026
2 checks passed
@mostlydev mostlydev deleted the issue-310-budget-enforcement branch June 23, 2026 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proxy-enforced compute budgets and rate limits ADR-025: policy plane architecture and policy service contract

1 participant