Iirc the MC is a prisoner (a murderous criminal) sent by the king to join the hero party to help them and do the dirty job for them from behind(the hero party have absolutely no idea about it). I can't remember much aside from that its japanese novel.