Skip to content

Security

Roi Horowitz edited this page Dec 2, 2026 · 3 revisions

Security

Never run the bot inside Foundry's Data folder

Foundry serves every file inside a module folder over HTTP. If the bot runs from Data/modules/squire/bot, its .env (your Discord bot token and FOUNDRY_TOKEN) and data/store.json can be downloaded by anyone who can reach your Foundry.

The bot refuses to start inside a Foundry module folder. Copy it elsewhere (Installation). ALLOW_INSIDE_FOUNDRY=1 overrides the check; don't use it on a Foundry server anyone else can reach.

Tokens

  • DISCORD_TOKEN controls your bot. Never share or commit it. If it leaks, click Reset Token in the Discord developer portal.
  • FOUNDRY_TOKEN is the shared secret between the module and the bot. Use a long random string. In Foundry it's stored only in the GM's browser, not in the world, so players can't read it.
  • .env and data/ are git-ignored. Keep them that way.

Who can do what

  • Only users in GM_DISCORD_IDS can set DCs, reveal, request, target, roll as PCs or creatures, apply results, or give Hero Points.
  • Players can roll only as their own linked character, and only in linked channels. ALLOWED_CHANNEL_IDS narrows that further.
  • The bot's HTTP API requires FOUNDRY_TOKEN for everything except /api/health, and only accepts browser requests from FOUNDRY_ORIGIN.

Live Assistant: what leaves your machines

Only if you turn it on (see Live Assistant):

  • Transcript text and Foundry context (scene, journals, combat, tokens) go to Anthropic, whichever Claude provider you pick.
  • Audio goes to the transcriber. Local Whisper keeps it on your machine; a cloud endpoint receives it.
  • No audio is stored. The transcript stays in the bot's memory and is cleared when listening stops. Logs hold counts and timings only.
  • Players are told in Discord and can run /assistant optout, which deletes their lines at once.
  • Local Whisper has no password. Never expose it to the internet; keep it on 127.0.0.1 or a private network.
  • Claude runs with no tools, and answers reach only the GM's window. Keep ANTHROPIC_API_KEY secret like the other tokens.

Discord permissions

The bot needs only View Channel, Send Messages, Send Messages in Threads and Read Message History (permissions integer 274877975552). Avoid giving it Administrator.

Clone this wiki locally