Agamyāśca na gaccheta, meaning, “never transgress social customs and engage in coitus with agamyā, or inaccessible women”, is a directive expressed in Mahābhārata (Mahabharata), along with a catalogue of certain relationships that lay outside the bounds of copulation. These women were, therefore, agamyā, or ‘inaccessible’. This list included a king’s wife, wife’s friend, wife of a learned man, wife of an ignorant man, wife of an elderly man, a friend’s wife, wife of a brāhmaṇa (brahmana), wife of someone seeking shelter, a woman seeking shelter, and wife of a brother-in-law or a relative. It is notable that just as Caṇḍāla and other such women were inaccessible owing to the social order of varṇa (varna; caste), the above-mentioned women were also deemed i because of their superior stature, and the dignity accorded to the familial relationship shared with them. This list also encompassed the prohibition on adulterous relationships.
Bṛhaspati (Brihapati) informed Indra that sexual relations with mother, sister, a teacher’s wife and the wife of a paternal uncle were highly blasphemous. The sin of sexual union with a teacher’s wife or the wife of an uncle might be atoned for by performing the rigorous austerities of penance or kṛccha (krichchha), for a period of twelve and six years respectively. There are various resolutions of repentance for other sinful forms of sexual relations. Apart from this, the transgressions committed may be atoned for by worshiping the Śakti (Shakti), the goddess embodying primordial energy, by chanting her names one thousand and eight times through paṅcadaśākṣarī mantra (panchadashakshari mantra; a mantra comprising fifteen letters or syllables).
A man who engaging in coition with an inaccessible woman is condemned to the hell called Śavala (Shavala), one who copulates with the wife of a teacher is sent to the hell known as Tāla (Tala), someone who has an incestuous relationship with his sister is damned to the hell named Taptakumbha, and one who engages in fornication with his daughter is condemned to the hell called Mahājvāla (Mahajwala).
In Mahābhārata, apart from relations with women sanctioned by the scriptures, or those that fell within the ambit of conventional social relationships, any other affiliation with women was considered adultery and incest. These unions were also referred to as varṇaśaṅkara (varnasamkara), or crossbreeding. That is, to a kṣatriya (kshatriya) man, even a brāhmaṇa woman was inaccessible in a certain sense; and the marriage of a gṛhastha (grihastha), or a householder, to an ascetic woman would also be an instance of violation of attainability, signifying a hybridisation of two aśramas (ashramas) [here, stages of life]. A woman belonging to the same kin is also inaccessible. Finally, a union with the wife of another man was considered the fourth form of hybridisation or varṇaśaṃkara, because such a woman would always be treated as agamyā—
agamyā parabhāryeti caturtho varṇasaṃkarah.