CI/CD pipelines can use AI agents to review pull requests, generate tests, and validate code changes automatically. E2B sandboxes provide the secure, isolated execution environment where these agents can safely clone repositories, run untrusted code, and report results — all triggered by GitHub Actions on every pull request. Each run uses its own isolated sandbox, so malicious or buggy PR code never touches your CI runner.Documentation Index
Fetch the complete documentation index at: https://e2b.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
GitHub Actions workflow
The workflow triggers on pull request events and runs a review script.E2B_API_KEY and the LLM API key are stored as GitHub Actions secrets, while the built-in GITHUB_TOKEN is available automatically. The permissions block grants write access so the script can post PR comments.
Review script
The workflow calls this script on every PR. It runs five steps inside an E2B sandbox, keeping all untrusted code isolated from the CI runner.- Create sandbox —
Sandbox.create()creates an isolated Linux environment for the review - Clone the PR —
sandbox.git.clone()checks out the PR branch usingx-access-token+GITHUB_TOKENfor authentication - AI review — runs
git diffinside the sandbox, sends the output to an LLM — swap the model for any provider via Connect LLMs - Run tests —
commands.run()streams output in real time and throws on failure (CommandExitError/CommandExitException) - Post results — comments the review on the PR via the GitHub REST API, then shuts down the sandbox
Related guides
Git integration
Clone repos, manage branches, and push changes from sandboxes
Connect LLMs
Integrate AI models with sandboxes using tool calling
Custom templates
Build reproducible sandbox environments for your pipelines