What is the BEST practice for secrets in applications?

Answer

Secure environment variables and secret management

Explanation

The best practice for managing sensitive information like API keys and other secrets in applications is to use secure environment variables and dedicated secret management systems (e.g., AWS Secrets Manager, Google Secret Manager, HashiCorp Vault). This approach ensures that secrets are not committed to version control, are not hardcoded (A), and can be rotated securely. Hardcoding (A) and storing in public GitHub (C) are major security vulnerabilities. Embedding secrets directly in prompts (D) can lead to them being logged or exposed during model interactions, which is also a security risk.

Last reviewed: October 2026

Reviewed by FirstInTest Editorial Team

Report an error
QuestionBack to list