It seems at one point to not have been unheard of for a prisoner of war to sign a parole agreement with their captor, independent of their own country's command structure.
In the American Civil War, for example, some prisoners would be released to return to their homes with an agreement that they would not fight in the conflict until and unless they were later formally exchanged in an agreement between the Union and the Confederacy.
Contrarily, the current Code of Conduct for Member of the United States Armed Forces, for example, includes a vow from a soldier that...
I will accept neither parole nor special favors from the enemy.
However, notwithstanding such a code of conduct or policy, supposing that a prisoner of war were to accept a parole agreement from their captors, what would be the legal force of such an agreement?
For example, suppose that a prisoner accepted their immediate release and safe passage to their home, on condition that they do not again fight against their captor in the current conflict (for its duration, or with any other limiter). Suppose that no torture, or (abnormal) duress were used, and the only enticement to the agreement was the promise of immediate release and return home.
Once the agreement was made, and the soldier returned home, what would the force of the agreement be, in practice, from the perspective of international law?
If the released prisoner wished to adhere to it, but their country did not? (Intending to force the soldier to return to the war)
If the released prisoner themselves did not wish to adhere to it? (Intending to somehow "get out" of their promise by some stratagem)
If the released prisoner did break the agreement, and survived the conflict, but their erstwhile captor discovered this fact and wished to prosecute it in some capacity? (Either with the prisoner being re-captured during the conflict, or as a free person)
Regardless of whether it possesses any "teeth" or actual force, is there any framework or precedent that would consider these agreements binding? That could, for example, rule that a country "could not" legally compel a soldier to break one? Or which would allow one country to issue an indictment, warrant, &c for a soldier of another country that had broken one? &c.