Credit risk is a widespread component of financial contracts and has long been the topic of academic research. While academic research has focused on the pricing of credit risk, practitioners, on the other hand, tend to use collateralization to circumscribe the problem. Very little academic work has addressed the issue of how to control optimally for risky collateral. This research develops stylized programs providing parties exposed to credit risk with optimal timing and optimal size of the controls required on the collateral they secure, in cases of both complete and partial observation. General control of implicit or explicit financial guarantees such as credit risk (but also deposit insurance, mortgage-backed insurance, etc.) is approached as an impulse control problem. Detailed numerical analysis of a specific application is given. Results, other applications, and possible extensions are discussed.