My son has three Purple Hearts. (One and two Oak Leaf clusters.)
Two were awarded for wounds in battle in Iraq. I think the third was for combat in a country that can't be named, for diplomatic reasons. He was then a mercenary soldier (security contractor) assigned by the US State Dept. to protect US federal agents conducting covert operations there. He was wounded in the shoulder, above the Kevlar plates in his vest, by what seems to have been a ricocheting AK-47 bullet. It entered him sideways and was recovered when a US agent rendered first aid after they neutralized the attackers.
I think this was the second Oak Leaf cluster to his Purple Heart, and he was technically a civilian then. It is possible that because he was functioning as a paramilitary soldier under the auspices of the United States that he was deemed military for this purpose.
I may be wrong about this. All three awards may be for action in Iraq. I'll ask. But that's what I remember from what he told me. The scar is sort of weird, because the bullet evidently didn't enter point-first. Had it penetrated deeper, it would have been a really nasty wound.
My son got married in his dress blues and the uniform is impressive. But I'd rather that he didn't have to "earn" those Purple Hearts. BTW, one required his evacuation to the USA and he spent some time in Walter Reed army hospital. He said the staff treated him and other wounded soldiers very well.
This is an interesting question. I think the OP wants to know if civilians wounded by enemies of the USA can receive an actual Purple Heart or if they get another award. I am especially keen to know if the Purple Heart can be awarded to technical civilians who are bearing arms against the enemy, and whose wounds occurred in battle, not while they were helpless victims of terrorists.
This could easily occur if FBI agents were investigating a bomb blast at a US Embassy, such as in Libya or in Kenya.
I suspect that CIA officers may sometimes accompany friendly foreign forces looking for terrorists, as may US paramilitary troops or advisors who are no longer in the army or other services may do.