Access to credentials should be restricted to particular user roles, processes an resources. They should not be made available to all roles/processes/resources. Access to the Production environment should also be highly secure - developers should not have any access to Production and therefore no access to live passwords. The only passwords anyone can cast in this way should be those in Dev or (non-live) Test. Where UAT uses Live data, the Logical Access Model should dictate that developers have read-only access to processes. Passwords have to be 'castable' so that they can be sent to the target application. Even is it was not possible to perform this cast, it would be just as easy to write the password into Notepad. Even when you type password manually, you are sending plain text to the application.