Whenever you see a small, thin wasp with long antennae, don’t squash it. Don’t even be afraid of it. These Ichneumonid wasps are parasitoids: they lay their eggs inside other insects, often insects that are pests of agricultural crops. Their eggs develop within these host insects, and when the larvae emerge they devour the host from the inside out. This behavior helps control many pest insect populations, which is great for us and our food supply.
Females are also incapable of stinging. Their ovipositors (the long, thin, hairlike organs at the rear of the abdomen) are adapted to laying eggs, not stinging people as with some other Hymenoptera. The lack of an ovipositor in the photo above shows that this particular wasp is a male.
You’ll notice I made no attempt to identify this wasp beyond the family level. That’s because there are 3,000-5,000 known Ichneumonid species in North America alone, and at least 60,000 known worldwide.