Sub-ticket of epic #346. Depends on #347; hardens #348–#350. Gate for opening the studio to all students — until this lands, access stays staff + pilot cohort.
What: the guardrails that make a GPU-backed generative feature safe and fair on a minors platform with one 24 GB card.
Scope:
Prompt-side moderation in SubmitArtAssetCommand / motion-prompt validation (FluentValidation via the existing ValidationBehavior + a moderation service): blocklist + classifier before any job is queued; rejected prompts get a kid-appropriate message and are logged for staff (not silently dropped)
Output-side NSFW gating (introduced per-stage in #349) promoted to a shared worker service with one policy: flag → stage fails → asset flagged → staff review queue; add staff override to release false positives
Per-student quotas: GPU-minutes and asset-count per day/week (config), enforced at submit time with a clear "come back tomorrow / ask your teacher" UX; staff exempt; usage surfaced on the asset library ("you've used 12 of 30 minutes this week")
Queue fairness: one active pipeline per student (additional submissions park as drafts), FIFO with staff priority lane; queue-position events already surfaced in P5's UI
Rate limiting on submit/upload endpoints via the existing RedisRateLimitMiddleware conventions (return 429 — see #341)
Audit trail: who generated what, prompts, moderation verdicts — queryable by staff (Mongo, staff-only query + controller action)
Note: decide the moderation classifier here (local model on the GPU host vs a small CPU model vs external API) — a minors platform probably wants belt-and-suspenders: blocklist + classifier. Keycloak realm roles (student/staff/admin, mapped in Authentication.cs::MapRealmRolesToClaims) drive exemptions.
Acceptance: the abuse drills pass; a student cannot exceed quota, jump the queue, see a flagged image, or get raw model errors; staff can review flagged assets and release false positives; every generation is attributable in the audit log.
Sub-ticket of epic #346. Depends on #347; hardens #348–#350. **Gate for opening the studio to all students** — until this lands, access stays staff + pilot cohort.
**What:** the guardrails that make a GPU-backed generative feature safe and fair on a minors platform with one 24 GB card.
**Scope:**
- [ ] **Prompt-side moderation** in `SubmitArtAssetCommand` / motion-prompt validation (FluentValidation via the existing `ValidationBehavior` + a moderation service): blocklist + classifier before any job is queued; rejected prompts get a kid-appropriate message and are logged for staff (not silently dropped)
- [ ] Output-side NSFW gating (introduced per-stage in #349) promoted to a shared worker service with one policy: flag → stage fails → asset flagged → staff review queue; add staff override to release false positives
- [ ] **Per-student quotas**: GPU-minutes and asset-count per day/week (config), enforced at submit time with a clear "come back tomorrow / ask your teacher" UX; staff exempt; usage surfaced on the asset library ("you've used 12 of 30 minutes this week")
- [ ] **Queue fairness**: one active pipeline per student (additional submissions park as drafts), FIFO with staff priority lane; queue-position events already surfaced in P5's UI
- [ ] Rate limiting on submit/upload endpoints via the existing `RedisRateLimitMiddleware` conventions (return 429 — see #341)
- [ ] Audit trail: who generated what, prompts, moderation verdicts — queryable by staff (Mongo, staff-only query + controller action)
- [ ] Abuse drills documented as integration tests: blocked prompt, NSFW output, quota exhaustion, queue flooding
**Note:** decide the moderation classifier here (local model on the GPU host vs a small CPU model vs external API) — a minors platform probably wants belt-and-suspenders: blocklist + classifier. Keycloak realm roles (`student`/`staff`/`admin`, mapped in `Authentication.cs::MapRealmRolesToClaims`) drive exemptions.
**Acceptance:** the abuse drills pass; a student cannot exceed quota, jump the queue, see a flagged image, or get raw model errors; staff can review flagged assets and release false positives; every generation is attributable in the audit log.
Both halves merged to master: backend PR #70 (blocklist prompt moderation with kid-safe rejections + audit, per-student quotas — one active pipeline / 10 per day / 30 GPU-min per week — usage endpoint, staff review queue with dismiss/release wired to restart-from-stage, full audit trail, rate limits) and angular PR #118 (usage meter in the studio shell, staff review queue at /admin/art-review with blurred-by-default quarantine previews, inline kid-safe composer errors). Output-side NSFW gating landed earlier via #67/#69 (#349/#362). Staff/admin exempt throughout.
The gate for opening the studio beyond staff/pilot is now in place. Remaining nuances tracked elsewhere: ML prompt classifier (interface ready, documented), queue-position events (#364 — needs GpuCoordinator emit), owner display-name lookup in the review queue (small follow-up if wanted). Closing.
Both halves merged to `master`: backend PR #70 (blocklist prompt moderation with kid-safe rejections + audit, per-student quotas — one active pipeline / 10 per day / 30 GPU-min per week — usage endpoint, staff review queue with dismiss/release wired to restart-from-stage, full audit trail, rate limits) and angular PR #118 (usage meter in the studio shell, staff review queue at `/admin/art-review` with blurred-by-default quarantine previews, inline kid-safe composer errors). Output-side NSFW gating landed earlier via #67/#69 (#349/#362). Staff/admin exempt throughout.
The gate for opening the studio beyond staff/pilot is now in place. Remaining nuances tracked elsewhere: ML prompt classifier (interface ready, documented), queue-position events (#364 — needs GpuCoordinator emit), owner display-name lookup in the review queue (small follow-up if wanted). Closing.
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.
Sub-ticket of epic #346. Depends on #347; hardens #348–#350. Gate for opening the studio to all students — until this lands, access stays staff + pilot cohort.
What: the guardrails that make a GPU-backed generative feature safe and fair on a minors platform with one 24 GB card.
Scope:
SubmitArtAssetCommand/ motion-prompt validation (FluentValidation via the existingValidationBehavior+ a moderation service): blocklist + classifier before any job is queued; rejected prompts get a kid-appropriate message and are logged for staff (not silently dropped)RedisRateLimitMiddlewareconventions (return 429 — see #341)Note: decide the moderation classifier here (local model on the GPU host vs a small CPU model vs external API) — a minors platform probably wants belt-and-suspenders: blocklist + classifier. Keycloak realm roles (
student/staff/admin, mapped inAuthentication.cs::MapRealmRolesToClaims) drive exemptions.Acceptance: the abuse drills pass; a student cannot exceed quota, jump the queue, see a flagged image, or get raw model errors; staff can review flagged assets and release false positives; every generation is attributable in the audit log.
Both halves merged to
master: backend PR #70 (blocklist prompt moderation with kid-safe rejections + audit, per-student quotas — one active pipeline / 10 per day / 30 GPU-min per week — usage endpoint, staff review queue with dismiss/release wired to restart-from-stage, full audit trail, rate limits) and angular PR #118 (usage meter in the studio shell, staff review queue at/admin/art-reviewwith blurred-by-default quarantine previews, inline kid-safe composer errors). Output-side NSFW gating landed earlier via #67/#69 (#349/#362). Staff/admin exempt throughout.The gate for opening the studio beyond staff/pilot is now in place. Remaining nuances tracked elsewhere: ML prompt classifier (interface ready, documented), queue-position events (#364 — needs GpuCoordinator emit), owner display-name lookup in the review queue (small follow-up if wanted). Closing.