Mac hosting guide

Limit Network Access for Agents on a Hosted Mac

Write a destination policy, enforce it with a pf anchor that denies egress by default, add LuLu for per-process rules where it can run, and re-run a verification script after every change.

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.

Limit an agent's network access by writing down the destinations it needs, blocking everything else with a pf egress anchor, and re-running a verification script after every rule change. An agent that can call any host is an unaudited data pipe, and one hallucinated URL, compromised dependency or runaway retry loop can leak data. pf is part of macOS, so any Figment Mac plan you have administrator access to can enforce it, starting with the Intel Mac VM at $25 a month.

Which Figment Mac plan suits a network-restricted agent?

The Intel Mac VM fits an agent that calls a small, stable set of HTTPS APIs. It has 4 shared vCPUs, 4GB of RAM and an 80GB SSD on macOS Sequoia, at $25 a month, $2 a day or $0.15 an hour. You have administrator access to your own VM, which you need to edit pf rules.

Choose the Apple Silicon Mac VM ($39 a month) when the agent needs Apple silicon tools such as Core ML or Vision framework work. Choose the Dedicated M4 Pro 48 GB ($349 a month) when the agent handles data you want on a whole Mac that no other customer's VM shares. The Mac plans do not change which pf rules you write. Figment manages the network layer around the Mac. The rules inside the Mac are yours.

If you are cross-shopping, check the vendor pricing pages directly. CloudMac publishes $99.99 a month and a $999 a year prepay on cloudmac.org (an effective $83.25 a month) for an M4 with 16GB and 256GB. MacStadium lists M2.S at $109 and M4.S at $149 with support and a published 99.99% uptime target.

Why use both pf and LuLu?

Each covers a gap the other leaves. macOS has two independent network controls, and neither does everything alone.

LayerWhat it filtersPer-processHostnamesBest for
pf (packet filter)IP addresses, ports, protocolsNoNo (IPs only)Broad egress allow-lists
Application FirewallSigned binaries, inbound onlyNoNoNot useful for agent egress
LuLu (Objective-See)Outbound per processYesResolved at prompt timePer-agent rules

Use pf as the deny-by-default baseline on every plan. Add LuLu (version 4.5.7, requires macOS 10.15 or later) when you want per-process rules. LuLu installs a system extension that you approve in System Settings, so check on your own Mac or VM that it installs and loads before you rely on it. If it does not, use pf plus application-level allow-lists.

How do I build the destination policy?

List every destination the agent legitimately needs before you write a rule. This table is the artifact you verify against.

ServiceHostnamePortProtocolEnforcement
OpenAI APIapi.openai.com443TCP/HTTPSpf CIDR + LuLu rule
Anthropic APIapi.anthropic.com443TCP/HTTPSpf CIDR + LuLu rule
GitHub (self-hosted runner)endpoints from GitHub meta API443TCP/HTTPSpf CIDR
Your artifact storeyour bucket host443TCP/HTTPSpf CIDR
Local loopback127.0.0.1anyanypf pass
Everything else*anyanypf default deny

pf matches on IPs, not hostnames. Resolve each host with dig +short at deploy time and schedule a weekly re-resolution. Pull provider ranges from the vendor's own published source (for example GitHub's /meta API or an AWS IP-range feed) and do not invent CIDRs. Do not add App Store Connect or TestFlight "webhook" ranges, because Apple does not publish such an allow-list.

How do I write the pf egress rules?

Keep agent rules in their own anchor. The pf configuration lives in /etc/pf.conf and loads anchor files from /etc/pf.anchors/. See man pfctl and man pf.conf on the host for the exact syntax of your macOS version.

Create /etc/pf.anchors/agent-egress:

# /etc/pf.anchors/agent-egress
# pf uses last-match semantics unless 'quick' is set. Put the broad
# default-deny first and let specific allow rules override it below.
# Replace the IPs with values re-resolved from your destination policy.

block out all

# Loopback
pass out on lo0 all

# DNS so the agent can resolve its own destinations
pass out proto udp to any port 53

# HTTPS to approved service IPs (re-resolve before each deploy)
pass out proto tcp to <openai_ips>     port 443
pass out proto tcp to <anthropic_ips>  port 443
pass out proto tcp to <github_ips>     port 443

Reference the anchor from /etc/pf.conf:

anchor "agent-egress"
load anchor "agent-egress" from "/etc/pf.anchors/agent-egress"

Check syntax, then load:

sudo pfctl -n -f /etc/pf.conf
sudo pfctl -ef /etc/pf.conf

To persist across reboots, use a LaunchDaemon plist in /Library/LaunchDaemons/, the location Apple documents for system daemons in the launchd developer archive. Set the plist to run pfctl -ef /etc/pf.conf at load, owned by root with mode 644.

How do I verify allowed and blocked paths?

Run this script after every rule change. It scores reachability against the policy and exits non-zero on any mismatch.

#!/bin/bash
# verify_network_policy.sh
set -uo pipefail
PASS=0; FAIL=0

check() {
  local label="$1" host="$2" port="$3" expect="$4"
  if nc -z -G 3 -w 3 "$host" "$port" 2>/dev/null; then
    reached=yes
  else
    reached=no
  fi
  if [ "$reached" = "$expect" ]; then
    echo "PASS  $label (expected=$expect)"
    PASS=$((PASS+1))
  else
    echo "FAIL  $label (expected=$expect got=$reached)"
    FAIL=$((FAIL+1))
  fi
}

# Allowed
check "OpenAI"      api.openai.com                 443 yes
check "Anthropic"   api.anthropic.com              443 yes
check "GitHub API"  api.github.com                 443 yes

# Must be blocked
check "SMTP egress" smtp.gmail.com                 587 no
check "Random web"  example.com                    80  no
check "Metadata"    checkip.amazonaws.com          80  no

echo "Results: $PASS passed, $FAIL failed"
[ "$FAIL" -eq 0 ]

A FAIL on any blocked line means a rule gap. Fix it before the agent handles sensitive data. pf drops silently by default, so an unexpected timeout in the agent's own logs is the usual sign of a destination you have not approved.

How do I handle IP drift and secrets?

Re-resolve the hostnames in your destination policy weekly and diff against your anchor, because cloud providers rotate IPs. Subscribe to the provider's own range feed where one exists. When the agent needs a new endpoint, add it to the policy table first, update pf, then re-run the verification script.

Keep API keys in the Mac's Keychain or your CI secret manager, not in a plaintext env file. If you move secrets between machines, transfer the names and restore the values from the secret manager on the new one. Never dump the whole environment to disk.

Where do I start?

Write the destination policy table first. It takes about thirty minutes and removes most later debugging. Then pick a machine from the Mac hosting plans, load the anchor, and run the verification script before the agent touches real data.

Related reading

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