<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[W8MEJ Thoughts]]></title><description><![CDATA[W8MEJ Thoughts]]></description><link>https://w8mej.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sat, 05 Dec 2026 19:32:34 GMT</lastBuildDate><atom:link href="https://w8mej.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Running 5 Distinct Model Architectures in 128GB Unified Memory]]></title><description><![CDATA[Summary: Running local models inside macOS Linux VMs forfeits unified memory zero-copy addressing and ANE offload. Heimdall-Enclave maps five distinct…]]></description><link>https://w8mej.hashnode.dev/running-5-distinct-model-architectures-in-128gb-unified-memory</link><guid isPermaLink="true">https://w8mej.hashnode.dev/running-5-distinct-model-architectures-in-128gb-unified-memory</guid><category><![CDATA[AppleSilicon]]></category><dc:creator><![CDATA[social]]></dc:creator><pubDate>Fri, 04 Dec 2026 19:18:37 GMT</pubDate><content:encoded><![CDATA[<blockquote>
<p><strong>Summary:</strong> Running local models inside macOS Linux VMs forfeits unified memory zero-copy addressing and ANE offload. Heimdall-Enclave maps five distinct model architectures (<code>SmolLM2</code>, <code>RWKV-7</code>, <code>EAGLE-3</code>, <code>LLaDA-8B</code>, <code>V-JEPA 2</code>) directly into shared CPU/GPU/ANE physical pages while holding control-plane RSS under <code>12.7 MiB</code>.</p>
</blockquote>
<p>On a traditional x86 workstation, CPU DRAM and discrete GPU VRAM sit on opposite sides of a <code>32–64 GB/s</code> PCIe bus. Moving model weights or KV caches across that bus dominates cold-start and multi-model switching latency.</p>
<p>Apple Silicon (<code>M1–M5+</code>) eliminates that bus entirely: CPU cores, Metal GPU cores, and the 16-core Apple Neural Engine share up to <code>546 GB/s</code> of unified physical memory. Yet most developer tools throw that architectural advantage away by booting a Linux VM inside Virtualization.framework and running a single monolithic Ollama container.</p>
<pre><code class="language-text">+----------------------- UNIFIED PHYSICAL RAM (546 GB/s) -----------------------+
|  [SmolLM2 4-bit]  [RWKV-7 SSM]  [EAGLE-3 Head]  [LLaDA-8B]  [V-JEPA 2]       |
|        |               |              |              |           |            |
|        +---------------+--------------+--------------+-----------+            |
|                        Zero-Copy Read-Only mmap (VM_FLAGS_PURGABLE)           |
+------------------------+-----------------------------------+------------------+
                         | Metal Command Queue               | CoreML / ANE
              [UID 502 MLX C++ Worker]              [Canary &amp; Policy Offload]
</code></pre>
<h2>Matching Architecture to Workload Complexity</h2>
<p>Forcing one standard causal Transformer to handle every developer workflow wastes memory bandwidth:</p>
<ol>
<li>RWKV-7 (Linear-State SSM): Maintains repository-wide context in constant <code>O(1)</code> recurrent state memory rather than <code>O(N)</code> KV-cache growth during multi-hour coding sessions.</li>
<li>SmolLM2 + EAGLE-3 Speculative Decoding: Drafts multi-token trees verified in a single parallel Metal pass (<code>2.4x</code> throughput gain on M4 Max).</li>
<li>LLaDA-8B (Discrete Diffusion): Resolves bidirectional code edits and structural AST refactors where left-to-right causal generation struggles.</li>
<li>V-JEPA 2: Evaluates visual UI states and architecture diagrams in latent space without heavyweight pixel-token expansion.</li>
</ol>
<h2>Zero-Copy Arena Management (<code>&lt;= 12.7 MiB</code> Control Plane)</h2>
<p>Heimdall's Rust daemon opens verified safetensors shards read-only and maps page-aligned weight buffers directly into Metal (<code>newBufferWithBytesNoCopy</code>). Setting <code>MallocLargeCache=0</code> ensures transient heap allocations return immediately to Darwin's VM subsystem, holding daemon RSS at <code>&lt;= 12.7 MiB</code>.</p>
<h2>Limitations &amp; Hardware Floor</h2>
<ul>
<li>Memory Capacity: Co-residing all five 4-bit/8-bit model arenas simultaneously consumes <code>~38 GiB</code> of unified memory (recommended <code>64 GiB+</code> SKU); on <code>16 GiB</code> or <code>24 GiB</code> MacBooks, Heimdall evicts cold arenas via Darwin purgeable memory (<code>madvise(MADV_FREE)</code>), incurring a <code>~420ms</code> NVMe warm-up on model switch.</li>
</ul>
<h2>Reproduce Benchmark</h2>
<pre><code class="language-bash">git clone https://github.com/w8mej/heimdall-enclave.git
cd heimdall-enclave &amp;&amp; ./scripts/bench-unified-arenas.sh
</code></pre>
]]></content:encoded></item><item><title><![CDATA[Why System Prompts Are Not Security Boundaries]]></title><description><![CDATA[Summary: Prompt-level guardrails and regex classifiers cannot create a security boundary when untrusted repository data shares an OS user ID with shell…]]></description><link>https://w8mej.hashnode.dev/why-system-prompts-are-not-security-boundaries</link><guid isPermaLink="true">https://w8mej.hashnode.dev/why-system-prompts-are-not-security-boundaries</guid><category><![CDATA[appsec]]></category><dc:creator><![CDATA[social]]></dc:creator><pubDate>Thu, 03 Dec 2026 17:47:42 GMT</pubDate><content:encoded><![CDATA[<blockquote>
<p><strong>Summary:</strong> 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 <code>POSIX UID</code> with <code>sandbox_init</code> and typed Mach IPC eliminates ambient authority at an <code>83us</code> end-to-end <code>p99</code> cost.</p>
</blockquote>
<p>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 <code>child_process.spawn</code>.</p>
<p>From a systems security standpoint, both mitigations are equivalent to placing a comment in C source code asking <code>strcpy</code> not to overflow the stack.</p>
<pre><code class="language-text">BROKEN: Single-Context / Ambient Authority (UID 501)
+---------------------------------------------------------------+
| [Poisoned README.md] + [System Prompt] -&gt; [LLM] -&gt; /bin/zsh   |
|  Has full ambient access to ~/.ssh, ~/.aws, Keychain, LAN     |
+---------------------------------------------------------------+

HEIMDALL: Dual-Model Kernel Separation (UID 502 &lt;-&gt; UID 501)
+-----------------------------+     Mach IPC    +---------------+
| Quarantined Worker (UID 502)| --------------&gt; | Coordinator   |
| 0 FS handles | 0 Net sockets|  Typed Proposal | Cedar &lt;= 45us |
+-----------------------------+                 +-------+-------+
                                                        |
                                                [SEP Touch ID]
</code></pre>
<h2>The Confused Deputy Inside Your Terminal</h2>
<p>An LLM token stream is a single flat sequence of embeddings. Once untrusted bytes from a <code>git diff</code>, stack trace, or fetched documentation page enter that context window, every downstream tool invocation becomes a textbook <strong>Confused Deputy</strong>.</p>
<p>Regex filters and secondary "judge" LLMs fail for two structural reasons:</p>
<ol>
<li>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.</li>
<li>Latency &amp; Utility Tax: Secondary LLM classifiers add <code>150ms–400ms</code> per turn while falsely flagging legitimate security patches or SQL migration scripts.</li>
</ol>
<h2>Kernel-Enforced Dual-Model Privilege Separation</h2>
<p>Heimdall-Enclave removes ambient authority from the model ingesting untrusted data:</p>
<ul>
<li>Isolated Darwin UID (<code>502</code>): The Quarantined Synthesizer drops privileges immediately at spawn and enters an immutable Darwin sandbox (<code>no-network</code>, <code>no-file-read*</code>, <code>no-process-exec</code>). Even arbitrary native code execution inside the worker yields zero host credentials.</li>
<li>Typed Mach Port IPC: Communication back to the Executive Coordinator (<code>UID 501</code>) accepts strictly bounded Cap'n-style typed capability requests—never free-form bash pipelines.</li>
<li>Deterministic Cedar Evaluation: Every proposed action is checked against machine-verified Cedar invariants (<code>p99 &lt;= 45us</code>) before issuing a scoped WASI 0.2 handle or triggering a Touch ID SEP sheet.</li>
</ul>
<h2>Limitations &amp; Trade-Offs</h2>
<ul>
<li>Explicit Capability Wiring: Tools can no longer rely on ambient <code>$PATH</code> or <code>~/.config</code> files; workflows require explicit directory/host capability grants.</li>
<li>IPC Serialization Cost: Crossing the Mach IPC + Cedar boundary adds <code>~83us</code> <code>p99</code> overhead per tool call (negligible next to token generation, but measurable in tight &gt;10k/sec micro-loops).</li>
</ul>
<h2>Verify Locally</h2>
<pre><code class="language-bash">git clone https://github.com/w8mej/heimdall-enclave.git
cd heimdall-enclave &amp;&amp; cargo test -p heimdall-ipc --release
</code></pre>
]]></content:encoded></item><item><title><![CDATA[The Three Great Lies of Local AI on macOS]]></title><description><![CDATA[Summary: Running local coding agents as unsandboxed Python or 1.8 GiB Electron processes exposes macOS developer endpoints to single-diff prompt injection…]]></description><link>https://w8mej.hashnode.dev/the-three-great-lies-of-local-ai-on-macos</link><guid isPermaLink="true">https://w8mej.hashnode.dev/the-three-great-lies-of-local-ai-on-macos</guid><category><![CDATA[AppleSilicon]]></category><dc:creator><![CDATA[social]]></dc:creator><pubDate>Wed, 02 Dec 2026 16:49:01 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6b0a61d2fb27fd05b61ce698/45024640-9b22-40b4-9ede-8be6f287751d.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote>
<p><strong>Summary:</strong> 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.</p>
</blockquote>
<p>Enterprise engineering teams keep repeating the same local-AI deployment mistake on developer laptops.</p>
<p>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.</p>
<p>When teams do venture into running models locally, the result is an architectural disaster:</p>
<ol>
<li>Monolithic Python processes running with the engineer's full user permissions.</li>
<li>Electron shells consuming 1.8 GiB of resident memory before a single token is evaluated.</li>
<li>Un-sandboxed child processes executing shell commands via local <code>stdio</code>.</li>
<li>"Security" enforced by prompt engineering: asking an untrusted probability distribution to pinky-swear it won't read <code>~/.ssh/id_ed25519</code>.</li>
</ol>
<p>Today, we are releasing <strong>Heimdall-Enclave</strong> (<code>v1.0-alpha</code>).</p>
<pre><code class="language-text">+-----------------------------------------------------------------------+
|                         DARWIN HOST KERNEL                            |
|                                                                       |
|  +-------------------------+             +-------------------------+  |
|  |  Quarantined Worker     |             |  Executive Coordinator  |  |
|  |  (Untrusted Synthesizer)|             |  (Trusted Orchestrator) |  |
|  |  POSIX UID: 502 (Sandboxed)           |  POSIX UID: 501 (Host)  |  |
|  +------------+------------+             +------------+------------+  |
|               |                                       |               |
|               +----------&gt; [ Mach IPC Pipe ] &lt;--------+               |
|                                   |                                   |
|                      +------------v------------+                      |
|                      |  Cedar Policy Engine    |                      |
|                      |  (Lean 4: 94 Modules)   |                      |
|                      |  Eval: p99 &lt;= 45us      |                      |
|                      +------------+------------+                      |
|                                   |                                   |
+-----------------------------------|-----------------------------------+
                                    |
                 +------------------v------------------+
                 |     Apple Secure Enclave (SEP)      |
                 |     Biometric Touch ID Ceremony     |
                 |     RFC 9449 DPoP Hardware Proof    |
                 +-------------------------------------+
</code></pre>
<h3>Lie 1: "Prompt Injection Can Be Mitigated at the Prompt Level"</h3>
<p>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.</p>
<p>Heimdall-Enclave enforces hard privilege boundaries at the OS level:</p>
<ul>
<li>The <strong>Quarantined Synthesizer</strong> runs as an isolated POSIX UID (<code>502</code>) inside an immutable Darwin sandbox. It can ingest untrusted tokens, summarize code, and propose diffs. It has zero network access and zero filesystem handles.</li>
<li>The <strong>Executive Coordinator</strong> inspects proposed actions against an embedded Cedar policy engine.</li>
<li>Every capability is governed by unforgeable WASI 0.2 handles.</li>
</ul>
<h3>Lie 2: "Hardware Custody Requires Datacenter HSMs"</h3>
<p>Enterprise compliance teams often claim that zero-trust key custody can only happen inside datacenter HSMs or cloud key vaults.</p>
<p>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 <code>CoreAuthUI</code> 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.</p>
<h3>Lie 3: "Local AI Requires a 2GB Runtime Tax"</h3>
<p>The prevailing dogma says running AI requires Docker Desktop, virtual machines, or heavyweight Python environments.</p>
<p>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}\) (<code>MallocLargeCache=0</code>). It offloads security canaries to the Apple Neural Engine at 0 GPU load, achieving \(P_{99} &lt; 15\text{ms}\) inference dispatch overhead.</p>
<h3>Operational Trade-Offs &amp; Where Not To Deploy This</h3>
<ul>
<li>Hardware Scope: Heimdall-Enclave targets Apple Silicon (<code>arm64</code> M1–M5+) with SEP and Unified Memory; x86_64 Linux developer workstations require a separate TPM2/Landlock backend.</li>
<li>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.</li>
</ul>
<h3>Reproduce the Benchmarks &amp; Verify Proofs Locally</h3>
<p>We mechanized our safety invariants in Lean 4 across 94 formal modules and 1,036 theorems with zero axioms or <code>sorry</code>. Inspect the proofs and run the enclave daemon locally:</p>
<pre><code class="language-bash">git clone https://github.com/w8mej/heimdall-enclave.git
cd heimdall-enclave &amp;&amp; ./scripts/l1-alpha-smoke.sh
</code></pre>
]]></content:encoded></item><item><title><![CDATA[The Three Great Lies The Three Great Lies of Local AI on macOSof Local AI on macOS]]></title><description><![CDATA[Summary: Running local coding agents as unsandboxed Python or 1.8 GiB Electron processes exposes macOS developer endpoints to single-diff prompt injection…]]></description><link>https://w8mej.hashnode.dev/the-three-great-lies-the-three-great-lies-of-local-ai-on-macosof-local-ai-on-macos</link><guid isPermaLink="true">https://w8mej.hashnode.dev/the-three-great-lies-the-three-great-lies-of-local-ai-on-macosof-local-ai-on-macos</guid><category><![CDATA[macOS]]></category><dc:creator><![CDATA[social]]></dc:creator><pubDate>Wed, 02 Dec 2026 16:43:07 GMT</pubDate><content:encoded><![CDATA[<blockquote>
<p><strong>Summary:</strong> 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.</p>
</blockquote>
<h1>The Three Great Lies of Local AI on macOS</h1>
<p>Enterprise engineering teams keep repeating the same local-AI deployment mistake.</p>
<p>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 cl<strong>Summary:</strong> 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.</p>
<p>Enterprise engineering teams keep repeating the same local-AI deployment mistake on developer laptops.</p>
<p>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.</p>
<p>When teams do venture into running models locally, the result is an architectural disaster:</p>
<ol>
<li>Monolithic Python processes running with the engineer's full user permissions.</li>
<li>Electron shells consuming 1.8 GiB of resident memory before a single token is evaluated.</li>
<li>Un-sandboxed child processes executing shell commands via local <code>stdio</code>.</li>
<li>"Security" enforced by prompt engineering: asking an untrusted probability distribution to pinky-swear it won't read <code>~/.ssh/id_ed25519</code>.</li>
</ol>
<p>Today, we are releasing <strong>Heimdall-Enclave</strong> (<code>v1.0-alpha</code>).</p>
<pre><code class="language-text">+-----------------------------------------------------------------------+
|                         DARWIN HOST KERNEL                            |
|                                                                       |
|  +-------------------------+             +-------------------------+  |
|  |  Quarantined Worker     |             |  Executive Coordinator  |  |
|  |  (Untrusted Synthesizer)|             |  (Trusted Orchestrator) |  |
|  |  POSIX UID: 502 (Sandboxed)           |  POSIX UID: 501 (Host)  |  |
|  +------------+------------+             +------------+------------+  |
|               |                                       |               |
|               +----------&gt; [ Mach IPC Pipe ] &lt;--------+               |
|                                   |                                   |
|                      +------------v------------+                      |
|                      |  Cedar Policy Engine    |                      |
|                      |  (Lean 4: 94 Modules)   |                      |
|                      |  Eval: p99 &lt;= 45us      |                      |
|                      +------------+------------+                      |
|                                   |                                   |
+-----------------------------------|-----------------------------------+
                                    |
                 +------------------v------------------+
                 |     Apple Secure Enclave (SEP)      |
                 |     Biometric Touch ID Ceremony     |
                 |     RFC 9449 DPoP Hardware Proof    |
                 +-------------------------------------+
</code></pre>
<h3>Lie 1: "Prompt Injection Can Be Mitigated at the Prompt Level"</h3>
<p>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.</p>
<p>Heimdall-Enclave enforces hard privilege boundaries at the OS level:</p>
<ul>
<li>The <strong>Quarantined Synthesizer</strong> runs as an isolated POSIX UID (<code>502</code>) inside an immutable Darwin sandbox. It can ingest untrusted tokens, summarize code, and propose diffs. It has zero network access and zero filesystem handles.</li>
<li>The <strong>Executive Coordinator</strong> inspects proposed actions against an embedded Cedar policy engine.</li>
<li>Every capability is governed by unforgeable WASI 0.2 handles.</li>
</ul>
<h3>Lie 2: "Hardware Custody Requires Datacenter HSMs"</h3>
<p>Enterprise compliance teams often claim that zero-trust key custody can only happen inside datacenter HSMs or cloud key vaults.</p>
<p>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 <code>CoreAuthUI</code> 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.</p>
<h3>Lie 3: "Local AI Requires a 2GB Runtime Tax"</h3>
<p>The prevailing dogma says running AI requires Docker Desktop, virtual machines, or heavyweight Python environments.</p>
<p>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}\) (<code>MallocLargeCache=0</code>). It offloads security canaries to the Apple Neural Engine at 0 GPU load, achieving \(P_{99} &lt; 15\text{ms}\) inference dispatch overhead.</p>
<h3>Operational Trade-Offs &amp; Where Not To Deploy This</h3>
<ul>
<li>Hardware Scope: Heimdall-Enclave targets Apple Silicon (<code>arm64</code> M1–M5+) with SEP and Unified Memory; x86_64 Linux developer workstations require a separate TPM2/Landlock backend.</li>
<li>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.</li>
</ul>
<h3>Reproduce the Benchmarks &amp; Verify Proofs Locally</h3>
<p>We mechanized our safety invariants in Lean 4 across 94 formal modules and 1,036 theorems with zero axioms or <code>sorry</code>. Inspect the proofs and run the enclave daemon locally:</p>
<pre><code class="language-bash">git clone https://github.com/w8mej/heimdall-enclave.git
cd heimdall-enclave &amp;&amp; ./scripts/l1-alpha-smoke.sh
oud API endpoints.
</code></pre>
<p>When teams do venture into running models locally, the result is an architectural disaster:</p>
<ol>
<li>Monolithic Python processes running with the engineer's full user permissions.</li>
<li>Electron shells consuming 1.8 GiB of resident memory before a single token is evaluated.</li>
<li>Un-sandboxed child processes executing shell commands via local <code>stdio</code>.</li>
<li>"Security" enforced by prompt engineering: asking an untrusted probability distribution to pinky-swear it won't read <code>~/.ssh/id_ed25519</code>.</li>
</ol>
<p>Today, we are releasing <strong>Heimdall-Enclave</strong> (<code>v1.0-alpha</code>).</p>
<pre><code class="language-text">+-----------------------------------------------------------------------+
|                         DARWIN HOST KERNEL                            |
|                                                                       |
|  +-------------------------+             +-------------------------+  |
|  |  Quarantined Worker     |             |  Executive Coordinator  |  |
|  |  (Untrusted Synthesizer)|             |  (Trusted Orchestrator) |  |
|  |  POSIX UID: 502 (Sandboxed)           |  POSIX UID: 501 (Host)  |  |
|  +------------+------------+             +------------+------------+  |
|               |                                       |               |
|               +----------&gt; [ Mach IPC Pipe ] &lt;--------+               |
|                                   |                                   |
|                      +------------v------------+                      |
|                      |  Cedar Policy Engine    |                      |
|                      |  (Lean 4: 94 Modules)   |                      |
|                      |  Eval: p99 &lt;= 45us      |                      |
|                      +------------+------------+                      |
|                                   |                                   |
+-----------------------------------|-----------------------------------+
                                    |
                 +------------------v------------------+
                 |     Apple Secure Enclave (SEP)      |
                 |     Biometric Touch ID Ceremony     |
                 |     RFC 9449 DPoP Hardware Proof    |
                 +-------------------------------------+
</code></pre>
<h3>Lie 1: "Prompt Injection Can Be Mitigated at the Prompt Level"</h3>
<p>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.</p>
<p>Heimdall-Enclave enforces hard privilege boundaries at the OS level:</p>
<ul>
<li>The <strong>Quarantined Synthesizer</strong> runs as an isolated POSIX UID (<code>502</code>) inside an immutable Darwin sandbox. It can ingest untrusted tokens, summarize code, and propose diffs. It has zero network access and zero filesystem handles.</li>
<li>The <strong>Executive Coordinator</strong> inspects proposed actions against an embedded Cedar policy engine.</li>
<li>Every capability is governed by unforgeable WASI 0.2 handles.</li>
</ul>
<h3>Lie 2: "Hardware Custody Requires Datacenter HSMs"</h3>
<p>Enterprise compliance teams often claim that zero-trust key custody can only happen inside datacenter HSMs or cloud key vaults.</p>
<p>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 <code>CoreAuthUI</code> 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.</p>
<h3>Lie 3: "Local AI Requires a 2GB Runtime Tax"</h3>
<p>The prevailing dogma says running AI requires Docker Desktop, virtual machines, or heavyweight Python environments.</p>
<p>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}\) (<code>MallocLargeCache=0</code>). It offloads security canaries to the Apple Neural Engine at 0 GPU load, achieving \(P_{99} &lt; 15\text{ms}\) inference dispatch overhead.</p>
<h3>Operational Trade-Offs &amp; Where Not To Deploy This</h3>
<ul>
<li>Hardware Scope: Heimdall-Enclave targets Apple Silicon (<code>arm64</code> M1–M5+) with SEP and Unified Memory; x86_64 Linux developer workstations require a separate TPM2/Landlock backend.</li>
<li>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.</li>
</ul>
<h3>Reproduce the Benchmarks &amp; Verify Proofs Locally</h3>
<p>We mechanized our safety invariants in Lean 4 across 94 formal modules and 1,036 theorems with zero axioms or <code>sorry</code>. Inspect the proofs and run the enclave daemon locally:</p>
<pre><code class="language-bash">git clone https://github.com/w8mej/heimdall-enclave.git
cd heimdall-enclave &amp;&amp; ./scripts/l1-alpha-smoke.sh
</code></pre>
]]></content:encoded></item></channel></rss>