Time-ordering operator acting on exponential?

Looking into quantum field theory I have come across the time-ordering operator, $T$, defined such that (ignoring the sign associated with fermion opeartors): $$T(a_1(t_1)...a_n(t_n))=a_{\pi(1)}(t_{\pi(1)})...a_{\pi(n)}(t_{\pi(n)})$$ where $\pi$ is a permutation of $1,2,...,n$ such that $t_{\pi(1)} \gt t_{\pi(2)}\gt...\gt t_{\pi(n)}$. This is fine and I understand how this works. But have also seen expressions like:

$$T \left( \exp \left( -i \int^t_0 dt' V_I(t') \right) \right)$$ How is the time-ordering operator defined to work in these cases? Since in the first their is explicit time dependence and in the second it seems that all operators will be evaluated at the same time $t$.

In the case you describe, the time-ordering operator $\mathbb{T}$ is defined to work on the Taylor series defined by the exponential. Concretely, this means $$\mathbb{T}~\exp\left(-i\int_{t_I}^{t_F} dt~V(t)\right) = \mathbb{T}~\left(1 + (-i)\int_{t_I}^{t_F} dt~V(t)+ \frac{(-i)^2}{2!}\int_{t_I}^{t_F} dt_1~V(t_1)\int_{t_I}^{t_F} dt_2~V(t_2)+\cdots \right)$$ Now for example the nth order term is equal to $$\begin{split} &\mathbb{T}~\frac{(-i)^N}{N!}\int_{t_I}^{t_F} dt_1 \int_{t_I}^{t_F} dt_2\cdots\int_{t_I}^{t_F}dt_N~V(t_1)\cdots V(t_N)\\ &=\frac{(-i)^N}{N!}\int_{t_I}^{t_F} dt_1 \int_{t_I}^{t_F} dt_2\cdots\int_{t_I}^{t_F}dt_N~\mathbb{T}(V(t_1)\cdots V(t_N)) \end{split}$$ and from here on you can use the equation that you described to understand. So $\mathbb{T}$ acts exactly as you would expect it. What you probably missed in the beginning is that the Taylor series leads to a product of integrals each having an own integration name because $\left(\int_{t_I}^{t_F} dt_1~V(t_1)\right)^2=\int_{t_I}^{t_F} dt_1~V(t_1)\int_{t_I}^{t_F} dt_2~V(t_2)=\int_{t_I}^{t_F} dt_1\int_{t_I}^{t_F} dt_2~V(t_1)V(t_2)$. Therefore the above expression is meaningful.