  Lead-free halide double perovskites with the formula of quaternary
A$_2^+$B'B'$^{3+}$X$_6^-$ have recently attracted intense interest as
alternatives to lead-halide-perovskite-based optoelectronic materials for their
non-toxicity and enhanced chemical and thermodynamic stability. However, the
understanding of intrinsic defect properties and their effects on carrier
transport and Fermi level tuning is still limited. In this paper, we show that,
by exploring the phase diagram of a halide double perovskite, one can control
the effects of intrinsic defects on carrier trapping and Fermi level pinning.
We reveal the ideal growth conditions to grow p-type Cs$_2$AgInCl$_6$ and
Cs$_2$AgBiCl$_6$ as well as semi-insulating Cs$_2$AgBiBr$_6$ with low trap
density for targeted photovoltaic or visible-light/radiation detection
application.
