Skip to content

AI code fixes via pull request, without merging anything

Founder, AIUBY
Illustration: a code snippet with the fixed line goes through tests and review and becomes a draft pull request

Code Automation + Security Testing + AI Gateway

On this page
  1. The risk of letting AI open pull requests
  2. The path, from ticket to pull request
  3. What the diff cannot touch
  4. Four eyes and the proposal hash
  5. Fixing a security finding with a PR
  6. Cost and caps
  7. Limits

AI pull request automation is often sold as "the agent fixes it and opens the PR". The hard part is not generating the diff: it is making sure the diff does only what was asked, leaves alone what it should not touch and passes the tests before anyone spends time reviewing it. This post describes how AIUBY's Code Automation handles that, with the values checked against the platform code on November 27, 2026.

#The risk of letting AI open pull requests

An agent with write access to the repository can, by mistake or through a malicious instruction hidden in a ticket, change the CI workflow (which runs with the repository's secrets), add a key to the code or touch files nobody asked for. The platform's answer is to treat each step as a gate: plan before code, diff checked against rules, tests in an isolated runner and a decision by a person. The platform never merges.

#The path, from ticket to pull request

  1. Ticket

    The request starts on screen or from another product: a security finding, a test accepted in Test Automation, a flag to remove or infrastructure-as-code drift.

  2. Plan approved by a person

    The AI suggests a plan with the files it intends to change, 12 at most. A person with approval permission checks the plan by the hash shown on screen: if the plan changed after it was displayed, the approval is not valid.

  3. Patch checked

    The generated diff goes through the rules in the next section. Anything that violates one of them is rejected before it runs.

  4. Tests in the isolated runner

    The patch is applied and the repository's own tests run in a Cloud Run job, never on the platform server, with an image pinned by digest and a dedicated service account. There are up to 300 seconds for setup and 420 for tests. For a private repository, the runner receives only a read token.

  5. Proposal reviewed by another person

    The final proposal, with the tested diff, must be accepted by someone other than the person who requested the run.

  6. Draft pull request, or patch

    With PR creation enabled and a write credential in the workspace, the platform always opens the PR as a draft, on a new branch aiuby/code-automation/..., without force-pushing or touching an existing branch. Otherwise, the deliverable is a patch for git apply.

#What the diff cannot touch

RuleResponse
File outside the approved planoutside_plan
More than 20 files in the patchtoo_many_files
Patch larger than 24 KBtoo_large
New line that looks like a secret (private key, token or literal password)secret_in_patch
GitHub workflows and actions, .git, .env, credential files, keys, .aws and .sshalways rejected; examples such as .env.example are allowed
Binary file, rename, permission change or submodulerejected

After the tests, the final diff also goes through fixed security rules that look for, for example, disabled TLS verification, dynamic code execution, shell commands built from text, concatenated SQL and permissive CORS.

#Four eyes and the proposal hash

The proposal has a SHA-256 hash computed over its canonical content. Before opening the PR, the platform checks three times that what goes to the repository is exactly what was decided: the decision hash matches the proposal's, the final diff matches the proposal's, and the hash of the final diff matches the recorded one. A proposal that changed after it was displayed must be reopened before a decision.

Note

There is automatic approval for low-risk changes, off by default. When on, it accepts only small proposals (3 files and 50 lines, by default), verified in the runner, never on a production branch without an explicit rule and never on a sensitive path (CI, dependencies, containers, infrastructure, migrations, authentication, secrets). It is capped at 20 per day per workspace, and the PR states that it was accepted this way. Accepting does not merge anything.

#Fixing a security finding with a PR

In Security Testing, an open finding can become a fix request. There is no shortcut: it becomes a Code Automation ticket and follows the same path above. Not every finding can be solved with code, and the screen explains why.

FindingBecomes a PR?
Vulnerable dependency with a published fixed versionYes, as a version upgrade
Static analysis or configuration, with file and lineYes, as a code change
Exposed secretNo: the credential must be revoked and rotated; removing it from the code does not erase Git history
Dependency with no fixed versionNo: replacing the package or mitigating is the team's decision
LicenseNo: it is a legal decision

Only workspace administrators can request the fix, and only connected GitHub repositories become PRs.

#Cost and caps

Every model call goes through the AI Gateway, so it counts toward the workspace budget and shows up in usage like any other (see AI cost management). On top of that, each ticket has its own AI budget: 2 dollars by default, with a fixed cap of 20 in the code. When it runs out, the ticket stops with budget_exhausted.

  • Plan, patch and test iterations: 3 by default; the approver can allow more, up to 5 in total.
  • Runs per day: 20 by default, capped at 100. Concurrent: 2 by default, capped at 5.

#Limits

  • Pull requests only on GitHub. Jira issues do not become tickets.
  • The PR is always a draft, and the platform never merges: the final decision belongs to whoever reviews it on GitHub.
  • The patch is capped at 24 KB and 20 files: a large refactor does not fit this flow.
  • Broken or flaky tests are not fixed automatically. What exists is selector repair in Test Automation.
  • Creating a PR requires, among other permissions, three things enabled in the workspace: the product, PR creation and a write credential (the GitHub App or a fine-grained token stored encrypted).
  • Large proposals appear truncated on screen: 40,000 characters in total and 4,000 per file.

The full reference is in Code Automation, in the documentation. For the E2E tests that feed this flow, see E2E testing with AI.

Biweekly digest

New posts and what reached the changelog, every two weeks. No other emails.