[ZD#696706] refactor code and show alert for agent only content