Negative commandment · Lo Ta’aseh #286 of 613
For a sinner not to act as a witness
שלא יעיד בעל עבירה
The verse · Shemot 23:1
לֹא תִשָּׂא שֵׁמַע שָׁוְא אַל־תָּשֶׁת יָדְךָ עִם־רָשָׁע לִהְיֹת עֵד חָמָס
“Thou shalt not raise a false report: put not thy hand with the wicked to be an unrighteous witness.”
The Rambam’s words
For a sinner not to act as a witness, as [Exodus 23:1] states: "Do not conspire with a wicked person to be a corrupt witness."
שלא יעיד בעל עבירה, שנאמר "אַל תָּשֶׁת יָדְךָ עִם רָשָׁע לִהְיוֹת עֵד חָמָס" (שמות כג, א).
Why · Sefer HaChinuch #75
Not to have a sinner testify
“The roots of the commandment are revealed — that anyone who is not concerned about himself and not concerned about his evil deeds will not be concerned about others.”
Who & when
“And this commandment is practiced in every place and at all times by males, but not by females; since they do not judge, that they should need to accept testimony.”
Where in the Mishneh Torah
Hilchot Testimony הלכות עדות