Coming too close to most npc faction members is what gets you shot.
Rave party is an exception, I think there are 1 or 2 more.
If you're a VC citizen you can approach their caravans and patrols with a weapon in your hand with no problem at all.
They let you come close, pick up stuff, etc.
Just don't pick stuff up during the fight, wait till it finishes and they returned to their starting position.
You can heal wounded VC patrol and caravan members for +1 xp.
I don't know for sure, but I assume BoS and Enclave work similar.