Now that you setup your ssh with a passphrase to add some level of security.
But you don't want the inconvenience to type your passphrase every single time you use your key.
When using git/ssh, you may have come across the following prompt:
Pitfalls
Make sure your keys/agent are unload when you log off your machine.
Do not copy your private keys on somebody else computer which has root on.
Do not run ssh-agent on somebody else computer which has root on.
Trade-off (Security vs Convenience)
If you are tempted to add the following script on your dotfile profile. You have to be aware that every instance of your Terminal will start a ssh-agent process
To remove current agent provide by SSH_AGENT_PID run:
To list running ssh-agent process (OSX):
Last tips for security would be to set a time to live using: -s bourne shell stdout, -t 86400 for 24 hours. It could be less according to your security policy definition.