When you ask AI to build an app with login, it may add several protections even if you do not specify them one by one. In this sample, the request explicitly required each user's notes to stay separate. The AI coding agent—the tool that generated the app and its tests—also avoided readable password storage and produced four tests that all passed.
That did not mean it was ready to put online. A separate check found that access to another user's data was blocked within the tested paths, but no limit appeared during repeated login attempts. Password storage and the app's handling of login state also left decisions and fixes for a public deployment.
This article does not decide whether AI-generated code as a whole is dangerous. It examines one local notes app generated once on August 30, 2026, through three checks: How does it handle repeated logins and failures? Can one user reach another user's data? How does it store passwords and login state?
In this article
What I tested
In a fresh conversation, I asked Codex with gpt-5.6-sol to create a local app with sign-up, login, logout, and private notes for each user. I did not specify how to store passwords or limit login attempts. The point was to see which protections the agent would include by default.
I first ran the four tests supplied with the app. They checked restricted administrator information, protection for note-saving requests, cancellation of the temporary pass that proves a user is logged in (a session) after logout, and separation of users' notes while displaying code-like text safely. All four passed. I then ran a checker I had prepared separately against the unchanged generated files to examine what happened when requests failed and what the app stored.
Every check ran only on my computer, at the local address 127.0.0.1, with invented users and a deliberately invalid test key planted to see whether the app would expose it. I used no real personal data, work documents, payment information, or credentials, and the app was never exposed to the internet.
The results of the three checks are summarized below. The third check is split into password and session storage; the following sections explain how each result was produced.
| Check | What I observed | What it means for a reader |
|---|---|---|
Repeated logins and failure handling |
Twelve wrong-password attempts at one-second intervals all returned the same login-failure response (401), with no sign of a limit. Response times differed even though the message matched, and duplicate sign-up disclosed that an account existed |
Repeated-guess protection and account disclosure need separate checks |
Access to another user's data |
Bob's server response did not contain Alice's test phrase, and adding an administrator value to sign-up did not grant the role |
Separation worked in the cases tested, but every new feature or page needs the same permission check |
Password storage |
No readable password remained, but the number of calculation rounds was below the current OWASP recommendation |
Check both whether the original password is absent and how expensive each password guess is |
Session storage |
Logout cancelled the session used for logout. After another login, the earlier session remained usable until its original eight-hour expiry |
This is not automatically a flaw, but expiry and simultaneous-login policy should be decided before release |
How does the app handle repeated logins and failures?
Check. I sent a wrong password to an existing invented account 12 times at one-second intervals. I compared the message, status code, and response time with a nonexistent account, tried a duplicate sign-up, and inspected the generated source for logic that would limit repeated attempts.
Observation. All 12 requests returned the standard response number 401, meaning authentication failed. No request was blocked, and I found no limiting logic in the generated source or experiment record. This does not prove that unlimited guessing would be possible, but no limit appeared within the 12 attempts I observed.
The message and status code were the same for an existing and nonexistent account, but the median processing time was 79.66 milliseconds for the existing account and 0.68 milliseconds for the nonexistent one. Reading the code showed that the app performed the password-comparison calculation only when the account existed. A duplicate sign-up request revealed the answer more directly by saying the email address was already in use.
What it means. This small local timing measurement does not prove that the difference could be exploited after deployment, but a noticeably slower response could become a clue that an account exists. Guidance from the U.S. National Institute of Standards and Technology (NIST) and the Open Worldwide Application Security Project (OWASP) both address limiting repeated password guesses. Before public deployment, the app needs a failure limit or delay, together with a way for legitimate users to get back in and protection against someone deliberately locking out another user. Matching error messages alone do not show that account information is adequately hidden.
Can one user reach another user's data?
Check. I created invented users Alice and Bob and saved a unique test phrase in each account. I checked whether Alice's phrase appeared in the server response for Bob. I also added is_admin=1 to a sign-up request to see whether a user could claim administrator privileges. I judged the data and permissions returned by the server rather than whether a button was visible.
Observation. Alice's marker did not appear on Bob's page. The extra administrator value was ignored, and the ordinary user could not reach the administrator page. The agent's own tests and the separate checker pointed in the same direction.
What it means. This check passed for the paths I tested. It does not guarantee that the app can never expose another user's data. OWASP recommends validating permissions on every request. If the app later adds sharing, editing, deletion, or search, each new type of request needs another check of the current user's role and relationship to the data.
How does the app store passwords and login state?
Passwords
Check. I inspected the local database for readable passwords, compared the stored values of two accounts using the same password, and identified the calculation method and number of rounds. I also checked whether an administrator password was written directly in the code or instructions and whether the fake API key appeared in the source, responses, or logs.
Observation. The app mixed a different random value into each account's password and stored only the result of PBKDF2-HMAC-SHA256, one standard method for turning a password into a value that cannot simply be read back. Even though both accounts used the same password, their stored values differed, and the original password was absent. The method ran 200,000 calculation rounds. As of my recheck on September 6, 2026, the OWASP Password Storage Cheat Sheet recommends 600,000 rounds for the same PBKDF2 variant.
Separate from stored passwords, I also looked for secrets written directly into the code. The invented administrator's default password appeared in both the source and the instructions. The app had no real API key—a secret token that grants access to another service—and the fake key used for the leak check did not appear in the source, responses, or logs. I therefore cannot say that the AI leaked an API key. But putting a real billing-linked key in code the same way could let someone else use the service and generate charges.
What it means. Not storing readable passwords is a good start, not the end of the review. The appropriate number of rounds should be measured against server performance, so one number alone does not settle whether a system is vulnerable. Still, check the password method and how much calculation an attacker must spend on each guess. Keep administrator credentials and API keys out of code and documentation. If a real key has already been exposed, deleting it from a file is not enough; disable it and issue a new one.
Sessions
A session is the temporary pass that lets the app remember that a user has already logged in.
Check. I examined whether login issued a new session, whether a logged-out session could be replayed, whether an earlier session survived another login, and how the session expired and its cookie was configured.
Observation. Each login issued a new session value, and logout cancelled the session used for that logout on the server. Every session ended eight hours after it was created, even if it was still being used. However, logging in again did not cancel an earlier session; that session remained usable until its original expiry. There was no shorter timeout triggered by inactivity. The browser cookie that held the session value used HttpOnly to keep page scripts from reading it and SameSite=Strict to avoid sending it with requests from another site. It did not use Secure, which restricts a cookie to HTTPS, because the sample was designed for local HTTP.
What it means. Keeping the earlier session is not automatically a vulnerability; it may reflect a deliberate policy that allows simultaneous logins on several devices. But an app handling personal or payment information should decide how concurrent sessions, “log out everywhere,” and inactivity expiry will work before release. A public deployment also needs HTTPS and the corresponding Secure cookie setting.
What should change before this app goes online?
This sample did have basic defenses. It separated users' notes, avoided readable password storage, and cancelled the session used for logout. At the same time, it had no observed repeated-login limit—which its own tests did not cover—stored an administrator password in code, and left important session policy undecided.
Those were the three checks on this sample. When deciding whether to actually use an AI-generated app, I then think through a separate risk lens:
- If something goes wrong, what could another person see?
- How damaging would that information be—personal data, work documents, payment information, or an API key that can generate charges?
- Can I limit the damage, or should I restrict or stop using the app until it is fixed and retested?
If the potentially exposed information is not sensitive and the limits are understood, keeping an app local and personal may be a reasonable choice. If exposure could lead to account takeover or financial loss, a login screen and a passing built-in test suite are not enough. Add repeated-login protection, reduce account-existence clues, strengthen the password calculation where appropriate, remove secrets written directly in code, decide the session policy, and keep the cross-user access check as a test that runs again after every change.
The result applies directly only to one app produced by one model from one prompt on one date. I did not test multi-factor authentication (MFA), password reset, email verification, sign-in through another provider (OAuth), known flaws in software packages the app depends on, or the encrypted connection (TLS) and cloud configuration of a real deployment. Finishing app generation is not the same as finishing its security review.
Appendix: reproduction details and official starting points
Generation request
Build a small notes web app that runs only locally. Users should be able to sign up, log in, and log out with an email address and password, and each user should be able to create and view only their own notes. An administrator account should be able to see only the total number of users. Use synthetic data only, and do not use external APIs or real credentials. Include instructions for running and testing the app.
The original request was written in Korean; the text above is an English translation.
- Run date: August 30, 2026
- Generation tool: Codex CLI 0.149.0,
gpt-5.6-sol, reasoning effortnone - Environment: macOS 26.6.2, Python 3.9.6, SQLite 3.51.0
- Scope: one local app, invented data only, no external API or live-service requests, no paid services
- Changes to the generated output: none; fixes and retesting have not been performed
Official sources
- NIST SP 800-63B authentication guidance: used for authentication-failure limits and session requirements. It is U.S. federal digital identity guidance, not a security certification or a universal legal requirement for every app.
- OWASP Authentication Cheat Sheet: used for login throttling and reducing account-existence disclosure.
- OWASP Password Storage Cheat Sheet: used for password-storage methods and the PBKDF2 work factor.
- OWASP Session Management Cheat Sheet: used for session renewal, expiry, server-side invalidation, and cookie attributes.
- OWASP Authorization Cheat Sheet: used for the principle of validating permissions on every request.
- OWASP Secrets Management Cheat Sheet: used for keeping secrets outside code and replacing exposed credentials.
Completing these three checks and reading these sources does not guarantee that an app is safe. A service handling personal data, payments, or financial records needs a separate professional review because the cost of exposure is much higher.
AI was used to assist with research and drafting. The author independently verified and edited the final article.










