In stratego what can a spy do?

If it attacks a Marshal it kills the marshal, but if it attacks any other piece or gets attacked it dies.