Skip to main content
AI Agents Are Breaking Your Contribution RulesGuides
5 min readFor Compliance Teams

AI Agents Are Breaking Your Contribution Rules

Your autonomous coding agents don't read your CONTRIBUTING.md file. They don't check your pull request template. They don't follow your branch naming conventions. A study from Peking University tested four frontier models across 106 issues from 49 repositories and found that agents almost never proactively retrieve the contribution rules.

This isn't a bug in the models. It's a fundamental mismatch between how we've structured open source governance and how AI agents operate.

Why These Mistakes Keep Happening

AI agents optimize for task completion, not process compliance. When you point an agent at an issue and say "fix this," it treats contribution guidelines as optional metadata, not as constraints.

Your existing controls assume a human contributor who reads documentation, understands social context, and fears rejection. AI agents have no fear of a maintainer closing their PR. They'll submit non-compliant code because they completed the literal task you gave them.

This creates a compliance gap that traditional SDLC processes weren't designed to handle. Your code review catches the technical issues, but by then you've already spent reviewer time on a submission that should never have reached your queue.

Mistake 1: Treating AI Agents Like Junior Developers

Why it happens: You're using the same onboarding process for AI agents that you use for new hires. You have documentation, you have templates, you assume the agent will read them.

Real consequence: Your agents submit PRs that violate basic hygiene: wrong branch names, missing issue references, unsigned commits. Your maintainers spend time writing rejection comments that the agent won't learn from because it doesn't persist context between runs.

The fix: Build guardrails into the agent's execution environment, not into documentation. If you require commits to be signed, configure the agent's git environment to sign automatically. If you require issue references in PR titles, write a pre-submission hook that validates the format before the agent can push. Your contribution guidelines should become runtime constraints.

Mistake 2: Assuming Code Review Catches Everything

Why it happens: You've relied on human code review as your final quality gate for years. It works for human contributors, so you apply the same process to AI-generated PRs.

Real consequence: Your reviewers burn out. A human contributor who gets feedback will learn and improve. An AI agent will make the same category of mistake on the next issue unless you modify its prompt or environment. Your review process becomes repetitive correction instead of quality improvement.

The fix: Add a pre-review validation layer specifically for AI contributions. Before a PR from an agent reaches human review, run it through automated checks for your contribution standards: file structure, naming conventions, documentation requirements, test coverage thresholds. Think of it as extending your CI pipeline backward into the contribution process itself. Tools like pre-commit hooks and GitHub Actions can enforce these rules before your team ever sees the PR.

Mistake 3: Not Separating Task Prompts from Process Prompts

Why it happens: You give your agent a single instruction: "Fix issue #1234." You assume it will figure out the process requirements from context.

Real consequence: The agent optimizes for fixing the issue, not for following your process. It might solve the technical problem perfectly while violating every contribution guideline you have. You end up with correct code in an unacceptable package.

The fix: Split your agent instructions into two distinct layers. The task prompt describes what to fix. The process prompt, which you inject separately, describes how to contribute. For example: "Before submitting any code, retrieve and follow the CONTRIBUTING.md file in the repository root. Verify your changes meet all requirements in the pull request template. Do not submit until all checklist items are complete." Make the process prompt non-negotiable and consistent across all tasks.

Mistake 4: Failing to Audit Agent Behavior

Why it happens: You monitor your production systems, but you don't monitor your AI agents' contribution patterns. You treat each PR as an isolated event rather than as data about agent behavior.

Real consequence: You don't notice when an agent consistently violates the same guideline across multiple repositories. You don't catch when an agent starts ignoring a rule it previously followed. Your compliance problems compound invisibly until a maintainer escalates.

The fix: Log every agent action: which guidelines it retrieved, which checks it ran, which rules it violated. Build a dashboard that shows patterns across repositories and time. If an agent fails to retrieve CONTRIBUTING.md in 80% of its runs, that's a configuration problem you need to fix at the agent level, not a one-off mistake. Track compliance metrics the same way you track security metrics: failure rates, time to remediation, repeat violations.

Mistake 5: Not Updating Your Contribution Guidelines for AI

Why it happens: Your CONTRIBUTING.md was written for humans. It uses social language ("please"), assumes context ("as mentioned above"), and relies on implied knowledge ("follow our standard practices").

Real consequence: AI agents can't parse implicit requirements. When your guidelines say "write clear commit messages," a human knows what that means in your project's context. An agent doesn't. It'll generate technically accurate but contextually wrong messages because you didn't define "clear."

The fix: Create a machine-readable version of your contribution requirements. This doesn't replace your human-friendly documentation; it supplements it. Define explicit rules: "Commit messages must start with a ticket number in the format ABC-1234." "All public functions must include docstrings with parameter types." "PRs must include at least one test file." Consider using a structured format like JSON schema or a YAML checklist that agents can programmatically verify against.

Prevention Checklist

Before you deploy autonomous coding agents in your repositories:

  • Create runtime enforcement for contribution rules (pre-commit hooks, CI checks)
  • Separate task instructions from process requirements in agent prompts
  • Build a pre-review validation layer for AI-generated contributions
  • Set up logging and dashboards to track agent compliance patterns
  • Write explicit, machine-readable versions of critical contribution rules
  • Define which types of contributions require human-only submission
  • Document your agent oversight process for audit purposes (relevant for SOC 2 Type II controls around change management)
  • Test your controls by running agents against a sandbox repository first

The goal isn't to make AI agents behave exactly like human contributors. It's to redesign your contribution process so that compliance happens through automation and enforcement, not through reading and understanding. Your agents won't learn from feedback, so your controls need to prevent non-compliant contributions before they happen.

Topics:Guides

You Might Also Like