Merge request validation after AI-authored patches
LLM-generated pull requests raise the review bill before a line of code is merged. A patch can look tidy, compile cleanly, and still carry awkward questions about authorship, provenance, and whether the change belongs in the project at all. Security projects feel that pressure first because their contribution rules tend to be stricter and their rollback costs are rarely low.
The first pass has to catch authorship, not just syntax
A syntactically clean patch can still be the wrong patch to accept. Reviewers need to ask where the change came from, whether it maps to a real issue or agreed task, and whether the submitter can explain the implementation without hand-waving. If the only trace is a polished diff and a vague description, the review path has already gone soft.
Check whether the patch can be traced back to a real change request
A merge request that names a bug, ticket, or maintainer-approved task is easier to validate than one that arrives as generic “improvement” code. That trace matters because a plausible AI-authored submission can be assembled around a real defect while still hiding its origin or intent. In a security project, the first question is not whether the patch looks neat. It is whether the change can be tied back to a problem the project actually agreed to solve.
This is where merge request validation stops being a purely technical gate. If the submission cannot be matched to a credible request, the review burden shifts to maintainers immediately. They are then forced to infer intent from code shape, commit text, and surrounding claims, which is a poor trade when the patch has been generated quickly.
Separate useful contribution from copyable implementation detail
A patch can contain a good idea without being safe to accept as-is. The contribution may be a valid fix, but the implementation can still be too close to material that would create provenance trouble later. That matters where copyright provenance and contribution policy are enforced tightly, because the useful part and the risky part are often mixed together.
Security projects often need to treat the specification as the safer asset. If a patch describes a real behaviour change, that description can survive even when the implementation must be redone from scratch. The cost of that split rises fast with large changes, which is exactly why sloppy authorship checks hurt. A single accepted diff can become a long-term maintenance liability if later review shows it should never have passed the gate.
Review the patch as a governance problem, not a tidy bit of code
A security project is not only judging whether the code works. It is also judging whether the change fits the project contribution policy, whether the authorship story can stand up later, and whether accepting the patch creates a path for abuse. A clean patch that breaks those rules is still a bad merge.
Tie validation to copyright provenance and project contribution policy
Contribution policy is not decoration. If a project requires human-created code, signed-off authorship, a CLA, or a similar rule, merge request validation has to check that rule before the patch lands. AI-authored code turns that check into more than a box-tick because the authorship claim can be hard to verify and easy to obscure with a bit of human editing.
That is also where a malicious contributor can get awkwardly efficient. A useful patch can be submitted and then followed by refusal to sign the CLA, which leaves maintainers with something that is hard to ignore but unsafe to copy. AI-generated submissions add another layer of nuisance because they lower the cost of producing plausible code while pushing review and reimplementation costs onto the project. A strict “human-created only” rule is simple to state and expensive to defend.
Treat clean-room reimplementation as the fallback when trust is thin
Clean-room reimplementation is the sensible escape hatch when provenance is uncertain. One person writes the specification, another person implements it without using the suspect patch as a source. That separation cuts the obvious contamination risk, but it is not cheap. The more complex the change, the more time the second implementer needs, and the easier it is for the original patch to have already consumed volunteer effort.
For small fixes, this is tolerable. For large invasive changes, it can become a denial of service in slow motion. The project spends time validating a submission it may never safely use, then spends more time recreating the work in a form that can be accepted. AI-authored pull requests make that pattern easier to trigger because they raise the volume of plausible submissions without raising the standard of provenance.
Make the merge gate do the hard work before the branch lands
If the branch reaches merge review before the project has checked authorship and policy, the gate is already late. The validation path needs to be able to reject suspicious submissions early, and the review workflow needs enough friction to stop a polished but vague patch from sliding through on presentation alone.
Test the merge request validation path against AI-generated submissions
Projects that care about abuse resistance should run their own validation flow against AI-generated or AI-assisted examples. Not because every such patch is malicious, but because the review path should be able to spot the difference between a real contribution and a submission that only looks competent. If a policy says “100% human-created”, then the gate has to test for that claim in practice, not just in prose.
That means checking what happens when the patch is plausible, invasive, and lightly edited by a human. It also means checking the failure mode where the contributor discloses AI use after merge, which can force remediation, policy arguments, and rollback pressure long after the review window closed. A project that only tests for syntax and tests passing has missed the more expensive part.
Keep the code review workflow honest when the patch looks polished but vague
A polished diff can mask a weak explanation. If the reviewer cannot get a straight answer about intent, provenance, or why a particular implementation was chosen, the review should slow down or stop. The code review workflow has to reward detail, not presentation. Clean formatting and plausible naming are easy to generate. Clear accountability is harder.
This is the awkward part for maintainers: the better the AI output gets, the more ordinary the bad submission looks. That pushes review effort upwards because the obvious signals weaken. If the project lets polished but shallow patches through, every later dispute over authorship or similarity becomes harder to resolve. The patch may be technically fine and administratively rotten.
Keep the final decision tied to abuse resistance and rollback cost
The last decision should be shaped by how easy the submission is to abuse and how painful reversal would be. A change that is cheap to generate and costly to unwind is a bad deal for a security project, even when the code itself looks neat. If rollback would force a clean-room rewrite, a provenance argument, or a public policy fight, the bar for acceptance should already be higher.

