agent: clean up keyring file implementation