A Spy in the House by Y.S. Lee
What I wrote before:
More spies. Mary Quinn is rescued from the gallows and educated at a special school. When she grows up, she is given a special assignment which brings her into the home of a rich merchant. She finds unexpected romance and secrets about her past while on her mission.