For-Site, the San Francisco foundation that brought Ai Weiwei’s art to Alcatraz in 2014, has just finalized plans for another politically engaged, site-specific show, “Sanctuary.” This fall, For-Site is blanketing a decommissioned chapel in Fort Mason with prayer rugs designed by 36 contemporary artists, including Mr. Ai, Diana Al-Hadid, Mona Hatoum and Cornelia Parker.

The participating artists, from 22 countries, are predominantly Middle Eastern, said Cheryl Haines, the founder of For-Site. Originally, she explained, she was considering a group show featuring only artists from the countries named in President Trump’s initial travel ban. “But I realized that restricted travel and forced migration are larger concerns that affect so many more people — and interest so many artists.”

To take on the idea of sanctuary — what it means to secure it, lose it or provide it — she asked the artists to create their own versions of the prayer mats that are used daily in Muslim religious observance.

Several of the rugs incorporate images of war. Mr. Ai, who has just completed a film about the international refugee crisis, has contributed a design using interlocking images of machine guns and handcuffs, evoking the industrial forces behind displacement. The Syrian artist Tammam Azzam has created a repeating pattern of a man carrying a child through rubble. The Iranian-Canadian artist Sanaz Mazinani has made a more traditional-looking tapestry with a geometric border, but the medallions are, on closer inspection, images of nuclear mushroom clouds.