Trust is a collective, self-fulfilling phenomenon that suggests analogies with phase transitions. We introduce a stylised model for the build-up and collapse of trust in networks, which generically displays a first order transition. The basic assumption of our model is that whereas trust begets trust, panic also begets panic, in the sense that a small decrease in trust may be amplified and ultimately lead to a sudden and catastrophic drop of trust. We show, using both numerical simulations and mean-field analytic arguments, that there are extended regions of the parameter space where two equilibrium states coexist: a well-connected network where confidence is high, and a poorly connected network where confidence is low. In these coexistence regions, spontaneous jumps from the well-connected state to the poorly connected state can occur, corresponding to a sudden collapse of trust that is not caused by any major external catastrophe. In large systems, spontaneous crises are replaced by history dependence: whether the system is found in one state or in the other essentially depends on initial conditions. Finally, we document a new phase, in which agents are connected yet distrustful.