I was doing vibe coding and saw AI generated this code.
Notice anything?
Notice anything? 👉 It hardcodes a fallback JWT secret (‘supersecretjwtkey’) right in the code.
It is a typical example of vibe coding output.
If you push this code straight to production without reading it, you’re basically planting a time bomb in your system.
💡 One way to avoid this is to instruct your AI coding assistant upfront with rules based on best practices. For example, in this case:
“Never use hardcoded secrets. Always load them securely from environment variables.”
By giving your AI secure coding guidelines as rules, you reduce the chance of these mistakes slipping through.
Generative AI can accelerate us, but blind trust can sink us. ⚡️
Always: ✅ Set clear coding instructions for your AI ✅ Review the code for security pitfalls ✅ Replace placeholders with proper environment variables
What are the rules you give your AI coding assistant to keep your code safe and clean?
#vibecoding #security #vibecode
Enjoyed this? Subscribe for more.
Practical insights on AI, growth, and independent learning. No spam.
More in Vibe Coding
Create a Free LinkedIn Carousel with Vibe Coding
(See the carousel below that I created for one of my posts)
**GenAI Pitfalls**
ChatGPT has recently encountered various outages. These outages took down our AI services and disrupted business operations, both for us and our clients.
Two Choices for Handling Tech Debt in Vibe Coding
· Go full vibe: ignore tech debt, and when things inevitably break, spend a week fixing it.
Honored to speak at the largest OpenClaw event at Amazon Web Services (AWS) last night, organised by OpenClaw Singapore. Thanks Lionel Sim for the invitation.
I was tasked to address the elephant in the room - security. I have converted my presentation to an article with slides for anyone interested.
Vibe coding is a double-edged sword.
In the wrong hands, it's a security nightmare. In the right hands, it's a powerful security assistant.
The Worst Job Displacement of Software Engineers Is Yet to Come.
This is not another fear mongering post.
Create a Free LinkedIn Carousel with Vibe Coding
(See the carousel below that I created for one of my posts)
Honored to speak at the largest OpenClaw event at Amazon Web Services (AWS) last night, organised by OpenClaw Singapore. Thanks Lionel Sim for the invitation.
I was tasked to address the elephant in the room - security. I have converted my presentation to an article with slides for anyone interested.
Vibe coding is a double-edged sword.
In the wrong hands, it's a security nightmare. In the right hands, it's a powerful security assistant.
**GenAI Pitfalls**
ChatGPT has recently encountered various outages. These outages took down our AI services and disrupted business operations, both for us and our clients.
Two Choices for Handling Tech Debt in Vibe Coding
· Go full vibe: ignore tech debt, and when things inevitably break, spend a week fixing it.
The Worst Job Displacement of Software Engineers Is Yet to Come.
This is not another fear mongering post.