AI wrote your app. Where should its code live?
An app built by AI breaks on day three and nobody can say what changed. Why AI code needs version control more than human code, what to check by hand, and how Vertal Dev and GitMoon handle it.
By Laercio Borges
· 5 min read
Here is a story I have seen many times. Someone builds an app with an AI app builder on Monday. It works. They ask for a few changes on Tuesday. On Wednesday the checkout page is broken, and they ask the obvious question: what changed?
Nobody can answer, because there is no history. The app was rewritten five times by a model, and each version replaced the one before it.
This post is about that problem. Where should code that an AI wrote actually live, and what should a person still check by hand?
AI code needs version control more, not less
When a person writes code, they usually change a few lines at a time. When a model writes code, it often rewrites whole files, or the whole app, in one step. That is fast, and it is also exactly the situation where you need a history:
- To see what changed. A diff between two versions tells you more than any summary the model writes about itself.
- To go back. If version 7 broke the checkout and version 6 worked, you want version 6 back in one step, not a new prompt and some hope.
- To know what you shipped. If a customer reports a bug from last Friday, you need the exact code that was live last Friday.
Git gives you all three. Every saved version becomes a commit, every commit has a parent, and the chain cannot be changed quietly. The tool is twenty years old, and it fits this new problem very well.
The real risks of AI-written code
I build an AI app builder, Vertal Dev, so I am not against AI code. But I would be lying if I said it was safe by default. These are the problems I watch for:
It can look right and be wrong. Generated code is usually well formatted and confident. That makes it easy to approve without reading. A wrong condition in a nicely formatted function is still a bug.
It can invent dependencies. Models sometimes import packages that do not exist, or use a name that is close to a real one. If someone later publishes a malicious package with that name, an install can pull it in. Check that every new dependency is real, maintained and spelled correctly before you install it.
It can put secrets in code. Ask a model to "connect to Stripe" and it may write the key straight into a file. That file then goes into history.
It can use old patterns. A model learned from code that was written years ago. It may use an API that changed, or a security practice that is no longer recommended.
It does not know your rules. Your data retention policy, your customer's contract, your country's laws. None of that is in the prompt unless you put it there.
None of this means "do not use AI". It means AI code should land somewhere you can read it, compare it and roll it back, and that place should be private until a person has looked at it.
How Vertal Dev and GitMoon handle it
When I connected Vertal Dev to GitMoon, I set a few rules for myself:
- Every app gets its own repository. One project in Vertal Dev is one private repository in GitMoon.
- Every saved version is a commit. When the code changes and the app is saved, a new commit is created. If the code did not change, no empty commit is created.
- Private by default. The repository starts private. The owner decides if it ever becomes public.
- It happens automatically. The person building the app does not need to know Git for their history to exist. If they learn Git later, the history is already there.
The code goes to GitMoon, not to a third-party host. That keeps the app, its versions and its owner in one place.
The Service API, for other builders
The same path is open to partner apps through the GitMoon Service API. It is a server-to-server JSON API. Each partner app has its own key, and the customers and repositories one app creates are only visible to that app.
A commit is a full snapshot of the files:
curl -s -X POST "https://gitmoon.dev/api/service/v1/repositories/$REPO_ID/commits" \
-H "Authorization: Bearer $GITMOON_SERVICE_KEY" \
-H "content-type: application/json" \
-d '{
"message": "Publish version 7",
"branch": "main",
"files": [
{ "path": "index.html", "content": "<!doctype html>..." },
{ "path": "app.js", "content": "console.log(\"hello\")" }
]
}'
A few details that matter in practice:
- Files that did not change are detected by their SHA-256 hash and are not uploaded again.
- A commit with no changes returns "No changes." instead of creating an empty commit.
- There are clear limits: 2,000 files and 50 MB per commit, and 10 MB per file.
- Creating a customer or a repository is idempotent. Calling it twice with the same ID returns the existing one.
Service API keys are issued per partner app. They are not a self-service feature in the dashboard today.
What a person still has to do
A good home for the code is half the job. The other half is human:
- Read the diff between the last working version and the new one, at least for anything that touches money, logins or personal data.
- Run the tests, or write a few if there are none. Ask the AI to write them, then read them.
- Scan for secrets before anything goes public. If you find one, change it at the provider first.
- Check every new dependency. Does the package exist? Is it the right name? Is it maintained?
- Keep the repository private until someone has done the steps above.
GitMoon can help with a second opinion: AI code review on a commit, paid with tokens from your plan. It is useful, and it is also AI checking AI. It is not a replacement for a person who knows what the app is supposed to do.
Where GitMoon fits
If you build with Vertal Dev, your apps already have a private history in GitMoon. If you write code by hand, GitMoon is young: it does not accept git push over SSH or HTTPS today, and it has no pull requests or issues. I explain what that means for a move in moving from GitLab or GitHub to GitMoon, and the Git habits post covers the habits that matter for any code, AI-made or not.
You can create a free account and look at what other people chose to share on Explore.
FAQ
Should AI-generated code be in a Git repository?
Yes. A model often rewrites many files at once, so you need a history to see what changed, to go back to a working version, and to know exactly what was live on a given day.
Is AI-generated code safe to deploy?
Not without a review. It can contain wrong logic, dependencies that do not exist, hard-coded secrets and outdated patterns. Read the diff, run tests and scan for secrets first.
Where does Vertal Dev store the code of my apps?
Each app saved in Vertal Dev is committed to its own private repository in GitMoon, with one commit for each saved version that changed the code.
Can other AI app builders use GitMoon?
Partner apps can use the GitMoon Service API, a server-to-server API with one key per partner app. Keys are issued per partner, not created in the dashboard.