AIToday

sde: macOS tool isolates AI agents in containers with credential firewalls

Hacker News1h agoSend on LINE
sde: macOS tool isolates AI agents in containers with credential firewalls

Key takeaway

A new open-source CLI called sde creates isolated container environments on macOS for AI-assisted development, designed to prevent agents from exfiltrating secrets or making unauthorized changes. It enforces an egress allowlist at the DNS layer, keeps credentials (GitHub tokens, AWS SSO keys) on the host and vends them per-operation to containers, and requires explicit time-boxed grants for write operations like git push. The tool is available now via Homebrew or source build, with Linux support planned.

Summaries like this, in your inbox every morning.

Sign up free →

3 Key Points

  • What happened

    A new open-source CLI tool called sde boots an isolated container environment on macOS where AI agents and code can run safely, with role-separated data services, an egress firewall that blocks unlisted domains at the DNS layer, and a credential broker that keeps secrets on the host and out of the container filesystem.

  • Why it matters

    Running an AI agent against a codebase typically grants it shell access to read environment files, push code, and call cloud APIs—a broad attack surface. sde enforces explicit write grants (git push requires a time-boxed approval from the host), keeps Git tokens in macOS Keychain rather than in the container, and vends short-lived AWS credentials per operation via a broker, reducing the blast radius if an agent or dependency goes rogue.

  • What to watch

    The tool is under active development targeting v1 (workspace isolation, credential brokerage, egress policy, AWS/GitHub integration on macOS); Linux runtime support and additional token providers are on the roadmap. Installation is available via Homebrew or by building from source with Go 1.25+. For threat model details, the author notes it is a guardrail, not a jail, and does not defend against container escape—documented in SECURITY.md.

In Depth

sde is a single-binary CLI tool for macOS that boots a role-separated, network-isolated container environment—called a workspace—where your code and AI agents can run safely. The core idea is to apply the principle of least privilege: give an agent what it needs to work (read access, ability to fetch dependencies, make git commits), nothing more (no raw internet access, no static credentials, no uncontrolled write access).

The tool enforces isolation through three mechanisms. First, egress control: the workspace container can only reach domains you explicitly list in a topology.yaml file. All other traffic is blocked at the DNS resolver (a sidecar container that returns NXDOMAIN) and again at iptables within the workspace. Cloud instance metadata (169.254.169.254) is always blocked, preventing an agent from stealing cloud-provider secrets. Second, credential brokerage: Git tokens live in macOS Keychain on the host; when the workspace needs to git clone or git push, it talks to a Unix-socket broker running on the host, which mints short-lived tokens per-operation and injects them via GIT_CONFIG_COUNT environment variables—no .gitconfig file in the container. AWS credentials work similarly: sde injects a ~/.aws/config into the workspace that uses credential_process to call back to the broker, which shells out to aws configure export-credentials on the host, vending short-lived SSO credentials without storing static keys in the container. Third, write gating: git pull is allowed by default, but git push requires an explicit grant you issue from your host terminal (e.g., sde grant push --repo my-org/my-project --ttl 10m), time-boxing push access to the window you specify.

Installation is available via Homebrew (brew tap alexs60/sde && brew trust alexs60/sde && brew install sde) or by building from source using Git, Go, and Make. The tool requires macOS 13 or later, Colima (a free, Docker-API-compatible container runtime), and Git; AWS CLI v2 is optional if you want AWS credentials available. The container runtime can be switched from Colima to OrbStack with a one-line topology change.

The workflow is five steps: store a GitHub PAT (sde auth github --store), navigate to your project, generate a topology.yaml (sde init, which auto-detects your stack), boot the environment (sde up), open a shell in the workspace (sde shell), and then grant write access when needed (sde grant push --ttl 10m) or stop everything (sde down). The topology.yaml file specifies networks, services (workspace and datastore containers), egress policy, and credential providers; a reference example includes a Node.js workspace with pnpm, a Postgres datastore, and an allowlist for npm registry, GitHub, and Anthropic API.

The tool is under active development and licensed under GPL-3.0-or-later. The v1 target covers workspace isolation, credential brokerage, egress policy, and AWS/GitHub integration on macOS; Linux runtime support and additional token providers are on the roadmap. Latest E2E verification was 2026-07-21. The author notes in SECURITY.md that sde is a guardrail, not a jail: it raises the cost of an agent going off the rails or a dependency phoning home, but does not survive a container escape, and an allowlisted domain that serves arbitrary user content is a data channel by design.

Context & Analysis

sde addresses a real security gap in AI-assisted development: when you run an agent against your codebase, you typically grant it a shell with access to secrets, Git history, and cloud credentials—a broad permission surface that a compromised agent or malicious dependency could abuse. The tool implements three complementary layers of isolation. First, network isolation: the workspace can only reach domains you explicitly allowlist; everything else is blocked at the DNS resolver (a sidecar container) and at iptables, and cloud instance metadata is always blocked. Second, credential isolation: secrets never reside in the container filesystem—they live in the host's macOS Keychain and are brokered per-operation, so even if an attacker gains a shell in the workspace, they cannot harvest static keys. Third, write control: the agent cannot modify code or infrastructure without an explicit, time-boxed grant you issue from the host terminal, decoupling agent read access (which is needed for context) from write capability (which should be gated).

The architecture is modular: Colima is the default container runtime, but OrbStack works with a single topology change, and the codebase uses a hexagonal architecture where the core domain has zero external imports. Installation is straightforward—Homebrew or Go build from source—and the CLI is designed to be primary interface. The author is transparent about limitations: sde is a guardrail, not a jail, so it does not defend against container escape, and an allowlisted domain that serves arbitrary user content is a data channel by design. Latest E2E verification was 2026-07-21.

FAQ

What operating systems does sde support?
sde runs on macOS 13 (Ventura) or later on Apple Silicon or Intel. Linux runtime support is on the roadmap but not yet available.
How does sde prevent an AI agent from stealing credentials?
Credentials (GitHub PATs, AWS keys) are stored in macOS Keychain on the host, not in the container filesystem. A broker daemon running on the host vends short-lived tokens per operation via a Unix socket—for example, AWS SSO credentials are minted fresh per-operation without static keys touching the container, and Git tokens are injected via environment variables rather than stored in .gitconfig.
Can an AI agent push code changes without permission?
No. Git pull is allowed by default, but git push requires an explicit, time-boxed grant issued from the host terminal (e.g., sde grant push --ttl 10m), giving you control over when the agent can write.

Get the latest AI Coding Assistants news every morning

AI-summarized, only the topics you pick — one digest a day via Email, Slack, or Discord.

Free · takes 30 seconds · unsubscribe anytime

Discussion

No comments yet. Be the first to share your thoughts!

Log in to join the discussion

Related Articles

Stay ahead with AI news

Get curated AI news from 200+ sources delivered daily to your inbox. Free to use.

Get Started Free

Free · takes 30 seconds · unsubscribe anytime