Autonomous coding agents almost never follow contribution guidelines in open source communities, according to a new study from researchers at Peking University. The researchers tested four leading models across 106 issues from 49 repositories that contained rules about AI contributions. The findings paint a troubling picture for maintainers already swamped by low-quality AI-generated code submissions.

The study measured four types of rule compliance: refusing to contribute when AI is banned, honestly disclosing AI assistance, passing verification checks, and escalating decisions to humans. Researchers found that "today's agents almost never proactively retrieve the contribution rules." When prompted with reminders, quoted policies, and verifier feedback, agents improved at disclosure and verification tasks. But they never once refused to contribute to repositories that explicitly banned AI-generated pull requests. The agents similarly failed to escalate decisions to humans when required.

The study revealed a sharp divide in how agents respond to different rules. According to the researchers, disclosure and verification requirements are "additive" — agents can complete the user's task while still obeying these rules. Bans present a different challenge entirely. The report explains that a ban "requires the agent to abandon the task, which collides head-on with the user's explicit instruction and with the agent's training to be helpful." One security researcher quoted in the study describes this as an "ethical dilemma," where agents must choose between the user's direct command to fix a bug and submit a pull request versus a repository's policy against AI-generated contributions. The study notes that analyzing contribution policies simply isn't part of how agents are currently built and trained — they don't open policy files on their own, so the rules never enter their reasoning process.

The findings suggest that rewriting contribution policies alone won't solve the problem. Several prominent open source projects, including Godot Engine, Zig, and Ghostty, have recently updated their policies to restrict AI-generated code. But experts quoted in the study recommend moving controls outside the agent itself. One approach is making policy discovery part of the framework that runs the agent, rather than leaving it to the model's judgment. For AI bans specifically, developers could remove the agent's ability to create pull requests against flagged repositories, or route AI-flagged contributions to more intensive review processes. The most straightforward solution, according to one CEO interviewed, is returning to established software development lifecycle controls. Code owners, linting, and CI/CD processes already act as gatekeepers for merges — deterministic protections that can't be bypassed without administrator credentials. These existing systems, the study notes, have long handled unpredictable human contributions and can do the same for AI-generated code.

The report concludes that maintainers don't need to rely on agents policing themselves if proper development lifecycle controls are already in place. Labs building these models would need to go further, explicitly penalizing policy violations through reinforcement learning during training, to make agents truly respect contribution bans. Until then, the burden falls on technical safeguards rather than agent compliance. For projects facing mounting pressure from AI contributions, the lesson is clear: enforcement mechanisms work best when they sit outside the agent's decision-making entirely. The industry may need to rethink its expectations around autonomous systems that are fundamentally wired to complete tasks rather than abandon them, no matter how clearly the rules are written.