How do I protect myself from friendly-fired spells?
I crafted a very potent Firaga spell and, while liking Noctis' current setup, I gave the spell to Prompto. I was in a grassy area, fighting creatures who's weakness was fire, and the next thing I know Operation Firestorm commenced, which dealt a huge chunk damage that nearly costed me the fight.
If I cast a spell as Noctis, I can strategically cast spells and wait for an opening before casting. If I give it to either Prompto, Ignis, or Gladiolus, they appear to cast spells blindly, as long as it is the enemy's weakness.
Is there a way to protect myself from friendly-fired spells, or do I need to hope for the best that I do not get killed?
From my experience, giving your party members magic is like giving your companions Fat Men in Fallout 4. They use them with no regard to your location, so you'll typically be caught in the blast.
The same goes for when you cast. In fact, until recently, me using spells typically meant death to all my party members. Swinging your sword at your party members elicits a "Hey! Watch where you swing that thing!" response, but doesn't actually damage them. Using magic near them will pretty much kill them, if you use a powerful enough spell, so watch out.
My advice would just be to not ever give your party members spells, unfortunately.
If you have the season pass.
The holiday DLC has an accessory called "Ring of Resistance" which makes your party immune to friendly fire.