The Wikipedia article Slavery in Ancient Rome makes this claim about slaves and their ability to testify:
The testimony of a slave could not be accepted in a court of law unless the slave was tortured—a practice based on the belief that slaves in a position to be privy to their masters' affairs would be too virtuously loyal to reveal damaging evidence unless coerced
I'm highly skeptical of this claim, and was wondering if there's truth to this claim at all, or where the authors of the Wikipedia article may have gotten this idea from.
There's no source or cite for this particular claim, and the article doesn't mention any specific time period in Roman history. The reasoning for the law also seems rather suspicious to me as well.
Tacitus said so. There's an (in)famous story about a claim made about a nobleman and that 400 slaves were tortured before the case was confirmed. Tacitus discusses the brutality behind it in I think book 14 of Tactius' Annals. I will check and find the exact passage and edit this post.
Edit:
Sorry about the wait, I had to look through my old copy to find the passages. I've got the Penguin Classics version (ISBN 978-0-14-044060-7) In there it's pages 333-334. That makes it Book 14 XIV.42 onwards.
"Soon afterwards the City Prefect, Lucius Secundus, was murdered by one of his slaves Either Pedanius had refused to free the murderer after agreeing to a price, or the slave, infatuated with some man or other, found competition from his master intolerable. After the murder, ancient custom required that every slave residing under the same roof must be executed. But a crowd gathered eager to save so many innocent lives; and rioting began."
^^^^^^^^. A little after that Gaius Cassius Longinus makes a speech and says:
"it needs it today! A man who has held the consulship has been deliberately murdered by a slave in his own home. None of his fellow slaves prevented or betrayed the murderer, through the senatorial decree of threatening the whole hole household with execution still stands"
^^^^^^^^.
The speech is quite long but towards the end he said,
"The only way to keep down this scum is by intimidation."
^^^^^^^^.
So as much as torture isn't explicitly mentioned (if death threats don't count) it's pretty brutal. The fact that 400 people could have died because one slave owner was murdered it some serious threat! I mean, they killed them all anyway but Nero was nice enough to let the other ex-slaves stay in Italy... ¯_(ツ)_/¯ It's Nero!
^^^^^^^^.
Edit 2: I'm an idiot and forgot about Octavia's maids
"Dominating Nero as his wife, as she had long dominated him as a mistress, Poppaea incided on of Octavia's household to accuse Octavia of adultery with a slave- an Alexandrian flute-player called Eucaerus was designated for the role. Octavia's maids were tortured and though some were induced by the pain to make false confessions, the majority unflinchingly maintained her innocence."
The torture of Roman slaves in order to reveal the "truth" of their testimony in criminal matters was standard, widespread, and expected in the central period (200 B.C. - A.D. 200). It didn't end or get better in 200 A.D., that's just around the time period where most of the texts I'm familiar with end.
I wouldn't say that the reasoning was grounded in the belief that slaves would be "virtuously loyal." That may have been the belief of some, and there are cases of Roman writers relaying stories of slaves loyally bearing torture to avoid incriminating their masters, the belief that slaves were notorious liars was widespread in Roman society and tied up with the policy as well.
Romans were not unaware of how this practice could be abused. There were instances in which slaves were tortured so brutally and for such lengths of time that observers commented that the goal must have been to induce false testimony. Lawyers, such as Cicero in his defense of Faustus Cornelius Sulla, might argue that testimony extracted under torture was suspect. However, the right of masters or the state to torture slaves went unchallenged. Slaves couldn't be freed in order to avoid torture.
Some undertakers offered private slave torturing services, with options including flogging, burning, racking, and crucifying. In the city of Puteoli, regulations proscribed that each torturer be paid 4 sestertii (the cost of a couple liters of wine) for their services. Some masters kept torturers on as part of their household staff. Typically, slaves tortured for testimony would be tortured publicly or semi-publicly.
Augustus argued that torture shouldn't be used in minor cases, though later emperors would approve of torture for issues as minor as corroborating a master's claim that he owned the slave if he didn't have the necessary documentation with him. Slaves were not to be tortured into providing evidence against their masters, though this was sometimes sidestepped through an emperor forcing the sale of the slaves to the state before they were tortured. Sometimes protections existed for young children or pregnant women (who would be tortured after giving birth), but these were not consistent and young children were tortured in some cases.
Most of this information can be found in the following source:
Bradley, Keith. Slavery and Society at Rome. Cambridge: Cambridge University Press, 1994. pp 165-70.
edited to correct a misreading of a source, see below