The Vajraśekhara Sūtra is an important Buddhist tantra used in the Vajrayāna schools of Buddhism, but can refer to a number of different works. In particular a cycle of 18 texts studied by Amoghavajra, which included both Tattvasaṃgraha Tantra, and the Guhyasamaja Tantra, a Tibetan text which appears to be composed of two works grouped together and to further confuse matters in the Japanese Shingon school the Sarvatathāgatatattvasaṃgraha Tantra is known by this name. In Tibetan it is considered to be the main representative of the Yogatantra class of texts.
The tantra begins with Vairocana Buddha preaching the Dharma to a great host of Bodhisattvas, including Vajrasattva, in the Pure Land of Akanishta. As he preaches the Dharma, Prince Sarvarthasiddhi, the esoteric name of the Buddha, Siddhartha Gautama, is meditating under the Bodhi Tree. Enlightenment is imminent, but the Prince has still not attained it because he is still attached in some small way to his forsaken ascetic practices. Despairing over his inability to find Enlightenment, he is visited by Buddhist figures who were just now learning the Dharma from Vairocana.
These same deities proceed to teach him a more direct path to Enlightenment through tantric ritual. The tantra then details the rituals used to actualize the Dharma. These rituals help forming the basis of tantric ritual in Shingon Buddhism, including such practices as meditating upon the full moon and the use of certain mantras.
This tantra also introduces the Diamond Realm Mandala as a focus for meditative practices, and its use in the abhiseka ritual of initiation. As the prince has now experienced Enlightenment, he ascends to Mount Sumeru and constructs the Diamond Realm Mandala and initiates and converts the bodhisattvas gathered there, one by one, into tantric deities who constitute the Mandala.
In tantric ritual, the teacher assumes the role of the Prince who constructs the Mandala, while the master and student repeat specific mantras in a form of dialogue. The student, who is blindfolded, then throws a flower upon the Mandala that is constructed, and where it lands (i.e. which deity) helps dictate where the student should focus his devotion on the tantric path. From there, the student's blindfold is removed and a vajra is placed in hand.