---
title: "AI coding agents on Amazon EC2 Mac: How Cognition scales Devin for macOS"
description: "Cognition runs Devin's macOS workspaces as Apple Virtualization framework guest VMs on bare-metal EC2 Mac Dedicated Hosts across six AWS Regions, starting a fresh VM per session in under a minute with two guests per host as the macOS license allows."
url: "https://swe.quest/articles/ai-coding-agents-on-amazon-ec2-mac-how-cognition-scales-devin-for-macos-5985b4e71d5a1fc9"
canonical: "https://aws.amazon.com/blogs/architecture/ai-coding-agents-on-amazon-ec2-mac-how-cognition-scales-devin-for-macos/"
source: "AWS Architecture Blog"
published: "2026-11-20"
difficulty: "medium"
kind: "Case study"
reading_minutes: 12
tags: ["virtualization","ai-agents","cloud","mobile","networking"]
---

# AI coding agents on Amazon EC2 Mac: How Cognition scales Devin for macOS

A post on [AWS Architecture Blog](https://swe.quest/sources/aws-architecture.md), published 2026-11-20, 12 min read, Case study. Original: [https://aws.amazon.com/blogs/architecture/ai-coding-agents-on-amazon-ec2-mac-how-cognition-scales-devin-for-macos/](https://aws.amazon.com/blogs/architecture/ai-coding-agents-on-amazon-ec2-mac-how-cognition-scales-devin-for-macos/)

## Summary

Cognition runs Devin's macOS workspaces as Apple Virtualization framework guest VMs on bare-metal EC2 Mac Dedicated Hosts across six AWS Regions, starting a fresh VM per session in under a minute with two guests per host as the macOS license allows. Session state persists through a host-side snapshot process exposed to the guest over NBD, since the framework lacks vhost-user. About 90% of idle sessions release their VM and resume from S3 snapshots in seconds. A user-space Ethernet gateway on file-handle attachments avoids pf conflicts with Apple's NAT and enforces per-session network policy. Images are pre-provisioned with permissions to skip TCC dialogs, the live view bounds frame queues and restarts from keyframes to avoid stale video, and Devin drives apps through the accessibility tree rather than screenshot-only computer use.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Virtualization](https://swe.quest/tags/virtualization.md) (Infrastructure)
- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [Cloud platforms](https://swe.quest/tags/cloud.md) (Infrastructure)
- [Mobile](https://swe.quest/tags/mobile.md) (Web & mobile)
- [Networking](https://swe.quest/tags/networking.md) (Infrastructure)

## Prerequisites

- virtual machines
- AWS EC2 basics ([easy posts on Cloud platforms](https://swe.quest/tags/cloud.md?difficulty=easy))
- macOS development tooling ([easy posts on Developer tools](https://swe.quest/tags/developer-tools.md?difficulty=easy))

## Keywords

Amazon EC2 Mac, Devin, Apple Virtualization framework, Network Block Device, ScreenCaptureKit, accessibility-cli, iOS Simulator, Cognition

## Related posts

- [We gave AI agents a mobile dev environment](https://swe.quest/articles/we-gave-ai-agents-a-mobile-dev-environment-e8b96ac4decaf1a3.md): Shopify Engineering · 2026-10-22 · Medium · 9 min read · AI agents, Mobile, Developer productivity, Virtualization, AI for coding
  Shopify built Remote Dev so its Slack-based coding agent River can build and test iOS and Android apps in parallel on a fleet of remote Macs instead of developers' laptops.
- [Running Self-Hosted AI Agents](https://swe.quest/articles/running-self-hosted-ai-agents-c94787d8fbe36ddc.md): Oxide · 2026-10-29 · Medium · 10 min read · AI agents, Virtualization, Sandboxing & isolation, Cloud platforms
  Self-hosted AI agents on the Oxide Cloud Computer run best as a long-lived orchestrator VM that spawns an ephemeral VM per agent session.
- [ScreenEnv: Deploy your full stack Desktop Agent](https://swe.quest/articles/screenenv-deploy-your-full-stack-desktop-agent-d5b2c1a177c34ea2.md): Hugging Face · 2025-07-10 · Medium · 7 min read · AI agents, Containers, Python, Sandboxing & isolation
  ScreenEnv is a Python library that runs isolated Ubuntu desktop environments in Docker containers so GUI (computer-use) agents can see the screen, click, type, launch apps, manage files and record sessions.
- [Browser Use in Managed Deep Agents](https://swe.quest/articles/browser-use-in-managed-deep-agents-21e226e57e61da12.md): LangChain · 2026-11-06 · Medium · 7 min read · AI agents, Testing, Browsers
  Managed Deep Agents in LangSmith now runs a remote browser in its own sandbox and gives agents Stagehand-based tools: browser\_snapshot (accessibility tree with element IDs), browser\_run (batched actions or Playwright-style JavaScript in one call to keep page content out of context), browser\_screenshot, and browser\_handoff for letting a human sign in without exposing credentials.
- [Building with Modal and the OpenAI Agents SDK](https://swe.quest/articles/building-with-modal-and-the-openai-agents-sdk-c24777075f600dcf.md): Modal · 2026-04-15 · Medium · 12 min read · AI agents, Sandboxing & isolation, LLMs, Python, Cloud platforms
  A custom agent harness built on the OpenAI Agents SDK runs coding agents inside Modal Sandboxes, optionally with GPUs, rather than on the host, where an unsandboxed exec tool can be abused by malicious prompts.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
