76 karma · joined February 15, 2026
The architecture is simple: AgentBridge is a native Mac app that polls an inbox folder for text-file commands, executes them via the Mac Toolbox, and writes responses to an outbox folder. An MCP server on the modern side reads and writes those files. The shared folder can be a NAS, an emulator's host directory, or anything else both sides can access.
No SSH. No screen capture. No input injection at the host level. No system extensions or modifications. AgentBridge is just a regular Mac application, the only interface between the AI and the Mac is a folder full of text files.
The protocol is intentionally minimal: line-oriented key-value pairs, CR line endings, MacRoman encoding, parseable in ~50 lines of C with zero dynamic memory allocation. Commands cover window enumeration, app launching, menu selection, mouse/keyboard input, clipboard access, file browsing, and process listing.
The whole pipeline is verified working end-to-end: Claude Desktop -> MCP server -> Synology NAS -> AgentBridge on a Mac -> launches AppleWorks and types into a document.
Some fun bugs I hit along the way: a short overflow that silently prevented the text buffer from ever being populated (the 32KB max message size overflowed a 16-bit signed parameter to -32768, causing an early return), and PostEvent delivering keyboard events to AgentBridge's own event queue instead of the frontmost app under cooperative multitasking.
Built with Retro68 (GCC cross-compiler for 68k/PPC Macs). The MCP server is GPLv3 TypeScript; the Mac app is closed-source with pre-built binaries available. The protocol itself is open for anyone to implement.
Content guardrails (NeMo, LlamaGuard) control what models say, not what agents do. Agent sandboxes scope directories but don't back anything up. Checkpoint tools provide rollback, but the agent can delete the checkpoints. OPA evaluates policy in microseconds, but nobody has bridged it to AI agent frameworks yet.
Agent Gate sits in that gap. It classifies tool calls against pre-computed policy, enforces directory boundaries, and vault-backs every destructive target to an agent-unreachable location before the action proceeds. If the backup fails, the action is blocked.
Live tested with Claude Code in fully autonomous mode via PreToolUse hooks. 18/18 tests passing. The vault creates per-operation timestamped snapshots, so multiple overwrites of the same file produce separate recovery points.
Background: I spent years in nuclear command and control where Permissive Action Links verified authorization, not judgment, before any action could proceed. Same architectural principle applied here.
Honest about the limitations: the bash parser is naive, shell expansion isn't evaluated, and this is a safety net for well-intentioned agents, not a security boundary against adversarial escape. More detail in the README.
Python, YAML policy definitions, Apache 2.0. Roadmap includes MCP proxy integration and OPA/Rego support.
Happy to answer questions about the architecture.