Skip to content

Log AI-access denials server-side - #171

Merged
pratikbodkhe merged 3 commits into
mainfrom
feat/ai-access-observability
Jul 20, 2026
Merged

Log AI-access denials server-side#171
pratikbodkhe merged 3 commits into
mainfrom
feat/ai-access-observability

Conversation

@pratikbodkhe

Copy link
Copy Markdown
Contributor

requireAiAccess returned 403s with zero server-side trace. On app.getminutia.com this hid a total outage: feature gating was baked on at build time while no profile had has_full_access, so every transcription request 403'd FEATURE_UNAVAILABLE for every user, silently, since the instance launched.

Each deny now writes one grep-stable console.error with the [ai-access] prefix, distinguishing entitlement-absent from profile-read-failure (and profile-missing), with the user id. No secrets or emails logged. Response shapes, status codes, and the grant path are byte-identical.

Tests: verify-feature-access.test.mjs extended to cover requireAiAccess via the repo's esbuild DI pattern; 9/9 pass. Two independent reviews clean.

requireAiAccess returned 403s with no server-side trace, which let a
total entitlement outage (feature gating baked on with zero grants) run
silently in production: every transcription request 403'd for weeks with
nothing in the logs. Each deny now writes one grep-stable console.error
([ai-access] prefix) distinguishing entitlement-absent from
profile-read-failure, with the user id. Response shapes, status codes,
and the grant path are unchanged.
@pratikbodkhe
pratikbodkhe merged commit 0ac6eb9 into main Jul 20, 2026
18 checks passed
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.

1 participant