The Guardian of Forever is a powerful entity that described itself as both and neither machine or being. Its function was as a time portal, which Captain James T. Kirk discovered when a drugged and hysterical Dr.