The Agreement on the Free Movement of Persons (AFMP, in force since 2002) governs the residence and employment of EU/EFTA citizens in Switzerland. For employment lasting more than 90 days, an L permit (≤ 12 months) or a B permit (> 12 months) is required; for stays of less than 90 days, the online registration procedure (easyrelease.admin.ch) is sufficient.
Sex work is covered by the AFMP as self-employment. Nationals of third countries are not covered by the AFMP and are rarely granted a permit for sex work.