A prophet is confirmed as a true prophet by repeatedly making accurate predictions of the future (and only accurate predictions) or by the [direct] testimony of another confirmed prophet.
Mishneh Torah 10:5
When a prophet proclaims that another individual is [also] a
prophet, we accept the latter as a prophet without requiring [any
further] investigation. Thus, after Moses, our teacher, proclaimed
that Joshua [was a prophet], all the Jews believed in him before he
performed any wonders. The same holds true for subsequent generations.
Once a prophet has made known his prophecy, and his words have proven
true time after time, or another prophet has proclaimed him a prophet,
if he continues in the path of prophecy, it is forbidden to doubt him
or to question the truth of his prophecy.
[When establishing the authenticity of a prophet,] it is forbidden to
test him more than necessary. We may not continue to test him forever,
as [Deuteronomy 6:15] states: "Do not test God, your Lord, as you
tested him in Marah," when [the Jews] said [Exodus 17:7]: "Is God in
our midst or not?" Rather, once an individual is established as a
prophet, we should believe in him and know that God is in our midst.
We should not doubt or question him, as implied by [Ezekiel 2:5]:
"They shall know that a prophet was in their midst."