Here the compositor for the 1840 edition accidentally set the visually similar words instead of the correct works. Elsewhere in the text, works, never words, is associated with faith (eight times), including two that read good works:
This obvious 1840 error has never been perpetuated in any subsequent edition. But there are at least ten other cases in the text where the visually similar works and words have been mixed up. For a list of these cases, see under Alma 12:12–14.
Summary: Maintain the original reading “according to your faith and good works” in Alma 7:27.