"'Rules of Engagement" is an episode of Deep Space Nine, the seventeenth episode of the fourth season.
Worf is put on trial after the Defiant destroys a Klingon civilian transport. One by one, Worf's friends are forced to testify, either bolstering Worf's defense or damaging it. For example, O'Brien confesses he would have not done what Worf did.
The Klingon Advocate even provokes Worf into attacking him, which bolsters his case since the Advocate was unarmed at the time.
In the end, evidence is discovered that hints the entire affair was set up to frame Worf. Sisko still has criticisms of what Worf had done but he tells the Klingon he will make a fine captain some day.
In one of the few times Star Trek has ever broken the fourth wall, several characters are seen speaking directly into the camera. They are actually testifying at Worf's trial, with the 'fourth wall' being used as a metaphor.
The Klingon Advocate makes a point of determining Worf's motive in firing upon the ship. This directly contradicts the The Next Generation episode The Mind's Eye, which establishes that Klingons are interested only in people's actions, not their reasons for taking those actions. "Motives? Who cares for motives? Humans, perhaps," the Klingon Kell says in the cited episode.
In one of the court scenes Benjamin Sisko is......