KCL applied to a closed surface
You have four terminals coming out of your closed surface, the current sum across all terminals must be zero.

Assuming positive entering currents for the two top terminals you have \$+i_x\$ and \$-i_x\$, while for the bottom two terminals you have \$-4\$A and \$+4\$A. The sum is \$i_x-i_x+4A-4A=0\$ no matter the value of \$i_x\$.