This article investigates an output rate-coded secure control based on backstepping for the consensus of heterogeneous multiagent systems (MASs) with output-triggering condition. Due to the nondifferentiable virtual control inputs caused by discontinuous triggering signals, it presents a technical obstacle in implementing the recursive backstepping, rendering previous results inapplicable. To address this problem, an auxiliary high-order filter is elaborately constructed to guarantee the required-order derivatives of virtual control inputs. As this filter is driven by local triggering consensus error, it allows our MASs to have different system orders and relative degrees. Besides, to reduce communication bit and strengthen communication security, we propose a novel distributed rate-coded algorithm from an encoding-decoding viewpoint. When it is triggered, agent's output is encrypted into an L -length codeword, then transmitted to neighbors without exposing any sensitive system states or real control inputs. It is shown that all the closed-loop system signals are ultimately bounded, and the mean square consensus tracking error can be reduced by appropriately selecting control parameters. Simulations illustrate our theoretical finding.