Mac hosting guide

Separate Browser Profiles for Hosted Mac Agents

Give every account its own Chrome --user-data-dir, validate account IDs strictly, and run a Playwright cookie collision check before real credentials. Light browser jobs fit a Figment Intel Mac VM ($25 a month).

Figment editorial teamPublished Updated Facts checked November 10, 2026

Figment Mac plans

US East. Pay before use. Hourly and daily too.

Intel Mac VM4 shared vCPUs, 4GB RAM, 80GB SSD$25per monthApple Silicon Mac VM4 shared vCPUs, 4GB RAM, 65GB SSD$39per monthDedicated M4 Pro12-core CPU, 24GB RAM, 512GB SSD$199per month

Minimum first purchase: $25 of account credit, used for your rental.

Give each account its own Chrome --user-data-dir, validate account identifiers strictly so paths cannot collide, and run a collision check that reads cookies through the browser's own API before you wire in real credentials. If two automation jobs share one user data directory, one job's cookies, localStorage and auth state can leak into the other. Browser profiles give you logical session separation. They are not a security boundary against other code running under the same macOS user, so keep untrusted code out of the agent account.

Which Figment plan fits browser agents?

For browser automation that drives web pages (scraping, synthetic monitoring, Playwright or Puppeteer jobs, API-backed workflows), the Intel Mac VM ($25 a month, $2 a day, $0.15 an hour) fits a few light jobs. It has 4 shared vCPUs, 4GB of RAM and an 80GB SSD, runs macOS Sequoia, and runs Chrome, Chromium, Firefox and Playwright on Intel once you install them. Outbound HTTP, HTTPS and WebSocket work normally, and you reach the Mac over SSH, encrypted remote desktop or the browser.

Memory is the limit for browser work. Step up like this:

NeedPlanMonthDay
A few light headless jobs, one at a timeIntel Mac VM, 4GB RAM$25$2
arm64-only tools, iOS simulators that need Apple siliconApple Silicon Mac VM, 4 shared vCPUs, 4GB RAM$39$6
Many parallel Chrome instances, or accounts whose sessions must not share hardwareDedicated M4 Pro 48 GB, 48GB RAM, whole Mac$349Monthly only

VM vCPUs are shared, not reserved cores. Figment runs the Mac and network layer; your browsers, profiles and agents are yours to manage. Size the number of concurrent Chrome instances from a measurement on your own pages (see the checklist below).

How do I lay out one profile per account?

Use a flat directory per account and derive the path from a vetted identifier. Chrome's session isolation is driven by --user-data-dir. The Chromium user data directory documentation says the default macOS location is ~/Library/Application Support/Google/Chrome, and each profile is a subdirectory (typically Default) inside the user data directory. Pointing --user-data-dir at a fresh path gives a clean profile, and reusing the same path resumes the same cookies and storage.

~/browser-profiles/
├── client-alpha/        # cookies, localStorage, auth state for alpha
├── client-beta/
├── staging-preview/
└── prod-smoke-test/

One account gets one directory. Chrome enforces single-instance access through SingletonLock inside the user data directory, so do not point two concurrent runs at the same path, and let the browser manage its own locking.

Do not sanitise account names by replacing disallowed characters. Two different source names (client:alpha and client/alpha) can normalise to the same safe string and silently share a profile. Validate instead, and reject anything that is not already in your identifier set.

How do I launch Chrome with a strict account check?

Use a launcher that rejects anything outside an allow-list. This is an untested example, so run it against your own target URLs:

#!/usr/bin/env bash
set -euo pipefail

ACCOUNT="${1:?Usage: $0 <account-id> <url>}"
TARGET_URL="${2:?Usage: $0 <account-id> <url>}"

# Strict allow-list: lower-case letters, digits and hyphens, 3-40 chars.
# Reject anything else rather than rewriting it; rewriting risks collisions.
if [[ ! "${ACCOUNT}" =~ ^[a-z0-9]([a-z0-9-]{1,38}[a-z0-9])$ ]]; then
  echo "Refusing account id: ${ACCOUNT}" >&2
  exit 2
fi

PROFILE="${HOME}/browser-profiles/${ACCOUNT}"
mkdir -p "${PROFILE}"

CHROME="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"

echo "Launching Chrome account=${ACCOUNT} profile=${PROFILE}"
"${CHROME}" \
  --user-data-dir="${PROFILE}" \
  --no-first-run \
  --no-default-browser-check \
  --headless=new \
  "${TARGET_URL}" &

echo "chrome_pid=$!"

The launcher opens no remote-debugging TCP port, so there is nothing to collide on across accounts. If you need DevTools Protocol access, drive Chrome through a library such as Playwright or Puppeteer that opens an inherited pipe or picks a free local port. Do not hash-derive ports from account names.

How do I check that two profiles do not share cookies?

Open two persistent Playwright contexts on two directories, seed a distinct cookie into each, reopen them, and assert that each profile has only its own value. Chrome encrypts cookie values in the on-disk Cookies SQLite database on macOS, so you cannot assert a known plaintext value by querying the column. Use the browser's own API instead.

Playwright's browser-contexts guide describes contexts as incognito-like profiles that are completely isolated for cookies, localStorage and sessionStorage. browserType.launchPersistentContext(userDataDir) opens a persistent context bound to a specific directory. context.cookies() and context.addCookies() read and write cookies through the public API, and context.close() shuts the context and its pages down cleanly.

The check seeds a cookie with a one-hour expiry into each profile for a controlled test origin. Treat it as untested example code. Adapt TEST_ORIGIN to a local origin you control (a fixture served by python3 -m http.server on http://127.0.0.1:8080, or an explicitly test-only service) rather than a public echo endpoint.

// collision-check.mjs: untested example.
// Prereq: `npm i -D playwright && npx playwright install chromium`.
import { chromium } from 'playwright';
import { mkdtemp, rm } from 'node:fs/promises';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import assert from 'node:assert/strict';

const TEST_ORIGIN = 'http://127.0.0.1:8080'; // local fixture you control

async function seed(dir, cookie) {
  const ctx = await chromium.launchPersistentContext(dir, { headless: true });
  try {
    await ctx.addCookies([cookie]);
  } finally {
    await ctx.close();
  }
}

async function read(dir) {
  const ctx = await chromium.launchPersistentContext(dir, { headless: true });
  try {
    return await ctx.cookies(TEST_ORIGIN);
  } finally {
    await ctx.close();
  }
}

const dirA = await mkdtemp(join(tmpdir(), 'profile-a-'));
const dirB = await mkdtemp(join(tmpdir(), 'profile-b-'));
try {
  await seed(dirA, { name: 'session_id', value: 'ACCT_A', url: TEST_ORIGIN, expires: Math.floor(Date.now() / 1000) + 3600 });
  await seed(dirB, { name: 'session_id', value: 'ACCT_B', url: TEST_ORIGIN, expires: Math.floor(Date.now() / 1000) + 3600 });

  const a = (await read(dirA)).filter(c => c.name === 'session_id');
  const b = (await read(dirB)).filter(c => c.name === 'session_id');

  assert.equal(a.length, 1, 'profile A should have exactly one session_id');
  assert.equal(a[0].value, 'ACCT_A', 'profile A must keep its own value');
  assert.ok(!a.some(c => c.value === 'ACCT_B'), 'profile A must not see B');

  assert.equal(b.length, 1, 'profile B should have exactly one session_id');
  assert.equal(b[0].value, 'ACCT_B', 'profile B must keep its own value');
  assert.ok(!b.some(c => c.value === 'ACCT_A'), 'profile B must not see A');

  console.log('PASS: no cross-profile cookie bleed detected');
} finally {
  await rm(dirA, { recursive: true, force: true });
  await rm(dirB, { recursive: true, force: true });
}

Both own-value checks and both absence-of-other checks run on every pass, so a silent failure where neither profile stored anything is still caught. The temporary directories are created with mkdtemp and removed in finally, so the script never deletes a fixed, pre-existing profile path.

What should I check before trusting a new host with credentials?

Tick off this checklist on the host. Each item takes a few minutes, and together they replace long speculative scripts.

  • The launcher rejects any account id that contains .., /, whitespace, uppercase or punctuation, and the refusal is logged.
  • ~/browser-profiles/<account> exists for each configured account, and no two accounts resolve to the same path.
  • The job scheduler allows only one active job per profile directory. Do not rely on a second Chrome launch failing, because it can attach to an existing browser instance.
  • The Playwright collision check above passes with its temporary directories. Rerun it after any Chrome or Playwright upgrade.
  • Peak resident memory of a representative headless Chrome tab is measured on the host against your actual pages (/usr/bin/time -l on a short run, or Activity Monitor), and the concurrent agent count is sized from that measurement and not from a guess.
  • Outbound network to the agent's real targets works from the Mac, and required allowlists are updated on your own firewall, artifact store or CI service.
  • API keys and service credentials come from a secret manager and stay out of shell history and logs. Browser profiles can retain authenticated cookies, so restrict access to those directories.
  • After an unclean exit, stop any Chrome processes still holding the account's profile, then start the retry against a fresh scratch profile directory. Let the browser manage SingletonLock, and do not delete lock files while a Chrome process is still running against the profile.

How do I move browser agents to a Figment Mac?

Start clean. Create empty profile directories on the hosted Mac, sign in once for each account through an encrypted remote desktop session, and run the collision check. Do not copy a local profile wholesale: live profile directories contain credentials, tokens and encryption material tied to the origin machine, so moving them across hosts is risky and often broken by Keychain binding. If you must keep specific state, export only the fields you need (session cookie, selected localStorage keys) through DevTools or a scripted login, and re-import them on the host with context.addCookies().

Figment does not back up your Mac, so keep your own export of any state you cannot recreate. When the checklist is green end to end, promote the host to production use. Compare the Mac hosting plans if you need to resize.


Related guides: Disk pressure on a hosted Mac agent · Workspace isolation on a hosted Mac · GitHub Actions self-hosted runner on Mac

Which Figment Mac fits this work?

Intel Mac VM from $25 a month, Apple Silicon Mac VM from $39, or a Dedicated M4 Pro for $199. Hourly and daily plans too. You pay before use, starting with at least $25 of account credit.

Choose a Mac plan