onlinecompiler.io

How OnlineCompiler.io runs user-submitted code safely

Every request runs code from someone we don't know. This page describes how a run is contained, how keys and accounts are protected, what we store, and what we don't claim, so you can judge whether it fits your product.

Também em portuguêsTambién en español

Each run gets its own sandbox

A run starts a new container, executes the program and removes the container. Nothing is reused between runs, so one program cannot leave files or processes behind for the next.

  • gVisor: containers run under gVisor (runsc), which handles the program's system calls in a user-space kernel instead of passing them to the host's kernel. There is no fallback: if gVisor is unavailable, the run fails rather than starting in a less isolated runtime.
  • No network: networking is disabled, so programs cannot reach the internet, our servers or yours. A test-suite run gets its own 127.0.0.1, so a test can call a server it started, and still reaches nothing outside its sandbox.
  • No privileges: programs run as an unprivileged user (uid 65534) with every Linux capability dropped and privilege escalation turned off.
  • Read-only filesystem: the language image is read-only. The only writable space is a 256 MB workspace and 128 MB for temporary files, both held in memory and mounted without setuid or device files. The code and stdin are mounted read-only from a private directory created for that job.
  • Fixed limits: 512 MB of memory by default (up to 2 GB on Pro and above), with no swap, 2 CPUs, 16 processes, 256 open files and no core dumps. After 30 seconds the program is stopped, and the container is killed if it doesn't exit.
  • Bounded output: up to 64 KB per stream is kept, and a program that prints more than 8 MB is stopped, so a flood can't exhaust our workers.

The full list of limits, and the exit codes a run returns when it hits one, is in the API docs.

Is Docker enough? Docker, gVisor and microVMs compared

Not on its own. The three common ways to isolate a program differ in who handles its system calls, and so in how much of the host's kernel a hostile program can reach:

Docker (runc)gVisor (runsc), what we useMicroVM (Firecracker)
Who handles system callsThe host kernel, filtered by seccompgVisor's own user-space kernel; only a narrow set reaches the hostA guest kernel inside a virtual machine
What an escape needsA host kernel bug reachable through the allowed callsA bug in gVisor, then one in the narrower host interfaceA bug in the virtual machine monitor or KVM
CostNone beyond the programPrograms that make many system calls run slowerEach sandbox boots a kernel; the host needs KVM

A microVM draws the hardest line. gVisor keeps container start-up while taking most of the host kernel out of reach, and every run here also has no network, no privileges and a read-only image on top. gVisor's security model explains the design.

Keys and accounts

  • Two kinds of key. API keys call the REST API and the MCP server and belong on your server. Widget keys are meant for public pages: they only work over the widget's WebSocket, cannot call the REST API, and can be restricted to your domain, which we check on every connection. An iframe embed with a restricted key can only be framed by pages on that domain.
  • Account limits contain a leaked key. Every account has a per-minute rate (60 runs by default), a cap on pending runs (32), a cap on runs in a sandbox at once (4, so one account can't take every sandbox) and a monthly allowance, shared by all its keys. Disable a key in the dashboard to cut it off.
  • Callbacks only go to public addresses. The async endpoint posts results to the HTTP or HTTPS URL on your API key. Private, loopback and link-local addresses are refused, redirects are not followed, and the address is checked again at delivery so a DNS change can't point it inside our network.
  • Encrypted in transit. The API and WebSocket are served over HTTPS and WSS; plain HTTP requests are redirected.
  • Team members with roles. An account can add up to 25 members, invited by email, beside its Owner (the account's own user). Admins manage API keys, widgets, exams and the team; Members work on problems, submissions, sessions and webhook deliveries, pick an API key for a draft test by its name and never see a key's value; only the Owner opens billing, and nobody can remove or demote the Owner. Each person signs in as themselves and keeps their own account. The team account they work in is checked against their membership on every request, so removing someone takes effect on their next page.
  • Invitations work once. An invitation link works for 7 days, once, and only for someone signed in with the invited address. We store only a hash of the link, so it can't be read back.
  • A team event log. Every invitation, resend, cancellation, join, role change, removal and departure is recorded with who did it and when, on the dashboard's Team page.

What we store

Each run is stored as execution history: the code, input, output, errors, exit code, timing, the key that sent it and the client's IP address. You can see your account's history in the dashboard. How long it is kept, and how to have it deleted, is in the Privacy Policy. Programs themselves can't store anything: their workspace disappears with the container.

If a request causes an error on our servers, we keep an error report on our own error tracker in the European Union for 30 days: the error, where in our code it happened, and the request's address and headers with keys removed. The code, input and tests the request sent, and the values our program was handling, are removed before it is stored (an error message itself can, rarely, quote a short fragment of one), and we delete it sooner on request.

Where data lives and how long

  • Where: code runs, and execution history and account data are stored, on servers in the European Union.
  • Email: sign-in links and account email are sent through Amazon Web Services SES in India (ap-south-1). The full list of processors is on the sub-processors page.
  • How long: account data is kept while the account is active and deleted with it. Execution history keeps each run's code, input, output and IP address for 365 days, or as long as the judged submission it belongs to, and is deleted with the account sooner, as the Privacy Policy sets out. Judged submissions and their receipts follow your plan's retention, described below. Database backups are kept on the same servers in the European Union for 30 days, then deleted. Returned files, share links and Jobe support files have their own periods there.
  • A data processing agreement is part of our Terms on every plan, including Free, and applies without a signature.

Judging results and receipts

A submission judged through the run-tests API is kept, with its results and its signed receipt, for your plan's retention: 90 days on Free, 1 year on Starter and 2 years on Pro. DELETE /api/submissions/{id}/ removes one sooner, and deleting your account removes them all. The code and the external_ref you send are personal data if they identify a person, so use opaque references. Hidden tests are never returned and are not in a receipt: it holds their verdicts and one salted hash of the whole test list, which cannot be checked against a guess at the tests without the salt only your account can read. A receipt proves what ran and what came out; it does not prove who wrote the code, or that they wrote it without help. How receipts work.

How we patch

We update the base images, the language runtimes and gVisor ourselves, by hand. Because the code runs on our service, customers never patch a Jobe server or any runtime of ours.

What we don't claim

  • We don't hold SOC 2 or ISO 27001 certification, and we haven't published a third-party audit.
  • No sandbox is perfect. gVisor shrinks the part of the kernel a program can reach, and the limits above contain what it can do, but neither is a guarantee.
  • OnlineCompiler.io is hosted only. If your policy requires code to run on your own servers, this isn't the right fit.

Reporting a vulnerability

If you find a way out of the sandbox, around a limit, or into another account's data, please email security@onlinecompiler.io or contact us with the steps to reproduce it before disclosing it publicly. Test against your own account only, and don't degrade the service for other users. The same contact is in our security.txt.

Frequently asked questions

Is it safe to run untrusted code with OnlineCompiler.io?

That is what it is built for. Every run gets a new container under gVisor, with no network, an unprivileged user, a read-only filesystem and firm limits (512 MB of memory by default, up to 2 GB on Pro and above, 2 CPUs, 16 processes, 30 seconds). The code runs on our servers, never on yours.

Is Docker enough to run untrusted code?

Not on its own. A plain Docker container shares the host kernel, so a kernel bug reachable through the system calls it allows can lead out of the container. gVisor puts a user-space kernel in between, and a microVM such as Firecracker gives the program a kernel of its own. We run every program under gVisor.

Can code in the sandbox reach the internet or my servers?

No. Containers start with networking disabled, so programs cannot open connections, download packages or call back to your systems. Results reach you only through our API.

Can one user's code see another user's?

Each run gets its own container with its own memory-backed workspace, and its code and input are mounted read-only from a private directory for that job. The container is removed when the run ends, so nothing carries over to the next run.

Is the widget key a secret?

No. Widget keys sit in public HTML by design. They only work over the WebSocket the widget uses, cannot call the REST API, and can be locked to your domain. Keep REST API keys on your server.

Do you keep the code that runs?

Yes. Each run is stored with its input, output and timing as execution history, which you can see in your dashboard. The Privacy Policy covers how long it is kept; ask us to delete your account and its data at any time.