Skip to content

Security and your data

What BotBarn stores, where, who can see it, how long it is kept, and how bots and accounts are kept apart. Each statement here describes what the code does today; things that are not in place yet are marked planned.

Where your data lives

  • BotBarn runs in the European Union. The main server is a virtual server in a data centre in France: it holds the database, your account and the platform. Your bot runs either on that server or on a second server in Italy that BotBarn's operator owns and runs. The bot's code, its build, the running bot and its /data folder are on the server that runs it. The two servers talk through an encrypted WireGuard tunnel, and the second server can reach only what a node needs on the main one.
  • On the server in Italy, everything that belongs to a bot (code, image, variables, token, logs, /data) and the password of its backups are on encrypted volumes (LUKS). They open at start-up only while the main server accepts that server, so a stolen disk, or a server cut off by BotBarn, gives no access to them. Its system disk and its swap hold no bot data: swap is off.
  • The database is backed up every day. A copy of each backup stays on the server and, once an off-site repository is configured, an encrypted copy is stored with another storage provider (see Backups).
  • Services BotBarn uses: Telegram processes payments in Stars and confirms Telegram sign-ins; Mailgun, on its EU region, sends BotBarn's emails; Telegram receives the calls BotBarn makes with your bot's token (checking it, setting the webhook); Pydantic Logfire receives technical logs and traces of the web app (request paths, timings, IP addresses, database queries without their values, error messages with secret values masked) to find errors. Calls to Telegram are never traced, and request contents are not recorded, so your token and your variables do not reach it.
  • The privacy policy lists every provider and what it receives.

What BotBarn stores

Data Why
Email, username, password hash Your account. The password is stored only as a bcrypt hash. Email and password are optional with Telegram sign-in.
Telegram account: id, username, name, photo address, whether the BotBarn bot may message you Telegram sign-in, the BotBarn app in Telegram and notices. Deleted with your account.
Bots: name, code (archive or Git address), variables, Telegram token To build and run your bots.
Deployments: status, build log, the last lines of the bot's output To show you what happened.
Resource usage per bot and hour (CPU, memory, network, disk) Usage page, limit warnings and plan advice.
Subscriptions and payment records (for Stars: the amount and Telegram's payment id) Billing. How you bought your Stars stays with Telegram.
AI connector: tokens, connected apps, actions the assistant took The AI connector page.
Emails sent to you (kind and date, not the text) So a reminder is not sent twice.

BotBarn does not read or store the messages your bot exchanges with Telegram users. What your bot prints to its output ends up in its log: do not print personal data you do not need.

Encryption

  • In transit: the web app, the API and the webhooks of your bots are served over HTTPS, and browsers are told to use HTTPS only (HSTS). The database is not reachable from the internet.
  • At rest: every variable value (secret or not), the Telegram token, Git credentials and the bot's platform key are encrypted in the database (Fernet: AES with an authentication code). Access tokens of the AI connector are stored only as a hash: nobody can read them back, not even BotBarn.
  • In logs: the values of secret variables and the Telegram token (6 characters or longer) are replaced by *** in the logs BotBarn shows.
  • Backups: every backup is encrypted with restic (AES-256 with an authentication code) before it is stored, on the server and at the other provider. The password that opens the backups is readable only by the server's administrator, who also keeps a copy off the server. The encryption key of the database is not in the backups: a copy of a backup alone cannot decrypt your variables or tokens.

The encryption key of the database is on the same server as the database: encryption at rest protects your secrets in a copy of the database (a lost disk, a backup), not against the people who run the server.

Isolation between bots

Each bot runs in its own container (see Limits and isolation):

  • No privileges: containers run rootless (no root on the host), with every Linux capability dropped and no way to gain new privileges.
  • Network: a bot reaches the public internet only. Other bots, BotBarn's own services and private networks are blocked by the firewall rules of the server itself, which apply to everything a bot or its build runs. Incoming traffic reaches a bot only through its webhook URL.
  • Limits: CPU, memory, open files and number of processes are capped per bot, so one bot cannot starve the others.
  • Network speed: each bot's traffic is limited to the bandwidth of its plan, in each direction, by queues the server sets up in the bot's own network namespace before the bot starts; the bot cannot change or remove them, even as root in its container. The webhook path shares the same limit, so the total never exceeds the rate. A server without this mechanism does not start the runner, and a bot whose limit cannot be applied is not run. Data that others send to a bot can still reach the server up to the size of its socket buffers before the limit drops it; the bot receives, and is charged for, only what the limit lets through. A bot's own loopback traffic to its webhook port (8080), and packets it sends straight to the limit's devices, pass the limit and count toward its own monthly transfer like any other traffic; they cannot affect another bot.
  • Variables and files: a bot receives only its own variables. Nothing is shared between bots. The filesystem of a container is read-only except the bot's own /data folder and two small in-memory folders (/tmp, /var/tmp).
  • Builds: the build of your image runs in storage of its own, so another bot's build cannot read your image, with the same network rules and with memory and CPU limits.
  • Storage: each bot has a persistent /data folder with a hard size limit from its plan. It is mounted into that bot only, cannot run programs, and the limit is enforced by the server's filesystem, not by the bot. A bot that fills its folder only stops its own writes. The bot's data lives on the disk of the server that runs the bot, separate from the disk that holds the database, so a full disk does not stop the platform. The data is deleted with the bot and 7 days after the plan ends.

Isolation between accounts

You see and change only your own bots, variables, code, deployments, logs, usage, subscriptions, payments, tokens and connected apps. For anyone else's, BotBarn answers "not found", the same answer as for something that does not exist.

This is checked by an automated test run on every change of the API:

  • the test lists every route of the API and fails if a new route that takes an id of a bot, deployment, variable, subscription, invoice, payment, token or connection is not covered;
  • for each of those routes, a second user asks for the first user's resource and must get "not found", with nothing of the first user in the answer, and the first user's data must be unchanged;
  • every tool of the AI connector is checked the same way with the second user's token;
  • every request without valid credentials is refused.

Who can see what

  • You: everything above about your account, in the web app.
  • AI assistants you connect: only what the permissions you granted allow. The AI connector never receives secret values or the Telegram token, and refuses to set them: you enter secrets in the web app. You can disconnect an app or revoke a token at any time.
  • BotBarn operators: the people who run BotBarn can see accounts, bots, deployments and logs, for support or to stop abuse. Every change an operator makes to your account, bots or plans, and every time an operator opens a bot's logs, is recorded in an audit log.
  • Nobody else. BotBarn does not sell or share your data.

How long data is kept

Data Kept
Build and runtime logs of a deployment 30 days after its last change, except the latest deployment of each bot, which keeps its logs
Usage per hour 13 months, then summed into one row per day
AI connector activity, operator audit log 12 months
Log of emails sent 6 months (reminders of a plan still running are kept until it ends)
Expired AI sign-in codes and tokens deleted when they expire
Revoked or expired access tokens, disconnected apps 30 days
Payment notifications from PayPal (they include the payer's name and email) 12 months
Sign-ups never confirmed by email 30 days
Telegram sign-in checks and unpaid Stars orders deleted once used or expired
Payment records 10 years

Everything else is kept while your account exists, and deleted with the bot or the account it belongs to.

Export and deletion

On the Account page:

  • Download my data gives you a JSON file with your profile, bots (variable names, not their values), subscriptions and payment records.
  • Delete account deletes your bots (their code, variables, deployments, logs and usage), your subscriptions, your Telegram link, your access tokens and connected apps, your AI activity and the log of emails sent, and signs you out everywhere. Payment records are kept for 10 years, attached to an anonymised account with no name, email or password. PayPal payer details on older payments are removed.

Deleting a single bot deletes its code, variables, deployments, logs, usage and its /data folder at once.

Backups

  • The database and the bots' /data folders are backed up every day. Each database backup is checked before it is stored, and the stored copies are checked again every week.
  • Backups are kept on the server and, once an off-site repository is configured, also at another storage provider, encrypted with restic in both places. Only the administrator of the server can read the copy on the server.
  • The last 14 daily and 4 weekly snapshots are kept; older ones are deleted.
  • Bot data is backed up with the database's schedule and retention, encrypted in both places like the database, one snapshot per bot, and the bot is paused for a moment while its folder is read.
  • Deleted data therefore disappears from backups within 35 days, bot data included.

Report a problem

Found a security issue? Write to info@botbarn.dev. Please do not test against other users' bots or accounts.