{
  "id": 20928528,
  "title": "Running untrusted pull request code from agents and contributors",
  "url": "https://urgent.news/2026/11/20/running-untrusted-pull-request-code-from-agents-and-contributors",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-20T17:53:16.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/sandscale/running-untrusted-pull-request-code-from-agents-and-contributors-la9"
  },
  "original_language": "en",
  "account": "Pull requests allow developers to run someone else's code on their machine during the testing phase. This introduces risks such as code escaping or damaging the system, exfiltrating sensitive information, establishing persistence, or consuming excessive resources. To mitigate these risks, using a sandbox environment can isolate the untrusted code.\n\nSandscale provides a sandboxing service that creates a Firecracker microVM for each PR, ensuring a separate kernel and network environment for each test run. By starting a fresh sandbox for each PR, you can limit the potential damage that malicious code can cause. The sandbox is stopped automatically after a certain time limit to prevent runaway processes, and the use of a template with a short TTL_seconds value further ensures efficient resource management.\n\nTo run the untrusted code, you start by creating a sandbox with a short life using the API and specifying a unique name for the PR. The sandbox is then populated with the PR's files using a POST request, without exposing it to the internet. The tests are run within the sandbox using the POST /exec endpoint, which returns useful information such as exit codes, stdout, and stderr.\n\nAfter the tests complete, the sandbox should be stopped and discarded, leaving no trace of the potentially malicious code. While the sandbox provides a strong boundary against unauthorized access and data exfiltration, it's essential to remember that no protection is foolproof. The exit codes and logs should still be treated as untrusted input, and a thorough review of the PR's output is necessary before considering it safe to merge.",
  "summary": "Originally published on sandscale.dev . A pull request is a request to run someone else's code on your machine. CI has always worked this way: check out the branch, install dependencies, run the tests. The code that runs includes the test files, the build scripts, the install hooks of every new dependency, and anything the PR changed in your CI config. That was already a risk with human…",
  "key_points": [
    "Pull requests run untrusted code, posing risks like code escaping or data exfiltration",
    "Sandscale's sandbox creates a separate kernel and network environment for each PR",
    "After tests, sandbox should be stopped and discarded to prevent lingering malicious code"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}