Password Engineering
Why You Shouldn’t Use AI to Generate Passwords (And What to Use Instead)
July 20, 2026 · 8 min read
Artificial intelligence can write code, summarize books, translate languages, draft emails, and answer complex questions—but it isn’t the right tool for generating passwords.
With tools like ChatGPT, Claude, Gemini, and other AI assistants becoming part of everyday life, it’s increasingly common for people to ask them to create a “strong, random password.” At first glance, the results look remarkably convincing.
Appearances can be deceiving
G7$kL9#mQ2&xP4!wIt checks every traditional box. It’s long, contains uppercase and lowercase letters, includes numbers and symbols, and appears completely random.
Unfortunately, appearances can be deceiving.
Independent analyses from Irregular and Kaspersky show that passwords generated by Large Language Models (LLMs) are more predictable than they appear. Rather than producing cryptographically random output, LLMs introduce measurable statistical biases that can reduce their effective entropy compared with passwords generated by a Cryptographically Secure Random Number Generator (CSPRNG).
The distinction may seem subtle, but in security, it’s critical.
AI mimics randomness—it doesn’t create it
The reason comes down to a fundamental architectural difference.
Large Language Models are prediction engines. Their purpose is to predict the most likely next token based on patterns learned during training. That’s exactly what makes them exceptionally good at writing natural language, answering questions, and generating code.
It’s also why they shouldn’t be relied upon to generate passwords intended to protect sensitive accounts or systems.
A secure password generator works in the opposite direction. Instead of predicting which character should come next, it draws values from a Cryptographically Secure Random Number Generator (CSPRNG) provided by your operating system or browser. These generators are specifically designed to produce values that are computationally infeasible to predict, even for an attacker who understands how the generator works.
Modern browsers expose this capability through the Web Crypto API, allowing password generators such as passwords.lu to generate cryptographically secure passwords entirely within your browser. No password generation requests need to be sent to a server, and no AI model is involved in the process.
An LLM has no equivalent capability. It simply predicts what looks random. Those are fundamentally different goals.
Looking random isn’t the same as being random
Humans are surprisingly poor random number generators. Ask someone to invent a random sequence of digits and they’ll usually avoid repeating numbers, alternate odd and even values, and subconsciously create patterns that simply feel random. Ironically, these habits make their “random” choices easier to predict.
Large Language Models exhibit a similar limitation. Because they learn statistical patterns from enormous collections of text, they naturally reproduce those patterns instead of generating uniformly random output. Their objective is to produce plausible sequences—not unpredictable ones.
These preferences can be measured. In Irregular’s “Vibe Password Generation” study, prompting Claude Opus repeatedly for 16-character passwords produced only 30 unique strings out of 50 attempts—and the string G7$kL9#mQ2&xP4!w alone appeared 18 times. Across GPT, Claude, and Gemini, researchers also found repeated prefixes, skewed character frequencies, and recurring symbol placement.
Kaspersky’s World Password Day analysis reached a parallel conclusion at larger scale: generating 1,000 passwords each from ChatGPT, Llama, and DeepSeek revealed heavy character-frequency bias, frequent missing digits or symbols, and—for Llama and DeepSeek—dictionary-style substitutions such as P@ssw0rd variants.
To a human reviewer—or even a traditional password strength meter—these passwords often appear perfectly secure. However, if an attacker understands these statistical tendencies, they can prioritize guesses that match the model’s preferred patterns instead of searching the entire theoretical password space.
Why entropy matters
Password security isn’t determined by how random a password looks. It’s determined by how unpredictable it actually is.
Cryptographers describe this using the concept of entropy—a measure of uncertainty or unpredictability. A password generated using a CSPRNG is designed so that every character is selected independently from a uniformly distributed source of randomness.
An LLM doesn’t work that way. Instead of choosing each character independently, it predicts the next character based on what it has already generated. Even tiny statistical preferences can reduce effective entropy because certain combinations become more likely than others.
Irregular estimated Shannon entropy for Claude-generated 16-character passwords at roughly 27 bits from character statistics (versus about 98 bits expected for a uniform draw over printable ASCII)—and even lower when estimating via model log-probabilities. That gap is the difference between “would take centuries” marketing estimates and a searchable space an attacker can prioritize.
Academic work reaches the same architectural conclusion. A 2025 arXiv study evaluating randomness and entropy in LLM tasks found that model-generated passwords and random strings show poor entropy and fail large fractions of NIST randomness tests, with repeated passwords and substrings appearing across generations.
The difference may not be visible to a human, but attackers don’t rely on intuition—they rely on probability. When probabilities become biased, password guessing becomes more efficient.
The password strength meter illusion
Most password strength meters evaluate visible characteristics such as password length, uppercase and lowercase letters, numbers, symbols, dictionary words, and repeated characters.
An AI-generated password will often score extremely well. Many strength meters will confidently label it “Very Strong.” Irregular noted that tools including zxcvbn can still assign near-maximal entropy to passwords that are far weaker under LLM-aware analysis.
Kaspersky applied its own strength model to AI-generated sets and found that 88% of DeepSeek passwords and 87% of Llama passwords failed to meet their security bar—along with 33% of ChatGPT passwords—despite looking complex on the surface.
The problem is that these tools evaluate the password itself—not the process that created it. They cannot detect whether the password originated from cryptographically secure randomness or from a language model exhibiting statistical bias.
A password can satisfy every conventional complexity rule while still containing less effective entropy than expected.
The hidden risk in AI coding assistants
The issue isn’t limited to people asking ChatGPT for passwords.
Developers increasingly rely on AI coding assistants to generate configuration files, deployment scripts, infrastructure templates, and example code. When asked to “generate a password,” “create a secret,” or “fill in placeholder credentials,” an AI assistant may simply invent a password instead of recommending code that calls a cryptographically secure random number generator. Irregular also observed coding agents sometimes preferring and inserting LLM-generated secrets without the user noticing.
- .env files
- Docker Compose templates
- Kubernetes manifests
- deployment scripts
- test environments
- example projects
Placeholder credentials have a habit of becoming permanent
If that password is copied into any of the places above, its statistical characteristics may remain unnoticed for years. The credential looks perfectly reasonable during code review, but it still inherits the statistical behaviour of the language model that produced it.
While these placeholders are often replaced before production, history has shown that example credentials, test secrets, and temporary passwords have a habit of becoming permanent.
Can prompt engineering fix this?
Some users try prompts like “Generate a truly random password,” “Use maximum randomness,” or even “Increase the sampling temperature.”
Unfortunately, none of these solve the underlying problem. Changing the prompt changes which outputs the model is more likely to generate. It does not transform a language model into a cryptographically secure random number generator.
Irregular’s conclusion is blunt: passwords generated through direct LLM output are fundamentally weak, and this is unfixable by prompting or temperature adjustments. Current LLMs are designed to predict likely outputs—not generate cryptographic entropy.
AI can still help with password security
None of this means AI is bad for cybersecurity. Quite the opposite.
AI can be extremely useful for explaining password best practices, recommending password managers, teaching multi-factor authentication, helping users recognize phishing attacks, explaining how password hashing works, and answering general cybersecurity questions.
The one thing it shouldn’t replace is the random number generator itself.
AI passwords vs. cryptographic password generators
How AI-generated passwords differ from CSPRNG-based generators
| Property | AI-generated password | Cryptographic password generator |
|---|---|---|
| Generation method | Predicts likely characters using a language model | Uses cryptographically secure randomness |
| Character distribution | Can exhibit statistical bias | Uniform random distribution |
| Predictability | Influenced by learned patterns | Computationally infeasible to predict |
| Pattern repetition | Possible | No learned preferences |
| Security objective | Generate plausible-looking output | Generate unpredictable output |
Generate truly random passwords with passwords.lu
When generating credentials for your email, banking, cloud infrastructure, developer accounts, or business systems, you should rely on tools specifically designed for cryptographic security.
At passwords.lu, password generation never relies on AI. Every password is generated entirely within your browser using the Web Crypto API, which obtains randomness directly from your operating system’s Cryptographically Secure Random Number Generator.
- your passwords are generated locally on your device
- nothing is transmitted to our servers during generation
- no AI models influence the output
- no statistical language patterns affect character selection
- every character is chosen using cryptographically secure randomness
Final thoughts
The result is exactly what a password should be: genuinely unpredictable—not merely random-looking.
Artificial intelligence is transforming software development, education, research, and productivity. Password generation, however, requires a completely different property than language generation.
Large Language Models are designed to produce probable outputs. Secure password generators are designed to produce unpredictable outputs.
The difference between random-looking and cryptographically random may be invisible to most people—but it matters to attackers.
When your security depends on unpredictability, use a password generator built on cryptographic randomness rather than statistical language prediction.
Your passwords protect your identity, finances, business systems, and private data. They deserve true randomness.
Sources & further reading
- Irregular — Vibe Password Generation: Predictable by Design
- Kaspersky — Creating a strong and easy-to-remember password (World Password Day 2025 AI analysis)
- arXiv:2510.12080 — Evaluating the Quality of Randomness and Entropy in Tasks Supported by Large Language Models
- Bruce Schneier — LLMs Generate Predictable Passwords
Related reading
Generate a cryptographically secure password
Use the passwords.lu generator — local Web Crypto randomness, no AI in the loop.
Open password generator