Posse Comitatus Act and Related Matters: The Use of the Military to Execute Civilian Law [November 6, 2018] [open pdf - 1MB]
"Case law indicates that 'execution of the law' in violation of the Posse Comitatus Act occurs (a) when the Armed Forces perform tasks assigned to an organ of civil government, or (b) when the Armed Forces perform tasks assigned to them solely for purposes of civilian government. Questions concerning the act's application arise most often in the context of assistance to civilian police.At least in this context, the courts have held that, absent a recognized exception, the Posse Comitatus Act is violated when (1) civilian law enforcement officials make 'direct active use' of military investigators; or (2) the use of the military 'pervades the activities' of the civilian officials; or (3) the military is used so as to subject 'citizens to the exercise of military power which was regulatory, prescriptive, or compulsory in nature.' The act is not violated when the Armed Forces conduct activities for a military purpose."
CRS Report for Congress, R42659
Congressional Research Service: https://crsreports.congress.gov/