With 2,500 species in the UK to choose from, identifying Ichneumonid wasps is a challenge, so much so that it’s hard to even know what sources you can rely on. You would think this one might be quite distinctive as it’s quite large with white sections on the antennae, but after checking around the best I can do is tentatively put it down as Stenichneumon sp., perhaps S. militarius or S. culpator. It’s a dark form, as these species usually have a white spot on the thorax and, in the case of S. militarius, a white section on the legs.
The adult wasp feed on nectar, but they lay their eggs on/in moth larvae, which are then eaten from the inside by the wasp’s own larvae. The fact the caterpillar dies strictly speaking makes the wasp a parasitoid rather than a parasite.