agent: refactor keyring loader