Then when he says, but they shall proceed no farther, he shows how they are restrained: first, he shows that they must be hindered; second, how to hinder them, at for their folly.
In regard to the first it should be noted that the desire to hurt is present in a man of himself; but the power to hurt comes from God's permission. And God does not permit the wicked to inflict as much harm as they would like, but he sets a limit: hitherto you shall come, and shall go no further; and here you shall break your swelling waves (Job 38:11). So, too, the devil harassed Job only as much as God permitted.... So, too, Arius harmed the Church only so far as the Lord permitted: hurt not the earth, not the sea, nor the trees, till we sign the servants of our God in their foreheads (Rev 7:3). And he says, they shall proceed no farther than God permitted.
The way they are to be hindered is by taking from them their mantle and authority with which they inflict harm: who can discover the face of his garment (Job 41:4). Therefore, he says, their folly shall be made manifest to all men, God unmasking them, when he lights up things hidden in the dark and manifests the counsels of hearts, as it is stated in 1 Corinthians, namely, the hearts of Pharaoh's magicians, whose hearts were manifested, because they were unable to work their signs (1 Cor 4:5).
Source: Commentary on 2 Timothy