How to Enable Luna Thales HSM for Robot Credentials?

Do we have to modify the bot’s code in order to retrieve HSM credentials? any activities that need to be added in order to use HSM?