The Xperia Z3 and Z3 Compact receive root and custom recovery support
To do so, you'll need a model of either with an unlocked bootloader (stock firmware or ROMs based on it), and you'll have to flash a custom kernel. Once done, you'll have access to a ClockWorkMod custom recovery (v6.0.4.7). From that point on, if you'd like to root your Z3 or Z3 Compact, you'll have to download SuperSU and save it onto an SD card and flash it through CWM. The developer recommends you download BusyBox right after rooting, and install it in /system/xbin.
For the full installation instructions, refer to the source link below.
source: xda-developers [Z3], [Z3 Compact]
Things that are NOT allowed: