Custom software
I attack my own systems locally before going live: testing with AI and Docker
How I attack a management system locally with Docker and AI-written scripts: user permissions, sessions, injection, uploads, APIs and rate limits.
Fabio Folgori7 min read

A breached brochure site is reputational damage. A breached management system is something else: it holds customer records, contracts, payments and documents, and whoever gets in where they should not finds no page to deface, but someone's customer data. In recent years I have been working more and more on management systems and custom applications, and that has changed how I close a project: before it goes live, I try to attack it myself.
I do it locally, on a copy of the application running in Docker, with scripts I write together with AI. It is not a penetration test in the professional sense, and I explain why further down. It is a systematic check of the classes of error that do the most damage in an application with users and roles, done before the project goes live.
Why locally, and why Docker
A serious attack test is destructive. It creates fake users, sends thousands of requests in a few seconds, tries to write where it should not, uploads files built to cause harm. Doing that on the live site means risking locked-out real users, a polluted database and the hosting provider's protections kicking in.
Locally none of this has consequences. With Docker, the application, the database and the surrounding services run in isolated containers: if a test leaves the data in an unusable state, you throw the environment away and recreate it as it was. No request leaves the machine and no real data is involved.
Where AI comes in
AI does not "attack" anything on its own. I use it to write the test scripts, and it is work where it pays off, for a precise reason: the most serious errors in a management system are not generic, they depend on its rules. An automated tool knows how to look for SQL injection on any site; it cannot know that a user from one branch must not see another branch's orders.
AI, on the other hand, can read the code: the API routes, the intended roles, the data model. From there it proposes the tests that make sense for that application and writes the script that runs them one by one, with different users, and reports what passed and what did not. I decide what to test, read every script before running it and interpret the results: a false positive has to be recognised, and a passed test does not prove the problem is absent.
The tests I run
Permissions between users
The first and the most important. The script logs in as user A, collects the identifiers of their data, then logs in as user B and tries to read, change and delete them by swapping the identifier in the request. An API that only checks "is this user logged in?" and not "is this record theirs?" falls immediately. It is the most widespread error in web applications and the hardest to notice through the interface, because the interface shows each person only their own data: the problem appears only when you talk to the API directly.
Roles
Same logic, vertically: a normal user tries to call the functions reserved for the administrator. Hiding a button in the interface protects nothing if the route that button calls does not check the role on the server.
Login and sessions
Repeated password attempts on the same account, to see whether anything stops them. Then sessions: a token used after logout, an expired session, a token edited by hand. And password recovery, which must answer the same way whether the address exists or not, otherwise it becomes a way to find out who is registered.
Rate limits
Many requests in a few seconds against the most expensive or most sensitive endpoints: login, search, exports, email sending. An application without limits can be slowed until it is unusable, or used to send mail in someone else's name.
Injection in fields
Values built to break out of the expected context: SQL fragments in search and sorting parameters, HTML and JavaScript in text fields that are later shown to other users. In a management system this second case weighs more than elsewhere: a note written by any user is read, sooner or later, by an administrator.
File uploads
Files whose extension does not match their real content, huge files, names with paths in them. The server must check type and size for itself, without trusting what the browser declares, and store files where they cannot be executed.
APIs without login
Every route is called without credentials and with malformed data: missing fields, wrong types, oversized values. A route left open by mistake is more common than you would think, especially among those added in a hurry at the end of a project.
Headers and secrets
The security headers the server should send, the files that should not be reachable (configuration, backup copies, development folders), the keys that ended up by mistake in the code shipped to the browser.
What happens after a failed test
A test that passes does not close the matter; one that fails opens a job in two stages. First you fix the cause, not the symptom: if an API does not check whose record it is, the check almost always belongs in a single place that every route goes through, not route by route. Where the database allows it, the rule moves one level down, like the row-level security policies I discuss in PostgreSQL vs MySQL: at that point even a mistake in the API code does not expose the data.
Then you run the script again, all of it, not just the failed test: a fix on permissions can break something else. The scripts are my own working tools, written for that project: they do not stay in the repository and are not part of what I deliver.
The limits
These tests find known, repeatable errors. They do not find what I did not think of, the chains of small flaws a professional knows how to combine, or the problems of the production infrastructure, which does not exist locally. And AI gets things wrong: it proposes useless tests, forgets obvious ones, and sometimes declares a test passed that it never really ran. That is why every script is read before it is launched.
My take
On management systems and applications with users, roles and confidential data, I consider these tests part of development, like functional tests: they are included in the work. On other kinds of project they are a separate service, available on request. It is the same idea I apply to everything else: code on Git, a preview for every change, the main branch never touched directly. The attack tests are the last step before going live. My view on AI is the usual one too: it is a tool that lets me write in an hour what would take days by hand, but the decisions stay mine, and I do not let it run anything I have not read.
There is also a simpler reason. Whoever replaces a spreadsheet with a management system, as I describe in custom management system vs Excel, puts in one place data that used to be scattered: it is more convenient and tidier, but also a more interesting target. Protections like the captcha I write about in from Google reCAPTCHA to Turnstile stop bots on forms; they do not stop a registered user who changes a number in the address. Only the code stops that, and the only way to know is to try.
Why work with me
I have been developing since 1999, and today a growing share of my work is management systems and applications with users, roles and confidential data. I design them with permissions checked on the server, and test them locally with attack tests before putting them online. If you have an application to build, or one already live that nobody has ever tried to attack, get in touch or see the custom software development service.
Frequently asked questions
No. The scripts I write with AI cover the most common classes of error and check them before going live, but they have neither the experience nor the creativity of someone who does this for a living. For applications handling health data, payments or large volumes of personal data, an independent test is still necessary: my work is about getting there without the avoidable mistakes.
Because an attack test is destructive by nature: it creates users, sends thousands of requests, tries to write data where it should not. Locally, in Docker containers, the environment is rebuilt from scratch in seconds and no real data is involved. On the live site you would risk locking out real users, polluting the database or triggering the provider's protections.
The ones on permissions. In a management system every user sees part of the data: their orders, their customers, their branch. The most frequent and most serious error is an API that checks whether the user is logged in but not whether the requested record is theirs. No generic automated tool finds it, because it depends on the rules of the application.
Only if it is your own, or if its owner has authorised it in writing. I work on local copies of the projects I am developing, on my own machine, and never on third‑party systems. Trying to access someone else's system without authorisation is a crime, even with good intentions.
- #security
- #penetration testing
- #docker
- #artificial intelligence
- #management systems


