We all know torture was used to make people give false confessions for which they were then punished or executed. We now know, comfessions given under torture have no value.
I'm curious though if there were people back then when this was being done, who questioned confessions gained like this?
The Spanish Inquisition did question confessions extracted by means of torture, and did so from the very earliest of their times. In the Instructions for Inquisitors, which is the rulebook, you can see in articles 49-53 of the addenda by Diego de Deza in 1498, that they had many reserves about this kind of confessions. I translate:
49. [...] Experience teaches us that the accused, in that agony, would confess anything that is suggested to them, which causes damages to third parties, and occasion for their confessions to be revoked.
50. The Inquisitors shall carefully examine whether the sentence of torment is justified or not, and preceded by legitimate evidence. In case they have issues with this, or doubts, as the damage could be irreparable, for in cases of heresy interlocutory sentences can be appealed, shall then the appeal be granted. [...] When in doubt, appeal shall always be granted. Also, the sentence of torment shall not be executed until the cause is concluded, and having received the accused's defendants.
53. Twenty four hour having passed after the torment, the accused shall ratify his confessions, and in case he revokes them, he shall be repaired as provided by the Law.
These legal guarantees (like having the right to leagl assistance and in case you can't afford one be it provided for you at the Court's expenses), as well as the others present in the Inquisitors Instructions, resulted in the Inquisition having a rather meager conviction rate. As for witch trials, in Spain they were excedingly rare, and the whole concept of withcraft was dismissed in 1612 by a Pragmatic from the Supreme Council of the Inquisition, wherein it is explained that witchcraft is nothing but neighbours acting in bad faith, and cases of mass hysteria.