As you have outlined, any secrets are added to AYON Secrets Tab which is mainly used on the AYON Server web app.
In your DCC, you can retrieve these secrets via AYON Python API. AYON Server will only respond with the values if the user has the proper permissions. e.g. if a user can see the contents of secrets tab, the secrets api call will work for them.
ayon_api.get_secrets()
ayon_api.get_secret("secret_name")
Alternatively, since your goal is setting some environment variables for DCCs, then you may consider achieving it by setting environment variables in application or core addon as outlined in the following guide.