Let $G$ be an algebraic group acting on an affine variety $X=\operatorname{Spec}A$ (all over $\mathbb{C}$). This gives an action of $G$ on the $\mathbb{C}$-algebra $A$, and an action of the Lie algebra $\mathfrak{g}$ of $G$ on $A$ by derivations.


If the action is not transitive, then $G$ will preserve some nontrivial ideal of $A$ (namely take an ideal of a closed $G$-orbit). In particular, $\mathfrak{g}$ will preserve this ideal.


My question is whether this remains true if we only have the lie algebra and no group action. In particular, suppose that $\mathfrak{g}$ is a finite-dimensional Lie subalgebra of $\operatorname{Der}\_{\mathbb{C}}(A)$, and suppose that it does not act 'transitively' on $X$, i.e. for some closed point $x\in X(\mathbb{C})$ the natural map
$$
\mathfrak{g}\to T\_xX
$$
is not surjective, where $T\_xX$ is the tangent space of $X$ at $x$. Then, must there exist a non-trivial ideal $I$ of $A$ which is preserved by $\mathfrak{g}$? Feel free to assume $X$ is smooth, say. Note I am not assuming the action of $\mathfrak{g}$ on $A$ is integrable, else we could use the statement about group actions stated initially.



Lie algebra preserving ideal of functions
A counterexample is $X=\mathbb{A}^2\backslash\{y=0\}$, $A=\mathbb{C}[x,y,y^{-1}]$, and $\mathfrak{g}$ the span of the derivation $D(x)=1$, $D(y)=y$. Now $\mathfrak{g}$ is $1$-dimensional and $X$ is $2$-dimensional, so the map $\mathfrak{g}\to T\_x X$ is not surjective for any $x\in X(\mathbb{C})$. The integral curves of (the vector field associated with) $D$ are $y=ce^x$ for $c\in\mathbb{C}^\times$, 
 and the intuition is that because each of these curves is Zariski dense, there cannot be a non-trivial ideal preserved by $D$. I'm a little confused about how to formalize this argument, especially because an ideal might not be reduced (maybe someone else sees how to do this). I will argue directly that there is no non-trivial ideal $I\subset A$ with $D(I)\subset I$.


Suppose $I\neq (0)\subset A$ satisfies $D(I)\subset I$. Let 
$$
f(x,y)=\sum\_{n=0}^m f\_n(x) y^m\in\mathbb{C}[x,y], \,\,f\_m\neq 0
$$
be an element of $I\cap \mathbb{C}[x,y]$ for which $m$ is minimal, and for which $\deg(f\_m(x))$ is minimal (among those elements with minimal $m$). Then
$$
mf-D(f) = \sum\_{n=0}^m \big((m-n)f\_n - f\_n'\big)y^n\in I.
$$
The coefficient of $y^m$ in the above element is $-f\_n'$, which has degree less than that of $f\_n$, so by the construction of $f$ we must have $mf-D(f) = 0$. Looking at the coefficient of $y^0$, we see $m f\_0= f\_0'$. This can only happen if either $f\_0=0$, or if $m=0$ and $f\_0$ is constant. If $f\_0=0$, then $y^{-1} f\in I\cap\mathbb{C}[x,y]$ contradicts the minimality of $f$. If $m=0$ and $f\_0$ is constant, then $f$ is a constant, and $I=A$.


