MirLabs / The blog / Security / AI
AI writes my code, I keep the keys
I no longer type code: an AI writes all of it. Yet it has access neither to the server nor to a single secret. Who can do what, what is in place, and what is not yet.
For more than a year, I have not written code myself. On my sites and my bundles, an AI writes everything: the features, the tests, the fixes, the documentation. I describe, I review, I decide.
I also present myself as a security-minded developer. The question comes quickly: "You do security, and you hand everything to an AI?"
Yes. But not the keys.
The risk is not that it writes code
An AI that writes code makes mistakes, like a developer. It did this week: a setting in Sentinelle, my security bundle, never applied, although its tests passed (I tell the story of the bug here). That kind of mistake shows, gets fixed and can be undone: everything is in Git, reviewable, dated.
The real risk is something else: that it has access to what cannot be undone. The server, the databases, the payment keys, the accounts. That is where I draw the line.
Who can do what
The AI works in a separate, disposable environment that is not my server. It writes the code there, runs the tests there, and sends the result to GitHub. It has no access to the server. No password, no API key goes through our exchanges: when a key has to be set, it guides me step by step, and I am the one who types it, directly on the server.
The server reads the code on GitHub, but cannot write anything there: its access key is read-only. It does the mechanical work on its own, the kind that needs no judgement.
I keep the keys: the accounts, the production secrets, access to the server. And I decide when a decision has to be made.
The rule fits in one sentence: what is mechanical goes to the server, what needs judgement goes to the AI, what commits me stays with me.
What already runs
- Tests before every push. The AI runs them in its disposable copy. A change that breaks a test does not go out.
- The server's night round. Every database is backed up, and the backup is read back to check it can be used. Everything that runs is scanned for known flaws. A site whose PHP is one patch behind is rebuilt, and everything is rebuilt from scratch every week.
- Sentinelle inside the application. It blocks bots looking for secrets, and only writes to me on the spot when something has really gone out.
What does not run yet
I would rather say it than let it be assumed.
- Backups off the server. Today, backups stay on the server: they protect against a bad command, not against losing the server. The next step is under way: an encrypted copy at a second provider, with a retention period nobody can shorten, not even me, and a copy of all code repositories somewhere other than GitHub. With a restore test every month.
- Automatic rollback. If a deployment breaks a site, the previous version must come back on its own. It is ready, but not yet tried in production. Until it is, I do not count it.
- Night-time upgrades. Uplift prepares PHP and Symfony upgrades in a separate copy and a disposable container, tests them, then waits for my approval. The bundle is published; plugging it into the night round waits for the next release.
- Two-factor authentication everywhere, by app and not by SMS, with printed backup codes. It is twenty minutes of my time, and it is on my list.
Why I am writing this
Because "I am careful" means nothing. A chain you can describe, with what is done and what is missing, can be checked. I put that chain on a separate page, How I secure my sites, which I will update with every link added.
And because the question "you hand everything to an AI?" is the right question. The answer is neither "yes, it is very good" nor "no, never". It is: what can it touch, and what happens when it gets it wrong?
Read next
LocService: a cyberattack copied links to rental files
The rental platform LocService, published by Gobocom, says it suffered an intrusion detected on 30 October: names, contact details, invoices and share links to DossierFacile rental files were copied. ID documents and supporting papers were not copied directly.
Ipsos: the Qilin group claims a data theft, ten days after an acknowledged intrusion
Ipsos acknowledged an intrusion into an internal system on 16 November, with no disruption to its business. On 23 November the Qilin group listed it on its site and showed five screenshots of documents. Nothing confirms that these documents come from the acknowledged intrusion.
1Password: a stolen GitHub account was used to copy customer data, without touching the vaults
1Password says an attacker took an employee's GitHub account, slipped malicious code into services and copied customer data: login addresses, identifiers, public keys, some tokens. According to the company, the vaults and master passwords were not reached.