Here's what Wikipedia has to say about her trial:
(b.unknown- executed 28 January 1591) Agnes Sampson was a Scottish healer and purported witch. Also known as the "Wise Wife of Keith", Sampson is most famous for her part in the North Berwick Witch trials in the later part of the sixteenth century.This image is from Alan C. Kors and Peter Edwards: Witchcraft in Europe 1100-1700
In the spring of 1590, James VI returned from Oslo after marrying Anne, daughter of the King of Denmark-Norway. The Danish court at that time was greatly perplexed by witchcraft and the black arts, and this must have impressed on the young King James. The regal voyage back from Denmark was beset by storms. "In the summer of 1590 a great witch hunt was instituted in Copenhagen. One of the first victims was Anna Koldings, who under pressure divulged the names of five other women, one of whom was Mail the wife of the burgomaster of Copenhagen. They all confessed that they had been guilty of sorcery in raising storms which menaced Queen Anne's voyage and that they had sent devils to climb up the keel of her ship. In September two women were burnt as witches at Kronborg"  James heard news from Denmark regarding this and decided to set up his own tribunal.
By the autumn of 1590, Scotland was aflame with witch hunts and many of those sent to trial were questioned by the King himself.
Agnes Sampson was arrested along "sundrie" [sic] others, questioned regarding her role in the storm raising, and that of others. She was put to the torture which she resisted at first but:
"This aforeaside Agnis Sampson which was the elder Witch, was taken and brought to Haliruid house before the Kings Maiestie and sundry other of the nobility of Scotland, where she was straitly examined, but all the perswasions which the Kings maiestie vsed to her with ye rest of his counsell, might not prouoke or induce her to confesse any thing, but stood stiffely in the deniall of all that was laide to her charge: whervpon they caused her to be conueied awaye to prison, there to receiue such torture as hath been lately prouided for witches in that country: and forasmuch as by due examination of witchcraft and witches in Scotland, it hath latelye beene found that the Deuill dooth generallye marke them with a priuie marke, by reason the Witches haue confessed themselues, that the Diuell dooth lick them with his tung in some priuy part of their bodie, before hee dooth receiue them to be his seruants, which marke commonly is giuen them vnder the haire in some part of their bodye, wherby it may not easily be found out or seene, although they be searched: and generally so long as the marke is not seene to those which search them, so long the parties that hath the marke will neuer confesse any thing. Therfore by special commaundement this Agnis Sampson had all her haire shauen of, in each parte of her bodie, and her head thrawen with a rope according to the custome of that Countrye, beeing a paine most greeuous, which she continued almost an hower, during which time she would not confesse any thing vntill the Diuels marke was found vpon her priuities, then she immediatlye confessed whatsoeuer was demaunded of her, and iustifying those persons aforesaid to be notorious witches."
"Item, the saide Agnis Sampson confessed before the Kings Maiestie sundrye thinges which were so miraculous and strange, as that his Maiestie saide they were all extreame lyars, wherat she answered, she would not wishe his Maiestie to suppose her woords to be false, but rather to beleeue them, in that she would discouer such matter vnto him as his maiestie should not any way doubt off. And therupon taking his Maiestie a little aside, she declared vnto him the verye woordes which passed betweene the Kings Maiestie and his Queene at Vpslo in Norway the first night of their mariage, with their answere eache to other: whereat the Kinges Maiestie wondered greatlye, and swore by the liuing God, that he beleeued that all the Diuels in hell could not haue discouered the same: acknowledging her woords to be most true, and therefore gaue the more credit to the rest which is before declared."(Newes from Scotland)
Edinburgh Burgh Treasurer's accounts itemise the cost of Agnes Sampson's execution, giving the date as the 16 day of January 1590 [OS] 'quha wes burnt' as £6 8s 10d.