Developing countries frequently offer tax incentives and even subsidize the entry and operation of foreign firms. I examine the optimality of such policies in an economy where growth is driven by entrepreneurial know-how, a skill that is continuously updated on the basis of the productive ideas implemented in the country. Openness allows foreign ideas to disseminate inside a country and can foster the country's domestic accumulation of know- how. With externalities, however, laissez-faire openness is suboptimal and can be growth-and even welfare-reducing. I examine the gains from openness under an optimal taxation program the self-funding taxes on domestic and foreign firms that maximize the welfare of the recipient country, subject to the equilibrium behavior of national and foreign firms. Under optimal taxation, openness is always welfare enhancing and leads lagging countries to catch up with the world frontier. Yet, a country may want to subsidize the entry of foreign firms only if it can also subsidize the domestic accumulation of know-how. I also consider the optimal tax program under a number of restrictions that developing countries typically face. For instance, a country must not subsidize entry of foreign firms if doing so requires taxing the concurrent cohort of domestic firms. Similarly, an international agreement that requires equal taxation of domestic and foreign firms can be welfare reducing for a country close to the knowledge frontier.