This paper examines the problem of costly exclusion of individuals fro
m a public good. Previous analyses of exclusion have treated it as sol
ely a question of technologies; in our analysis exclusion depends on t
echnology and incentives. In this paper providers of the good design a
mechanism to provide an optimal level of deterrence to free riders. I
f individuals are heterogeneous optimal deterrence may allow some free
riders. We examine the effect of costs of exclusion on the Samuelson
condition for optimal provision, and see that the desire to deter free
riding leads to underprovision of the good irrespective of the degree
of rivalry of the good.