We investigate the exact Kohn-Sham exchange-correlation potential at semiconductor interfaces, including Schottky barriers, heterojunctions, and semiconductor surfaces. By considering the electron density at the interface, we deduce the way in which the exact exchange-correlation potential differs from its bulk counterpart. The potential has a slow spatial variation related to the discontinuity, ¿, that occurs on addition of an electron to the bulk semiconductor. This variation, which corresponds to an ultra-non-local ‘‘vertex correction’’ in the Kohn-Sham formulation of the dielectric response of the semiconductor, results in correction terms for Schottky barrier heights and band offsets calculated using Kohn-Sham orbital energies. The effect is exhibited numerically for a model semiconductor.