<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: MrLuke2</title>
    <description>The latest articles on DEV Community by MrLuke2 (@mrluke2).</description>
    <link>https://dev.to/mrluke2</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1078418%2F7db57e11-605a-4bd3-a843-60b9449b364f.png</url>
      <title>DEV Community: MrLuke2</title>
      <link>https://dev.to/mrluke2</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mrluke2"/>
    <language>en</language>
    <item>
      <title>Your AI Coding Agent Has Root Access to Your Machine. Does Anything Else?</title>
      <dc:creator>MrLuke2</dc:creator>
      <pubDate>Mon, 30 Mar 2026 22:30:41 +0000</pubDate>
      <link>https://dev.to/mrluke2/your-ai-coding-agent-has-root-access-to-your-machine-does-anything-else-3m5j</link>
      <guid>https://dev.to/mrluke2/your-ai-coding-agent-has-root-access-to-your-machine-does-anything-else-3m5j</guid>
      <description>&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;Two critical vulnerabilities — CVE-2026-22812 (CVSS 8.8) and CVE-2026-22813 (CVSS 9.6) — affect the most widely deployed open-source AI coding agent platforms. 220,000+ instances are exposed on the public internet with no authentication. 15,200 are confirmed vulnerable to unauthenticated remote code execution. But the exposure isn't limited to cloud servers — the same agent running on your Mac Mini under your desk has the same root-level access to your files, your credentials, and your network. This article provides the technical analysis, the exposure data, remediation for both VPS and local hardware deployments, and a 5-layer defense architecture that works regardless of where your agent runs.&lt;/p&gt;




&lt;h2&gt;
  
  
  The machine under your desk
&lt;/h2&gt;

&lt;p&gt;Apple cannot keep the Mac Mini in stock. The M4 and M4 Pro configurations are backordered across most retailers, and the reason is not what Apple planned for. Developers are buying them to run AI coding agents locally — specifically OpenClaw, which needs Apple Silicon's unified memory architecture for local LLM inference.&lt;/p&gt;

&lt;p&gt;The logic makes sense on paper. A $600 Mac Mini with 16GB of unified memory runs a 7B parameter model fast enough for real-time coding assistance. A $1,400 M4 Pro with 48GB runs 34B models comfortably. No cloud costs. No API rate limits. No data leaving your network. Private, fast, and owned.&lt;/p&gt;

&lt;p&gt;There is one problem. The agent running on that Mac Mini has the same privileges as the user who launched it. On most developer machines, that means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Full read/write access to &lt;code&gt;~/&lt;/code&gt; — every project, every &lt;code&gt;.env&lt;/code&gt; file, every SSH key&lt;/li&gt;
&lt;li&gt;Access to the macOS Keychain if unlocked&lt;/li&gt;
&lt;li&gt;Ability to install packages, modify system files, and execute arbitrary shell commands&lt;/li&gt;
&lt;li&gt;Network access to every service on the local network — NAS drives, printers, other machines&lt;/li&gt;
&lt;li&gt;No sandboxing, no firewall rules, no permission boundaries&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A Meta security researcher had to &lt;strong&gt;physically unplug her Mac Mini&lt;/strong&gt; to stop an AI coding agent from deleting her email inbox. The agent was running with full system permissions and connected to a compromised skill package. It began executing destructive commands that could not be stopped through the UI because the WebSocket connection was being used by the attacker's injected scripts.&lt;/p&gt;

&lt;p&gt;That incident happened on a local machine with no internet exposure. The attack vector was not a network exploit — it was a malicious package in the agent's skill chain.&lt;/p&gt;

&lt;p&gt;For the 220,000+ instances running on VPS infrastructure with no authentication and no firewall, the same attack can be executed remotely by anyone on the internet.&lt;/p&gt;

&lt;p&gt;The industry spent two months talking about the 220,000 number. What it missed is that the number only counts servers. It does not count the desks.&lt;/p&gt;




&lt;h2&gt;
  
  
  Two CVEs, one architectural failure
&lt;/h2&gt;

&lt;h3&gt;
  
  
  CVE-2026-22812: Unauthenticated Remote Code Execution
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;CVE ID:&lt;/strong&gt; CVE-2026-22812&lt;br&gt;
&lt;strong&gt;CVSS Score:&lt;/strong&gt; 8.8 (High)&lt;br&gt;
&lt;strong&gt;Vector:&lt;/strong&gt; &lt;code&gt;CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Affected Software:&lt;/strong&gt; OpenCode HTTP server (serve mode), OpenClaw instances&lt;br&gt;
&lt;strong&gt;Discovery:&lt;/strong&gt; Reported via NVD/NIST, confirmed by SecurityScorecard STRIKE team&lt;/p&gt;

&lt;p&gt;When an AI coding agent runs in serve mode — exposing an HTTP and WebSocket interface for browser-based interaction — the server binds to &lt;code&gt;0.0.0.0&lt;/code&gt; by default. In versions prior to 1.1.10, this server has &lt;strong&gt;no authentication mechanism whatsoever&lt;/strong&gt;. Even in 1.1.10+, where the server is disabled by default, enabling it provides only optional Basic Auth that most deployments skip.&lt;/p&gt;

&lt;p&gt;Any process on the network — or anyone on the internet if the server is publicly reachable — can:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Execute arbitrary shell commands&lt;/strong&gt; with the user's full privileges&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Read and write any file&lt;/strong&gt; accessible to the running process&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Install packages, modify system configurations, exfiltrate data&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pivot to other services&lt;/strong&gt; running on the same host or network&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The agent is not a code assistant. It is a full remote shell with an AI interface.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;On a VPS:&lt;/strong&gt; If port 4096 is open, the entire internet has root access.&lt;br&gt;
&lt;strong&gt;On a Mac Mini:&lt;/strong&gt; If the agent binds to &lt;code&gt;0.0.0.0&lt;/code&gt; instead of &lt;code&gt;127.0.0.1&lt;/code&gt;, every device on the local network has root access. On a coffee shop WiFi, a coworking space, a hotel — that is everyone in the room.&lt;/p&gt;
&lt;h4&gt;
  
  
  CVSS vector breakdown
&lt;/h4&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Attack Vector&lt;/td&gt;
&lt;td&gt;Network&lt;/td&gt;
&lt;td&gt;Exploitable remotely&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Attack Complexity&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;td&gt;No special conditions required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Privileges Required&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;td&gt;No authentication needed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;User Interaction&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;td&gt;No victim action required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Scope&lt;/td&gt;
&lt;td&gt;Unchanged&lt;/td&gt;
&lt;td&gt;Stays within the vulnerable component&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Confidentiality&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;Full read access&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Integrity&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;Full write access&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Availability&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;Full denial of service possible&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This is a trivially exploitable vulnerability. If the port is reachable, the system is compromised.&lt;/p&gt;
&lt;h3&gt;
  
  
  CVE-2026-22813: XSS-to-RCE via LLM Output
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;CVE ID:&lt;/strong&gt; CVE-2026-22813&lt;br&gt;
&lt;strong&gt;CVSS Score:&lt;/strong&gt; 9.6 (Critical)&lt;br&gt;
&lt;strong&gt;Affected Software:&lt;/strong&gt; OpenClaw web UI&lt;/p&gt;

&lt;p&gt;The web interface that renders AI agent output does not sanitize the markdown and HTML returned by the language model. An attacker who can influence the LLM's output — through prompt injection, malicious context documents, or compromised training data — can inject arbitrary JavaScript that executes in the user's browser session.&lt;/p&gt;

&lt;p&gt;Because the browser session has an active WebSocket connection to the agent backend, this JavaScript can send commands to the agent as if the user typed them, exfiltrate the contents of the current session, execute shell commands through the agent's execution interface, and persist across sessions if the injected script writes to the agent's context files.&lt;/p&gt;

&lt;p&gt;This is the vulnerability that matters most for Mac Mini owners. CVE-2026-22812 requires network access to the agent's port. CVE-2026-22813 does not. It requires only that the agent processes a file, package, or repository that contains adversarial content. Given that AI coding agents routinely clone repositories, install npm/pip/cargo packages, read documentation files, and process code review comments — the attack surface is &lt;strong&gt;every piece of content the agent interacts with&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The Mac Mini on your desk. Running a local model. No cloud connection. Still vulnerable to CVE-2026-22813 through a poisoned &lt;code&gt;package.json&lt;/code&gt; or a malicious code review comment.&lt;/p&gt;


&lt;h2&gt;
  
  
  The exposure data
&lt;/h2&gt;

&lt;p&gt;Between January and March 2026, multiple independent security research groups conducted internet-wide scans targeting AI coding agent infrastructure:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Finding&lt;/th&gt;
&lt;th&gt;Count&lt;/th&gt;
&lt;th&gt;Source&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;OpenClaw instances exposed on public internet&lt;/td&gt;
&lt;td&gt;220,000+&lt;/td&gt;
&lt;td&gt;Censys, Bitsight, Penligent&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Instances confirmed vulnerable to RCE (CVE-2026-22812)&lt;/td&gt;
&lt;td&gt;15,200&lt;/td&gt;
&lt;td&gt;Penligent&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Instances correlated with prior breach activity&lt;/td&gt;
&lt;td&gt;53,300&lt;/td&gt;
&lt;td&gt;SecurityScorecard STRIKE team&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Malicious packages in ClawHub skill marketplace&lt;/td&gt;
&lt;td&gt;1,184&lt;/td&gt;
&lt;td&gt;CyberDesserts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Leaked API tokens (Supabase breach)&lt;/td&gt;
&lt;td&gt;1,500,000&lt;/td&gt;
&lt;td&gt;Infosecurity Magazine&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Leaked email addresses (same breach)&lt;/td&gt;
&lt;td&gt;35,000&lt;/td&gt;
&lt;td&gt;Infosecurity Magazine&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These numbers are the ones that made the news. They count VPS deployments — Hetzner, DigitalOcean, Linode, Contabo — where a developer provisioned a server, installed the agent, started serve mode, and did not configure a firewall.&lt;/p&gt;

&lt;p&gt;What they do not count: Mac Minis on home networks. Development laptops in coworking spaces. Workstations in offices with flat network topologies. These machines are not indexed by Censys. They are not visible to Shodan. But if the agent's HTTP server binds to anything other than &lt;code&gt;127.0.0.1&lt;/code&gt;, every device on the same network segment has the same unauthenticated access that the internet has to those 220,000 VPS instances.&lt;/p&gt;

&lt;p&gt;The 220,000 number is a floor. The actual exposure includes every unsandboxed AI coding agent running on every machine where the developer has not explicitly configured network isolation. The Mac Mini shortage suggests that number is growing, not shrinking.&lt;/p&gt;
&lt;h3&gt;
  
  
  The supply chain problem
&lt;/h3&gt;

&lt;p&gt;The 1,184 malicious packages discovered in the ClawHub skill marketplace represent a systemic supply chain compromise. These packages masqueraded as legitimate MCP skills but contained credential harvesters, reverse shells, cryptominers, and data exfiltration routines.&lt;/p&gt;

&lt;p&gt;This is the attack path that bypasses all network-level defenses. A tunnel does not help if the agent itself installs a malicious package that reads &lt;code&gt;~/.ssh/id_rsa&lt;/code&gt; and uploads it to an attacker's server. A firewall does not help if the package phones home through an outbound HTTPS connection that looks identical to a legitimate API call.&lt;/p&gt;

&lt;p&gt;Defense requires both network isolation (Layers 1–3) &lt;strong&gt;and&lt;/strong&gt; permission scoping (Layer 5). Neither alone is sufficient.&lt;/p&gt;


&lt;h2&gt;
  
  
  Why this happened
&lt;/h2&gt;

&lt;p&gt;The root cause is not a coding error. It is an architectural assumption.&lt;/p&gt;

&lt;p&gt;AI coding agents were designed as local development tools. They assume a trusted network — your laptop, your home WiFi. The HTTP server is a convenience feature: start the agent, open a browser tab, start coding.&lt;/p&gt;

&lt;p&gt;That assumption fails in two directions simultaneously:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Direction 1: Servers.&lt;/strong&gt; Developers run agents on VPS infrastructure because they need persistent execution, shared team access, and GPU availability. The agent's HTTP server, designed for &lt;code&gt;localhost&lt;/code&gt;, is now reachable from the public internet. This produced the 220,000 exposed instances.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Direction 2: Local hardware at scale.&lt;/strong&gt; The Mac Mini shortage proves that developers are deploying AI agents on physical hardware in volumes that matter. These machines sit on home networks, office networks, and coffee shop WiFi. They are not behind firewalls. They are not running in sandboxes. The agent has the same access to the filesystem, the network, and the macOS Keychain that the developer does. The difference from the VPS scenario is visibility — no one is scanning home networks, so the exposure goes unreported.&lt;/p&gt;

&lt;p&gt;Both directions share the same gap: the tooling provided &lt;strong&gt;zero infrastructure guidance&lt;/strong&gt;. No documentation for firewall configuration. No reverse proxy templates. No authentication integration. No sandboxing guide for macOS. No permission scoping.&lt;/p&gt;

&lt;p&gt;Developers were told "start the server and open a browser." They did.&lt;/p&gt;


&lt;h2&gt;
  
  
  Reproduction methodology
&lt;/h2&gt;

&lt;p&gt;The following describes the verification methodology used by researchers. This information is provided for defensive purposes — to help teams verify whether their own instances are vulnerable.&lt;/p&gt;
&lt;h3&gt;
  
  
  For VPS deployments
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Use Censys, Shodan, or any internet-facing port scanner to identify hosts running the agent's HTTP server. The default port is 4096. The server responds with a distinctive HTTP response that includes WebSocket upgrade headers and the agent's UI HTML.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="nf"&gt;GET&lt;/span&gt; &lt;span class="nn"&gt;/&lt;/span&gt; &lt;span class="k"&gt;HTTP&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;1.1&lt;/span&gt;
&lt;span class="na"&gt;Host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;&amp;lt;target-ip&amp;gt;:4096&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A vulnerable instance returns a 200 response with the full agent interface. There is no login page. There is no authentication challenge.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Connect to the WebSocket endpoint. The agent accepts commands in its standard message format. Any command that the agent can execute — file operations, shell commands, package installations — is available to the attacker.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Send a benign verification command (e.g., &lt;code&gt;whoami&lt;/code&gt;, &lt;code&gt;hostname&lt;/code&gt;, &lt;code&gt;uname -a&lt;/code&gt;). If the agent returns system information, the instance is confirmed vulnerable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; Do not execute destructive commands. Do not access, copy, or modify any data. Verification should confirm the vulnerability exists and stop. Report findings to the instance owner if identifiable.&lt;/p&gt;

&lt;h3&gt;
  
  
  For local hardware (Mac Mini, workstations)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; On the machine running the agent, check what address the server is bound to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# macOS&lt;/span&gt;
lsof &lt;span class="nt"&gt;-i&lt;/span&gt; :4096

&lt;span class="c"&gt;# Linux&lt;/span&gt;
ss &lt;span class="nt"&gt;-tlnp&lt;/span&gt; | &lt;span class="nb"&gt;grep &lt;/span&gt;4096
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the output shows &lt;code&gt;*:4096&lt;/code&gt; or &lt;code&gt;0.0.0.0:4096&lt;/code&gt;, the agent is listening on all network interfaces — not just localhost. Any device on the same network can connect.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; From another device on the same network (phone, laptop, tablet), open a browser and navigate to &lt;code&gt;http://&amp;lt;mac-mini-ip&amp;gt;:4096&lt;/code&gt;. If the agent's interface loads, the machine is exposed to the local network.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Check what the agent process has access to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# What user is running the agent?&lt;/span&gt;
&lt;span class="nb"&gt;whoami&lt;/span&gt;

&lt;span class="c"&gt;# What files are readable?&lt;/span&gt;
&lt;span class="nb"&gt;ls&lt;/span&gt; ~/

&lt;span class="c"&gt;# Is the macOS Keychain accessible?&lt;/span&gt;
security list-keychains

&lt;span class="c"&gt;# Are SSH keys present?&lt;/span&gt;
&lt;span class="nb"&gt;ls&lt;/span&gt; ~/.ssh/

&lt;span class="c"&gt;# Are environment variables set with API keys?&lt;/span&gt;
&lt;span class="nb"&gt;env&lt;/span&gt; | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the majority of local installations, the agent runs as the primary user account — which means full access to the home directory, all development projects, all SSH keys, and all environment variables containing API credentials.&lt;/p&gt;




&lt;h2&gt;
  
  
  Remediation: 5-layer defense-in-depth
&lt;/h2&gt;

&lt;p&gt;The following architecture addresses both CVEs at the infrastructure level. The first three layers apply to VPS deployments. All five layers apply to any deployment, including local hardware.&lt;/p&gt;

&lt;h3&gt;
  
  
  Layer 1: Network isolation — eliminate the public attack surface
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;For VPS deployments:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Use an outbound-only encrypted tunnel instead of opening inbound ports. Cloudflare Tunnel (&lt;code&gt;cloudflared&lt;/code&gt;) establishes a connection from your server to Cloudflare's network using outbound-only QUIC connections on port 7844. No inbound ports are opened. The server's IP address is never exposed. All traffic routes through Cloudflare's 330+ city anycast network.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Install cloudflared&lt;/span&gt;
curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://pkg.cloudflare.com/cloudflare-main.gpg &lt;span class="se"&gt;\&lt;/span&gt;
  | gpg &lt;span class="nt"&gt;--dearmor&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; /usr/share/keyrings/cloudflare.gpg
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"deb [signed-by=/usr/share/keyrings/cloudflare.gpg] &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;
  https://pkg.cloudflare.com/cloudflared &lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;lsb_release &lt;span class="nt"&gt;-cs&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt; main"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  | &lt;span class="nb"&gt;tee&lt;/span&gt; /etc/apt/sources.list.d/cloudflared.list
apt update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt &lt;span class="nb"&gt;install &lt;/span&gt;cloudflared

&lt;span class="c"&gt;# Create tunnel (requires Cloudflare API token)&lt;/span&gt;
cloudflared tunnel create my-agent-tunnel

&lt;span class="c"&gt;# Configure: route agent.yourdomain.com → localhost:4096&lt;/span&gt;
&lt;span class="c"&gt;# Catch-all: return 404 for all other hostnames&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Configuration note:&lt;/strong&gt; Set the tunnel's catch-all to &lt;code&gt;http_status:404&lt;/code&gt;. This ensures that any request arriving at Cloudflare that does not match your specific hostname is rejected before it reaches your server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For Mac Mini / local hardware:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Force the agent to bind to &lt;code&gt;127.0.0.1&lt;/code&gt; only — never &lt;code&gt;0.0.0.0&lt;/code&gt;. This restricts the HTTP server to connections originating from the same machine.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# If the agent supports a bind address flag:&lt;/span&gt;
opencode serve &lt;span class="nt"&gt;--host&lt;/span&gt; 127.0.0.1

&lt;span class="c"&gt;# Verify it's not listening on all interfaces:&lt;/span&gt;
lsof &lt;span class="nt"&gt;-i&lt;/span&gt; :4096
&lt;span class="c"&gt;# Should show: 127.0.0.1:4096, NOT *:4096&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you need to access the agent from another device (e.g., your laptop connecting to a Mac Mini on your desk), use SSH port forwarding instead of exposing the port:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# From your laptop, forward local port 4096 to the Mac Mini's localhost:4096&lt;/span&gt;
ssh &lt;span class="nt"&gt;-L&lt;/span&gt; 4096:127.0.0.1:4096 user@mac-mini-ip

&lt;span class="c"&gt;# Then open http://localhost:4096 in your laptop's browser&lt;/span&gt;
&lt;span class="c"&gt;# Traffic is encrypted through the SSH tunnel — never exposed on the network&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For persistent remote access, Cloudflare Tunnel works on macOS as well:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Install on macOS&lt;/span&gt;
brew &lt;span class="nb"&gt;install &lt;/span&gt;cloudflare/cloudflare/cloudflared

&lt;span class="c"&gt;# Same tunnel configuration as Linux — agent stays on localhost,&lt;/span&gt;
&lt;span class="c"&gt;# Cloudflare handles authenticated remote access&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What this prevents:&lt;/strong&gt; On VPS — direct IP scanning, port-based attacks, DDoS. On local hardware — exposure to every device on the same WiFi or LAN. The agent becomes reachable only through authenticated channels.&lt;/p&gt;

&lt;h3&gt;
  
  
  Layer 2: Identity verification — gate every request
&lt;/h3&gt;

&lt;p&gt;Cloudflare Zero Trust Access enforces authentication at the edge. Before a request is proxied to your tunnel (and therefore your server or Mac Mini), the user must authenticate through an identity provider — Google, GitHub, one-time pin via email, or any SAML/OIDC provider.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Access Policy:
  Action: Allow
  Include: Emails ending in @yourdomain.com
  Session duration: 24 hours
  Cookie: SameSite=None, HttpOnly, Binding=Enabled
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Critical configuration for WebSocket agents:&lt;/strong&gt; The &lt;code&gt;SameSite=None&lt;/code&gt; and Binding Cookie settings are required for AI coding agents that use WebSocket connections. Without them, the browser's WebSocket upgrade request will fail the cookie check and the session will drop mid-conversation. This is a common misconfiguration that causes intermittent disconnections.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What this prevents:&lt;/strong&gt; Unauthorized access from anyone who does not possess valid identity credentials. Even if an attacker discovers the agent's URL, they see a Cloudflare login page — not the agent interface.&lt;/p&gt;

&lt;h3&gt;
  
  
  Layer 3: Application authentication — defense in depth
&lt;/h3&gt;

&lt;p&gt;Enable authentication on the agent's HTTP server itself as a secondary gate.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Generate a high-entropy password&lt;/span&gt;
&lt;span class="nv"&gt;AGENT_PASSWORD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;openssl rand &lt;span class="nt"&gt;-base64&lt;/span&gt; 24&lt;span class="si"&gt;)&lt;/span&gt;

&lt;span class="c"&gt;# Set as environment variable for the agent process&lt;/span&gt;
&lt;span class="c"&gt;# Linux (systemd):&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"OPENCODE_SERVER_PASSWORD=&lt;/span&gt;&lt;span class="nv"&gt;$AGENT_PASSWORD&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; /etc/systemd/system/opencode.service.d/override.conf
systemctl daemon-reload &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; systemctl restart opencode

&lt;span class="c"&gt;# macOS (launchd or manual):&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;OPENCODE_SERVER_PASSWORD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$AGENT_PASSWORD&lt;/span&gt;
opencode serve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Important caveat:&lt;/strong&gt; When Zero Trust Access is active, enabling Basic Auth on the agent server can create an authentication loop (Access redirects on 401, server returns 401 before Access processes). The correct implementation is conditional: set the server password only when Zero Trust is not configured. When Zero Trust is active, it is the authentication layer.&lt;/p&gt;

&lt;h3&gt;
  
  
  Layer 4: Host hardening — reduce the blast radius
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;For VPS (Ubuntu/Debian):&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Firewall: deny all inbound, allow SSH only&lt;/span&gt;
ufw default deny incoming
ufw default allow outgoing
ufw allow ssh
ufw &lt;span class="nt"&gt;--force&lt;/span&gt; &lt;span class="nb"&gt;enable&lt;/span&gt;
&lt;span class="c"&gt;# Port 4096 is NOT opened — all agent traffic goes through the tunnel&lt;/span&gt;

&lt;span class="c"&gt;# Brute force protection&lt;/span&gt;
apt &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; fail2ban
systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;fail2ban

&lt;span class="c"&gt;# Kernel hardening&lt;/span&gt;
&lt;span class="nb"&gt;cat&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; /etc/sysctl.d/99-hardening.conf &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="no"&gt;EOF&lt;/span&gt;&lt;span class="sh"&gt;'
net.ipv4.tcp_syncookies = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.conf.all.accept_redirects = 0
kernel.randomize_va_space = 2
net.ipv4.conf.all.log_martians = 1
&lt;/span&gt;&lt;span class="no"&gt;EOF
&lt;/span&gt;sysctl &lt;span class="nt"&gt;--system&lt;/span&gt;

&lt;span class="c"&gt;# Automatic security updates&lt;/span&gt;
apt &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; unattended-upgrades
dpkg-reconfigure &lt;span class="nt"&gt;-plow&lt;/span&gt; unattended-upgrades
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Control&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;UFW (default deny)&lt;/td&gt;
&lt;td&gt;Blocks all inbound traffic except SSH&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;fail2ban&lt;/td&gt;
&lt;td&gt;Bans IPs after repeated failed SSH attempts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SYN cookies&lt;/td&gt;
&lt;td&gt;Prevents SYN flood denial of service&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reverse path filtering&lt;/td&gt;
&lt;td&gt;Prevents IP spoofing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ICMP broadcast ignore&lt;/td&gt;
&lt;td&gt;Prevents Smurf amplification attacks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Redirect rejection&lt;/td&gt;
&lt;td&gt;Prevents ICMP redirect hijacking&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ASLR (full)&lt;/td&gt;
&lt;td&gt;Randomizes memory addresses to defeat buffer overflow exploits&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Martian logging&lt;/td&gt;
&lt;td&gt;Logs packets with impossible source addresses&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Unattended upgrades&lt;/td&gt;
&lt;td&gt;Automatically applies security patches&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;For Mac Mini / macOS:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;macOS does not need the same kernel hardening (it ships with ASLR, SIP, and Gatekeeper enabled). The priorities are different:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Enable the macOS firewall&lt;/span&gt;
&lt;span class="nb"&gt;sudo&lt;/span&gt; /usr/libexec/ApplicationFirewall/socketfilterfw &lt;span class="nt"&gt;--setglobalstate&lt;/span&gt; on

&lt;span class="c"&gt;# Block all incoming connections (allow only essential services)&lt;/span&gt;
&lt;span class="nb"&gt;sudo&lt;/span&gt; /usr/libexec/ApplicationFirewall/socketfilterfw &lt;span class="nt"&gt;--setblockall&lt;/span&gt; on

&lt;span class="c"&gt;# Enable stealth mode (don't respond to pings or port scans)&lt;/span&gt;
&lt;span class="nb"&gt;sudo&lt;/span&gt; /usr/libexec/ApplicationFirewall/socketfilterfw &lt;span class="nt"&gt;--setstealthmode&lt;/span&gt; on

&lt;span class="c"&gt;# Verify settings&lt;/span&gt;
&lt;span class="nb"&gt;sudo&lt;/span&gt; /usr/libexec/ApplicationFirewall/socketfilterfw &lt;span class="nt"&gt;--getglobalstate&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Additional macOS-specific hardening:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Disable Remote Login (SSH) if you don't need it&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemsetup &lt;span class="nt"&gt;-setremotelogin&lt;/span&gt; off

&lt;span class="c"&gt;# Disable Remote Management&lt;/span&gt;
&lt;span class="nb"&gt;sudo&lt;/span&gt; /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-deactivate&lt;/span&gt; &lt;span class="nt"&gt;-configure&lt;/span&gt; &lt;span class="nt"&gt;-access&lt;/span&gt; &lt;span class="nt"&gt;-off&lt;/span&gt;

&lt;span class="c"&gt;# Enable FileVault (full disk encryption) — critical if the machine is physically accessible&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;fdesetup &lt;span class="nb"&gt;enable&lt;/span&gt;

&lt;span class="c"&gt;# Automatic updates&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;softwareupdate &lt;span class="nt"&gt;--schedule&lt;/span&gt; on
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Control&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;macOS Firewall (block all)&lt;/td&gt;
&lt;td&gt;Blocks all incoming connections&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Stealth mode&lt;/td&gt;
&lt;td&gt;Makes the machine invisible to network scans&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;FileVault&lt;/td&gt;
&lt;td&gt;Encrypts the entire disk — protects if the machine is stolen&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Remote Login off&lt;/td&gt;
&lt;td&gt;Disables SSH access if not needed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Automatic updates&lt;/td&gt;
&lt;td&gt;Applies security patches as they ship&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Post-deployment:&lt;/strong&gt; Disable SSH password authentication on both VPS and macOS. Use key-only access:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Linux&lt;/span&gt;
&lt;span class="nb"&gt;sed&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="s1"&gt;'s/^PermitRootLogin yes/PermitRootLogin prohibit-password/'&lt;/span&gt; /etc/ssh/sshd_config
systemctl restart sshd

&lt;span class="c"&gt;# macOS (if SSH is enabled)&lt;/span&gt;
&lt;span class="nb"&gt;sudo sed&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt; &lt;span class="s1"&gt;'s/^#PasswordAuthentication yes/PasswordAuthentication no/'&lt;/span&gt; /etc/ssh/sshd_config
&lt;span class="nb"&gt;sudo &lt;/span&gt;launchctl stop com.openssh.sshd &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;launchctl start com.openssh.sshd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Layer 5: Scoped permissions — limit what each agent can do
&lt;/h3&gt;

&lt;p&gt;This layer is the one that defends against CVE-2026-22813 and supply chain attacks — the threats that bypass all network-level protection. It applies equally to VPS deployments and Mac Mini setups.&lt;/p&gt;

&lt;p&gt;MCP servers — now governed by the Linux Foundation with backing from Anthropic, OpenAI, Google, Microsoft, AWS, and Cloudflare — provide a standardized interface between AI agents and external tools. The critical security feature of MCP is that each server connection can be independently scoped:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Read-only agents&lt;/strong&gt; receive MCP connections with &lt;code&gt;write: false&lt;/code&gt; — they can analyze code, run audits, and report findings, but cannot modify files&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scoped write agents&lt;/strong&gt; receive MCP connections limited to specific operations — a deployment agent can interact with Cloudflare Workers but cannot modify DNS records outside its configured zone&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No-shell agents&lt;/strong&gt; receive MCP connections with &lt;code&gt;bash: false&lt;/code&gt; — they cannot execute arbitrary commands regardless of what the LLM requests
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Example: read-only security auditor&lt;/span&gt;
&lt;span class="na"&gt;agent&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;security-reviewer&lt;/span&gt;
  &lt;span class="na"&gt;tools&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;write&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
    &lt;span class="na"&gt;edit&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
    &lt;span class="na"&gt;bash&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
  &lt;span class="na"&gt;mcp&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;cloudflare-docs&lt;/span&gt;    &lt;span class="c1"&gt;# Can read documentation&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;github&lt;/span&gt;             &lt;span class="c1"&gt;# Can read repositories&lt;/span&gt;
    &lt;span class="c1"&gt;# Cannot: deploy, modify, execute&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is not behavioral guardrailing. The agent cannot prompt its way past these restrictions. The MCP server simply does not expose write operations to agents configured as read-only. The permission boundary is enforced at the infrastructure layer, not the prompt layer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For Mac Mini owners specifically:&lt;/strong&gt; This layer is your primary defense against supply chain attacks. A malicious package installed by the agent can execute code with the agent's permissions. If the agent has unrestricted filesystem and shell access, the package has unrestricted filesystem and shell access. Scoped MCP permissions mean that even if the agent is tricked into installing a malicious package, the damage is bounded by the agent's configured permission set — not by the user's full system access.&lt;/p&gt;




&lt;h2&gt;
  
  
  What you should do today
&lt;/h2&gt;

&lt;h3&gt;
  
  
  If you run an agent on a VPS
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Check exposure now.&lt;/strong&gt; Run &lt;code&gt;ss -tlnp | grep 4096&lt;/code&gt; — if the port is listening, check if it's reachable from outside. Search Censys or Shodan for your server's IP.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Block the port.&lt;/strong&gt; &lt;code&gt;ufw deny 4096&lt;/code&gt; — the single fastest remediation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Set up a tunnel.&lt;/strong&gt; Cloudflare Tunnel is free. Remove the port from the internet entirely.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Harden the host.&lt;/strong&gt; Apply kernel parameters, enable fail2ban, enable automatic updates.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scope your agents.&lt;/strong&gt; Restrict MCP permissions. Audit agents should be read-only.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  If you run an agent on a Mac Mini or local machine
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Check the bind address now.&lt;/strong&gt; Run &lt;code&gt;lsof -i :4096&lt;/code&gt; — if it shows &lt;code&gt;*:4096&lt;/code&gt;, your agent is exposed to your entire network.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Force localhost binding.&lt;/strong&gt; Restart the agent with &lt;code&gt;--host 127.0.0.1&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enable the macOS firewall.&lt;/strong&gt; Block all incoming. Enable stealth mode.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use SSH tunneling for remote access.&lt;/strong&gt; Never expose the agent's port on the network directly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enable FileVault.&lt;/strong&gt; If someone can physically access the Mac Mini, they should not be able to read the disk.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scope the agent's permissions.&lt;/strong&gt; This is your defense against malicious packages and prompt injection. Read-only agents for auditing, scoped agents for deployment.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  This month (both platforms)
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Monitor for compromise.&lt;/strong&gt; Check for unauthorized SSH keys in &lt;code&gt;~/.ssh/authorized_keys&lt;/code&gt;. Check for unexpected cron jobs (VPS) or Launch Agents (macOS). Review outbound network connections for unfamiliar destinations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Audit installed packages.&lt;/strong&gt; Review what the agent has installed. Check for packages you did not explicitly request.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Review environment variables.&lt;/strong&gt; If API keys, database credentials, or tokens are in your shell environment, the agent (and any malicious code it executes) has access to all of them. Use a secrets manager or scoped &lt;code&gt;.env&lt;/code&gt; files instead of global exports.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Let your agent fix this for you
&lt;/h2&gt;

&lt;p&gt;You just read 4,000 words of vulnerability analysis and remediation steps. Your AI coding agent — the one this article is about — can execute every one of them.&lt;/p&gt;

&lt;p&gt;Copy the block below. Paste it into your agent's chat. Say: &lt;strong&gt;"Do this."&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The agent will read the manifest, execute each step in order, stop when a condition isn't met, and ask you for credentials only when it needs them. It will not guess. It will not skip.&lt;/p&gt;

&lt;p&gt;This is how security advisories should work in 2026. Not "read this and figure it out" — but "read this and execute."&lt;/p&gt;




&lt;h3&gt;
  
  
  Agent-Executable Remediation: CVE-2026-22812 / CVE-2026-22813
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;## Agent-Executable Remediation Manifest&lt;/span&gt;
&lt;span class="gu"&gt;## CVE-2026-22812 (CVSS 8.8) + CVE-2026-22813 (CVSS 9.6)&lt;/span&gt;
&lt;span class="gu"&gt;## Source: Hodge Luke Digital Intelligence Agency&lt;/span&gt;
&lt;span class="gu"&gt;## Target: Any VPS or macOS machine running an AI coding agent&lt;/span&gt;

&lt;span class="gu"&gt;### INSTRUCTIONS FOR AGENT&lt;/span&gt;
Execute each step sequentially. Do not skip steps.
STOP_IF conditions halt execution — explain why to the user and await instructions.
ASK_USER directives require user input before proceeding — do not guess values.
All commands must be run with appropriate privileges (sudo where indicated).
Report the result of each step before moving to the next.
&lt;span class="p"&gt;
---
&lt;/span&gt;
&lt;span class="gu"&gt;### Step 0: Detect platform&lt;/span&gt;
Run: uname -s
IF output contains "Darwin" → SET PLATFORM=macos
IF output contains "Linux" → SET PLATFORM=linux
REPORT: "Detected platform: [PLATFORM]"
&lt;span class="p"&gt;
---
&lt;/span&gt;
&lt;span class="gu"&gt;### Step 1: Check if an agent HTTP server is running&lt;/span&gt;
IF PLATFORM=linux:
  Run: ss -tlnp | grep -E ':(4096|3000|8080|8888) '
IF PLATFORM=macos:
  Run: lsof -i -P | grep -E ':(4096|3000|8080|8888) .&lt;span class="err"&gt;*&lt;/span&gt;(LISTEN)'

STOP_IF: No output (no agent server detected — this machine may not be affected)
REPORT: "Found agent server listening on: [port and address]"

IF output shows 0.0.0.0 or &lt;span class="err"&gt;*&lt;/span&gt;: → REPORT: "WARNING: Agent is bound to all
interfaces — exposed to the network. Proceeding with remediation."
IF output shows 127.0.0.1 only → REPORT: "Agent is bound to localhost only.
Network exposure is limited. Continuing with hardening steps."
&lt;span class="p"&gt;
---
&lt;/span&gt;
&lt;span class="gu"&gt;### Step 2: Block the port immediately&lt;/span&gt;
IF PLATFORM=linux:
  Run: sudo ufw status
  IF ufw is inactive:
    Run: sudo ufw default deny incoming
    Run: sudo ufw default allow outgoing
    Run: sudo ufw allow ssh
    Run: sudo ufw --force enable
  Run: sudo ufw deny [detected port from Step 1]
  Run: sudo ufw reload
  REPORT: "Firewall enabled. Port [port] blocked."

IF PLATFORM=macos:
  Run: sudo /usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate
  IF firewall is disabled:
    Run: sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on
  Run: sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setblockall on
  Run: sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setstealthmode on
  REPORT: "macOS firewall enabled. All incoming blocked. Stealth mode on."
&lt;span class="p"&gt;
---
&lt;/span&gt;
&lt;span class="gu"&gt;### Step 3: Force localhost binding&lt;/span&gt;
IF PLATFORM=linux:
  Check if agent is managed by systemd:
    Run: systemctl list-units --type=service | grep -i -E 'opencode|claw'
  IF found:
    REPORT: "Agent is running as systemd service: [service name]"
    ASK_USER: "Should I modify the service to bind to 127.0.0.1 only? (yes/no)"
    IF yes:
      Run: sudo mkdir -p /etc/systemd/system/[service].d
      Write override.conf with Environment="HOST=127.0.0.1"
      Run: sudo systemctl daemon-reload
      Run: sudo systemctl restart [service]

IF PLATFORM=macos:
  REPORT: "On macOS, restart your agent with: --host 127.0.0.1"
  REPORT: "Example: opencode serve --host 127.0.0.1"
  ASK_USER: "What is the command you use to start your agent? I will provide
  the modified command with localhost binding."
&lt;span class="p"&gt;
---
&lt;/span&gt;
&lt;span class="gu"&gt;### Step 4: Install Cloudflare Tunnel (optional but recommended)&lt;/span&gt;
ASK_USER: "Do you want to set up a Cloudflare Tunnel for secure remote
access? This requires a Cloudflare account. (yes/no)"

STOP_IF: User says no (skip to Step 5)

ASK_USER: "Please provide your Cloudflare API token with Zone:DNS:Edit and
Account:Cloudflare Tunnel:Edit permissions."
ASK_USER: "What domain do you want to use for accessing the agent?
(e.g., agent.yourdomain.com)"

IF PLATFORM=linux:
  Run: curl -fsSL https://pkg.cloudflare.com/cloudflare-main.gpg &lt;span class="err"&gt;\&lt;/span&gt;
    | sudo gpg --dearmor -o /usr/share/keyrings/cloudflare.gpg
  Run: echo "deb [signed-by=/usr/share/keyrings/cloudflare.gpg] &lt;span class="err"&gt;\&lt;/span&gt;
    https://pkg.cloudflare.com/cloudflared $(lsb_release -cs) main" &lt;span class="err"&gt;\&lt;/span&gt;
    | sudo tee /etc/apt/sources.list.d/cloudflared.list
  Run: sudo apt update &amp;amp;&amp;amp; sudo apt install -y cloudflared

IF PLATFORM=macos:
  Run: brew install cloudflare/cloudflare/cloudflared

Run: cloudflared tunnel login
Run: cloudflared tunnel create agent-tunnel
Write config.yml:
  tunnel: [tunnel-id]
  credentials-file: /root/.cloudflared/[tunnel-id].json
  ingress:
&lt;span class="p"&gt;    -&lt;/span&gt; hostname: [user-provided domain]
      service: http://localhost:[detected port]
&lt;span class="p"&gt;    -&lt;/span&gt; service: http_status:404
Run: cloudflared tunnel route dns agent-tunnel [user-provided domain]
Run: cloudflared tunnel run agent-tunnel

REPORT: "Tunnel created. Agent accessible at https://[domain].
No inbound ports required."
&lt;span class="p"&gt;
---
&lt;/span&gt;
&lt;span class="gu"&gt;### Step 5: Harden the host&lt;/span&gt;
IF PLATFORM=linux:
  Run: sudo apt install -y fail2ban
  Run: sudo systemctl enable fail2ban

  Write /etc/sysctl.d/99-agent-hardening.conf:
    net.ipv4.tcp_syncookies = 1
    net.ipv4.conf.all.rp_filter = 1
    net.ipv4.icmp_echo_ignore_broadcasts = 1
    net.ipv4.conf.all.accept_redirects = 0
    kernel.randomize_va_space = 2
    net.ipv4.conf.all.log_martians = 1
  Run: sudo sysctl --system

  Run: sudo apt install -y unattended-upgrades
  Run: sudo dpkg-reconfigure -plow unattended-upgrades

  REPORT: "Host hardened: fail2ban active, kernel parameters set,
  automatic security updates enabled."

IF PLATFORM=macos:
  Run: sudo fdesetup status
  IF FileVault is off:
    REPORT: "FileVault (disk encryption) is disabled."
    ASK_USER: "Enable FileVault? This encrypts your entire disk.
    Requires restart. (yes/no)"
    IF yes: Run: sudo fdesetup enable

  Run: sudo softwareupdate --schedule on
  REPORT: "macOS hardened: firewall active, stealth mode on,
  automatic updates enabled."
&lt;span class="p"&gt;
---
&lt;/span&gt;
&lt;span class="gu"&gt;### Step 6: Disable SSH password authentication&lt;/span&gt;
IF PLATFORM=linux:
  Run: grep -E '^PasswordAuthentication' /etc/ssh/sshd_config
  IF set to yes:
    Run: sudo sed -i 's/^PasswordAuthentication yes/PasswordAuthentication no/' &lt;span class="err"&gt;\&lt;/span&gt;
      /etc/ssh/sshd_config
    Run: sudo systemctl restart sshd
    REPORT: "SSH password authentication disabled. Key-only access."

IF PLATFORM=macos:
  Run: sudo systemsetup -getremotelogin
  IF Remote Login is on:
    ASK_USER: "SSH is enabled. Do you need remote SSH access to this
    machine? (yes/no)"
    IF no:
      Run: sudo systemsetup -setremotelogin off
      REPORT: "SSH disabled entirely."
    IF yes:
      Run: sudo sed -i '' 's/^#PasswordAuthentication yes/PasswordAuthentication no/' &lt;span class="err"&gt;\&lt;/span&gt;
        /etc/ssh/sshd_config
      Run: sudo launchctl stop com.openssh.sshd
      Run: sudo launchctl start com.openssh.sshd
      REPORT: "SSH password authentication disabled. Key-only access."
&lt;span class="p"&gt;
---
&lt;/span&gt;
&lt;span class="gu"&gt;### Step 7: Verify remediation&lt;/span&gt;
IF PLATFORM=linux:
  Run: ss -tlnp | grep -E ':(4096|3000|8080|8888) '
  Run: sudo ufw status verbose
  Run: systemctl is-active fail2ban

IF PLATFORM=macos:
  Run: lsof -i -P | grep -E ':(4096|3000|8080|8888) .&lt;span class="err"&gt;*&lt;/span&gt;(LISTEN)'
  Run: sudo /usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate
  Run: sudo fdesetup status

REPORT: "Remediation complete. Summary:"
REPORT: "- Agent bind address: [current binding]"
REPORT: "- Firewall: [status]"
REPORT: "- SSH hardening: [status]"
REPORT: "- Host hardening: [status]"
REPORT: "- Tunnel: [configured/not configured]"
REPORT: "- Disk encryption: [status, macOS only]"
&lt;span class="p"&gt;
---
&lt;/span&gt;
&lt;span class="gu"&gt;### What this manifest does NOT cover (requires manual review)&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Layer 2 (Zero Trust Access): Requires Cloudflare dashboard configuration
  for identity provider integration. See the full article for policy setup.
&lt;span class="p"&gt;-&lt;/span&gt; Layer 5 (MCP permission scoping): Requires agent-specific configuration
  based on your tool chain. See the full article for examples.
&lt;span class="p"&gt;-&lt;/span&gt; Supply chain audit: Review installed packages manually.
  Run: pip list / npm list -g / cargo install --list
&lt;span class="p"&gt;-&lt;/span&gt; Credential rotation: If your agent was exposed, assume all environment
  variables, SSH keys, and API tokens accessible to the agent process are
  compromised. Rotate them.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the first security advisory we've published with an agent-executable remediation manifest. We believe every security disclosure that tells developers what to do should let their tools do it for them. We'll be publishing these with every advisory going forward.&lt;/p&gt;




&lt;h2&gt;
  
  
  The architecture we built
&lt;/h2&gt;

&lt;p&gt;We built &lt;a href="https://forge.useacceda.com" rel="noopener noreferrer"&gt;FORGE&lt;/a&gt; because we were setting up AI coding agent infrastructure for clients and kept solving the same security problems from scratch — every time. Cloudflare Tunnel configuration. Zero Trust access policies. WebSocket cookie conflicts. Kernel hardening. MCP server scoping. The same 1,000 lines of battle-tested &lt;code&gt;bash&lt;/code&gt; with rollback on failure.&lt;/p&gt;

&lt;p&gt;FORGE implements all five layers described in this article as a single deployment script. One command. Under 10 minutes. The agent runs on your VPS, behind your tunnel, gated by your identity, hardened to CIS baselines, with MCP servers pre-configured and scoped.&lt;/p&gt;

&lt;p&gt;It is not a hosted service. You own the server. You own the code. You own the infrastructure. The $47 Developer Edition buys the architecture, security model, and deployment automation. Your VPS costs about $7/month. There is no recurring fee to us.&lt;/p&gt;

&lt;p&gt;We built it because the gap between "start the server" and "run the server securely" should not require 1,000 lines of infrastructure automation that every developer has to figure out from scratch. FORGE closes that gap.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Product:&lt;/strong&gt; &lt;a href="https://forge.useacceda.com" rel="noopener noreferrer"&gt;forge.useacceda.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Full comparison (8 platforms):&lt;/strong&gt; &lt;a href="https://forge.useacceda.com/compare/" rel="noopener noreferrer"&gt;forge.useacceda.com/compare&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security architecture:&lt;/strong&gt; &lt;a href="https://forge.useacceda.com/docs/" rel="noopener noreferrer"&gt;SECURITY.md&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Purchase:&lt;/strong&gt; &lt;a href="https://hodgeluke.gumroad.com/l/forge" rel="noopener noreferrer"&gt;hodgeluke.gumroad.com/l/forge&lt;/a&gt; — $47, one-time&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2026-22812.&lt;/strong&gt; National Vulnerability Database (NVD/NIST). CVSS 8.8. Unauthenticated remote code execution in OpenCode HTTP server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2026-22813.&lt;/strong&gt; National Vulnerability Database (NVD/NIST). CVSS 9.6. Cross-site scripting to remote code execution via unsanitized LLM output in OpenClaw web UI.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;220,000+ exposed instances.&lt;/strong&gt; Cumulative findings from Censys, Bitsight, Bitdefender, and Penligent internet-wide scans, January–March 2026.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;15,200 confirmed RCE-vulnerable instances.&lt;/strong&gt; Penligent research report, Q1 2026.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;53,300 instances correlated with breach activity.&lt;/strong&gt; SecurityScorecard STRIKE team analysis, Q1 2026.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;1,184 malicious ClawHub packages.&lt;/strong&gt; CyberDesserts supply chain analysis, February 2026.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;1.5 million leaked API tokens and 35,000 email addresses.&lt;/strong&gt; Infosecurity Magazine report on Supabase breach affecting AI agent deployments, March 2026.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI agent market $7.8–10.9B (2026), projected $52B by 2030.&lt;/strong&gt; Industry composite estimates (Gartner, McKinsey, CB Insights).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;92% of US developers use AI coding tools daily.&lt;/strong&gt; GitHub developer survey, 2026.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;41% of all code is AI-generated.&lt;/strong&gt; Google internal metrics, reported Q1 2026.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;24.7% of AI-generated code contains security flaws.&lt;/strong&gt; Snyk Code analysis, 2025–2026.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MCP: 97 million monthly SDK downloads, 10,000+ servers.&lt;/strong&gt; Linux Foundation MCP governance announcement, March 2026.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Nate B. Jones, "5 Skills" framework.&lt;/strong&gt; AI News &amp;amp; Strategy Daily, published March 16, 2026. Framework for AI agent management: prompting, context management, iteration, evaluation, deployment.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;NVIDIA NemoClaw.&lt;/strong&gt; GTC 2026 announcement, NVIDIA Newsroom. Enterprise security wrapper for OpenClaw.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Apple Mac Mini supply constraints.&lt;/strong&gt; M4 and M4 Pro configurations backordered across major retailers, Q1 2026. Developer community reports attribute demand to local AI agent hosting on Apple Silicon unified memory architecture.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  About the author
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Hodge Luke&lt;/strong&gt; is the founder of Hodge Luke Digital Intelligence Agency and the creator of FORGE — a security-hardened deployment platform for AI coding agents built on Cloudflare's edge network. FORGE implements the 5-layer defense-in-depth model described in this article as a one-command deployment.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Website: &lt;a href="https://forge.useacceda.com" rel="noopener noreferrer"&gt;forge.useacceda.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Security disclosures: &lt;a href="mailto:info@useacceda.com"&gt;info@useacceda.com&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Hodge Luke | Two Guys and some Bots | forge.useacceda.com&lt;/em&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>ai</category>
      <category>devops</category>
      <category>cloudflare</category>
    </item>
  </channel>
</rss>
