Abstract: Companies adopt varying takeover defenses prior to IPOs, contrary to simple agency-cost models. Variation in defenses is explained in large part by the quality of legal services provided to entrepreneurs and pre-IPO managers. Data from 320 IPOs in 1991-92 and 1998 show that companies advised by larger law firms with more takeover experience adopt more defenses. In 1991-92, companies with Silicon Valley lawyers adopted almost no defenses; by 1998, Silicon Valley lawyer clients were as likely to use defenses as other lawyers. Companies with high-quality underwriters and venture capital backing are more likely to adopt defenses, and the overall rate of defense adoption increased in the 1990s. Dual class capital structures appear to be distinct, and motivated by non-pecuniary private benefits of control. Together, these findings suggest that, except for dual class structures, defenses are generally optimal at the IPO stage, but not all clients receive that advice from their lawyers.