Who Can Accuse God?

Is it a sin for God to purpose sin? God hasn’t broken any of His laws, nor can He be judged by His creation. The facts are, that things must occur according to His foreknowledge; and His foreknowledge originated within Himself. He certainly didn’t get His knowledge from His creation. But in order for a Divine Author to be considered wrong, there would have to be a greater law giver than Himself. Since there isn’t. Then it isn’t a sin.