The correct thing, and this isn't hard, is to give it a different set of permissions than yours. Do not let it get into your .ssh directory at all, problem solved. People keep posting these stories as if there's something useful in them, and there is:
The moral of the story is don't be a fool. Give your agents different, restricted, permissions, than your own permissions.
This is the same approach when working with people. Your agent should be, from an authentication and authorization perspective, treated like any other employee: Given an appropriate set of permissions to their needs, not root level access to all your systems.
ceejayoz•45m ago
matt3210•22m ago