Open Borders Agreement
Once you or another civ have discovered Civil Service (Writing in vanilla), you can enter into an Open Borders agreement with that civ. (City-States can't make Open Borders agreements.) While an Open Borders agreement is in effect, the other civ's units can enter your territory without automatically triggering war. If the agreement is mutual, either civ's units can enter the other's territory freely, but it doesn't have to be mutual: one civ can grant another Open Borders without automatically receiving it in return.