Skip to content

fix(usage): reject unsafe summary filters - #90

Open
XnLemon wants to merge 1 commit into
mainfrom
codex/phase2-usage-record-redaction
Open

fix(usage): reject unsafe summary filters#90
XnLemon wants to merge 1 commit into
mainfrom
codex/phase2-usage-record-redaction

Conversation

@XnLemon

@XnLemon XnLemon commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Objective

Close a Phase2 usage-accounting query safety gap by rejecting unsafe usage summary filters before aggregating or returning normalized filter scope.

Changes

  • Added shared redaction validation for UsageSummaryFilter.TenantID and UsageSummaryFilter.AppID after trimming.
  • Preserved existing missing-tenant behavior via ErrTenantIDRequired.
  • Added regression coverage for tenant/app summary filters carrying Authorization bearer tokens and API keys.

Validation

  • go test ./platform
  • go vet ./platform
  • git diff --check
  • open-code-review subagent review: 0 High / 0 Medium / 0 Low

Known Risks / Limitations

  • This is intentionally narrow and only hardens usage summary filter validation; usage record storage and aggregation semantics are otherwise unchanged.

Follow-up

  • Continue Phase2 closure on the next independently reviewable governance/security gap.

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@XnLemon, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 18 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8b3d842c-8dc4-4821-a7de-8a863899ff02

📥 Commits

Reviewing files that changed from the base of the PR and between 361e2a4 and cfa53f8.

📒 Files selected for processing (2)
  • platform/usage_summary.go
  • platform/usage_summary_test.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/phase2-usage-record-redaction

Comment @coderabbitai help to get the list of available commands.

@XnLemon
XnLemon force-pushed the codex/phase2-audit-query-redaction branch from 822da9a to 402953b Compare July 11, 2026 13:38
@XnLemon
XnLemon force-pushed the codex/phase2-usage-record-redaction branch from 9c6837b to 782305b Compare July 11, 2026 13:38
@XnLemon
XnLemon changed the base branch from codex/phase2-audit-query-redaction to main July 13, 2026 02:23
@XnLemon
XnLemon force-pushed the codex/phase2-usage-record-redaction branch from 782305b to cfa53f8 Compare July 13, 2026 02:37
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.

2 participants