Scripture also says faith was credited to Abraham as righteousness.
It does. Scripture also says: "But Phinehas stood up and intervened, and the plague was checked. This was credited to him as righteousness for endless generations to come." (Ps. 105:30-31) That's a work, but one not of himself, but of the grace of God.