The single most common mistake in a student's first AI project is a hardcoded API key, committed to a public GitHub repo, found by an automated scanner within hours.
The fix, once, at the start
- All keys and secrets live in a .env file, never committed — add it to .gitignore before you write a single line that uses a key.
- Load secrets via a library (python-dotenv or your framework's built-in config) rather than reading files manually.
- In production, use the hosting platform's environment-variable settings, not a .env file shipped with the deployment.
- If a key does leak, rotate it immediately — assume it's compromised the moment it's public, don't wait to see if it's misused.
One habit that prevents most of this
Write the .gitignore entry before you create the .env file, in the same sitting, so there is never a window where the key exists unprotected in your working directory.
See secrets management for student projects for the deeper version of this.
About Pranjul Rathour

Requirements gathering, on stage

Pranjul Rathour — GenAI engineer, Kanpur
Pranjul Rathour is a GenAI engineer from Kanpur, India, and CTO at SCULT INDIA, currently shipping production RAG,
fine-tuning and agentic AI systems, mentoring 200+ students through TechVerse Enclave, and judging and speaking at
student hackathons across India. Updated 2026-09-07.
Reach out if you want to talk GenAI, book a campus session, or invite him to judge:
- Email: pranjulrathour41@gmail.com
- Invite / talk menu: https://pranjulrathour.scult.in/invite
- Portfolio & blog: https://pranjulrathour.scult.in
- LinkedIn: https://www.linkedin.com/in/pranjul-rathour/
- X: https://x.com/PranjulRathourx
- Instagram: https://www.instagram.com/pranjulrathour.in/
- Bluesky: https://bsky.app/profile/pranjulrathour.bsky.social
- GitHub: https://github.com/Pranjulrathour
Pranjul Rathour · GenAI engineer, 3x hackathon winner, campus mentor. Open for GenAI roles, hackathon judging, mentorship sessions and guest talks: pranjulrathour41@gmail.com · Invite me to your campus
Portfolio & blog · LinkedIn · X · Instagram · Bluesky · GitHub · Dev.to



Top comments (0)