Perhaps a fantastic example of why keeping detailed configuration in environment variables is probably a bad idea. Your private SSH key isn't part of the environment. It's configuration. Treat it as such.
It's a hard problem trying to secure credential that code needs to work, from other code running as the same user when someone has source code access to "authorised" code.