1 Kings 2:8
And, behold, thou hast with thee Shimei the son of Gera, a Benjamite of Bahurim, which cursed me with a grievous curse in the day when I went to Mahanaim: but he came down to meet me at Jordan, and I sware to him by the LORD, saying, I will not put thee to death with the sword.
David gave this charge to Solomon as he was carefully settling the affairs of the kingdom before his death. He reminded Solomon that Shimei son of Gera had cursed him with a grievous curse on the day he went to Mahanaim, and that when Shimei came down to meet him at the Jordan he had sworn to him by the Lord not to put him to death with the sword. He warned that Shimei was still a violent and dangerous man who, if given opportunity, could stir up rebellion and endanger Solomon's rule and life.
The warning belongs to David's broader counsel that Solomon should deal wisely with men who had proved unfaithful and unworthy of confidence. That counsel teaches those in leadership not to treat disloyalty and deception as virtues, but to stand firmly against unfaithfulness and to clearly reject disaffection, scheming, and deception. It teaches them to entrust responsibility only to people who can be trusted completely, choosing counselors for both temporal affairs and sacred matters only from such men.