The Mars Science Laboratory (MSL) rover Curiosity has documented a section of fluvio-lacustrine strata at Yellowknife Bay (YKB), an embayment on the floor of Gale crater, approximately 500 m east of the Bradbury landing site. X-ray diffraction (XRD) data and evolved gas analysis (EGA) data from the CheMin and SAM instruments show that two powdered mudstone samples (named John Klein and Cumberland) drilled from the Sheepbed member of this succession contain up to ~20 wt% clay minerals. A trioctahedral smectite, likely a ferrian saponite, is the only clay mineral phase detected in these samples. Smectites of the two samples exhibit different 001 spacing under the low partial pressures of H2O inside the CheMin instrument (relative humidity <1%). Smectite interlayers in John Klein collapsed sometime between clay mineral formation and the time of analysis to a basal spacing of 10 Å, but largely remain open in the Cumberland sample with a basal spacing of ~13.2 Å. Partial intercalation of Cumberland smectites by metal-hydroxyl groups, a common process in certain pedogenic and lacustrine settings on Earth, is our favored explanation for these differences. The relatively low abundances of olivine and enriched levels of magnetite in the Sheepbed mudstone, when compared with regional basalt compositions derived from orbital data, suggest that clay minerals formed with magnetite in situ via aqueous alteration of olivine. Mass-balance calculations are permissive of such a reaction. Moreover, the Sheepbed mudstone mineral assemblage is consistent with minimal inputs of detrital clay minerals from the crater walls and rim. Early diagenetic fabrics suggest clay mineral formation prior to lithification. Thermodynamic modeling indicates that the production of authigenic magnetite and saponite at surficial temperatures requires a moderate supply of oxidants, allowing circum-neutral pH. The kinetics of olivine alteration suggest the presence of fluids for thousands to hundreds of thousands of years. Mineralogical evidence of the persistence of benign aqueous conditions at YKB for extended periods indicates a potentially habitable environment where life could establish itself. Mediated oxidation of Fe2+ in olivine to Fe3+ in magnetite, and perhaps in smectites provided a potential energy source for organisms.