7. For any $x \in\left[-\frac{\pi}{6}, \frac{\pi}{2}\right]$, the inequality $\sin ^{2} x+a \sin x+a+3 \geqslant 0$ always holds. Then the range of the real number $a$ is $\qquad$ .
7. $[-2,+\infty)$.

Let $f(x)=\sin ^{2} x+a \sin x+a+3$, then
$$
f(x)=\left(\sin x+\frac{a}{2}\right)^2+a+3-\frac{a^{2}}{4} \geqslant 0 .
$$

Since $x \in\left[-\frac{\pi}{6}, \frac{\pi}{2}\right]$, thus, $\sin x \in\left[-\frac{1}{2}, 1\right]$.
Let $t=\sin x$, then $-\frac{1}{2} \leqslant t \leqslant 1$. Let
$$
g(t)=\left(t+\frac{a}{2}\right)^{2}+3+a-\frac{a^{2}}{4} .
$$

We need to find all $a$ such that the minimum value of $g(t)$ on $\left[-\frac{1}{2}, 1\right]$ is greater than or equal to 0, which is equivalent to
$$
\begin{array}{l}
\left\{\begin{array} { l } 
{ - \frac { a } { 2 } \leq 1, \\
g(1) \geqslant 0
\end{array}\right.\right.\right. \\
\Leftrightarrow\left\{\begin{array} { l } 
{ a \geq -2, } \\
{ a \geqslant - \frac { 13 } { 2 } }
\end{array} \text { or } \quad \left\{\begin{array} { l } 
{ - 2 \leqslant a \leqslant 1, } \\
{ 6 \geqslant a \geqslant - 2 }
\end{array} \text { or } \quad \left\{\begin{array}{l}
a > 1 \text { or } -2 \leqslant a \leqslant 1 \Leftrightarrow a \geqslant -2 .
\end{array}
$$