"Chains" and "Forge," both by Laurie Halse Anderson, tell the stories of Isabel and Curzon. Both teens are slaves in New York at the time of the Revolution, and both want nothing more than their freedom.
"Chains" is Isabel's story. The story of a young girl who was promised freedom, but sold to new owners instead. Isabel, determined to become free by whatever means necessary, meets fellow slave Curzon and decides to spy for whichever side will grant her freedom.
"Forge" shifts perspective to Curzon (sort of sequel, sort of a companion novel), and finds the newly escaped young man caught up with Washington's army for the winter at Valley Forge. Curzon cannot leave or let his true identity be known, for fear that he will be punished and sent back.
If you want to learn more about real slaves that spied for the British, you should make sure to check out "Liberty or Death: The Surprising Story of Runaway Slaves who Sided with the British During the American Revolution" by Margaret Whitman Blair. This is a truly fascinating look at American history and an inspiring story of a little known group of freedom fighters.