We analyze the optimal capital requirement in a model of banks with heterogeneous investment risks and asymmetric information. Asymmetric information prevents depositors from charging an actuarially fair interest rate and leads to cross-subsidization across banks. A leverage constraint reduces the investment of riskier banks, mitigating the pecuniary externality on deposit rates. When policymakers lack information about banking risk, the optimal leverage constraint is tighter than the first-best leverage ratio. When policymakers observe a noisy signal of banking risk, the optimal signal-based leverage constraint is tighter when the signal has worse precision, rather than a larger level of expected risk.