The standard economic solution would be to measure that externality precisely and implement it through a price mechanism.