Contract 2.0 §4.4 entitlements are read but not enforced, so a tenant can exceed the SKU limits (STD 5/50, BUS 25/500, ENT unlimited targets/scans per month) at will. Decision 1 of the plan: a trial over quota gets a hard 429; a paying tenant may exceed the quota and the overage is emitted as usage for CRA-CSA-CLD-SCAN with a banner.
What to change
Enforce limits.targets on target create, demo-seed and DAST target add.
Enforce scans_per_month on every scan trigger: manual, scheduled and webhook.
Trial over quota → 429 + X-Trial-Limit-Reset.
Paying tenant over quota → allow, emit the overage as usage for CRA-CSA-CLD-SCAN, and show a banner (dashboard side in MVP-1.10).
Re-check freshly on writes when the cached entitlement is older than 60 s.
Check the Werkbank add-on entitlement.
Emit the bp_entitlement_check_* metrics.
When the registry is unset in production, fail closed (api/server.rs:63-98, registry.rs).
Acceptance
Creating one target past limits.targets is refused for both trial and paid, with the SKU limit in the error.
A trial tenant over scans_per_month receives 429 with X-Trial-Limit-Reset; a stage script covers it.
A paid tenant over quota still scans and produces an overage usage record.
Manual, scheduled and webhook triggers all go through the same check.
bp_entitlement_check_* metrics appear on /metrics (MVP-1.7).
With APP_ENV=production and no registry configured, the agent fails closed (MVP-0.1).
## Goal
Contract 2.0 §4.4 entitlements are read but not enforced, so a tenant can exceed the SKU limits (STD 5/50, BUS 25/500, ENT unlimited targets/scans per month) at will. Decision 1 of the plan: a trial over quota gets a hard 429; a paying tenant may exceed the quota and the overage is emitted as usage for `CRA-CSA-CLD-SCAN` with a banner.
## What to change
- Enforce `limits.targets` on target create, demo-seed and DAST target add.
- Enforce `scans_per_month` on every scan trigger: manual, scheduled and webhook.
- Trial over quota → **429 + `X-Trial-Limit-Reset`**.
- Paying tenant over quota → allow, emit the overage as usage for `CRA-CSA-CLD-SCAN`, and show a banner (dashboard side in MVP-1.10).
- Re-check freshly on writes when the cached entitlement is older than 60 s.
- Check the Werkbank add-on entitlement.
- Emit the `bp_entitlement_check_*` metrics.
- When the registry is unset in production, fail closed (`api/server.rs:63-98`, `registry.rs`).
## Acceptance
- [ ] Creating one target past `limits.targets` is refused for both trial and paid, with the SKU limit in the error.
- [ ] A trial tenant over `scans_per_month` receives 429 with `X-Trial-Limit-Reset`; a stage script covers it.
- [ ] A paid tenant over quota still scans and produces an overage usage record.
- [ ] Manual, scheduled and webhook triggers all go through the same check.
- [ ] `bp_entitlement_check_*` metrics appear on `/metrics` (MVP-1.7).
- [ ] With `APP_ENV=production` and no registry configured, the agent fails closed (MVP-0.1).
sharang
added this to the Production MVP milestone 2026-09-20 20:17:20 +00:00
Closing as superseded by t72 metering (#927-#932): extra targets are billed instead of refused and Prüftage replace the overage, with admission in compliance-core/src/models/metering.rs. A trial 429 or entitlement metrics would be new issues if still wanted.
Closing as superseded by t72 metering (#927-#932): extra targets are billed instead of refused and Prüftage replace the overage, with admission in `compliance-core/src/models/metering.rs`. A trial 429 or entitlement metrics would be new issues if still wanted.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Goal
Contract 2.0 §4.4 entitlements are read but not enforced, so a tenant can exceed the SKU limits (STD 5/50, BUS 25/500, ENT unlimited targets/scans per month) at will. Decision 1 of the plan: a trial over quota gets a hard 429; a paying tenant may exceed the quota and the overage is emitted as usage for
CRA-CSA-CLD-SCANwith a banner.What to change
limits.targetson target create, demo-seed and DAST target add.scans_per_monthon every scan trigger: manual, scheduled and webhook.X-Trial-Limit-Reset.CRA-CSA-CLD-SCAN, and show a banner (dashboard side in MVP-1.10).bp_entitlement_check_*metrics.api/server.rs:63-98,registry.rs).Acceptance
limits.targetsis refused for both trial and paid, with the SKU limit in the error.scans_per_monthreceives 429 withX-Trial-Limit-Reset; a stage script covers it.bp_entitlement_check_*metrics appear on/metrics(MVP-1.7).APP_ENV=productionand no registry configured, the agent fails closed (MVP-0.1).Closing as superseded by t72 metering (#927-#932): extra targets are billed instead of refused and Prüftage replace the overage, with admission in
compliance-core/src/models/metering.rs. A trial 429 or entitlement metrics would be new issues if still wanted.