This paper investigates the relation between risk and the degree of financial intermediation in a model with moral hazard. Entrepreneurs can simultaneously get credit from two type of competing institutions:"financial intermediairies" and "local lenders". The former are competitive firms issuing deposits and having a comparative advantage in diversifying credit risks. The latter are individuals with a comparative advantage in credit arrangements with a "nearby" entrepreneur. Because of intermediation costs, local lenders are willing to diversify their portfolio by offering some direct lending to nearby entrepreneurs.We show that, in some cases, a fall in intermediation costs, by inducing local lenders to choose a safer portfolio reduces entrepreneurs' effort and increases the probability of default. In these cases a taxation policy may be welfare-improving.