Judge Advocate General's Corps, also known as JAG or JAG Corps, refers to the legal branch or specialty of a military concerned with military justice and military law. Officers serving in a JAG Corps are typically called Judge Advocates. Only the chief attorney within each branch is referred to as the "Judge Advocate General"; however, individual JAG Corps officers are colloquially known as JAGs.
Judge Advocates serve primarily as legal advisors to the command to which they are assigned. In this function, they can also serve as the personal legal advisor to their commander. Their advice may cover a wide range of issues dealing with administrative law, government contracting, civilian and military personnel law, law of war and international relations, environmental law, etc. They also serve as prosecutors for the military when conducting courts-martial. In the United States military, they are charged with both the defense and prosecution of military law as provided in the Uniform Code of Military Justice. Highly experienced officers of the JAG Corps often serve as military judges in courts-martial and courts of inquiry.
The Uniform Code of Military Justice (UCMJ), is the primary legal code through which all internal military justice matters of the United States are governed. The UCMJ applies to all members of the Military of the United States, including military retirees as well as members of other federal uniformed services (such as NOAA Corps and the Public Health Service Commissioned Corps) when attached to the military. The UCMJ was created by an act of the United States Congress in 1951 in order to establish relatively consistent systems of military justice in all branches of the nation's armed forces. However, in cases involving very minor disciplinary infractions, each service has somewhat differing procedures. Such cases are governed by UCMJ Article 15 and are called non-judicial punishment, Captain's Mast (Navy), or Office Hours (Marines).