Skip to content

fix: gate BYOK slop advisory by contributor - #739

Closed
JSONbored wants to merge 1 commit into
mainfrom
codex/fix-byok-slop-calls-vulnerability-0um5b4
Closed

fix: gate BYOK slop advisory by contributor#739
JSONbored wants to merge 1 commit into
mainfrom
codex/fix-byok-slop-calls-vulnerability-0um5b4

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Motivation

  • A public PR author could trigger BYOK-backed slop advisory calls and consume the maintainer-paid BYOK daily quota, which in turn could suppress the blocking AI review pass and bill the maintainer.
  • The change ensures slop advisory usage of maintainer BYOK credentials is authorized the same way as the AI review path to prevent unconfirmed contributors from driving BYOK calls.

Description

  • Require confirmedContributor in runAiSlopForAdvisory and only decrypt/use the repo BYOK key when args.confirmedContributor is true so unconfirmed PRs fall back to Workers AI.
  • Move the contributor confirmation earlier in the public-surface PR processing (maybePublishPrPublicSurface) and pass confirmedContributor into the slop advisory call so both slop and review paths share the same authorization signal.
  • Add unit coverage in test/unit/ai-slop.test.ts that verifies confirmed contributors can use BYOK and unconfirmed contributors do not trigger maintainer BYOK fetches while still receiving the advisory via Workers AI.

Testing

  • Ran git diff --check with no issues.
  • Ran npm run typecheck (tsc --noEmit) and the typecheck succeeded.
  • Ran npx vitest run test/unit/ai-slop.test.ts --reporter=verbose and all unit tests passed (30 tests passed).

Codex Task

@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 #739 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 contributor confirmation check to the BYOK slop advisory flow, ensuring BYOK keys are only used for confirmed contributors and updates related callers and tests accordingly. The implementation is clean and the new test validates the fallback behavior.

Suggestions

  • Consider making the confirmedContributor argument optional with a default of false to avoid compilation issues in any future callers that may forget to pass it.
  • Search the codebase for any other invocations of runAiSlopForAdvisory to ensure they are updated or rely on the default value.
  • Add a brief comment near the new parameter explaining its purpose for future maintainers.

Worth double-checking

  • If any existing call sites are missed, TypeScript compilation will fail due to the new required parameter.
  • The logic assumes official detection runs before the BYOK check; any change to that order could unintentionally allow BYOK usage for unconfirmed contributors.

Reviewer B · nemotron-3-120b-a12b — recommends ✅ merge
The PR gates the BYOK slop advisory to only use the maintainer's BYOK key for confirmed contributors (falling back to Workers AI otherwise), preventing unconfirmed contributors from triggering maintainer-billed BYOK usage. It also refactors the confirmation logic earlier in the gate function for efficiency. Tests are updated and a new test verifies the BYOK restriction for unconfirmed contributors.

Worth double-checking

  • Verify that the advisory output remains free of forbidden public terms (e.g., private context/score) regardless of whether BYOK or Workers AI generates it, though existing sanitization should apply.
  • Ensure the confirmedContributor logic (based on official?.status === 'confirmed') correctly identifies contributors and doesn't inadvertently block legitimate BYOK use.
  • Check that moving the official miner detection earlier doesn't alter behavior in edge cases (e.g., when official is already defined).

@JSONbored

Copy link
Copy Markdown
Owner Author

Duplicate of #737 (byte-identical diff, same Codex task task_e_6a2ee459d610832ab9f9ce62b695aed3). Consolidating on #737, which has been extended to the full confirmed-contributor gate (free Workers AI + BYOK). Closing this one.

@JSONbored JSONbored closed this Jun 14, 2026
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jun 14, 2026
@JSONbored
JSONbored deleted the codex/fix-byok-slop-calls-vulnerability-0um5b4 branch June 29, 2026 21:21
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