If you are on *nix
The ssh agent is controled by the user using the command ssh-add The agent asks the user for password and manages how long a socket stays open and where the keys gets stored using $SSH_AUTH_SOCK variable
You can for example lock the agent with
ssh-add -x
maybe you can execute this commands before the computer shutdown or sleep and unlock the agent with
ssh-add -X
an other way would be to set the lifetime of keys used by the agent to limited time like this:
ssh-add -t seconds