A key that sits in the ssh-agent all day can be used by anything that can reach the agent. I like giving it an expiry time.
The -t option sets a maximum lifetime when you add an identity:
ssh-add -t 1h ~/.ssh/id_ed25519
The man page says the lifetime can be given in seconds or in the time format of sshd_config(5), so 3600 and 1h are the same. After that time the agent drops the key, and the next use needs the passphrase again.
To see what the agent holds right now, list the fingerprints:
ssh-add -l
To empty it before you walk away, delete all identities:
ssh-add -D
If ssh adds your keys automatically, the AddKeysToAgent option in ~/.ssh/config accepts a time interval as well. The man page says the key is then removed from the agent after that lifetime, so you do not have to type the flag each time:
Host *
AddKeysToAgent 1h
There is a related option for a different worry. ssh-add -c marks the key so that every use must be confirmed before it is used for authentication, and the man page says the confirmation goes through ssh-askpass(1).
The caveat is the nuisance: a short lifetime means more passphrase prompts, so pick a time that fits your working day. It also limits only how long the key is loaded, not what a program can do with it while it is.
Further reading: ssh-add man page, ssh_config man page