Skip to content

fix(slop): fully gate the AI slop advisory on confirmed contributor (free + BYOK) - #737

Merged
JSONbored merged 3 commits into
mainfrom
codex/fix-byok-slop-calls-vulnerability
Jun 14, 2026
Merged

fix(slop): fully gate the AI slop advisory on confirmed contributor (free + BYOK)#737
JSONbored merged 3 commits into
mainfrom
codex/fix-byok-slop-calls-vulnerability

Conversation

@JSONbored

@JSONbored JSONbored commented Jun 14, 2026

Copy link
Copy Markdown
Owner

What

Closes a cost/abuse vector in the AI-assisted slop advisory (#724/#728): it was being invoked for any PR author when slopGateMode != off and slopAiAdvisory was enabled, letting an unconfirmed/untrusted author spend both the shared free Workers AI neuron budget and the maintainer-paid BYOK quota. The AI review path (runAiReviewForAdvisory) already no-ops for unconfirmed authors; this brings the slop path in line.

How

  • runAiSlopForAdvisory now returns early when !confirmedContributor (matching the AI review path exactly): no AI spend — free OR BYOK — on a PR from an unconfirmed author. The deterministic slop core still runs for everyone; only the paid AI layer is gated. Fail-closed — if the contributor can't be confirmed, no AI runs.
  • confirmedContributor is computed before the slop block (the official detection + confirmation now runs ahead of the AI slop call), so the gate is enforced before any AI invocation.
  • The BYOK key lookup no longer needs its own && confirmedContributor guard — the early return guarantees it.

Scope note (supersedes #727 and #739)

Verification

  • typecheck ✅ · test:coverage ✅ (1836 passed; branches 97.02%, all metrics ≥97) · git diff --check ✅ · test:workers
  • test/unit/ai-slop.test.ts: confirmed contributors still get the advisory (free + BYOK paths); an unconfirmed contributor now triggers a complete no-op (neither BYOK fetch nor Workers AI; no finding) — matching the AI review path.

@ghost

ghost commented Jun 14, 2026

Copy link
Copy Markdown

Note

Gittensory Gate skipped

PR closed before full evaluation. No late first comment was created.

Signal Result Evidence Action
Gate result ⚠️ Skipped #737 is no longer open. No action.

💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

@ghost ghost added the gittensory:reviewed label Jun 14, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@ghost

ghost commented Jun 14, 2026

Copy link
Copy Markdown

gittensory · advisory review

Reviewed 2 changed file(s) — two independent AI reviewers.

Suggested action:Safe to merge — both reviewers found no blocking issues.

Reviewer A · gpt-oss-120b — recommends ✅ merge
The PR adds a confirmed‑contributor gate to the AI slop advisory, preventing AI spend for unconfirmed authors, and updates related call sites and tests accordingly. The changes are well‑scoped, compile‑time safe, and include comprehensive tests.

Suggestions

  • Update the JSDoc/comments for runAiSlopForAdvisory to document the new confirmedContributor flag.
  • Run the full TypeScript build to ensure no other call sites miss the new argument.
  • Consider adding a unit test for the case where confirmedContributor is true but the BYOK key is missing, to verify graceful fallback.

Worth double-checking

  • Potential missed call sites elsewhere in the codebase that still use the old function signature.
  • Ensuring the early‑return logic does not unintentionally skip necessary deterministic slop processing.

Reviewer B · nemotron-3-120b-a12b — recommends ✅ merge
The PR adds a confirmed-contributor gate to the AI slop advisory function, preventing unconfirmed PR authors from consuming AI resources (free Workers AI or paid BYOK). It moves the contributor confirmation check earlier in the gate logic and updates the function signature and tests accordingly. The change is small, focused, and consistent with the existing AI review advisory gate.

No blocking issues spotted.

Completes the BYOK-only gating in this PR by closing the remaining cost
vector: the AI slop advisory was still invoking FREE Workers AI for any
PR author (the shared daily neuron budget), even though the AI review
path (runAiReviewForAdvisory) already no-ops for unconfirmed authors.

- runAiSlopForAdvisory now returns early when `!confirmedContributor`
  (matching the AI review path exactly): no AI spend — free OR BYOK — on
  a PR from an unconfirmed/untrusted author. The deterministic slop core
  still runs for everyone; only the paid AI layer is gated. Fail-closed:
  if the contributor can't be confirmed, no AI runs.
- The BYOK key lookup no longer needs its own `&& confirmedContributor`
  guard (the early return already guarantees it).

Adopts the full-gate approach from the sibling PR #727 (which also
spotted this vector) while preserving this branch's BYOK integration
(#728). Deliberately does NOT adopt #727's neuron-budget bump (1 -> 6):
the AI review path estimates by LOGICAL free-call count, not worst-case
retries, so a 6x reservation would be inconsistent and over-reserve,
causing premature quota_exceeded.
@JSONbored JSONbored changed the title fix: gate BYOK slop advisory by contributor fix(slop): fully gate the AI slop advisory on confirmed contributor (free + BYOK) Jun 14, 2026
@JSONbored
JSONbored merged commit 14d2bee into main Jun 14, 2026
10 checks passed
@JSONbored
JSONbored deleted the codex/fix-byok-slop-calls-vulnerability branch June 14, 2026 18:38
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant