That's [not the agonizer. That's] the agony booth.
The agonizer is a small device which individuals carry for immediate discipline (Spock uses that on the transporter tech after the beam-up which transposes the landing party from one dimension to the other). It's immediate effects are unpleasant but not fatal.
The agony booth is used on Chekov for his attempt to kill Kirk, and is typically used until death (Kirk orders Chekov's release).