CodeTrain / Docs / Security and data handling
Security and data handling
This page is the engineering detail behind the privacy policy. It is written for whoever has to approve CodeTrain for a team, so it says what the software actually does rather than what it aspires to.
Where your code goes depends on how you run it
| Mode | What leaves your machine |
|---|---|
| CodeTrain Open Skill | The lesson page runs on 127.0.0.1 and CodeTrain Open Skill sends nothing to CodeTrain or InferHaven: no account, no telemetry. Your agent sends what it reads, your code included, to its own model provider, as it does for any task; from your profile it gets only a short summary, and the rest stays on your disk unless you ask for it. Python runs in your browser through Pyodide, downloaded from the jsDelivr CDN the first time Python runs. |
| CodeTrain CLI | Your source stays local. The CodeTrain CLI serves its UI on 127.0.0.1 and reads your checkout in place; we never copy or store your repository. The prompt snippets needed for one tutoring turn go to the model provider; on the managed plan they pass through CodeTrain's model proxy, which records the model name, token counts and cost of each call, not the text. What CodeTrain stores from the CLI is counts: on a Team plan, one row per step as the step closes, with the step's number, its kind (for example code or multiple choice), its hints, retries, whether it was skipped, the time spent on it in seconds (counted up to 30 minutes), and the checks passed and run; the delivery counts of one repository a team owner or admin uploads with codetrain metrics; and, from codetrain defend, how many questions were answered and skipped. |
| Managed browser tutor | The code you submit for review, and any files you attach as context, reach our servers and the model provider, and are stored in your lesson so you can resume it. On the free tier the repository is a public one you name, fetched from GitHub by us. |
| Bring your own key | With your own model key, model calls go from your machine straight to the provider on your account. The CodeTrain CLI reports the model name and the token counts of each call so the plan's usage can be shown. Prompts and replies are not sent to CodeTrain. |
Two of those are separate pieces of software and only one is open source, which is worth stating plainly because the distinction is easy to blur. CodeTrain Open Skill is published under Apache 2.0 and you can read every line of the tutor's instructions in it. The CodeTrain CLI is a free install that runs locally, but it is our own software and is not open source. Neither one uploads your repository to us. What each sends to a model provider, and how much of your code goes with it, is in the table above.
Secrets are refused before they are read
Any file matching the denylist is skipped when a repository is read for a lesson, in both the managed path and the CodeTrain CLI. The two lists are deliberately kept identical, because a repo
session once leaked a password out of a committed .env:
.env, .env.*, *.pem, *.key,
*.p12, *.pfx, *.pkcs12, id_rsa*,
id_dsa*, id_ecdsa*, id_ed25519*, *.keystore,
*.jks, .netrc, _netrc, .npmrc,
.pypirc, .pgpass, .git-credentials, *.kdbx,
credentials, credentials.json, service-account*.json,
*.secret, .secrets, secrets.json, secrets.yml,
secrets.yaml, client_secret*, .htpasswd,
*.ovpn, wg*.conf, *.ppk, *.tfstate,
*.tfstate.*.
Template files that exist to be committed are allowed through, since they carry no live values:
.env.example, .env.sample, .env.template,
.env.dist, .env.defaults.
Our error monitoring cannot see your prompts
Every Sentry client we build sets
include_local_variables=False. This is not the SDK default, and
send_default_pii=False does not cover it.
By default Sentry attaches each stack frame's local variables to an exception. The frames around a failed provider call hold the learner's prompt and, on a bring-your-own-key plan, a decrypted API key. Turning that off is the only control that stops those values leaving this application at all.
We also set max_request_body_size="never".
That is the second door onto the same room, and send_default_pii=False does not
close it either: the option defaults to attaching up to 10KB of the request body, which on a
tutor turn is the code you wrote and the question you typed. Our tests prove it end to end
against the real SDK, and one of them deliberately runs with the default so a passing result
can never mean the test stopped looking.
Sentry's own server-side scrubbing is not a substitute and testing it carelessly suggests
otherwise. That scrubber matches on field name: a local called api_key or
credentials comes back [Filtered], so a test using those names looks
reassuring. The real frame's locals are named messages, system,
org_creds and key_override, none of which match. Verified against a live
project on 2026-08-12, where all four arrived in plaintext, including the decrypted key twice.
Name-based redaction also happens after transmission, so it is not a control over what leaves
here.
A test generates its secrets at runtime, so they cannot appear in source context, and fails the build if this is ever flipped back. What we attach deliberately is operational metadata only: plan tier, provider, surface, and an opaque session id. Never a prompt, a model reply, or learner code.
Running your code
On the study screen, Python and JavaScript run in your own browser, so running them sends nothing to us. Submitting is different: in every language, code you submit for review in the browser tutor reaches our servers and the model provider. Every other language runs on our sandbox host, on free accounts as well as paid ones: Bash, Ruby, Perl, PHP, Node and OpenWrt. We would rather list them than say something shorter that is easier to misread.
Each run gets its own container, which is destroyed the moment it finishes. It runs as an unprivileged user with every Linux capability dropped and no way to regain one, on a read-only root filesystem with a small writable scratch directory, capped at 256 MB of memory, one CPU and 128 processes. It has no route to the internet. Almost every lane is given no network interface at all; the OpenWrt lane has one, on an isolated Docker network with no gateway, because a lesson about reading a router's interfaces cannot be taught on a machine that has none. We measured that lane from the inside rather than assuming it: no default route, DNS fails, and a TCP connection to a public address times out.
A lab gives each learner their own virtual machine: a real Debian 12 system with its own kernel, started from a prepared snapshot on our sandbox host. Inside it you are the user admin, with sudo, so you are root in that machine and nowhere else. The virtual machine runs in QEMU inside a container. QEMU runs there as an unprivileged user, with every Linux capability dropped and no way to regain one, capped at 1.5 GB of memory, 2 CPUs and 128 processes. The container has no network interface at all, and the virtual machine's own network is restricted to the machine itself. We measured that from inside a lab machine rather than assuming it: DNS lookups fail, and a TCP connection to a public address fails with "Network is unreachable".
Each machine writes to its own copy-on-write disk on top of a read-only snapshot. When recycled (after 30 minutes without use or 2 hours total), the machine is saved and kept for at most 24 hours. It is deleted sooner, at once, when the lab step is finished, the lesson ends, or the account is deleted. A machine whose disk grew past 2 GB is destroyed and never saved, and a saved machine is only ever returned to the learner it belongs to. No machine is ever reused for anybody else. Your browser reaches the terminal through our API with a one-time ticket, valid for 60 seconds and working only for your own lab. The terminal's raw stream is never stored or logged; the lab keeps a capped log of the commands that were run, and the privacy page says what.
A network lab is not a virtual machine. Each router is its own container on a private Docker network created for that lab alone, with no route out and none to any other learner's lab. Containers start with every Linux capability dropped. An FRR container gets back the networking ones plus others its daemons need to start; an OpenWrt container gets NET_ADMIN plus capabilities from Docker's own default set, which its init needs. On an FRR router the learner's shell runs as the user nobody in the group frrvty, which reaches FRR's command line and holds no Linux capability. On OpenWrt the shell is root inside its container, as it is on a real OpenWrt box, because uci, ip and nft need it. They run with no-new-privileges, a 128-process limit, memory and CPU caps, and they are destroyed with the lab. We measured from inside a lab that it has no internet: a connection to a public address fails and public names do not resolve. Our sandbox host also refuses connections from lab networks to the host itself.
No training on your data
We do not use your code, prompts, or lessons to train AI models, and we only use model providers under arrangements that do not train on your prompts. We do not sell personal data.
Access, keys and transport
Traffic is encrypted in transit. Access tokens are scoped, listed in your dashboard, and revocable individually. Bring-your-own-key credentials are stored encrypted and are decrypted only for the duration of a model call.
Sub-processors and retention
The full list of sub-processors, and how long each category of data is kept, is in the privacy policy.
Reporting something
If you have found a vulnerability, email [email protected] and we will confirm receipt. Please give us a reasonable window to fix it before disclosing.
What we do not claim
CodeTrain is a small product and it is in beta. We are not SOC 2 certified today and we do not imply otherwise. Self-hosting and a deployment where code never leaves your environment are available for Enterprise, which is the honest answer for teams that cannot send code anywhere. Ask us anything this page does not cover.