Why a dedicated claim, not a switched sub
A naive impersonation implementation has staff "switch" their session: the JWT's `sub` becomes the customer's id, and the staff identity disappears. This is wrong on two levels. First, audit logs lose the actor — there's no record that staff did anything; it looks like the customer themselves did it. Second, authorization gets simpler in the wrong way: any code that gates "only staff can do X" stops triggering, because the token no longer identifies a staff member.
The right pattern keeps both identities visible: the outer `sub` is the customer (so authorization scoping uses the customer's tenant context, as it should), and a separate `act` claim records the staff actor. Audit log middleware captures both.