Skip to content

devlog/flow-recipes/ai-code-ownership-rules-before-your-next-pr-115.md

AI Code Ownership Rules Before Your Next PR

AI Code Ownership Rules Before Your Next PR

The awkward ownership conversation usually starts after an agent edits twelve files and nobody wants to approve the diff. The fix is not another model prompt. It is a team rule that separates responsibility, review authority, and legal rights before generated code reaches the default branch.

Here is the troubleshooting FAQ I would put beside the repository contribution guide, where developers can find it without leaving their editor.

Who owns a patch when an agent wrote most of it?

For engineering purposes, assign one human patch owner: the person submitting the pull request. That person must explain the change, supply verification, and handle follow-up fixes. The model is a tool, not an accountable teammate.

Keep that operational rule separate from legal ownership. Copyright protection, employer agreements, provider terms, and third-party licenses can affect rights in generated output. Do not promise that generated code is automatically exclusive or free of obligations. Escalate uncertain cases through your legal or licensing process.

Our agent touched another team's directory. Who approves?

Use the same ownership boundaries you apply to human-written changes. Configure CODEOWNERS, then enable the relevant branch-protection rules to require code-owner review. A file listing alone does not enforce approval.

  • The submitting developer remains responsible for explaining every changed file.
  • The affected directory owner approves changes within their maintained boundary.
  • Security-sensitive changes require designated reviewers before the pull request merges.
  • Unrelated agent edits must be reverted or submitted separately.

If an agent rewrites authentication while fixing a button label, stop and split the patch. Small diffs make ownership visible; sprawling diffs turn review into archaeology.

Do we need to label every AI-generated line?

Usually, a pull-request declaration is more useful than permanent line annotations. Lines move, developers rewrite suggestions, and attribution comments become stale. Record enough context to investigate the patch without pretending you have perfect provenance.

Add a short template field covering the tool, model, assisted scope, human owner, and checks performed. For example: Claude Sonnet 5.5 drafted the retry helper; the submitting developer revised cancellation behavior and ran timeout tests. Never paste secrets or sensitive prompts into the PR.

Preserve license notices when required. An AI-use declaration does not replace attribution obligations attached to copied or adapted material.

The tests pass, but nobody understands the generated code. Can it merge?

No. Passing tests are evidence, not a transfer of responsibility. Ask the patch owner to explain inputs, failure paths, dependencies, and rollback behavior. If they cannot, reduce the change or rewrite it into something maintainable.

  • Run repository checks locally or in the approved CI environment.
  • Add regression coverage that fails without the intended behavioral fix.
  • Inspect new dependencies for licensing, maintenance, and security concerns.
  • Review authorization, data handling, and destructive operations with extra care.

We switched models mid-task. Does the ownership rule change?

No. Switching from Claude Sonnet 5.5 to GPT-6.1 Sol changes the generation source, not the accountable human. Keep the same review gates and update the PR record when the switch materially affects the patch.

This matters with Fluxo: one key and one base URL, https://api.fluxorelay.com, provide access across providers. It works with Claude Code, Codex, Gemini CLI, and any OpenAI SDK. Convenient routing should not bypass your team's approved-model list, data-handling rules, or review requirements.

Who pays for retries, and can referrals influence tool choices?

Assign usage budgets separately from code ownership. Fluxo bills per real token, including cache reads and writes, with no monthly fee. Record usage through approved billing records, not credentials committed to the repository.

Users also earn a referral share when people they invite pay. Disclose that incentive when recommending a team setup; evaluate access controls, terms, and costs independently.

If this workflow fits your team, consider creating a Fluxo account. For help, leave a note on the contact page after signing in.

The generated patch broke production. Who handles the incident?

Follow the normal incident process: mitigate first, involve the service owner, and bring in the patch owner for context. Record the missing safeguard in the review process. “The AI wrote it” explains a tool choice; it does not close an incident.

Next in the buffer

Sign up in a minute and get credit to try every model mentioned here. Sign up →