But the measure includes an exception for situations when military force is “necessary and appropriate to defend against an imminent attack” on Americans.