Let \[ f(x)= \begin{cases} ax+3, & x \leq 2 \\ a^2x-1, & x > 2 \end{cases} \] Then the values of \(a\) for which \(f\) is continuous for all \(x\) are: