LLM review of janitor candidates #2

Closed
opened 2026-11-25 05:17:58 +00:00 by lambadalambda · 1 comment

Problem

The keyword/score heuristics produce false positives. On 2026-11-24 a real user set a profile website on a fresh account and got sanitize_profile,restrict_user (score 130: profile_website, no_forge_activity, profile_backlink_spam, no_ssh_key). Restricted users cannot see public repos, so the account was useless until an admin allowlisted it by hand.

Proposal

Add an LLM review step between scoring and action.

  • Keep the heuristics as a cheap pre-filter. Send every new signup and every user/item with score > 0 to the model.
  • Context: profile fields, email domain only (never the full address), repo names + README excerpt, issue/comment text, account age, org memberships.
  • The model returns structured output: action (none / sanitize / restrict / prohibit / quarantine / redact), confidence, one-line reason.
  • Hard guardrails stay in code: never act on protected org members or allowlisted users; prohibit_login only above a high confidence threshold; no action if the model call fails (fall back to dry-run for that item, not to heuristics).
  • Log the reason with each action and put it in the admin notification email.
  • Provider/model and API key from env; keep a dry-run mode that prints model verdicts next to heuristic verdicts for comparison.

Volume

Last 30 days: 23 signups, 10 repos, 89 issues/PRs, 168 comments. About 300 items/month, so cost is small at any current model price.

Open questions

  • Which provider/model and which billing (API key vs. subscription credits).
  • Whether to send all signups or only scored ones.
## Problem The keyword/score heuristics produce false positives. On 2026-11-24 a real user set a profile website on a fresh account and got `sanitize_profile,restrict_user` (score 130: `profile_website`, `no_forge_activity`, `profile_backlink_spam`, `no_ssh_key`). Restricted users cannot see public repos, so the account was useless until an admin allowlisted it by hand. ## Proposal Add an LLM review step between scoring and action. - Keep the heuristics as a cheap pre-filter. Send every new signup and every user/item with score > 0 to the model. - Context: profile fields, email domain only (never the full address), repo names + README excerpt, issue/comment text, account age, org memberships. - The model returns structured output: `action` (none / sanitize / restrict / prohibit / quarantine / redact), `confidence`, one-line `reason`. - Hard guardrails stay in code: never act on protected org members or allowlisted users; `prohibit_login` only above a high confidence threshold; no action if the model call fails (fall back to dry-run for that item, not to heuristics). - Log the reason with each action and put it in the admin notification email. - Provider/model and API key from env; keep a dry-run mode that prints model verdicts next to heuristic verdicts for comparison. ## Volume Last 30 days: 23 signups, 10 repos, 89 issues/PRs, 168 comments. About 300 items/month, so cost is small at any current model price. ## Open questions - Which provider/model and which billing (API key vs. subscription credits). - Whether to send all signups or only scored ones.
Author
Owner

v1 decisions:

  • Provider: OpenAI Responses API (API credits), model gpt-6-luna, stdlib HTTP, structured output {verdict: ham|sanitize|restrict|prohibit, confidence, reason}.
  • Only users with heuristic score > 0 are reviewed; admins, allowlisted users and protected org members never reach the model.
  • For reviewed users the verdict replaces the score thresholds. restrict needs confidence >= 0.7, prohibit >= 0.9, else downgraded one step.
  • Model failure = no action for that user in this run. No fallback to heuristics.
  • Verdicts cached per user + content fingerprint, so the 60 s poll does not call the API again for unchanged users.
  • [llm] config section, off by default; key only from OPENAI_API_KEY.
v1 decisions: - Provider: OpenAI Responses API (API credits), model `gpt-6-luna`, stdlib HTTP, structured output `{verdict: ham|sanitize|restrict|prohibit, confidence, reason}`. - Only users with heuristic score > 0 are reviewed; admins, allowlisted users and protected org members never reach the model. - For reviewed users the verdict replaces the score thresholds. `restrict` needs confidence >= 0.7, `prohibit` >= 0.9, else downgraded one step. - Model failure = no action for that user in this run. No fallback to heuristics. - Verdicts cached per user + content fingerprint, so the 60 s poll does not call the API again for unchanged users. - `[llm]` config section, off by default; key only from `OPENAI_API_KEY`.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pleroma/forgejo-janitor#2
No description provided.