To prevent forwarding the SSH agent to Apptainer containers, use the --no-env flag to block the SSH_AUTH_SOCK environment variable:
bashapptainer run --no-env SSH_AUTH_SOCK my_container.sif
SSH_AUTH_SOCK) to containers by default--no-env flag explicitly excludes specified variables from being importedSSH_AUTH_SOCK, processes inside the container cannot locate your host's SSH agent socketIf your SSH agent socket resides in /tmp (the default location) and you want to prevent any possibility of access:
bashapptainer run --no-env SSH_AUTH_SOCK --no-mount tmp my_container.sif
This blocks both the environment variable and the automatic /tmp mount where the socket typically exists.
Vibe can make mistakes. Check answers. Learn more