In a recent paper [Phys. Rev. B 90, 115134 (2014)] we put forward a diagrammatic expansion for the selfenergy which guarantees the positivity of the spectral function. In this work we extend the theory to the density response function. We write the generic diagram for the density-response spectrum as the sum of "partitions". In a partition the original diagram is evaluated using time-ordered Green's functions on the left-half of the diagram, antitime-ordered Green's functions on the right-half of the diagram and lesser or greater Green's function gluing the two halves. As there exist more than one way to cut a diagram in two halves, to every diagram corresponds more than one partition. We recognize that the most convenient diagrammatic objects for constructing a theory of positive spectra are the half-diagrams. Diagrammatic approximations obtained by summing the squares of half-diagrams do indeed correspond to a combination of partitions which, by construction, yield a positive spectrum. We develop the theory using bare Green's functions and subsequently extend it to dressed Green's functions. We further prove a connection between the positivity of the spectral function and the analytic properties of the polarizability. The general theory is illustrated with several examples and then applied to solve the long-standing problem of including vertex corrections without altering the positivity of the spectrum. In fact already the first-order vertex diagram, relevant to the study of gradient expansion, Friedel oscillations, etc., leads to spectra which are negative in certain frequency domain. We find that the simplest approximation to cure this deficiency is given by the sum of the zero-th order bubble diagram, the first-order vertex diagram and a partition of the second-order ladder diagram. We evaluate this approximation in the 3D homogeneous electron gas and show the positivity of the spectrum for all frequencies and densities.