  We propose a systematic procedure to construct polynomial algebras from
intermediate Casimir invariants arising from (semisimple or non-semisimple) Lie
algebras $\mathfrak{g}$. In this approach, we deal with explicit polynomials in
the enveloping algebra of $\mathfrak{g} \oplus \mathfrak{g} \oplus
\mathfrak{g}$. We present explicit examples to show how these Lie algebras can
display different behaviours and can lead to Abelian algebras, quadratic
algebras or more complex structures involving higher order nested commutators.
Within this framework, we also demonstrate how virtual copies of the Levi
factor of a Levi decomposable Lie algebra can be used as a tool to construct
"copies" of polynomial algebras. Different schemes to obtain polynomial
algebras associated to algebraic Hamiltonians have been proposed in the
literature, among them the use of commutants of various type. The present
approach is different and relies on the construction of intermediate Casimir
invariants in the enveloping algebra $\mathcal{U}(\mathfrak{g} \oplus
\mathfrak{g} \oplus \mathfrak{g})$.
