Engineering
Hard-coded secret
A password, API key or token written directly into source code or a config file, where anyone who sees the code can use it.
In a sentence
“The live payments key was pasted into the code and pushed to a public repository: a hard-coded secret.”
Why it matters at work
Code gets copied, shared and leaked. Keep secrets in a secrets manager, and change any key that has been exposed straight away.
Related terms
Sources and further reading
OWASP Top 10 · PCI DSS 6.2
Cite this definitionAqoon. “Hard-coded secret.” Aqoon Security Dictionary, 2026. aqoonhq.com/dictionary/hard-coded-secret
Reviewed by the Aqoon GRC team. General guidance, not legal advice.