Harder-Narasimhan (HN) theory gives a structure theorem for principal G bundles on a smooth projective curve. A bundle is either semistable, or it admits a canonical filtration whose associated graded bundle is semistable in a graded sense. After reviewing recent advances in extending HN theory to arbitrary algebraic stacks, I will discuss work in progress with Andres Fernandez Herrero to apply this general machinery to the stack of “gauged” maps from a curve C to a G-scheme X, where G is a reductive group and X is projective over an affine scheme. Our main application is to use HN theory for gauged maps to compute generating functions for K-theoretic enumerative invariants known as gauged Gromov-Witten invariants. This problem is interesting more broadly because it can be formulated as an example of an infinite dimensional analog of the usual set up of geometric invariant theory, which has applications to other moduli problems.