It's a wasp! Wasps are also famous for parasitizing caterpillars.
Ichneumonidae, subfamily Ophioninae. There will me many similar, it would be difficult to say which it is unless you have a specimen or several photos showing close detail of parts.
http://bugguide.net/node/view/...