To run automated builds and integration tests securely with Devin, engineering teams implement a multi-layered security model centered on three pillars: declarative Blueprints that establish reproducible, snapshot-isolated machine environments; tiered secret management (organization, repository, and session levels) that injects credentials strictly at runtime without baking them into machine images or code; and strict execution sandboxing (utilizing Devin Cloud ephemeral instances, CLI OS-level sandboxing via bubblewrap, or Devin Outposts inside private VPCs).
Unlike code completion plugins, Devin operates as an autonomous agent. It installs system packages, manages project dependencies, executes shell scripts, spins up background services, and opens web browsers to interact with applications end-to-end. Granting an autonomous agent terminal and network access requires strict operational guardrails. A poorly isolated test environment risks data exfiltration, accidental pollution of persistent infrastructure, or exposure of sensitive production credentials.
1. Devin's Environment Architecture: Sandboxes and Compute Isolation
Devin supports three primary compute deployment modes depending on your organization's compliance requirements, infrastructure boundaries, and network topology:
Devin Cloud Sandboxes
By default, Devin runs inside ephemeral cloud virtual machines managed by Cognition. Each session runs in an isolated container or VM.
- Snapshot Isolation: Environments are defined through declarative Blueprints. When a blueprint builds, it creates a snapshot. Subsequent sessions or differential builds boot from this clean snapshot baseline.
- Ephemeral State: Modifications made during automated test runs are isolated to that session's ephemeral environment, preventing test pollution from spilling into future agent runs.
Devin CLI OS-Level Sandboxing
When running Devin via the command-line interface (CLI) or within custom CI runners, teams can activate OS-level isolation using the --sandbox flag:
- Filesystem Containment: The sandbox restricts write operations strictly to the active workspace directory and explicitly granted
Write(...)permission scopes. All system libraries, user configurations, and external directories remain read-only. - Deny Rules: Any path specified under a
Read(...)deny rule is completely hidden from sandboxed commands. - Fail-Closed Guarantee: If the underlying sandboxing dependencies are unavailable (such as missing
bubblewrap(bwrap) orsocaton Linux), Devin will hard-fail and refuse to start rather than running in an insecure, unsandboxed state. Note that OS-level sandboxing currently targets Linux environments; running--sandboxon unsupported platforms triggers a fail-closed stop. - Network Filtering: Teams can configure domain-level allowlists (
allowed_domains) and denylists (denied_domains) in the user configuration to restrict outbound HTTP/HTTPS traffic to internal test harnesses or trusted package registries.
Devin Outposts (Self-Hosted Infrastructure)
For organizations with stringent data sovereignty rules, private VPCs, or integration tests requiring access to internal databases and microservices, Devin Outposts separates the control plane from the data plane:
- Architecture: The agent's cognitive reasoning loop runs in Devin Cloud, but all tool invocations, shell commands, file edits, and test executions run exclusively on your own machines (VMs, bare metal, or Kubernetes clusters).
- Outbound-Only Connection: Workers run the Devin CLI command
devin worker start --outpost=<outpost_name>and connect to Devin Cloud over an outbound HTTPS connection. No inbound firewall ports, public IP addresses, or inbound VPN tunnels are required. - Local Data Boundary: Source code, private package repositories, internal database connections, and test logs never leave your private network boundary.
2. Secrets Management Hierarchy and Injection Mechanics
A core vulnerability in CI/CD automation is credential leakage—either committed to version control, embedded in Docker images, or dumped into build logs. Devin eliminates these risks through a centralized, encrypted secrets management hierarchy.
Secret Scopes
Devin separates credentials into distinct trust boundaries:
- Enterprise & Organization Secrets: Configured under
Settings > Resources > Secrets(or organization blueprint settings). Encrypted at rest and available across all organization sessions. At the Enterprise level, administrators can mark secrets as Build only, meaning they are available exclusively during base snapshot preparation and are automatically scrubbed before repositories are cloned and test sessions run. - Repository Secrets: Configured within each repository's blueprint editor (
Settings > Environment > Blueprints > [Repository] > Secrets). These credentials are accessible only to sessions and builds operating directly on that repository. Other team members have read-only visibility into secret names without viewing decrypted values. - Personal & Session Secrets: Developer-scoped secrets for individual debugging or ephemeral session secrets provided during an interactive prompt. Session secrets expire when the conversation finishes unless explicitly saved.
Injection Without "Baking"
- Runtime Injection as Environment Variables: Secrets configured in the UI are dynamically mapped to environment variables (e.g.,
$TEST_DB_PASSWORD,$STRIPE_TEST_KEY) when commands run. You do not declare secrets in blueprint YAML or.envfiles. - Snapshot Scrubbing: When Devin builds an environment snapshot, all injected secrets are scrubbed before saving the machine image. Secrets are never baked into container layers or snapshot disks.
- File Attachments for Build Configs: For build tools that require configuration files (such as Maven
settings.xmlor private.npmrc), teams upload attachments through the blueprint editor. These are mapped to~/.files/with auto-generated environment variables (such as$FILE_SETTINGS_XML), allowing setup scripts to copy them into place during maintenance without hardcoding credentials into git. - Site Cookies & TOTP for Browser Tests: Devin's secrets manager supports base64-encoded Chromium cookies and TOTP (Time-based One-Time Password) seeds. This allows Devin's browser automation to log in to staging portals and multi-factor-authenticated web apps during end-to-end integration tests without exposing master administrative passwords.
3. Step-by-Step Configuration Guide
Here is how engineering teams set up an isolated, credential-safe environment for automated builds and tests:
Step 1: Structure the Declarative Blueprint
Define your repository environment in the Blueprint editor with clear separation between base tool installation and runtime dependencies:
# 1. initialize: Runs during full builds to install system packages and runtimes
initialize: |
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt-get update && apt-get install -y nodejs postgresql-client
# 2. maintenance: Fast, self-contained project dependency installation
maintenance:
- name: "Install Project Dependencies"
run: npm ci
# 3. knowledge: Instructions guiding Devin on how to build and test
knowledge: |
To run unit tests: npm test
To run end-to-end integration tests against the local database: npm run test:e2e
Step 2: Configure Dedicated Staging Secrets
- Navigate to Settings > Environment > Blueprints and select your repository.
- Open the Secrets tab and click Create secret.
- Add only least-privilege test credentials:
E2E_DATABASE_URL: Connection string pointing to an isolated test database container or staging RDS instance.TEST_API_KEY: A scoped sandbox API token with mock data privileges.DEVIN_AUTH_COOKIE: Base64-encoded session cookie for end-to-end browser verification.
- Add clear notes in the secret's Note field (e.g., "Scoped strictly to Staging QA environment; auto-rotates monthly").
Step 3: Enforce Execution Guardrails
- If using Devin Cloud: Set up repository permissions in Enterprise Settings to ensure the agent only clones approved branches and repositories.
- If using Devin Outposts: Deploy workers inside an isolated subnet with strict network security groups (NSGs) that disallow outbound traffic to production databases or sensitive corporate networks.
- If using Devin CLI: Run test suites with
--sandboxand pass temporary credentials via--secret TEST_KEY=VALUEor rely on pre-configured team settings.
Step 4: Execute Integration Tests and Review Artifacts
When Devin completes a feature branch or bugfix, prompt it to run integration tests:
"Run the automated build, execute
npm run test:e2e, and verify the login workflow."
Devin enters testing mode:
- Checks the blueprint environment and sets up dependencies.
- Automatically reads injected test secrets as environment variables.
- Launches services, executes the test suite, and opens the built-in browser for UI verification.
- Records an annotated video of the test run and attaches the recording to the PR or conversation, demonstrating that tests passed without exposing raw credentials in log streams.
4. Key Security Practices and Traps to Avoid
| Security Area | Recommended Practice | Dangerous Trap |
|---|---|---|
| Credential Storage | Use Devin UI Secrets (Settings > Resources > Secrets or Blueprint Secrets tab). | Hardcoding API keys into Blueprint YAML, setup scripts, or committed .env files. |
| Credential Scope | Provision dedicated test service accounts (devin-test@company.com) with staging-only permissions. | Reusing production API keys or developer personal access tokens (PATs). |
| Image Persistence | Use environment variables and runtime $ENVRC bindings for secrets during test execution. | Writing secrets into config files during initialize, which bakes them into persistent snapshots. |
| Network Boundaries | Use Devin Outposts or CLI domain filtering to restrict network access to internal test servers and package registries. | Running builds without egress network filtering in environments containing accessible internal IPs. |
| Filesystem Safety | Rely on --sandbox with explicit Write(...) workspaces and fail-closed isolation checks. | Running CI automation with root privileges or allowing unrestricted write access across host volumes. |