12. The range of negative values of $a$ that make the inequality $\sin ^{2} x+a \cos x+a^{2} \geqslant 1+\cos x$ hold for all $\mathbf{x} \in \mathbf{R}$ is $\qquad$.
12. $a \leqslant-2$

The original inequality can be transformed into: $\left(\cos x-\frac{a-1}{2}\right)^{2} \leqslant a^{2}+\frac{(a-1)^{2}}{4}$.
Since $-1 \leqslant \cos x \leqslant 1, a<0, \frac{a}{2}-1<0$,
when $\cos x=1$, the function $y=\left(\cos x-\frac{a-1}{2}\right)^{2}$ has a maximum value of $\left(1-\frac{a-1}{2}\right)^{2}$, thus we have $\left(1-\frac{a-1}{2}\right)^{2} \leqslant a^{2}+\frac{(a-1)^{2}}{4}$, simplifying to $a^{2}+a-2 \geqslant 0$, so $a \geq 1$ or $a \leqslant-2$. Since $a<0$, we have $a \leqslant-2$.