Magic is typically forbidden to Israel for a number of reasons: (1) Magic is human encroachment into the divine realm. (2) Magic is used to manipulate deity. (3) Magic involves relying on a power other than Yahweh. If that is the reason, a sanctioned prophet would be able to bypass all three; his office already enters the divine realm, and the power comes from Yahweh, even though the prophet appears to have some autonomy in using it. The prophets are called to wield divine authority at some level.
1 KINGS 6:1-7 – 6 And the sons of the prophets said unto Elisha, Behold now, the place where we dwell with thee is too strait for us.
2 Let us go, we pray thee, unto Jordan, and take thence every man a beam, and let us make us a place there, where we may dwell. And he answered, Go ye.
3 And one said, Be content, I pray thee, and go with thy servants. And he answered, I will go.
4 So he went with them. And when they came to Jordan, they cut down wood.
5 But as one was felling a beam, the axe head fell into the water: and he cried, and said, Alas, master! for it was borrowed.
6 And the man of God said, Where fell it? And he shewed him the place. And he cut down a stick, and cast it in thither; and the iron did swim.
7 Therefore said he, Take it up to thee. And he put out his hand, and took it.