<?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: John Menerick</title>
    <description>The latest articles on DEV Community by John Menerick (@w8mej).</description>
    <link>https://dev.to/w8mej</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F554332%2Fab89e6c5-ba6c-416f-95f3-18f121b8e775.jpg</url>
      <title>DEV Community: John Menerick</title>
      <link>https://dev.to/w8mej</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/w8mej"/>
    <language>en</language>
    <item>
      <title>Why System Prompts Are Not Security Boundaries</title>
      <dc:creator>John Menerick</dc:creator>
      <pubDate>Thu, 03 Dec 2026 17:47:15 +0000</pubDate>
      <link>https://dev.to/w8mej/why-system-prompts-are-not-security-boundaries-2jeg</link>
      <guid>https://dev.to/w8mej/why-system-prompts-are-not-security-boundaries-2jeg</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Summary:&lt;/strong&gt; Prompt-level guardrails and regex classifiers cannot create a security boundary when untrusted repository data shares an OS user ID with shell tools. Isolating untrusted synthesis under a dedicated Darwin &lt;code&gt;POSIX UID&lt;/code&gt; with &lt;code&gt;sandbox_init&lt;/code&gt; and typed Mach IPC eliminates ambient authority at an &lt;code&gt;83us&lt;/code&gt; end-to-end &lt;code&gt;p99&lt;/code&gt; cost.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Every week, another developer tool ships a patch for an indirect prompt injection CVE by appending uppercase warnings to its system prompt or bolting a regex filter in front of &lt;code&gt;child_process.spawn&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;From a systems security standpoint, both mitigations are equivalent to placing a comment in C source code asking &lt;code&gt;strcpy&lt;/code&gt; not to overflow the stack.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;BROKEN: Single-Context / Ambient Authority (UID 501)
+---------------------------------------------------------------+
| [Poisoned README.md] + [System Prompt] -&amp;gt; [LLM] -&amp;gt; /bin/zsh   |
|  Has full ambient access to ~/.ssh, ~/.aws, Keychain, LAN     |
+---------------------------------------------------------------+

HEIMDALL: Dual-Model Kernel Separation (UID 502 &amp;lt;-&amp;gt; UID 501)
+-----------------------------+     Mach IPC    +---------------+
| Quarantined Worker (UID 502)| --------------&amp;gt; | Coordinator   |
| 0 FS handles | 0 Net sockets|  Typed Proposal | Cedar &amp;lt;= 45us |
+-----------------------------+                 +-------+-------+
                                                        |
                                                [SEP Touch ID]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The Confused Deputy Inside Your Terminal
&lt;/h2&gt;

&lt;p&gt;An LLM token stream is a single flat sequence of embeddings. Once untrusted bytes from a &lt;code&gt;git diff&lt;/code&gt;, stack trace, or fetched documentation page enter that context window, every downstream tool invocation becomes a textbook &lt;strong&gt;Confused Deputy&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Regex filters and secondary "judge" LLMs fail for two structural reasons:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Completeness Failure: Attackers encode instructions across line breaks, hex literals, commit metadata, or base64 test fixtures that the coding model decodes in-context after the input filter runs.&lt;/li&gt;
&lt;li&gt;Latency &amp;amp; Utility Tax: Secondary LLM classifiers add &lt;code&gt;150ms–400ms&lt;/code&gt; per turn while falsely flagging legitimate security patches or SQL migration scripts.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Kernel-Enforced Dual-Model Privilege Separation
&lt;/h2&gt;

&lt;p&gt;Heimdall-Enclave removes ambient authority from the model ingesting untrusted data:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Isolated Darwin UID (&lt;code&gt;502&lt;/code&gt;): The Quarantined Synthesizer drops privileges immediately at spawn and enters an immutable Darwin sandbox (&lt;code&gt;no-network&lt;/code&gt;, &lt;code&gt;no-file-read*&lt;/code&gt;, &lt;code&gt;no-process-exec&lt;/code&gt;). Even arbitrary native code execution inside the worker yields zero host credentials.&lt;/li&gt;
&lt;li&gt;Typed Mach Port IPC: Communication back to the Executive Coordinator (&lt;code&gt;UID 501&lt;/code&gt;) accepts strictly bounded Cap'n-style typed capability requests—never free-form bash pipelines.&lt;/li&gt;
&lt;li&gt;Deterministic Cedar Evaluation: Every proposed action is checked against machine-verified Cedar invariants (&lt;code&gt;p99 &amp;lt;= 45us&lt;/code&gt;) before issuing a scoped WASI 0.2 handle or triggering a Touch ID SEP sheet.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Limitations &amp;amp; Trade-Offs
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Explicit Capability Wiring: Tools can no longer rely on ambient &lt;code&gt;$PATH&lt;/code&gt; or &lt;code&gt;~/.config&lt;/code&gt; files; workflows require explicit directory/host capability grants.&lt;/li&gt;
&lt;li&gt;IPC Serialization Cost: Crossing the Mach IPC + Cedar boundary adds &lt;code&gt;~83us&lt;/code&gt; &lt;code&gt;p99&lt;/code&gt; overhead per tool call (negligible next to token generation, but measurable in tight &amp;gt;10k/sec micro-loops).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Verify Locally
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/w8mej/heimdall-enclave.git
&lt;span class="nb"&gt;cd&lt;/span&gt; heimdall-enclave &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; cargo &lt;span class="nb"&gt;test&lt;/span&gt; -p heimdall-ipc --release
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>security</category>
      <category>rust</category>
      <category>darwin</category>
      <category>appsec</category>
    </item>
    <item>
      <title>The Three Great Lies of Local AI on macOS</title>
      <dc:creator>John Menerick</dc:creator>
      <pubDate>Wed, 02 Dec 2026 15:30:45 +0000</pubDate>
      <link>https://dev.to/w8mej/the-three-great-lies-of-local-ai-on-macos-4if8</link>
      <guid>https://dev.to/w8mej/the-three-great-lies-of-local-ai-on-macos-4if8</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Summary:&lt;/strong&gt; Running local coding agents as unsandboxed Python or 1.8 GiB Electron processes exposes macOS developer endpoints to single-diff prompt injection. Heimdall-Enclave enforces Darwin POSIX UID separation, WASI 0.2 capabilities, Lean 4 verified Cedar policies ($p_{99} \le 45\mu\text{s}$), and Apple Secure Enclave Touch ID ceremonies within $\le 12.7\text{ MiB}$ RSS.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Enterprise engineering teams keep repeating the same local-AI deployment mistake on developer laptops.&lt;/p&gt;

&lt;p&gt;Every engineering leader nods sagely about "on-device AI," "local privacy," and "developer productivity." Organizations purchase pallets of $4,000 M-series Apple Silicon MacBooks—with 128 gigabytes of unified memory, hundreds of gigabytes per second of memory bandwidth, and 16-core Neural Engines—and promptly turn them into high-spec dumb terminals for cloud API endpoints.&lt;/p&gt;

&lt;p&gt;When teams do venture into running models locally, the result is an architectural disaster:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Monolithic Python processes running with the engineer's full user permissions.&lt;/li&gt;
&lt;li&gt;Electron shells consuming 1.8 GiB of resident memory before a single token is evaluated.&lt;/li&gt;
&lt;li&gt;Un-sandboxed child processes executing shell commands via local &lt;code&gt;stdio&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;"Security" enforced by prompt engineering: asking an untrusted probability distribution to pinky-swear it won't read &lt;code&gt;~/.ssh/id_ed25519&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Today, we are releasing &lt;strong&gt;Heimdall-Enclave&lt;/strong&gt; (&lt;code&gt;v1.0-alpha&lt;/code&gt;).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+-----------------------------------------------------------------------+
|                         DARWIN HOST KERNEL                            |
|                                                                       |
|  +-------------------------+             +-------------------------+  |
|  |  Quarantined Worker     |             |  Executive Coordinator  |  |
|  |  (Untrusted Synthesizer)|             |  (Trusted Orchestrator) |  |
|  |  POSIX UID: 502 (Sandboxed)           |  POSIX UID: 501 (Host)  |  |
|  +------------+------------+             +------------+------------+  |
|               |                                       |               |
|               +----------&amp;gt; [ Mach IPC Pipe ] &amp;lt;--------+               |
|                                   |                                   |
|                      +------------v------------+                      |
|                      |  Cedar Policy Engine    |                      |
|                      |  (Lean 4: 94 Modules)   |                      |
|                      |  Eval: p99 &amp;lt;= 45us      |                      |
|                      +------------+------------+                      |
|                                   |                                   |
+-----------------------------------|-----------------------------------+
                                    |
                 +------------------v------------------+
                 |     Apple Secure Enclave (SEP)      |
                 |     Biometric Touch ID Ceremony     |
                 |     RFC 9449 DPoP Hardware Proof    |
                 +-------------------------------------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Lie 1: "Prompt Injection Can Be Mitigated at the Prompt Level"
&lt;/h3&gt;

&lt;p&gt;If untrusted input (a git commit diff, an issue summary, a web page) shares a context window with tools capable of filesystem mutation or network egress, your system is already breached. No amount of RLHF, Constitutional AI, or system-prompt scolding alters the underlying reality: LLMs cannot deterministically distinguish instructions from data.&lt;/p&gt;

&lt;p&gt;Heimdall-Enclave enforces hard privilege boundaries at the OS level:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;Quarantined Synthesizer&lt;/strong&gt; runs as an isolated POSIX UID (&lt;code&gt;502&lt;/code&gt;) inside an immutable Darwin sandbox. It can ingest untrusted tokens, summarize code, and propose diffs. It has zero network access and zero filesystem handles.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;Executive Coordinator&lt;/strong&gt; inspects proposed actions against an embedded Cedar policy engine.&lt;/li&gt;
&lt;li&gt;Every capability is governed by unforgeable WASI 0.2 handles.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Lie 2: "Hardware Custody Requires Datacenter HSMs"
&lt;/h3&gt;

&lt;p&gt;Enterprise compliance teams often claim that zero-trust key custody can only happen inside datacenter HSMs or cloud key vaults.&lt;/p&gt;

&lt;p&gt;Apple Silicon already contains a dedicated hardware cryptographic coprocessor: the Apple Secure Enclave Processor (SEP). Heimdall-Enclave anchors all authorization tokens in hardware-bound RFC 9449 DPoP keys. When a privileged action is requested, the system invokes &lt;code&gt;CoreAuthUI&lt;/code&gt; for a hardware Touch ID ceremony. The plaintext model output is decrypted directly on the secure display layer: it never touches an unencrypted log file or standard output.&lt;/p&gt;

&lt;h3&gt;
  
  
  Lie 3: "Local AI Requires a 2GB Runtime Tax"
&lt;/h3&gt;

&lt;p&gt;The prevailing dogma says running AI requires Docker Desktop, virtual machines, or heavyweight Python environments.&lt;/p&gt;

&lt;p&gt;Heimdall-Enclave is written in native Rust and MLX C++. The entire background daemon operates with a hard RSS memory ceiling of $\le 12.7\text{ MiB}$ (&lt;code&gt;MallocLargeCache=0&lt;/code&gt;). It offloads security canaries to the Apple Neural Engine at 0 GPU load, achieving $P_{99} &amp;lt; 15\text{ms}$ inference dispatch overhead.&lt;/p&gt;

&lt;h3&gt;
  
  
  Operational Trade-Offs &amp;amp; Where Not To Deploy This
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Hardware Scope: Heimdall-Enclave targets Apple Silicon (&lt;code&gt;arm64&lt;/code&gt; M1–M5+) with SEP and Unified Memory; x86_64 Linux developer workstations require a separate TPM2/Landlock backend.&lt;/li&gt;
&lt;li&gt;Interactive Latency: Destructive actions intentionally block on human physical Touch ID presence (~450ms biometric roundtrip), so unattended CI pipelines must use pre-scoped non-interactive Biscuit attenuation tokens.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Reproduce the Benchmarks &amp;amp; Verify Proofs Locally
&lt;/h3&gt;

&lt;p&gt;We mechanized our safety invariants in Lean 4 across 94 formal modules and 1,036 theorems with zero axioms or &lt;code&gt;sorry&lt;/code&gt;. Inspect the proofs and run the enclave daemon locally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/w8mej/heimdall-enclave.git
&lt;span class="nb"&gt;cd&lt;/span&gt; heimdall-enclave &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; ./scripts/l1-alpha-smoke.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>rust</category>
      <category>macos</category>
      <category>security</category>
      <category>applesilicon</category>
    </item>
    <item>
      <title>keyoxide</title>
      <dc:creator>John Menerick</dc:creator>
      <pubDate>Tue, 05 Jan 2021 22:32:17 +0000</pubDate>
      <link>https://dev.to/w8mej/keyoxide-1ojp</link>
      <guid>https://dev.to/w8mej/keyoxide-1ojp</guid>
      <description>&lt;p&gt;openpgp4fpr:31e4a5aba427601eaf2abce046436f938667d7f6&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
