$\DeclareMathOperator\GL{GL}\DeclareMathOperator\M{M}\DeclareMathOperator\Tr{Tr}$Consider the diagonal action of $\GL(n,\mathbb{C})$ on the variety of $k$-tuples of matrices, $\M\_{n\times n}(\mathbb{C})^k$
through conjugation. Then it is known that the ring of invariants
$\mathbb{C}[\M\_{n\times n}(\mathbb{C})^k]^{\GL(n,\mathbb{C})}$
is generated by the functions obtained by first evaluating a non-commutative polynomial on the tuple of matrices and then applying the trace to the resulting matrix.


So for example if $k=2$, we need to look at functions like $(A,B) \mapsto \Tr(AB)$, $(A,B) \mapsto \Tr((AB)^2 A)$, etc. Details can be found in:


[*The invariant theory of $n \times n$ matrices*](https://doi.org/10.1016/0001-8708(76)90027-X), Claudio Procesi, Advances in Mathematics, Volume 19, Issue 3, March 1976, Pages 306-381


Now assuming this, suppose we are looking for the ring of invariants of tuples as before but now for the diagonal action of a reductive group $G$ on the variety of tuples $\mathfrak{g}^k$.


Then will it be true that the ring of invariants in this situation is also generated as above by first evaluating non-commutative polynomials and then taking the trace, but now we do this on the matrices obtained by considering various representations of $\mathfrak{g}$ (or $G$), just like what happens in the case of $k=1$?



Ring of invariants for $n$-tuples of Lie algebras
For some Lie groups you will need additional invariants. For example, for the even orthogonals you will need the Pfaffian in addition to the Trace.


See for example:


[*Invariant theory of special orthogonal groups*](https://projecteuclid.org/journals/pacific-journal-of-mathematics/volume-168/issue-2/Invariant-theory-of-special-orthogonal-groups/pjm/1102620558.full), Helmer Aslaksen, Eng-Chye Tan, Chen-bo Zhu Pacific J. Math. 168(2): 207-215 (1995).


However, you can already see this with one copy of $\mathfrak{so}(2,\mathbb{F})$ and $\mathrm{SO}(2,\mathbb{F})$ acting by conjugation. For in that case the Lie algebra is $\left\{\left(\begin{array}{cc}0&a\\-a&0\end{array}\right)|\ a\in \mathbb{F}\right\}$ and the conjugation action is trivial. In this case the trace is identically 0 and the Pfaffian is the only useful invariant.


In case you are interested, the Lie group version of this question was addressed by myself and Sikora here:


[*Varieties of Characters*](https://arxiv.org/pdf/1604.02164.pdf), Sean Lawton & Adam S. Sikora
Algebras and Representation Theory volume 20, pages 1133–1141(2017).


Remark 1: In the above answer, I assumed the OP wanted a *fixed* representation of $G$. As noted in the answers to this [MO question](https://mathoverflow.net/q/25439/12218), if you vary over all representations, then for $k=1$ the answer is yes. But for $k\geq 2$ the answer appears to me to still be no. See Theorem 1 in Sikora's paper [*SO(2n,C)-character varieties are not varieties of characters*](https://arxiv.org/pdf/1503.08279.pdf); it is not exactly the same thing, but it seems to imply the result (see the comments for a strategy to fill in the details).


Remark 2: As noted already by Professor Procesi, his work cited by the OP implies the answer is yes for the Lie groups $\mathrm{GL}\_n$, $\mathrm{O}\_n$, and $\mathrm{Sp}\_{2n}$ (by restricting $k$-tuples of generic matrices to the subvariety $\mathfrak{g}^k$). From this one can also deduce that the answer is yes for the Lie groups $\mathrm{SL}\_n$ and $\mathrm{SO}\_{2n+1}$.


Remark 3: As I said in the comments, I believe the work of G. Schwarz probably implies the answer is also yes for a representation of $G\_2$ (he also addresses some Spin groups). The question for the other exceptional groups is open as far as I know. If I were to guess, I would say it is probably true for all of them except $E\_6$ which has additional symmetry as in the case of $\mathrm{SO}\_{2n}$ (where the answer is no as I already indicated).


Remark 4: Once one knows the answer for a given $G$, then one also knows it for finite central quotients of $G$ (which is how one goes from the orthogonal case to the special orthogonal case for odd $n$). Also, if one knows the answer for $G$ and $H$, then one also knows it for $G\times H$. Putting these observations together with the known cases reduces the entire problem down to the (simply connected forms of the) exceptional groups and the spin groups.


