Demon Seed by Dean Koontz (1973) — see its film and TV adaptations.
A woman is imprisoned and tortured by her state-of-the-art computer security system--and its perverse desire...