The original answer contains solid security practices but can be improved for clarity and completeness. I made the following refinements: 1) Clarified 'Custom Metadata' to 'Custom Metadata Types' for technical precision, 2) Added Named Credentials as the preferred modern approach for external API authentication, which aligns with ApexSuggestUsingNamedCred rule guidance, 3) Made encryption conditional ('If using Custom Settings') since Named Credentials handle encryption automatically, 4) Improved the structure to present the most secure option first. The selected security rules relate directly to the FAQ content: ApexSuggestUsingNamedCred relates to the FAQ's focus on securely managing API credentials and suggests Named Credentials as the preferred approach. AvoidHardcodedCredentialsInFieldDecls, AvoidHardcodedCredentialsInVarAssign, and AvoidHardcodedCredentialsInVarDecls all relate to the core problem this FAQ addresses - avoiding hardcoded credentials by using secure storage mechanisms like Custom Settings. ApexBadCrypto relates to the FAQ's recommendation to use the Apex Crypto class for encryption, ensuring proper cryptographic practices are followed.