"Since before your sun burned hot in space, I have awaited a question."
— The Guardian
The device known as the Guardian of Forever is an artifact of an ancient alien race (most likely the Guardians), which functions as a time portal, located on the planetGateway. The Guardian is apparently sentient; it can speak and responds to the questions and actions of individuals who come in contact with it. It generates immense ripples in time that manifest themselves as spatial disturbances in the surrounding region (perhaps shielding its planet and star system from changes in the timeline). (TOS: "The City on the Edge of Forever")
Apparently an inert formation of a quasi-metallic substance, the Guardian is neither machine nor being, describing itself as "my own beginning, and my own ending." It has the ability to create portals to other times, which can be watched or traveled through.
"Personal log, stardate 61125.8: I am the storm-tossed man, but unlike the great Odysseus, I've got thousands of Trojans at my back, marooned in this strange place. How long will we wander before we find our way home? Will Corey be there? Will he recognize me? I have to try. I owe it to the crew. I never thought I would pray to a Prophet, and yet I find myself calling to Prophets so far away. May the wind be at our backs, vigor in our hearts, and luck on our side. And so the journey begins."