feat(moderation): per-org input moderation setting#22
Merged
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ckend) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The moderation card rendered before the providers section, so its category
multiselect combobox became getByRole('combobox').first(), breaking the
settings e2e provider-add flow. It is gated on providers?.length like quotas,
so group it next to quotas instead.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Moderation is now configurable per category, so the suites cover trusted roles too. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The gate (per-message content_filter) applies to every configured category, but strikes and the 1h cooldown must stay an anti-abuse measure for untrusted callers (anonymous/external) only. Task 3 over-applied moderationApplies to the cooldown short-circuits and to strike accrual, so a moderated trusted member could be locked out. Revert both cooldown checks and strike accrual to isUntrusted (this also restores summary/router.ts to its original state); the gate stays on moderationApplies. Adds an org-member regression test (forwards an org context through axiosAuth). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace the hardwired untrusted-only input moderation (and the admin self-test
toggle) with an org-level setting on account Settings:
anonymous,external,user,contrib,admin), persisted likequotas.moderationApplies(settings, role)helper is the single source oftruth for the gate, used by both the gateway and the summary endpoint.
isSelfTestModeration,selfTestModeration, thestartModerationselfTestbranch, and the debug-dialog toggle). The activity-page probe is unchanged.
ModerationEvent.rolewidened toEffectiveRoleso moderated trusted rolesrecord events/strikes uniformly.
Why: make moderation an explicit per-organization choice (like trace
storage) instead of a hardwired behavior — admins decide whether to moderate
and which user categories are screened.
Regression risks:
until an admin enables it per account. Operators must re-enable after deploy.