From Andrew Roberts’ Napoleon: A Life, on the 1803 outbreak of war between Britain and France, after Britain demanded Malta and Napoleon then wanted to know whether this demand was an ultimatum threatening war:
In fact Whitworth [the British ambassador to France] merely asked for his passports, the traditional ambassadorial request prior to a declaration of war.
This passage from the same book, about a later war, suggests that asking for passports isn’t merely a symbolic gesture, but associated with leaving the country:
Metternich [Austrian ambassador to France] remained in Paris until the last possible moment before requesting his passports, perhaps in order to continue gathering secret intelligence.
Indicating that a request for passports doesn't necessarily mean war, although supporting the idea that they are usually connected, Tolstoy writes in War and Peace:
Balashev [a Russian envoy to the invading French] recovered himself and began to speak. He said that the Emperor Alexander did not consider Kurakin's demand for his passports a sufficient cause for war; that Kurakin [the Russian ambassador to France] had acted on his own initiative and without his sovereign's assent, that the Emperor Alexander did not desire war, and had no relations with England.
This also comes up in British ambassador Edward Goschen’s account of the outbreak of WWI:
I said that in that case [Germany refusing to withdraw its troops from Belgium] I should have to demand my passports. After expressing his deep regret that the very friendly official and personal relations between us were about to cease, [Arthur Zimmermann, German Under Secretary of State] asked me casually whether a demand for passports was equivalent to a declaration of war. I said that such an authority on international law as he was known to be must know as well or better than I what was usual in such cases.
Are these “passports” the equivalent of what we today understand to be passports? If so, why are the diplomats asking a foreign government for their passports? As far as I can tell, passports have always been issued by the bearer’s own government, and not by the country they are visiting. This I think would be even more true for diplomats, who are even less subject to the jurisdiction of the country they are visiting than ordinary tourists.
Could these so-called “passports” be what we today call an “exit visa”, sometimes issued to visiting aliens? As far I can tell, exit visas are a 20th century concept. And if these “passports” are exit visas, that just raises further questions: How would a country replace its ambassador with another one without accidentally declaring war? Did John Adams risk war with France when he left for Holland? etc.
And why is “passports” used in the plural in all these passages?