Repository navigation
Review untrusted pull requests for malicious intent - #59
Merged
Merged
Conversation
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.
Changes
prSafety.enabledinfactory.yml). It asks whether an untrusted pull request is an attack, not whether its code has bugs: a planted vulnerability, exfiltration, GitHub Actions abuse, supply-chain tampering, hidden payloads, or text aimed at AI agents. It runs on every push from authors who aren'tOWNER/MEMBER/COLLABORATOR, and on renovate and dependabot pull requests, in public repos.src/pr-safety/signals.ts): workflows, install scripts, lockfile sources, hidden Unicode, credentials, new hosts, removed security checks, and prompt injection. Then a reviewer agent with the newskills/pr-safetyskill, in release security's read-only checkout (no shell, no network), which checks each change against the PR's stated purpose and returnsCLEAN/SUSPICIOUS/MALICIOUS/INCOMPLETE.SUSPICIOUS/MALICIOUSpost to the Discord security channel. TheFactory PR safetycheck always concludesneutralwith the same text, so it doesn't tell contributors whether they were flagged.withastro/astroaren't rejected by the release security route before it checks whether the branch is a release branch. Before this, every fork PR was dropped there.v9migration forFluePrSafetyReviewerAgentandPrSafetyCoordinator. This conflicts with Bring back the Discord assistant on Houston, confirmed by mention #57, which also usesv9; whichever merges second renumbers.Testing
tests/pr-safety-signals.test.ts: diff parsing (renames, quoted paths, binaries) and each rule family, including severity relaxing in tests, grouping, and the signal cap.tests/pr-safety.test.ts: author scope, routing (including fork PRs towithastro/astroand release PRs still going to release security), result validation, and alert and report formatting with untrusted text.tests/config.test.ts: the full-config equality now includesprSafety, plus a test that it's off by default and parses overrides.Docs
prSafetyconfig section.