A concrete example
Instead of writing your Anthropic key straight into a script, you write ANTHROPIC_API_KEY=... in .env, and the script reads it on startup.
Why it matters
Agents and automations start handling secrets fast. The .env file keeps them out of shared files.
You run into it at the root of a local project, or as environment variables in Vercel, Railway, or Supabase.
Don't mix it up with
API key: An API key is a technical password that lets a tool call an AI service on your behalf.
Vercel environment variables: Vercel environment variables store sensitive keys and settings on the deployment side.
Common mistakes
- Forgetting to add .env to .gitignore.
- Sharing a screenshot with the real values.
- Changing a variable without restarting the tool.
Quick checklist
- First I check whether the word names a concept, a tool, a risk, or a metric.
- I tie it to a concrete case: Instead of writing your Anthropic key straight into a script, you write ANTHROPIC_API_KEY=... in .env, and the script reads it on startup.
- I keep the main trap in mind: Forgetting to add .env to .gitignore.
Quick questions
What is .env file in AI?
A .env file keeps a project's sensitive keys and settings out of the visible code.
Where will I run into .env file?
You run into it at the root of a local project, or as environment variables in Vercel, Railway, or Supabase.
Which word should I read next?
Start with API key, Vercel environment variables, Git.