We propose a method for imposing an important exact constraint on model Kohn–Sham potentials, namely, the requirement that they be functional derivatives of functionals of the electron density ρ. In particular, we show that if a model potential v(r) involves no ingredients other than ρ, ∇ρ, and ∇2ρ, then the necessary and sufficient condition for v(r) to be a functional derivative is ∂v/∂∇ρ=∇(∂v/∂∇2ρ). Integrability conditions of this type can be used to construct functional derivatives without knowing their parent functionals. This opens up possibilities for developing model exchange-correlation potentials that do not lead to unphysical effects common to existing approximations. Application of the technique is illustrated with examples.