This writeup contains spoilers for the entire Haruhi Suzumiya series, so don't read it if you don't want to know those things.
Yuki Nagato is a character from the Haruhi Suzumiya light novel series (and later manga and anime adaptations) written by Nagaru Tanigawa and illustrated by Noizi Ito. She first appears in the first volume, 凉宮ハルヒの憂鬱 (The Melancholy of Haruhi Suzumiya) as the lone member of North High's Literature Club. She is quickly "absorbed" into Haruhi's club, the SOS Brigade, after Haruhi takes over the Literature Club's designated clubroom.
Character
At first glance, Yuki appears to be a relatively normal high school student. She wears glasses, has a fondness for books (especially science fiction and mystery novels), and speaks very little. She shows little to no emotion and usually answers questions with simply one word, if at all.
Unbeknownst to Haruhi, this bespectacled bibliophile is actually an alien. Specifically, she is a humanoid interface created three years ago by the Integrated Data Thought Entity and sent to monitor Haruhi. She has many powers, including the ability to reality-hack by altering "environmental data". She does this through incantations which are nothing more than (sometimes malformed) SQL statements in the books. In the anime, they are sped up and reversed, making for a very cool-sounding spell. Nagato also stars as the antagonist in the SOS Brigade's short film, The Adventures of Mikuru Asahina Episode 00. In it, she plays an evil alien witch. She later develops an interest in computers, after the SOS Brigade wins a computer game challenge against the Computer Research Society.
Relationships with other characters
Asakura is also an alien, and is Nagato's backup. She attempts to kill Kyon in the first book, believing that such an action will provoke Haruhi to do something drastic. Asakura wants to be able to study such a large amount of data, no matter the consequences. Yuki is able to protect Kyon at the last minute, and kills Asakura (at least in a physical sense) for disobeying her orders. This is the first time that Nagato's alien abilities are seen. This is also when she loses her glasses, which she had worn up until that point.
As stated above, Nagato risks her life to protect Kyon. She sustains what to a human would be serious injury in doing so, being impaled through the chest multiple times (It's just a flesh wound!). After the battle, she forgets to rematerialize her glasses. At Kyon's request, she stops wearing glasses because he thinks she looks cuter without them (He's not a glasses man, he says).
In the fourth novel, 凉宮ハルヒの消失 (The Disappearance of Haruhi Suzumiya), Nagato alters reality in such a way that aliens, time travellers, and espers no longer exist, and the members of the SOS Brigade are just regular people. She leaves behind an Emergency Escape Program that only Kyon can activate, leaving the decision of whether or not to keep things the way they are to him. Kyon activates the program, because he liked things better the way they were in the original world, including the old Nagato. In the end, Kyon gives the Integrated Data Thought Entity an ultimatum: if Nagato is ever taken away, he'll tell Haruhi that he is John Smith (see Bamboo Leaf Rhapsody). Nagato thanks him, the first time she's ever thanked anyone.
Oh, and she's really cute.