ブログ

  • Two Kinds of “The Operator Cannot See Your Prompt”

    A map of private inference in 2026

    Darkbloom launched this week, and the response on Hacker News — 470 points, hundreds of comments — is a clean signal: developers want cheaper inference, and they want it without a hyperscaler reading their prompts. The technical pitch is striking. Idle Apple Silicon Macs serve inference. Requests are end-to-end encrypted. Debuggers are denied at the kernel level. An operator with full physical custody of the machine cannot read what flows through it.

    That last claim is the one worth pausing on. Because “the operator cannot see your prompt” is true of Darkbloom in roughly the same sense that it is true of Apple’s Private Cloud Compute, NVIDIA Confidential Computing, and also — in a completely different way — true of systems built on fully homomorphic encryption, multi-party computation, and zero-knowledge proofs.

    These are not the same technology. They are not even the same category of technology. They defend against different adversaries, rely on different trust anchors, and fail in different ways. Treating them interchangeably is how buyers end up deploying the wrong tool for their actual threat model.

    This post is a map. It is not an argument that one approach is correct and another is wrong. Both are real. Both are shipping. Both have uses the other cannot cover. The goal is to give you the distinctions you need to read a “private AI” claim without getting fooled — yours or someone else’s.

    “Operator cannot see the prompt” has two meanings

    The two meanings are worth stating plainly before anything else.

    The TEE-based meaning. The data is decrypted inside a hardware-isolated execution environment — an Apple Secure Enclave, an Intel TDX enclave, an AMD SEV-SNP guest, an NVIDIA H100 or Blackwell GPU running in confidential-compute mode. Inside that environment, the data is in the clear. Computation happens on plaintext, at full hardware speed. What prevents the operator from seeing it is a combination of hardware isolation, memory encryption at the bus level, cryptographic attestation of the software stack, and policy choices like disabling debuggers and logging. The guarantee is: an attacker who controls everything except the silicon root of trust cannot observe the data.

    The cryptographic meaning. The data is never decrypted at all during computation. It remains ciphertext end-to-end. The server performs arithmetic on encrypted values and returns encrypted results. Only the key holder can read the output. What prevents the operator from seeing the data is mathematics — specifically, the hardness of lattice problems underlying schemes like CKKS, BFV, and TFHE. The guarantee is: an attacker who controls everything, including the silicon, cannot observe the data, because no component of the system ever holds it in plaintext.

    These are different guarantees with different costs. The first is fast and practical for realistic workloads but requires you to trust the hardware vendor. The second is slow and narrow but requires you to trust no one in particular.

    The TEE family, examined

    Start with Darkbloom’s concrete design, because it is a good representative of the current state of TEE-based AI privacy. The provider process runs in-process with the inference engine — no subprocess, no local server, no IPC. PT_DENY_ATTACH blocks debuggers at the kernel level. Memory-reading APIs are denied. The coordinator encrypts each request with the provider’s X25519 key before forwarding; only the hardened provider process decrypts. Attestation data is publicly verifiable. The trust anchor is the Apple Secure Enclave.

    Apple’s own Private Cloud Compute is a close cousin of this architecture, deployed at hyperscaler scale. PCC uses custom Apple Silicon servers, a hardened OS, and cryptographic attestation of every software image running in the data center. Requests are routed through an anonymizing relay so that Apple cannot link a request to a user. Crucially, and this is explicit in Apple’s threat model, PCC does not encrypt data during runtime on the node. Data is decrypted inside the trusted environment and processed in the clear. What PCC provides is a hardened path to that environment and a cryptographic guarantee about what code will run once the data arrives.

    NVIDIA’s Confidential Computing on H100 and Blackwell GPUs extends the same pattern to GPU workloads. The GPU has an on-die hardware root of trust, encrypted memory, and an encrypted bounce buffer between CPU and GPU. In confidential-compute mode, data stays encrypted on the bus and in GPU memory until it is inside the TEE boundary. Blackwell adds TEE-I/O, which extends the protected path over NVLink, so multi-GPU workloads can stay confidential across the interconnect. Published benchmarks put Blackwell’s confidential mode at nearly the same throughput as unencrypted — a dramatically different cost curve than the FHE world.

    What all three share is the trust model. You are trusting:

    1. That the hardware vendor designed the root of trust correctly.
    2. That the hardware vendor did not insert a backdoor, whether deliberately or under government compulsion.
    3. That the attestation chain has no exploitable flaw between the hardware measurement and the code running inside.
    4. That side channels — timing, power, electromagnetic, speculative-execution — do not leak enough information to defeat the isolation.
    5. That the supply chain delivered the actual chip the vendor designed, without tampering.

    These are not trivial assumptions. They are routinely challenged by academic research, including recent in-depth analyses of NVIDIA’s GPU confidential-computing architecture. But for most commercial threat models — “don’t let the cloud provider’s engineers read my prompts,” “don’t let a compromised host OS steal my model weights” — TEEs are a perfectly reasonable answer, and they run at production speeds.

    The cryptographic family, examined

    FHE, MPC, and ZKP are not one technology but three closely related ones, each with different primitives and different trade-offs. They share a structural property: the adversary is assumed to be unbounded in their access to the system, and the security guarantee follows from mathematics rather than from hardware.

    Fully homomorphic encryption allows arbitrary arithmetic on ciphertext. Modern schemes — CKKS for approximate arithmetic, BFV/BGV for exact integer arithmetic, TFHE for boolean circuits — encode a vector of plaintext values into a ring-element ciphertext and support ciphertext addition and multiplication with noise that grows with circuit depth. Bootstrapping refreshes the noise but is expensive. The security reduction is to the Ring Learning With Errors problem, which is believed hard against both classical and quantum adversaries.

    Multi-party computation splits data across several parties such that no single party sees the plaintext; computation proceeds through interaction between the parties, and the result is correct as long as some threshold of parties remains honest. Threshold FHE is the natural fusion: the decryption key itself is secret-shared across parties, so no single party can decrypt at all.

    Zero-knowledge proofs let a prover convince a verifier that a statement is true without revealing anything beyond the fact of its truth. For private inference, this matters because you often want not just the answer but a proof that the answer was computed correctly from the encrypted input.

    The honest story about FHE performance in 2026 is that it is improving fast and is still very slow compared to plaintext. Recent surveys put FHE overhead at roughly 10^5× slower than cleartext for realistic deep learning. GPU-accelerated CKKS implementations have brought CNN inference on CIFAR-10 down from thousands of seconds to a few seconds per image. For LLMs, the state of the art is something like GPT-2 small with LoRA, reporting on the order of 1.6 seconds per token under carefully engineered parameter choices. Recent ICLR work on FHE-based transformer inference reports single-digit-hours per prefill for small models. This is not a technology you plug into your Claude replacement and expect interactive chat.

    Where FHE genuinely shines is in computations with modest arithmetic depth applied to data from mutually distrusting parties. Private set intersection. Encrypted database queries. Summing encrypted supplier-level CO₂ emissions across a supply chain so that aggregate Scope 3 reporting becomes possible without any supplier revealing raw data to any other. Matching encrypted medical records across hospitals — an organ-transplant problem, for instance — where Threshold FHE removes the question of “who holds the decryption key” by ensuring nobody does. These are not LLM inference workloads. They are workloads where the privacy requirement is structural, where the parties have legal or competitive reasons to distrust one another, and where latency budgets are measured in minutes or hours rather than milliseconds.

    A threat model comparison

    Laying the two families side by side against concrete adversaries clarifies where each fits.

    A cloud operator’s curious engineer. TEEs defeat this attacker decisively — data is encrypted in transit, attested on arrival, processed only by audited code. FHE defeats this attacker too, but you paid 10^5× in compute to defeat an adversary a TEE would have beaten for free. The engineer is the TEE’s home turf.

    A malicious host OS or hypervisor. TEEs handle this — that is precisely what confidential VMs and confidential containers are designed for. FHE handles it trivially, because the host never sees plaintext at all. Either works.

    A sophisticated physical attacker with a bus analyzer and a DRAM cooling attack. TEEs mitigate this at considerable effort — Apple explicitly includes this attacker in PCC’s threat model; NVIDIA’s published threat model for Hopper and Blackwell confidential mode addresses PCIe bus probing with in-line encryption. Whether the mitigation is sufficient depends on the specific attack and the specific hardware generation. FHE is indifferent to this attacker by construction. The bus carries only ciphertext.

    The hardware vendor itself, or a state actor compelling the hardware vendor. TEEs cannot defend against this — the root of trust is the vendor. This is not a flaw in the technology; it is a definition. FHE defends against this, because no hardware component is assumed trustworthy. If your threat model includes “what if Apple or NVIDIA is compromised,” only the cryptographic family applies.

    A future adversary with a cryptographically relevant quantum computer, decrypting harvested ciphertext from 2026. This is the “harvest now, decrypt later” concern. Most TEE-based systems today use ECC-based key exchange — X25519 is the common choice, including in Darkbloom — which is quantum-broken. The data-in-use guarantee is unaffected by quantum attacks because the data is never encrypted during computation, but the transport layer is. FHE based on lattice assumptions (RLWE) is believed post-quantum secure for the data itself. Mature designs in either family are beginning to adopt ML-KEM for key exchange; check the specific system.

    Side channels — timing, cache, power, EM. Both families are vulnerable, in different ways. TEEs have a substantial published literature of side-channel breaks; mitigating them is an ongoing effort. FHE implementations have their own side-channel issues, particularly around bootstrapping and noise management. Neither is a silver bullet.

    No single technology dominates across this table. That is the whole point.

    Which one should you use

    The honest guidance is that these are complementary, not competing, for most realistic deployments.

    For interactive LLM inference at scale, TEEs are the only practical answer in 2026. The cost curve simply does not support FHE-based chat completion. Darkbloom, Apple PCC, NVIDIA confidential GPU instances, Azure confidential containers with H100 — this is where the industry is, and it is a reasonable place to be for most commercial privacy requirements.

    For fixed-depth arithmetic over encrypted data from mutually distrusting sources, the cryptographic family is frequently the correct choice and sometimes the only choice. Aggregating Scope 3 emissions across a supply chain where each supplier’s raw data is competitively sensitive. Matching medical records across hospitals where legal constraints forbid any party from holding plaintext from another party. Financial settlement calculations where the regulator, the counterparties, and the platform operator are all potential adversaries to each other. Voting systems where verifiability and ballot secrecy must hold simultaneously. These are not LLM problems. They are problems where the structure of distrust is irreducible, and trying to solve them with a TEE means picking which participant gets to be the trusted party — which is often the problem you were hired to eliminate.

    For systems where the threat model genuinely includes the hardware vendor, only the cryptographic family is responsive. This is a smaller market than the previous two, but it exists, and it is where certain strands of post-quantum cryptographic infrastructure are being built.

    A useful heuristic: if you can name the party who holds the decryption key, you are in TEE territory and should probably just use a good TEE. If the honest answer is “nobody holds the key, and that is the point,” you are in cryptographic territory and should not try to reduce it to a hardware problem.

    The 2026 picture

    What I see when I look at this landscape is not a competition but a division of labor that is still being worked out in public.

    TEE-based private inference is having a commercial moment. Darkbloom’s Apple-Silicon-on-idle-Macs architecture, Apple’s data-center PCC deployment, and NVIDIA’s Blackwell confidential GPUs are all maturing at the same time, and they collectively make “private by construction” a realistic default for AI workloads rather than a research curiosity. The remaining questions are not technical so much as governance-shaped: how is attestation verified, who audits the hardened OS images, how are side-channel disclosures handled, how does the supply chain prove itself.

    Cryptographic private computation is having a different kind of moment. GPU-accelerated CKKS has crossed the threshold where small CNN inference is genuinely practical. Threshold FHE is being deployed in real multi-party workflows. Zero-knowledge systems are standardizing. The workloads being unlocked are not “chat with a model” — they are the structural-distrust workloads that TEEs cannot cleanly serve, and there are more of those than the LLM-centric discourse usually admits.

    The mistake to avoid in either direction is conflation. If you read “operator cannot see your prompt” and do not ask which guarantee is being offered, you will eventually end up with the wrong one. If you read “privacy-preserving AI” and do not ask whether the trust root is silicon or mathematics, you cannot evaluate whether the claim matches your threat model.

    Both of these families are real technologies solving real problems. The point is to know which one is in front of you when somebody says the word “private.”


    The author works on cryptographic infrastructure for supply-chain and healthcare applications, including post-quantum key management (hyde), GPU-accelerated CKKS (plat), and multi-party organ-matching (Niobi).

  • OLMo 3:推論の根拠を訓練データまで遡れる「ガラス箱」LLMとは何か

    ChatGPTやClaudeなどのLLMは「なぜその回答をしたのか」が分かりません。Allen Institute for AI(AI2)が公開したOLMo 3は、推論の過程を訓練データまで遡って追跡できる「ガラス箱(glass-box)」モデルです。AI透明性の新たな一歩として、日本でも注目すべきプロジェクトです。

    OLMo 3とは

    AI2が公開したOLMo 3は、7Bと32Bパラメータのオープンソース推論モデルです。最大の特徴は完全な透明性です。

    • 訓練データ:Dolma 3(約9.3兆トークン)が完全公開
    • 訓練コード:全て公開
    • ポストトレーニングレシピ:RLHFやファインチューニングの手法も公開
    • モデルの重み:オープンウェイト

    つまり、モデルの入力から出力まで、全てのプロセスを検証できます。

    OlmoTrace:回答の根拠を追跡

    OLMo 3の最も革新的な機能がOlmoTraceです。モデルの回答に対して、以下を追跡できます。

    1. 推論の中間ステップ(思考チェーン)を可視化
    2. 各ステップがどの訓練データに基づいているかを特定
    3. 訓練データの原文を参照可能

    例えば、モデルが「東京の人口は約1400万人」と回答した場合、その数字がDolma 3のどのドキュメントから学習されたかを遡って確認できます。これはハルシネーション(幻覚)の原因特定にも直結します。

    OLMo 3-Think:32Bスケール最強のオープン推論モデル

    OLMo 3-Think(32B)は、32Bパラメータスケールにおける完全オープンソースの推論モデルとして最高性能を達成しています。「Think」の名前が示すように、段階的な推論(Chain-of-Thought)を行い、複雑な問題を分解して解く能力を持ちます。

    なぜ「ガラス箱」が重要なのか

    現在のLLMの大きな課題はブラックボックス性です。

    • 規制対応:EU AI Actをはじめ、AIの透明性を求める規制が世界的に強化されている
    • 信頼性:医療・法律・金融など、根拠が必要な分野でのAI活用には透明性が不可欠
    • 研究:モデルの挙動を理解し改善するためには、内部の可視化が必要
    • 著作権:生成AIの出力が訓練データの著作物に基づいているかを検証可能に

    OLMo 3のアプローチは、これら全ての課題に対する回答です。

    試してみるには

    OLMo 3はGitHub上で完全に公開されています。Hugging Faceからモデルをダウンロードし、ローカルで実行できます。32Bモデルは量子化版であれば16GB程度のGPUメモリで動作します。

    OlmoTraceのデモもAI2のサイトで公開されており、ブラウザから試すことも可能です。「このAIはなぜこう答えたのか?」を自分の目で確かめられる体験は、LLMの理解を一段深めてくれるはずです。

    まとめ

    OLMo 3は「最も高性能なモデル」ではありません。しかし「最も透明なモデル」です。AIが社会インフラになりつつある今、「なぜその答えなのか」を追跡できることの価値は計り知れません。商用LLMがブラックボックスのままである以上、OLMo 3のようなプロジェクトの存在はAI業界全体にとって重要です。

  • Meta×AMD 1000億ドル契約とバッテリー不要IoT:海外インフラ・ハードウェアの激動

    2026年2月最終週、テックインフラの世界で歴史的な動きがありました。MetaとAMDの1000億ドル規模のチップ契約と、バッテリー不要IoTの業界標準化を目指すAmbient IoT Allianceの発足です。日本ではあまり報道されていませんが、いずれも今後のテック業界の方向を決定づける重要なニュースです。

    Meta × AMD:史上最大のAIチップ契約

    2月24日、MetaがAMDと最大1000億ドル(約15兆円)の複数年チップ契約を発表しました。AI史上最大の単一契約です。

    契約の詳細

    • ハードウェア:AMD Instinct MI450ベースのカスタムGPU + 第6世代EPYC CPU
    • 規模:最大6ギガワットのAMD GPUキャパシティを展開
    • 出荷開始:2026年下半期
    • 株式ワラント:AMDがMetaに対し、最大1億6000万株(発行済み株式の約10%)を1株あたり0.01ドルで発行するワラントを付与。マイルストーン達成に応じて権利確定

    なぜ重要か

    注目すべきは3つのポイントです。

    第一に、Nvidiaの独占が崩れ始めていること。MetaはNvidiaにも数百万個のGPUを発注していますが、AMDに1000億ドルを投じることで戦略的に分散化を図っています。

    第二に、株式ワラントという前例のないスキーム。ハードウェア契約に株式報酬を組み合わせるのは異例で、AMDの株価(とMetaの交渉力)に大きなインパクトを持ちます。

    第三に、AIインフラ投資の規模感。Alphabet、Amazon、Meta、Microsoftの4社で2026年のAIインフラ投資は合計約6500億ドルに達する見通しです。2025年の約4100億ドルから58%増です。

    Ambient IoT Alliance:バッテリー不要IoTの標準化

    2月23日、Ambient IoT Allianceが設立されました。バッテリー不要のIoTデバイスの標準化を推進する業界団体です。

    参加企業

    設立メンバーはAtmosic、Infineon、Intel、PepsiCo、Qualcomm、VusionGroup、Wiliot。半導体大手からPepsiCoのような消費財企業まで参加しているのが特徴です。

    エナジーハーベスティングIoTとは

    環境中のエネルギー(無線電波、光、振動、温度差など)を収集して動作するIoTデバイスです。バッテリーが不要なため、以下のような用途が想定されています。

    • サプライチェーン:商品の物流トラッキング(バッテリー交換不要)
    • 小売:電子棚札、在庫管理センサー
    • 環境モニタリング:農業、建物の構造監視
    • 医療:使い捨てセンサーパッチ

    PepsiCoの参加は、大手消費財企業がサプライチェーンの可視化にバッテリーレスIoTを本気で検討していることを示しています。ESP32のような汎用IoTチップとは異なるレイヤーですが、IoT業界全体の進化を加速させる動きです。

    まとめ

    ハードウェアとインフラの世界では、AI投資の爆発的な拡大と、IoTの新しいパラダイム(バッテリーレス)が同時進行しています。Nvidiaの独占崩壊とバッテリー不要IoTの標準化は、今後数年のテック業界を大きく変える可能性があります。日本でも注視すべきトレンドです。

  • GitHub Agentic WorkflowsとCursor並列エージェント:AI開発ツールの2026年2月最前線

    2026年2月、AI開発ツールの世界で2つの大きな動きがありました。GitHubが「Agentic Workflows」をテクニカルプレビューで公開し、CursorがAIエージェントの並列VM実行に対応。どちらも「AIアシスタント」から「AIエージェント」への転換を象徴する出来事です。

    GitHub Agentic Workflows:CI/CDをMarkdownで書く

    2月13日、GitHubが「Agentic Workflows」をテクニカルプレビューとして公開しました。最大の特徴は、CI/CDの自動化をYAMLではなくMarkdownで記述できることです。

    仕組み

    • .github/workflows/にMarkdownファイルを配置
    • gh aw CLIコマンドでMarkdownからGitHub Actionsに変換
    • 複数のAIエンジンに対応:Copilot CLI、Claude Code、OpenAI Codex
    • デフォルトは読み取り専用権限。PRの自動マージは不可
    • MITライセンスで完全オープンソース

    例えば「PRが作成されたらコードレビューして、テストが通ったらステージング環境にデプロイして」という指示を自然言語で書けば、AIエージェントがActionsのワークフローとして実行します。

    注目ポイント

    特に注目すべきはマルチエンジン対応です。Copilot CLIだけでなく、Claude CodeやOpenAI Codexも選択可能。ベンダーロックインを避けるGitHubの姿勢が見えます。セキュリティ面でもデフォルトでread-only、PRの自動マージ禁止と、慎重な設計です。

    Cursor:AIエージェントが並列VMで動く時代

    2月24日、AIコードエディタのCursorが大型アップデートを発表しました。AIエージェントが専用の仮想マシン(VM)上で並列実行できるようになりました。

    何が変わったか

    • 並列実行:複数のAIエージェントがそれぞれ独立したVM上で動作。ローカルPCのリソースを消費しない
    • 自己テスト:エージェントが自分で変更をテストし、ビデオ/スクリーンショットで結果を記録
    • プラグインシステム:Amplitude、AWS、Figma、Stripeなどとの統合
    • クロスプラットフォームサンドボックス:開発者の中断を40%削減
    • CursorのPRの約35%がVM上のエージェントによって生成

    パラダイムシフト

    これは「1ファイルのコード補完」から「10-20の並列エージェントが同時にタスクをこなす」への転換です。1つのエージェントにバグ修正を、別のエージェントにテスト追加を、さらに別のエージェントにドキュメント更新を任せる——そんなワークフローが現実になっています。

    AI開発ツールのトレンド

    これら2つの動きから見えるトレンドは明確です。

    1. 「アシスタント」から「エージェント」へ:補完ではなく、タスク全体を自律的に実行
    2. サンドボックスとセキュリティ:エージェントの権限管理が必須要件に
    3. マルチエンジン:特定のAIモデルに依存しない設計
    4. 並列処理:複数エージェントの同時実行が前提のアーキテクチャ

    2026年は「AIがコードを書く」から「AIチームがプロジェクトを回す」へと進化する年になりそうです。GitHub Agentic Workflowsはオープンソースなので、ぜひ試してみてください。

  • メモ帳がハッキングの入口に?Windows NotepadのRCE脆弱性とCopilotプロンプトインジェクションの衝撃

    2026年2月のMicrosoft Patch Tuesdayで、セキュリティ業界を騒がせる脆弱性が2つ明らかになりました。1つはWindows Notepad(メモ帳)のリモートコード実行(RCE)、もう1つはGitHub Copilotへのプロンプトインジェクション攻撃です。どちらも「信頼されてきたツール」が攻撃経路になるという点で、開発者なら知っておくべきニュースです。

    Windows Notepadにリモートコード実行(CVE-2026-20841)

    Windowsのメモ帳に新しく追加されたMarkdownレンダリング機能が、深刻な脆弱性の原因となりました。CVSSスコアは8.8(High)で、すでにGitHubにPoCエクスプロイトが公開されています。

    攻撃の仕組み

    攻撃者が細工した.mdファイルをメモ帳で開くと、Markdownレンダリング時に悪意のあるリンクが生成されます。ユーザーがそのリンクをクリックすると、メモ帳が未検証のプロトコルを起動し、リモートのファイルを実行してしまいます。

    つまり、「.mdファイルを開いてリンクをクリックしただけ」でマルウェアが実行される可能性があるということです。

    なぜ重要か

    メモ帳はWindowsで最も基本的な、最も信頼されてきたアプリケーションです。「メモ帳が危険」という概念自体が今までなかった。これはシンプルなツールに機能を追加する際のセキュリティリスクを如実に示す教訓です。2月のPatch Tuesdayで修正済みですが、Windows Updateを適用していない環境は注意が必要です。

    GitHub Copilotにプロンプトインジェクション脆弱性

    同じ2月のパッチで、GitHub Copilotに関する複数のCVEも修正されました。中でもCVE-2026-21516(CVSS 8.8)は、JetBrains版Copilotにおいてプロンプトインジェクションにより任意コード実行が可能というものです。

    攻撃シナリオ

    攻撃者がリポジトリのコードベースに悪意のあるプロンプトを埋め込みます(コメントやドキュメント内など)。開発者がそのリポジトリでCopilotのAIエージェント機能を使うと、エージェントが悪意のあるプロンプトを処理し、意図しないコードの実行やファイル操作を行ってしまいます。

    VS Code版(CVE-2026-21256)でも同様の問題が発見されています。

    AI時代の新しい脅威カテゴリ

    これは「プロンプトインジェクションが実際の攻撃ベクトルとなった」最初の大規模事例と言えます。AIコーディングアシスタントが「毒入りリポジトリ」から任意コードを実行するという脅威は、従来のセキュリティモデルでは想定されていませんでした。

    今後、AIエージェントの権限管理やサンドボックス設計がより重要になることは間違いありません。OSS リポジトリをクローンしてAIに分析させる際は、信頼性の確認が不可欠です。

    対策まとめ

    • Windows Updateを早急に適用する(2月のPatch Tuesday)
    • GitHub Copilotを最新版にアップデートする(VS Code、JetBrains両方)
    • 不審な.mdファイルをメモ帳で開かない
    • AIエージェントに未知のリポジトリを処理させる際は慎重に
    • AIツールの権限設定を最小限にする(read-onlyをデフォルトに)

    「信頼されたツール」が攻撃の入口になる時代。セキュリティの常識がアップデートされていることを、改めて認識させられるニュースでした。

  • Rust × ESP32開発が本格化:esp-hal 1.0のインパクトと始め方

    2025年10月、ESP32向けRust HAL「esp-hal」がバージョン1.0.0に到達しました。これはマイコンベンダーが公式にサポートする初の安定版Rust HALであり、組込みRust界にとって画期的な出来事です。この記事では、esp-hal 1.0の意義と、ESP32でRust開発を始める方法を解説します。

    esp-hal 1.0.0とは

    esp-halはEspressifが公式に開発・メンテナンスしている、ESP32ファミリー向けのRustハードウェア抽象化レイヤー(HAL)です。2025年2月にベータ版、10月に正式リリースされました。

    1.0で安定化された機能:

    • HAL初期化(esp_hal::init)と設定
    • GPIO、UART、SPI、I2Cドライバ
    • 時間モジュール(Instant、Duration、Rate)
    • async/blockingの両方のドライバモード
    • Embassyなどの非同期ランタイムとの互換性

    その他の機能はunstableフィーチャーフラグの下に配置され、段階的に安定化される予定です。次の大きな安定化ターゲットはWi-Fi/Bluetooth/ESP-NOWスタック「esp-radio」です。

    2つの開発アプローチ

    ESP32でRustを使う方法は2つあります。

    1. no_std + esp-hal(ベアメタル)

    OSを使わず、ハードウェアを直接制御するアプローチです。バイナリサイズが小さく、起動が速く、リアルタイム性が必要な場面に適しています。esp-hal 1.0はこのパスの安定版です。

    2. std + esp-idf-hal(IDF上で動作)

    ESP-IDFの上にRust標準ライブラリを載せるアプローチです。スレッド、ネットワーキング、ファイルシステムなど標準ライブラリの機能がフルに使えます。バイナリは大きくなりますが、機能の網羅性は高いです。

    LLVM Xtensaアップストリーム化

    ESP32・ESP32-S2・ESP32-S3が採用するXtensaアーキテクチャのLLVMサポートが、本家LLVMへのアップストリーム化が進んでいます。基本ISAの大部分はすでにLLVM本体に取り込まれており、将来的にはEspressifのカスタムLLVMフォークなしで、標準のRustツールチェーンからXtensaターゲットにコンパイルできるようになります。

    なお、RISC-VベースのESP32-C系/H系チップはすでに標準ツールチェーンでコンパイル可能です。

    始め方

    ESP32でRust開発を始める手順は以下のとおりです。

    1. RustインストールrustupでRustをインストール
    2. espupインストールcargo install espupでESP32用ツールチェーンマネージャを導入
    3. ツールチェーン構築espup installでXtensa対応ツールチェーンを自動セットアップ
    4. プロジェクト作成cargo generate esp-rs/esp-halテンプレートからプロジェクトを生成
    5. ビルド&フラッシュcargo runで実機にフラッシュして実行

    まとめ

    esp-hal 1.0.0のリリースにより、ESP32でのRust開発は「実験的」から「プロダクション対応」へと段階が上がりました。メモリ安全性とゼロコスト抽象化というRustの利点を、IoTデバイス開発で活かせる時代が来ています。C/C++に慣れた組込みエンジニアも、ぜひRust on ESP32を試してみてください。

  • ESP32-S3でTinyML入門:エッジAI推論を実装する方法

    クラウドに頼らず、マイコン上で直接AI推論を行う「TinyML」が注目を集めています。ESP32-S3はベクトル命令拡張を備え、TinyMLに最適なチップの一つです。この記事では、ESP32-S3でのエッジAI開発について、ツールチェーンからモデルデプロイまで解説します。

    なぜESP32-S3なのか

    ESP32-S3はデュアルコアXtensa LX7(最大240MHz)に加え、ベクトル命令拡張を搭載しています。これにより畳み込みニューラルネットワーク(CNN)の演算が高速化されます。ESP-NNライブラリがこれらの命令を最適に活用し、推論電力は約130〜157mW、レイテンシはモデルサイズに応じて7ms〜536msです。

    実用的な性能として、小型CNNなら約20FPS、中規模モデルでも約1FPSで推論可能です。顔検出、動体検知、音声コマンド認識などのユースケースに十分な性能です。

    ESP-DL:Espressif公式ディープラーニングライブラリ

    Espressifが提供するESP-DLは、ESP32向けの公式ディープラーニングフレームワークです。2025年に大幅なアップデートが行われました。

    ESP-DL v3.2(2025年10月)の主な特徴:

    • 独自のモデルフォーマット「.espdl」(FlatBuffersベースで高速なゼロコピー読み込み)
    • 8bit/16bit量子化サポート
    • ESP32-S3/P4向けのアセンブリ最適化カーネル(PIE命令活用)
    • Conv、Gemm、Add、Mulなどの主要演算をハードウェアアクセラレーション

    ESPDet-Pico:リアルタイム物体検出

    2025年4月にリリースされたESPDet-PicoはUltralytics YOLOv11ベースの軽量物体検出モデルです。歩行者検出、顔検出、COCO(YOLO11n)、猫・犬・手の検出など、事前学習済みモデルが提供されており、ESP32-S3上でリアルタイム推論が可能です。

    開発フロー

    ESP32でTinyMLを始める基本的な流れは以下のとおりです。

    1. モデル学習:PC上でPyTorch/TensorFlowでモデルを学習
    2. 量子化:esp-ppqツールで8bit/16bitに量子化し、.espdlフォーマットに変換
    3. デプロイ:ESP-DLライブラリを使ってESP32上でモデルをロード・推論
    4. 最適化:ESP-NN/PIE命令による自動最適化が適用される

    より手軽に始めたい場合はEdge Impulseがおすすめです。Webブラウザ上でデータ収集からモデル学習、ESP32へのデプロイまで一貫して行えます。深いML知識がなくても物体検出や音声認識モデルを構築できます。

    ESP32-S3 + カメラの活用例

    ESP32-S3はカメラインターフェースを備えているため、映像系のAIアプリケーションに強みがあります。DFRobotの「ESP32-S3 AI Camera」(8MB PSRAM、16MBフラッシュ)は、顔認識・物体検出・音声対話をエッジで実行できる開発ボードとして2025年に発売されました。

    代表的なユースケース:

    • Ringの代替となるローカル動作のドアベルカメラ
    • ペット検知・見守りカメラ
    • 製造ラインでの外観検査
    • 来客カウンターや人流分析

    まとめ

    ESP32-S3はTinyMLの実用的なプラットフォームとして成熟しました。ESP-DL v3.2とESPDet-Picoにより、YOLOベースの物体検出まで手の届く範囲になっています。数百円のマイコンでAI推論ができる時代を、ぜひ体験してみてください。

  • ESP32の最新動向まとめ(2025-2026):新チップ・Wi-Fi 6・AI対応まで完全解説

    IoT開発者にとって定番のESP32ファミリーですが、2025〜2026年にかけて大きな進化を遂げています。新チップの量産開始、Wi-Fi 6対応、AI推論機能の強化など、注目すべきアップデートが目白押しです。この記事では、ESP32エコシステムの最新動向を網羅的にまとめます。

    新チップラインナップの拡充

    Espressifは従来のESP32シリーズに加え、用途特化型の新チップを続々とリリースしています。

    ESP32-P4:高性能HMI向けSoC

    ESP32-P4はEspressif史上最もパワフルなチップです。デュアルコアRISC-V(最大400MHz)を搭載し、MIPI-CSI/DSIによる1080pカメラ入力・ディスプレイ出力、ハードウェアH.264エンコーダ(1080p@30fps)、55本のGPIOを備えています。

    注目点はWi-Fi/Bluetoothを内蔵しないこと。無線通信はESP32-C6などのコンパニオンチップと組み合わせる設計です。WaveshareやGUITIONからP4+C6を統合した開発ボード(約14ドル〜)が発売されています。

    ESP32-C5:業界初デュアルバンドWi-Fi 6対応MCU

    2025年5月に量産開始されたESP32-C5は、RISC-Vベースで2.4GHz + 5GHzのデュアルバンドWi-Fi 6(802.11ax)に対応した業界初のMCUです。従来のESP32はすべて2.4GHzのみだったため、5GHz帯が使えるのは大きな進化です。さらにBluetooth 5やIEEE 802.15.4(Zigbee/Thread)にも対応しています。

    CES 2026で発表:ESP32-E22とESP32-H21

    ESP32-E22はWi-Fi 6E(2.4/5/6GHz トライバンド)に対応し、2×2 MIMOで最大2.4Gbpsのデータレートを実現。デュアルコア500MHz RISC-Vプロセッサを搭載し、無線コプロセッサとして動作します。

    ESP32-H21は超低消費電力BLE MCUで、96MHz RISC-V、320KB RAM、BLE + IEEE 802.15.4対応。ウェアラブルやバッテリー駆動IoTノード向けです。

    開発フレームワークの進化

    ESP-IDF 6.0(2026年2月リリース)

    ESP-IDFのメジャーアップデートであるv6.0が2026年2月13日にリリースされました。主な変更点はMbedTLS v4シリーズへのアップグレードとPSA Crypto APIへの移行です。暗号化APIの使い方に破壊的変更があるため、既存プロジェクトの移行には注意が必要です。

    Arduino ESP32 Core 3.x

    Arduino ESP32 Core 3.0はESP-IDF 5.1ベースに刷新され、ESP32-C6やESP32-H2のサポートが追加されました。8つの周辺機器APIが更新され、ネイティブI2Cオーディオライブラリ、Ethernet SPIサポート(W5500、DM9051等)も追加されています。2.x系からの移行には破壊的変更があるため注意が必要です。

    セキュリティ:CVE-2025-27840「バックドア」騒動

    2025年3月、ESP32に29個の文書化されていないBluetooth HCIコマンドが見つかり「バックドア」として話題になりました。しかしEspressifは、これらはデバッグ用コマンドであり物理アクセスなしにはリモートで悪用できないと説明。ESP-IDF v5.5でこれらのコマンドをデフォルト無効化する修正が行われました。

    Matter/Thread対応の成熟

    スマートホーム標準プロトコル「Matter」への対応が着実に進んでいます。ESP32ファミリーはMatter 1.0認証を取得済みで、Thread Border RouterソリューションもThread V1.3認証を取得しています。ESPHome 2025.6.0ではOpenThreadサポートが追加され、ESP32-C6/H2をThreadエンドポイントとしてHome Assistantに直接接続できるようになりました。

    まとめ

    ESP32ファミリーは単なるWi-Fiマイコンから、Wi-Fi 6/6E、Thread/Matter、AI推論、1080p映像処理まで対応する総合IoTプラットフォームへと進化しています。用途に応じて最適なチップを選べるラインナップの充実が最大の魅力です。次回はESP32でのAI/TinyMLについて詳しく解説します。

  • WordPress プラグイン開発入門:OOP設計でメンテナブルなプラグインを作る

    WordPressプラグインの開発は、functions.phpにコードを追加する延長線上にありますが、本格的なプラグインはOOP(オブジェクト指向)で設計すべきです。この記事では、保守性が高く拡張しやすいプラグインの作り方を解説します。

    プラグインのディレクトリ構成

    my-awesome-plugin/
    ├── my-awesome-plugin.php    # メインファイル(エントリポイント)
    ├── includes/
    │   ├── class-plugin.php     # プラグインのメインクラス
    │   ├── class-admin.php      # 管理画面の処理
    │   ├── class-api.php        # REST APIエンドポイント
    │   └── class-db.php         # データベース操作
    ├── admin/
    │   ├── views/               # 管理画面テンプレート
    │   ├── css/
    │   └── js/
    ├── public/
    │   ├── css/
    │   └── js/
    ├── languages/               # 翻訳ファイル
    └── readme.txt               # WordPress.org用

    メインファイル

    <?php
    /**
     * Plugin Name: My Awesome Plugin
     * Description: プラグインの説明
     * Version: 1.0.0
     * Author: Your Name
     * Text Domain: my-awesome-plugin
     */
    
    if (!defined("ABSPATH")) exit;
    
    define("MAP_VERSION", "1.0.0");
    define("MAP_PLUGIN_DIR", plugin_dir_path(__FILE__));
    define("MAP_PLUGIN_URL", plugin_dir_url(__FILE__));
    
    require_once MAP_PLUGIN_DIR . "includes/class-plugin.php";
    
    // プラグイン初期化
    function map_init() {
        return MyAwesomePluginPlugin::get_instance();
    }
    add_action("plugins_loaded", "map_init");
    
    // アクティベーション・ディアクティベーション
    register_activation_hook(__FILE__, ["MyAwesomePluginPlugin", "activate"]);
    register_deactivation_hook(__FILE__, ["MyAwesomePluginPlugin", "deactivate"]);

    プラグインのメインクラス(シングルトン)

    <?php
    namespace MyAwesomePlugin;
    
    class Plugin {
        private static $instance = null;
    
        public static function get_instance() {
            if (self::$instance === null) {
                self::$instance = new self();
            }
            return self::$instance;
        }
    
        private function __construct() {
            $this->load_dependencies();
            $this->init_hooks();
        }
    
        private function load_dependencies() {
            require_once MAP_PLUGIN_DIR . "includes/class-admin.php";
            require_once MAP_PLUGIN_DIR . "includes/class-api.php";
            require_once MAP_PLUGIN_DIR . "includes/class-db.php";
        }
    
        private function init_hooks() {
            // 管理画面
            if (is_admin()) {
                new Admin();
            }
            // REST API
            add_action("rest_api_init", [new Api(), "register_routes"]);
            // フロントエンド
            add_action("wp_enqueue_scripts", [$this, "enqueue_public_assets"]);
        }
    
        public function enqueue_public_assets() {
            wp_enqueue_style(
                "map-public",
                MAP_PLUGIN_URL . "public/css/style.css",
                [],
                MAP_VERSION
            );
            wp_enqueue_script(
                "map-public",
                MAP_PLUGIN_URL . "public/js/main.js",
                [],
                MAP_VERSION,
                true
            );
            // JSにデータを渡す
            wp_localize_script("map-public", "mapConfig", [
                "ajaxUrl" => admin_url("admin-ajax.php"),
                "apiUrl" => rest_url("my-plugin/v1/"),
                "nonce" => wp_create_nonce("wp_rest"),
            ]);
        }
    
        public static function activate() {
            Db::create_tables();
            flush_rewrite_rules();
        }
    
        public static function deactivate() {
            flush_rewrite_rules();
        }
    }

    管理画面クラス

    <?php
    namespace MyAwesomePlugin;
    
    class Admin {
        public function __construct() {
            add_action("admin_menu", [$this, "add_menu"]);
            add_action("admin_init", [$this, "register_settings"]);
        }
    
        public function add_menu() {
            add_options_page(
                "My Plugin設定",
                "My Plugin",
                "manage_options",
                "my-awesome-plugin",
                [$this, "render_settings_page"]
            );
        }
    
        public function register_settings() {
            register_setting("map_settings", "map_api_key");
            register_setting("map_settings", "map_enabled");
        }
    
        public function render_settings_page() {
            include MAP_PLUGIN_DIR . "admin/views/settings.php";
        }
    }

    データベースクラス

    <?php
    namespace MyAwesomePlugin;
    
    class Db {
        public static function create_tables() {
            global $wpdb;
            $table = $wpdb->prefix . "map_logs";
            $charset = $wpdb->get_charset_collate();
    
            $sql = "CREATE TABLE IF NOT EXISTS $table (
                id bigint(20) NOT NULL AUTO_INCREMENT,
                user_id bigint(20) DEFAULT NULL,
                action varchar(50) NOT NULL,
                data longtext,
                created_at datetime DEFAULT CURRENT_TIMESTAMP,
                PRIMARY KEY (id),
                KEY user_id (user_id),
                KEY created_at (created_at)
            ) $charset;";
    
            require_once ABSPATH . "wp-admin/includes/upgrade.php";
            dbDelta($sql);
        }
    
        public static function insert_log($action, $data = null) {
            global $wpdb;
            return $wpdb->insert(
                $wpdb->prefix . "map_logs",
                [
                    "user_id" => get_current_user_id(),
                    "action" => $action,
                    "data" => is_array($data) ? json_encode($data) : $data,
                ],
                ["%d", "%s", "%s"]
            );
        }
    }

    セキュリティのベストプラクティス

    • ABSPATH チェック: 全PHPファイルの先頭で if (!defined("ABSPATH")) exit; を記述
    • Nonceの検証: フォーム送信やAjaxリクエストでは必ずnonce検証を行う
    • 権限チェック: current_user_can() で適切な権限を確認
    • サニタイズ: 入力値は sanitize_text_field()、出力は esc_html() で処理
    • SQLインジェクション対策: $wpdb->prepare() を使用

    まとめ

    OOP設計でプラグインを作ることで、コードの見通しが良くなり、チーム開発やメンテナンスが格段に楽になります。最初は少し面倒に感じるかもしれませんが、一度フレームワークを作ってしまえば、新しいプラグインでも使い回せます。WordPress公式ディレクトリへの公開を目指す場合も、この設計であればレビューを通過しやすいでしょう。

  • WordPress REST APIでヘッドレスCMS構築:Next.jsフロントエンドと連携する実践テクニック

    WordPressをヘッドレスCMSとして使い、フロントエンドをNext.jsで構築するアーキテクチャが注目されています。コンテンツ管理はWordPressの使いやすい管理画面で、表示はモダンなReactアプリで、という両方の良いところを取る手法です。

    WordPress REST APIの基本

    WordPress 4.7以降、REST APIが標準搭載されています。/wp-json/wp/v2/ 以下のエンドポイントで投稿・ページ・カテゴリなどのデータをJSON形式で取得できます。

    # 投稿一覧を取得
    curl https://your-site.com/wp-json/wp/v2/posts
    
    # 特定の投稿を取得
    curl https://your-site.com/wp-json/wp/v2/posts/123
    
    # カテゴリ一覧
    curl https://your-site.com/wp-json/wp/v2/categories
    
    # 検索
    curl "https://your-site.com/wp-json/wp/v2/posts?search=React"
    
    # ページネーション
    curl "https://your-site.com/wp-json/wp/v2/posts?per_page=10&page=2"

    Next.jsプロジェクトのセットアップ

    npx create-next-app@latest wp-frontend --typescript --app
    cd wp-frontend

    WordPress APIクライアント

    // lib/wordpress.ts
    const API_URL = process.env.WORDPRESS_API_URL || "https://your-site.com/wp-json/wp/v2";
    
    export interface WPPost {
      id: number;
      slug: string;
      title: { rendered: string };
      content: { rendered: string };
      excerpt: { rendered: string };
      date: string;
      categories: number[];
      _embedded?: {
        "wp:featuredmedia"?: Array<{ source_url: string }>;
      };
    }
    
    export async function getPosts(page = 1, perPage = 10): Promise<WPPost[]> {
      const res = await fetch(
        `${API_URL}/posts?_embed&per_page=${perPage}&page=${page}`,
        { next: { revalidate: 3600 } } // ISR: 1時間キャッシュ
      );
      if (!res.ok) throw new Error("Failed to fetch posts");
      return res.json();
    }
    
    export async function getPostBySlug(slug: string): Promise<WPPost | null> {
      const res = await fetch(
        `${API_URL}/posts?_embed&slug=${slug}`,
        { next: { revalidate: 3600 } }
      );
      const posts = await res.json();
      return posts[0] || null;
    }
    
    export async function getCategories() {
      const res = await fetch(`${API_URL}/categories`);
      return res.json();
    }

    投稿一覧ページ

    // app/page.tsx
    import { getPosts } from "@/lib/wordpress";
    import Link from "next/link";
    
    export default async function Home() {
      const posts = await getPosts();
    
      return (
        <main>
          <h1>ブログ</h1>
          {posts.map((post) => (
            <article key={post.id}>
              <Link href={`/posts/${post.slug}`}>
                <h2 dangerouslySetInnerHTML={{ __html: post.title.rendered }} />
              </Link>
              <div dangerouslySetInnerHTML={{ __html: post.excerpt.rendered }} />
              <time>{new Date(post.date).toLocaleDateString("ja-JP")}</time>
            </article>
          ))}
        </main>
      );
    }

    投稿詳細ページ

    // app/posts/[slug]/page.tsx
    import { getPostBySlug, getPosts } from "@/lib/wordpress";
    import { notFound } from "next/navigation";
    
    export async function generateStaticParams() {
      const posts = await getPosts(1, 100);
      return posts.map((post) => ({ slug: post.slug }));
    }
    
    export default async function PostPage({ params }: { params: { slug: string } }) {
      const post = await getPostBySlug(params.slug);
      if (!post) notFound();
    
      return (
        <article>
          <h1 dangerouslySetInnerHTML={{ __html: post.title.rendered }} />
          <time>{new Date(post.date).toLocaleDateString("ja-JP")}</time>
          <div dangerouslySetInnerHTML={{ __html: post.content.rendered }} />
        </article>
      );
    }

    カスタムエンドポイントの追加

    functions.phpでカスタムREST APIエンドポイントを追加できます。人気記事ランキングや関連記事など、標準APIにない機能を実装する場合に使います。

    // functions.php
    add_action("rest_api_init", function() {
        register_rest_route("custom/v1", "/popular", [
            "methods" => "GET",
            "callback" => function() {
                $posts = get_posts([
                    "meta_key" => "post_views",
                    "orderby" => "meta_value_num",
                    "order" => "DESC",
                    "numberposts" => 5,
                ]);
                return array_map(function($p) {
                    return [
                        "id" => $p->ID,
                        "title" => $p->post_title,
                        "slug" => $p->post_name,
                        "views" => get_post_meta($p->ID, "post_views", true),
                    ];
                }, $posts);
            },
            "permission_callback" => "__return_true",
        ]);
    });

    CORS設定

    ヘッドレス構成ではフロントエンドとWordPressが別ドメインになるため、CORS設定が必要です。

    // functions.php
    add_action("rest_api_init", function() {
        remove_filter("rest_pre_serve_request", "rest_send_cors_headers");
        add_filter("rest_pre_serve_request", function($value) {
            header("Access-Control-Allow-Origin: https://your-frontend.com");
            header("Access-Control-Allow-Methods: GET, POST, OPTIONS");
            header("Access-Control-Allow-Headers: Content-Type, Authorization");
            return $value;
        });
    });

    まとめ

    WordPressのREST APIとNext.jsを組み合わせることで、編集者にはWordPressの使いやすいUIを、ユーザーにはReactベースの高速な表示体験を提供できます。ISRを使えばビルド不要で最新コンテンツが反映される、最強のブログ基盤が構築できます。

IP: 取得中...
216.73.216.30216.73.216.30