The left-sided player will join Hibs in the summer when his Saints deal expires.
A statement on the club's official website read: "Hibernian today confirmed that it has agreed terms with Liam Craig for a contract which will commence in summer 2013 following expiry of the player's existing contract with St Johnstone.
"The club followed the SPL Rules which govern the ability of clubs to approach players registered with other clubs in certain circumstances and St Johnstone had previously been made aware of the pre-contract agreement."
The 26-year-old has made more than 200 appearances for Saints, who he joined from Falkirk in July 2008 following an earlier loan spell.
Saints manager Steve Lomas has himself signed a pre-contract deal with a midfielder this month, tying up Ross County captain Richard Brittain last week.