Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk6 min

Split Generate and Apply Into Two Planes: Isolating AI-Written Code Changes From Canonical History

Let an AI agent generate patches in disposable scratch compute, and let a separate trusted identity inspect, constrain, and apply them to canonical git history. Here is how the two-plane design works, what Git guarantees, and where it falls short.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Split generation and application into two planes. Let the AI agent produce a patch inside disposable scratch compute, then let a separate trusted identity inspect, constrain, and apply that patch to the canonical repository. The design does not depend on trusting the model. It depends on making sure the component that writes code is never the component that decides what enters repository history.

What the two planes are

Harper Xu’s article on this pattern describes the split with a kitchen and dining room metaphor. The scratch plane is the kitchen: the agent prepares code there, runs tests, and throws away whatever it does not need. The canonical repository is the dining room: it holds reviewed history, and only work that has passed inspection gets served there.

As an Amazon Associate I earn from qualifying purchases.

The practical point is the separation of authority and failure domains. The generation environment can write scratch files. The trusted apply side controls what reaches canonical history. If the generator misbehaves, is compromised, or simply produces a bad change, the damage is limited to the scratch workspace and to whatever the trusted side chooses to accept.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Xu presents this as a recommended design rather than a formally standardized architecture. Treat it as a pattern to adapt to your own threat model, not as a certified control.

#1 Best Overall
Yubico - Security Key C NFC - Basic Compatibility - Multi-Factor authentication (MFA) Security Key and passkey, Connect via USB-C or NFC, FIDO Certified
  • POWERFUL SECURITY KEY: The Security Key C NFC is the essential physical passkey for protecting your digital life from phishing attacks. It ensures only you can access your accounts.
  • WORKS WITH 1000+ ACCOUNTS: Compatible with Google, Microsoft, and Apple. A single Security Key C NFC secures 100 of your favorite accounts, including email, password managers, and more.
  • FAST & CONVENIENT LOGIN: Plug in your Security Key C NFC via USB-C and tap it, or tap it against your phone (NFC) to authenticate. No batteries, no internet connection, and no extra fees required.
  • TRUSTED PASSKEY TECHNOLOGY: Uses the latest passkey standards (FIDO2/WebAuthn & FIDO U2F) but does not support One-Time Passwords. For complex needs, check out the YubiKey 5 Series.
  • BUILT TO LAST: Made from tough, waterproof, and crush-resistant materials. Manufactured in Sweden and programmed in the USA with the highest security standards.

The workflow, step by step

  1. Build a task bundle instead of mounting the live tree. The bundle carries a sparse checkout recipe, the test command, and a size budget. It excludes dotenv files and private keys. The manifest format is a local contract you define for your team; the article does not propose a vendor schema.
  2. Run generation in disposable scratch state. Withhold production secrets, private deploy keys, writable origin access, and unnecessary production network access. Check the routes that can collapse the isolation: shared mounts, Docker sockets, cached credential helpers, and copies of a home directory that carry credentials with them.
  3. Export only a diff and logs to a review inbox on a trusted machine. The generator never pushes to the canonical remote. The artifact that crosses the boundary is a file you can read, hash, and reject.
  4. Inspect, then apply through a trusted identity. Review the diff for scope, path problems, embedded secrets, and binary content. Then apply it from the canonical side, using a check before the real apply, and commit from there.
  5. Enforce limits on the apply side. Enforce the file-count and byte-size limits on the trusted host. The generator may ignore the manifest budget, so the budget only means something if the apply host checks it.

Where the boundary sits

The two planes differ on every axis that matters for failure. The table below uses the separation described in the article. It is a way to reason about the design, not a scored comparison of products.

Concern Generation plane (scratch) Apply plane (trusted)
Identity and write authority Can write scratch files only; no write authority over canonical history Trusted identity; the only identity that applies changes and commits
Filesystem access Disposable workspace built from a task bundle; no shared mounts into canonical trees Canonical working tree and index
Network access No production network access beyond what the task needs; the article does not specify a firewall policy Canonical remote and review tooling
Secrets No production secrets, private deploy keys, or dotenv files Holds the credentials needed to commit and push to canonical history
Output A diff and logs, exported to a review inbox An accepted, checked patch applied to the index and committed
Review and auditability Test logs are generator output and are not evidence of correctness Human review of the diff; constraints enforced on the host
Failure if the generator is compromised Contained to scratch state, subject to the isolation controls above Protected by the check, inspection, and limits, which are only as strong as their implementation

Applying the patch safely

The article’s sample workflow runs a check before any real apply. The command sequence is:

  1. Run git apply --check incoming.patch from the canonical working tree. This verifies that the patch applies cleanly without changing anything.
  2. If the check passes and the diff has been reviewed, run git apply --index incoming.patch. This applies the change to the index and the working tree.
  3. Review the staged result with git diff --cached, then commit from the canonical side.

What Git guarantees and what it does not

Git’s official manual documents the command behavior that this workflow relies on. git apply --check checks whether a patch applies without applying it. git apply --index applies the patch to the index and working tree. git apply itself never creates a commit, so the commit is an explicit step you control.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Yubico - YubiKey 5 NFC - Multi-Factor authentication (MFA) Security Key and passkey, Connect via USB-A or NFC, FIDO Certified - Protect Your Online Accounts
  • POWERFUL SECURITY KEY: The YubiKey 5 NFC is the most versatile physical passkey, protecting your digital life from phishing attacks. It ensures only you can access your accounts
  • WORKS WITH 1000+ ACCOUNTS: Compatible with popular accounts like Google, Microsoft, and Apple. A single YubiKey 5 NFC secures 100+ of your favorite accounts, including email, password managers, and more
  • FAST & CONVENIENT LOGIN: Plug in your YubiKey 5 NFC via USB and tap it, or tap it against your phone (NFC), to authenticate. No batteries, no internet connection, and no extra fees required
  • MOST SECURE PASSKEY: Supports FIDO2/WebAuthn, FIDO U2F, Yubico OTP, OATH-TOTP/HOTP, Smart card (PIV), and OpenPGP. That means it’s versatile, working almost anywhere you need it
  • PRIMARY & SPARE KEYS: Just like having a spare house key, we recommend buying two YubiKeys - one for daily use and one as a spare. That way you’ll never get locked out of your accounts

Git also rejects, by default, patches that touch paths outside the working area in the documented context. The --unsafe-paths option overrides that check when Git is used as a patch utility outside index or cached mode. Leave that override off unless you have a specific, reviewed reason to use it.

These behaviors support parts of the workflow. They do not establish the security of the whole design. An applicability check tells you the patch fits the tree; it does not tell you the patch is safe or correct.

Threat model and its assumptions

The article treats both the model and the remote scratch host as untrusted. Its assumptions are direct: the prompt may be a lie, the generator may write its own tests, and a green test log is not a substitute for human review. Keep production APIs and canonical git write privileges unreachable from scratch compute.

Rank #3
Yubico - YubiKey 5C NFC - Multi-Factor authentication (MFA) Security Key and passkey, Connect via USB-C or NFC, FIDO Certified - Protect Your Online Accounts
  • POWERFUL SECURITY KEY: The YubiKey 5C NFC is the most versatile physical passkey, protecting your digital life from phishing attacks. It ensures only you can access your accounts
  • WORKS WITH 1000+ ACCOUNTS: Compatible with popular accounts like Google, Microsoft, and Apple. A single YubiKey 5C NFC secures 100+ of your favorite accounts, including email, password managers, and more
  • FAST & CONVENIENT LOGIN: Plug in your YubiKey 5C NFC via USB and tap it, or tap it against your phone (NFC), to authenticate. No batteries, no internet connection, and no extra fees required
  • MOST SECURE PASSKEY: Supports FIDO2/WebAuthn, FIDO U2F, Yubico OTP, OATH-TOTP/HOTP, Smart card (PIV), and OpenPGP. That means it’s versatile, working almost anywhere you need it
  • PRIMARY & SPARE KEYS: Just like having a spare house key, we recommend buying two YubiKeys - one for daily use and one as a spare. That way you’ll never get locked out of your accounts

Xu puts the core rule in one line: “The applying identity must not be the generator.” A companion sentence describes the boundary as persistent: “Generation and apply remain separate failure domains always.”

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Trade-offs you accept

  • Sparse bundles can omit context. A generator that cannot see related modules may produce a change that looks correct locally and breaks a caller elsewhere.
  • Remote scratch hosts can disappear mid-run. The apply side has to handle an incomplete or missing export without treating it as success.
  • The guard cannot parse every patch trick. Path checks and size limits catch common problems, not every adversarial construction.
  • Review time is real. Every change crosses a human inspection step before it reaches history, and the isolation requires copies of the repository and additional tooling.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

When to skip the two-plane design

The article says the approach can be skipped for throwaway solo prototypes and short-lived kata folders. Its argument for the split applies where the stakes are higher: production history, customer data, and deploy keys. If a repository holds none of those, the overhead may outweigh the benefit. If it does, the split is the point.

What the evidence does and does not show

The main source is a named-author technical opinion article. The command behavior comes from Git’s official manual. Neither source reports a comparative study, a measured breach-reduction result, or a quantitative outcome for this design, so no effectiveness percentage can be attached to it.

Rank #4
Yubico - Security Key NFC - Basic Compatibility - Multi-Factor Authentication (MFA) Key, Connect via USB-A or NFC, FIDO Certified
  • POWERFUL SECURITY KEY: The Security Key NFC is the essential physical passkey for protecting your digital life from phishing attacks. It ensures only you can access your accounts.
  • WORKS WITH 1000+ ACCOUNTS: Compatible with Google, Microsoft, and Apple. A single Security Key NFC secures 100 of your favorite accounts, including email, password managers, and more.
  • FAST & CONVENIENT LOGIN: Plug in your Security Key NFC via USB-A and tap it, or tap it against your phone (NFC) to authenticate. No batteries, no internet connection, and no extra fees required.
  • TRUSTED PASSKEY TECHNOLOGY: Uses the latest passkey standards (FIDO2/WebAuthn & FIDO U2F) but does not support One-Time Passwords. For complex needs, check out the YubiKey 5 Series.
  • BUILT TO LAST: Made from tough, waterproof, and crush-resistant materials. Manufactured in Sweden and programmed in the USA with the highest security standards.

The article’s example Python guard is an illustration. It does not demonstrate that every malicious path, secret leak, or patch edge case is caught. Treat it as a starting point that needs a review against your own threat model.

The article also discloses that it was prepared as part of product outreach involving MonkeyCode, which it names for model access and a server option. That disclosure matters if you consider that server option. It does not establish the service’s availability, its program terms, or any security guarantee.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some of these claims are judgments by the author rather than tested results. Read the design as a well-reasoned pattern for limiting authority, and verify each control on your own infrastructure before relying on it.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.