Mercenary
International and national laws of war: Protocol Additional GC 1977 (APGC77) is a 1977 amendment protocol to the Geneva Conventions. Article 47 of the protocol provides the most widely accepted international definition of a mercenary, though it is not endorsed by some countries, including the United States. The Protocol Additional to the Geneva Conventions of 12 August 1949, and relating to the Protection of Victims of International Armed Conflicts (Protocol I), 8 June 1977 states:

Art 47. Mercenaries
All the criteria, as listed in 2(a) through 2(f), must be met, according to the Geneva Convention, for a combatant to be considered a mercenary. While mercenaries do not enjoy the same protection as prisoners of war do, they must still be treated humanely according to the rules of the Protocol and they may not be punished without a trial.
On 4 December 1989, the United Nations passed resolution 44/34, the International Convention against the Recruitment, Use, Financing and Training of Mercenaries. It entered into force on 20 October 2001 and is usually known as the UN Mercenary Convention. Article 1 of the UN Mercenary Convention contains the definition of a mercenary. Article 1.1 is similar to Article 47 of Protocol I. Article 1.2 broadens the definition to include a non-national recruited to overthrow a "Government or otherwise undermin[e] the constitutional order of a State; or Undermin[e] the territorial integrity of a State"; and "Is motivated to take part therein essentially by the desire for significant private gain and is prompted by the promise or payment of material compensation". Under Article 1.2, a person does not have to take a direct part in the hostilities in a planned coup d'état to be a mercenary.

Austria: If a person is proven to have worked as a mercenary for any other country while retaining Austrian citizenship, their Austrian citizenship will be revoked.

France: In 2003, France criminalized mercenary activities, as defined by the protocol to the Geneva convention for French citizens, permanent residents, and legal entities (Penal Code, L436-1, L436-2, L436-3, L436-4, L436-5). This law does not prevent French citizens from serving as volunteers in foreign forces. The law applies to military activities with a specifically mercenary motive or with a mercenary level of remuneration. However, due to jurisdictional loopholes several French companies provide mercenary services.
The French state owns 50% of Défense conseil international, which it founded, a private military company (PMC) which does not supply any fighters but is used to export military training services. It realised a profit of €222 million in 2019.

Germany: It is an offence "to recruit" German citizens "for military duty in a military or military-like facility in support of a foreign power" (§109h StGB).
Furthermore, a German citizen who enlists in the armed forces of a state they are also a citizen of risks the loss of their citizenship
(§28 StAG).

South Africa: In 1998, South Africa passed the Foreign Military Assistance Act that banned citizens and residents from any involvement in foreign wars, except for humanitarian operations, unless a government committee approved deployment. In 2005, the legislation was reviewed by the government because:

South African citizens were working as security guards in Iraq during the American occupation of Iraq;
consequences of the mercenary soldier sponsorship case against Mark Thatcher for the "possible funding and logistical assistance in relation to an alleged attempted coup in Equatorial Guinea" organized by Simon Mann.
As of 2010, South Africa forbids citizens from fighting in foreign wars unless they are under the direct control of their own national armed forces.

United Kingdom: In the United Kingdom, the Foreign Enlistment Act 1819 and the Foreign Enlistment Act 1870 make it unlawful for British subjects to join the armed forces of any state warring with another state at peace with Britain. During the Greek War of Independence, British volunteers fought with the Greek rebels, which could have been unlawful per the Foreign Enlistment Act. It was unclear whether or not the Greek rebels constituted a 'state', but the law was later clarified to indicate that they were.
The British government considered using the Act against British subjects fighting for the International Brigades in the Spanish Civil War and the FNLA in the Angolan Civil War, but on both occasions chose not to do so.

United States: Civilians with the US Armed Forces lose their law of war protection from direct attack if, and for such time as, they directly participate in hostilities.
The Anti-Pinkerton Act of 1893 (5 U.S.C. § 3108) forbids the US government from using Pinkerton National Detective Agency employees or similar private police companies.
In 1977, the United States Court of Appeals for the Fifth Circuit interpreted the Anti-Pinkerton Act as forbidding the U.S. government from employing companies offering "mercenary, quasi-military forces" for hire (United States ex rel. Weinberger v. Equifax, 557 F.2d 456, 462 (5th Cir. 1977), cert. denied, 434 U.S. 1035 (1978)). There is disagreement over whether this proscription is limited to strikebreakers only, because Weinberger v. Equifax states the following:

The purpose of the Act and the legislative history reveal that an organization was "similar" to the Pinkerton Detective Agency only if it offered for hire mercenary, quasi-military forces as strikebreakers and armed guards. It had the secondary effect of deterring any other organization from providing such services lest it be branded a "similar organization." The legislative history supports this view and no other.
In the 7 June 1978 Letter to the heads of Federal Departments and Agencies, the Comptroller General interpreted this decision in a way that carved out an exemption for "Guard and Protective Services".
A United States Department of Defense (DoD) interim rule revised DoD Instruction 3020.41 to authorize contractors, other than private security contractors, to use deadly force against enemy armed forces only in self-defense (71 Fed. Reg. 34826), effective 16 June 2006. Per that interim rule, private security contractors were authorized to use deadly force when protecting their client's assets and persons, consistent with their contract's mission statement. One interpretation is that this authorized contractors to engage in combat on behalf of the US government. It is the combatant commander's responsibility to ensure that private security contract mission statements do not authorize performance of inherently governmental military functions, i.e. preemptive attacks, assaults, or raids, etc.
On 18 August 2006, the US Comptroller General rejected bid protest arguments that the United States Army contracts violated the Anti-Pinkerton Act by requiring that contractors provide armed convoy escort vehicles and labor, weapons, and equipment for internal security operations at Victory Base Complex in Iraq. The Comptroller General reasoned the act was unviolated because the contracts did not require contractors to provide quasi-military forces as strikebreakers.
In 2007, the US Army was temporarily barred from awarding a $475 million security contract in Iraq, the largest one at that time, because of a lawsuit filed by a US citizen alleging violation of the Anti-Pinkerton Act of 1893. Three of the candidates under final consideration for the contract (to include intelligence services and security for reconstruction work by the United States Army Corps of Engineers) included British firms Aegis Defence Services and Erinys Iraq, as well as Blackwater of North Carolina. The case was later dismissed.

Foreign national servicemen: The better-known combat units in which foreign nationals serve in another country's armed forces are the Gurkha regiments of the British Army and Indian Army, the French Foreign Legion, the Spanish Legion and the Ukraine Foreign Legion.
Recruits from countries of the Commonwealth of Nations in the British Army swear allegiance to the British monarch and are liable to operate in any unit. Gurkhas, however, operate in dedicated Gurkha units of the British Army (specifically units that are administered by the Brigade of Gurkhas) and the Indian Army. Although they are nationals of Nepal, a country that is not part of the Commonwealth, they still swear allegiance (either to the Crown or the Constitution of India) and abide by the rules and regulations under which all British or Indian soldiers serve. French Foreign Legionnaires serve in the French Foreign Legion, which deploys and fights as an organized unit of the French Army. This means that as members of the armed forces of Britain, India, and France these soldiers are not classed as mercenary soldiers per APGC77 Art 47.e and 47.f. Volunteers for the Ukraine Foreign legion have three-year contracts, and are eligible for Ukrainian citizenship (the probation period being the duration of the war).

Private military companies: The private military company (PMC) is a private company providing armed combat or security services for financial gain. PMCs refer to their personnel as security contractors or private military contractors. PMC contractors are civilians (in governmental, international, and civil organizations) authorized to accompany an army to the field; thus, the term civilian contractor.