<?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: Michael Laweh</title>
    <description>The latest articles on DEV Community by Michael Laweh (@klytron).</description>
    <link>https://dev.to/klytron</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%2F842146%2F4e30a8fd-cd7a-47d3-af1b-a3befce7c172.png</url>
      <title>DEV Community: Michael Laweh</title>
      <link>https://dev.to/klytron</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/klytron"/>
    <language>en</language>
    <item>
      <title>The Hybrid Architecture: Blending Physical IoT with Cloud Computing</title>
      <dc:creator>Michael Laweh</dc:creator>
      <pubDate>Sun, 15 Nov 2026 00:00:31 +0000</pubDate>
      <link>https://dev.to/klytron/the-hybrid-architecture-blending-physical-iot-with-cloud-computing-3l7j</link>
      <guid>https://dev.to/klytron/the-hybrid-architecture-blending-physical-iot-with-cloud-computing-3l7j</guid>
      <description>&lt;p&gt;When software engineers discuss architecture, they usually refer to cloud-native systems. They talk about microservices, serverless functions, database replication, and CDN caching. In this virtual space, networks are fast, resources are elastic, and servers do not suffer from physical wear.&lt;/p&gt;

&lt;p&gt;But when you build solutions that must interact with the physical world—such as factory monitors, real estate camera systems, logistics tracking devices, or edge servers—these cloud assumptions fall apart.&lt;/p&gt;

&lt;p&gt;In the physical world, networks go down. Power supplies fail. Heat wears down hardware components. Dust clogs up systems.&lt;/p&gt;

&lt;p&gt;To build reliable systems, you need a hybrid architecture that merges edge computing with cloud fallback systems. Drawing on my experience architecting and maintaining a 6-year continuous 24/7 camera livestream for a real estate group, here is how to design resilient hybrid systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The Core Strategy: Smart Edge, Simple Cloud
&lt;/h2&gt;

&lt;p&gt;In a hybrid architecture, the boundary between local (edge) systems and cloud servers must be clearly defined. The most common failure pattern is treating the edge system as a "dumb" terminal that streams raw data to a complex cloud processor.&lt;/p&gt;

&lt;p&gt;If the network drops, a dumb terminal fails immediately.&lt;/p&gt;

&lt;p&gt;Instead, implement a &lt;strong&gt;Smart Edge, Simple Cloud&lt;/strong&gt; architecture:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Edge&lt;/strong&gt;: Handles local processing, data filtering, buffering, and immediate hardware control. It must be capable of operating autonomously for extended periods without an active cloud connection.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Cloud&lt;/strong&gt;: Handles global metadata accumulation, alerting, long-term analytical storage, and user-facing dashboards.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. Designing for Intermittent Connections (Offline-First)
&lt;/h2&gt;

&lt;p&gt;If your hybrid system relies on continuous network uptime to function, it is structurally fragile. You must design your local services to be offline-first.&lt;/p&gt;

&lt;h3&gt;
  
  
  Local Cache and Queue (MQTT/SQLite)
&lt;/h3&gt;

&lt;p&gt;Instead of sending telemetry or log events directly to a cloud API endpoint, send them to a local broker (like Mosquitto MQTT) or write them to a local lightweight database (like SQLite).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Local Sensors / Inputs] ➔ [Local SQLite / Queue] ➔ [Local Network Daemon] ➔ (Active WAN?) ➔ [Cloud API]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A local network daemon can monitor your internet connection. When online, it flushes the queued records to the cloud. When offline, it keeps writing to the local SQLite database, managing cache rotation policies to prevent the local drive from running out of disk space.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Physical Network Failover Routing
&lt;/h2&gt;

&lt;p&gt;If your edge application requires near-real-time connectivity (such as security monitoring or live video streams), you must invest in redundant network routing at the physical site.&lt;/p&gt;

&lt;p&gt;A typical production setup includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Primary ISP&lt;/strong&gt;: A high-speed fiber or cable connection.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Secondary WAN&lt;/strong&gt;: A cellular 4G/5G router connected via an industrial gateway.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dynamic Routing&lt;/strong&gt;: A local router configured with automatic failover (WAN load balancing). The moment the primary gateway fails to ping a designated external DNS (like &lt;code&gt;1.1.1.1&lt;/code&gt;), it reroutes all traffic through the cellular network, lowering streaming bitrates or logging rates to conserve data.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4. Hardware Self-Healing and Remote Orchestration
&lt;/h2&gt;

&lt;p&gt;In the cloud, if a virtual machine degrades, you destroy it and spawn a new one. In the physical world, rebooting a frozen edge device requires a human technician to drive to the physical site—a slow, expensive process.&lt;/p&gt;

&lt;p&gt;Your edge systems must be designed to self-heal.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hardware Watchdog Timers
&lt;/h3&gt;

&lt;p&gt;A hardware watchdog is a physical chip on your edge motherboard (commonly found on Raspberry Pis and industrial PCs). The edge operating system must write a signal ("pat the dog") to this chip at regular intervals.&lt;/p&gt;

&lt;p&gt;If the system freezes and stops sending this signal, the watchdog chip interrupts the power line and triggers a hard reboot of the machine.&lt;/p&gt;

&lt;h3&gt;
  
  
  Smart Power Outlets
&lt;/h3&gt;

&lt;p&gt;For external devices (like IP cameras or modems) that do not have built-in watchdogs, connect their power lines to network-controlled relays or smart power bars.&lt;/p&gt;

&lt;p&gt;Write a simple bash script running on the local host to monitor camera connectivity:&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;#!/bin/bash&lt;/span&gt;
&lt;span class="nv"&gt;CAMERA_IP&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"192.168.1.50"&lt;/span&gt;
&lt;span class="nv"&gt;RELAY_API&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"http://192.168.1.100/api/relay/0"&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; ! ping -c 3 &lt;span class="nv"&gt;$CAMERA_IP&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /dev/null&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Camera offline. Power cycling relay..."&lt;/span&gt;
    curl -X POST -d &lt;span class="s2"&gt;"state=0"&lt;/span&gt; &lt;span class="nv"&gt;$RELAY_API&lt;/span&gt; &lt;span class="c"&gt;# Power Off&lt;/span&gt;
    sleep 10
    curl -X POST -d &lt;span class="s2"&gt;"state=1"&lt;/span&gt; &lt;span class="nv"&gt;$RELAY_API&lt;/span&gt; &lt;span class="c"&gt;# Power On&lt;/span&gt;
&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This simple script prevents 90% of physical maintenance trips by power-cycling locked camera interfaces automatically.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Blending physical IoT systems with cloud architecture requires shifting from optimistic programming to defensive systems design. By building smart edge nodes, implementing offline-first queues, structuring automatic network failovers, and building hardware self-healing scripts, you can create hybrid systems that operate reliably for years.&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://www.klytron.com/blog/hybrid-iot-cloud-livestream" rel="noopener noreferrer"&gt;Read the complete deep-dive with the full code repository and bonus security checklist on klytron.com&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.klytron.com/blog/hybrid-iot-cloud-livestream" rel="noopener noreferrer"&gt;https://www.klytron.com/blog/hybrid-iot-cloud-livestream&lt;/a&gt;&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>cloud</category>
      <category>infrastructure</category>
      <category>iot</category>
    </item>
    <item>
      <title>Inside the $6.34B Binance Heist (Part 2): Fake Job Interviews, Weaponized AI Tools, Multi-Chain Exploitation, and the Corporate Recovery Playbook</title>
      <dc:creator>Michael Laweh</dc:creator>
      <pubDate>Sun, 08 Nov 2026 00:00:38 +0000</pubDate>
      <link>https://dev.to/klytron/inside-the-634b-binance-heist-part-2-fake-job-interviews-weaponized-ai-tools-multi-chain-4e6p</link>
      <guid>https://dev.to/klytron/inside-the-634b-binance-heist-part-2-fake-job-interviews-weaponized-ai-tools-multi-chain-4e6p</guid>
      <description>&lt;p&gt;When the digital dust settled over the final days of October 2026, the cybersecurity world assumed it knew the shape of the disaster. An automated hot-wallet drain, Ethereum's newly adopted EIP-7702 delegation, and a lightning-fast 50-nonce spray against &lt;code&gt;Binance 14&lt;/code&gt; (&lt;code&gt;0x28C6...1d60&lt;/code&gt;). The mainstream narrative was straightforward: an engineer's laptop was infected, an active hot wallet was siphoned, and $6.34 billion escaped.&lt;/p&gt;

&lt;p&gt;We now know that was only the tip of the spear.&lt;/p&gt;

&lt;p&gt;Forensic disclosures from Binance's official incident autopsy, blockchain intelligence firms TRM Labs and Chainalysis, and the &lt;strong&gt;U.S. Federal Bureau of Investigation (FBI)&lt;/strong&gt; revealed an operational reality far more sophisticated than anyone anticipated. The breach was a &lt;strong&gt;meticulous, five-month state-sponsored cyber campaign&lt;/strong&gt; orchestrated by North Korea’s elite &lt;strong&gt;TraderTraitor&lt;/strong&gt; (Lazarus Group).&lt;/p&gt;

&lt;p&gt;The attackers did not breach Binance by cracking cryptographic keypairs. They breached it through &lt;strong&gt;human trust, fake job interviews, weaponized AI coding tools, and internal container token harvesting&lt;/strong&gt;, executing a synchronized heist that struck &lt;strong&gt;10 distinct blockchain networks simultaneously&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Here is the complete forensic autopsy of how the world’s largest crypto exchange was infiltrated, the engineering truth behind the attack path, how Binance pulled off an unprecedented recovery operation, and the essential architecture blueprints your company must implement immediately.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌────────────────────────────────────────────────────────────────────────────────────────┐
│                      THE FULL 5-MONTH MULTI-STAGE ATTACK PATH                           │
└────────────────────────────────────────────────────────────────────────────────────────┘

  [ June 2026: Phase 1 - Reconnaissance &amp;amp; AI Tool Lure ]
  Wallet engineer downloads tampered installer for an AI coding tool (via modified package).
  Binance SOC intercepts payload &amp;amp; wipes machine, but internal team hierarchy is mapped.
                            │
                            ▼
  [ September 2026: Phase 2 - The Weaponized Job Interview ]
  DPRK operatives pose as recruiters/executives on professional networks.
  Multi-round interview loop, rapport-building video calls, and a technical "coding test".
  DevOps engineer executes the assignment repository on corporate laptop -&amp;gt; Zero-Day Foothold.
                            │
                            ▼
  [ October 20, 2026: Phase 3 - Lateral Escalation via Internal AI Tool ]
  Adversary pivots from work laptop into internal networks.
  Compromises internal AI developer assistant &amp;amp; harvests short-lived container tokens.
  Gains execution pathway to wallet-signing service containers.
                            │
                            ▼
  [ October 29, 2026: Phase 4 - The 20-Minute Multi-Chain Blitzkrieg ]
  Attacker coordinates synchronized drain across 10 blockchains:
  ETH (EIP-7702), BSC, Solana, XRP Ledger, Sui, Base, Polygon, TRON, Arbitrum, Optimism.
  Total impact: $6.34 Billion siphoned in under 30 minutes.
                            │
                            ▼
  [ October 30 - November 7, 2026: Phase 5 - Containment &amp;amp; Recovery ]
  • Centralized Freezes: $2.85B halted in transit by Tether ($1.57B), Circle ($800M+), &amp;amp; peers.
  • Binance Corporate Backstop: $6.34B pledged from internal corporate reserves (0% user loss).
  • Market Replenishment: 98% of drained assets acquired &amp;amp; restored within 6 days.
  • Proof of Reserves: Expanded from 10 to 44 assets with zk-SNARKs.
  • Phased Reopening: 9 staged recovery rollouts restoring withdrawals network by network.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  1. The Real Patient Zero: The 5-Month Social Engineering Long Game
&lt;/h2&gt;

&lt;p&gt;This heist did not begin in late October. &lt;strong&gt;It began in June 2026.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: The Initial AI Tool Probe (June 2026)
&lt;/h3&gt;

&lt;p&gt;A Binance wallet infrastructure engineer attempted to install a popular third-party AI coding tool. The developer downloaded a tampered installer through an untrusted package manager channel. Binance's Security Operations Center (SOC) detected the anomaly, isolated the machine, and wiped the device. &lt;/p&gt;

&lt;p&gt;However, the malware successfully exfiltrated internal team directories, developer usernames, organizational hierarchies, and technology stack fingerprints, mapping out who held the keys to the wallet-signing pipelines.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: The Weaponized Job Interview (September 2026)
&lt;/h3&gt;

&lt;p&gt;Armed with internal intelligence, the TraderTraitor unit targeted a senior DevOps and infrastructure engineer through a professional networking platform:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fabricated a legitimate technology startup with authentic web domains and corporate profiles.&lt;/li&gt;
&lt;li&gt;Conducted multiple live video interviews discussing distributed systems and DevOps topologies.&lt;/li&gt;
&lt;li&gt;Built deep psychological rapport over several weeks.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 3: The Malicious Coding Assignment
&lt;/h3&gt;

&lt;p&gt;During the evaluation loop, the "recruiter" sent a technical assessment containing a GitHub repository. The engineer committed the fatal error: &lt;strong&gt;they downloaded and executed the coding assessment directly on their corporate-managed work laptop.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The repository contained obfuscated zero-day malware embedded in build scripts that bypassed standard commercial EDR signatures in memory, establishing a persistent root foothold inside an authenticated employee workstation.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Lateral Escalation: Weaponizing Internal AI Tools
&lt;/h2&gt;

&lt;p&gt;Once inside the engineer’s workstation, the attackers did not noisy port-scan the network. On &lt;strong&gt;October 20, 2026&lt;/strong&gt;, they leveraged modern developer productivity integrations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Internal AI Assistant Exploitation:&lt;/strong&gt; Binance engineering utilized an internal, containerized AI developer assistant to query architecture docs and API documentation. The attackers commandeered this local integration to map out the exact microservice topology governing automated wallet-signing containers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Container Token Harvesting:&lt;/strong&gt; Extracted ephemeral Kubernetes service tokens and SSH credentials from local developer caches.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pivoting into Signing Service Containers:&lt;/strong&gt; Traversed VPC peering boundaries using valid credentials until establishing communication with the internal microservice cluster responsible for automated hot-wallet transaction dispatch.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;[!WARNING]&lt;br&gt;
&lt;strong&gt;Adversaries did not crack Binance's cryptographic private keys.&lt;/strong&gt; The private keys remained secure inside HSMs and MPC nodes. The attackers compromised the &lt;strong&gt;software service authorized to tell the keys when and what to sign.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. The 20-Minute Multi-Chain Blitzkrieg
&lt;/h2&gt;

&lt;p&gt;While on-chain analysts focused on Ethereum's EIP-7702 Type-4 transaction with a 50-nonce spray window against &lt;code&gt;Binance 14&lt;/code&gt;, the full forensic ledger revealed a synchronized assault across &lt;strong&gt;10 distinct blockchains&lt;/strong&gt;: Ethereum, BNB Smart Chain, Solana, XRP Ledger, Sui/Aptos, Base, Polygon, TRON, Arbitrum, and Optimism.&lt;/p&gt;

&lt;p&gt;In approximately &lt;strong&gt;20 to 25 minutes&lt;/strong&gt;, an estimated &lt;strong&gt;$6.34 billion&lt;/strong&gt; in tokenized value was drained out of Binance custody accounts and routed into adversary aggregation contracts, overwhelming incident response teams and cross-chain liquidity.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Emergency Containment: Freezing $2.85 Billion in Flight
&lt;/h2&gt;

&lt;p&gt;Within minutes of anomaly detection, Binance severed internal signing services and halted outbound bridges. Working alongside law enforcement and intelligence units at TRM Labs and Chainalysis, emergency blacklists were deployed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Tether&lt;/strong&gt; froze &lt;strong&gt;$1.567 billion in USDT&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Circle&lt;/strong&gt; froze &lt;strong&gt;over $800 million in USDC&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ripple, BitGo, and validators&lt;/strong&gt; locked an additional &lt;strong&gt;$229 million&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Total Frozen:&lt;/strong&gt; Approximately &lt;strong&gt;$2.85 billion&lt;/strong&gt; immobilized before hitting privacy pools or mixers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;[!IMPORTANT]&lt;br&gt;
Centralized kill-switches can save institutions from catastrophic loss, but relying on external third parties to freeze funds after they leave your network is emergency triage—not security architecture.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. The Corporate Recovery Playbook
&lt;/h2&gt;

&lt;p&gt;Binance's response between October 30 and November 7 demonstrated the gold standard for crisis financial engineering:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;100% Absorbed Losses:&lt;/strong&gt; User funds were completely untouched; Binance absorbed the entire financial impact using corporate reserves and their SAFU fund.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rapid Market Replenishment:&lt;/strong&gt; Repurchased and replenished &lt;strong&gt;98% of all impacted token assets&lt;/strong&gt; via spot buying and OTC desks within 6 days.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Expanded Proof of Reserves:&lt;/strong&gt; Expanded cryptographic Proof of Reserves (PoR) from 10 core tokens to &lt;strong&gt;44 distinct assets&lt;/strong&gt; utilizing zk-SNARKs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;9-Stage Phased Resumption:&lt;/strong&gt; Deployed a disciplined, phased recovery across nine sequential operational updates, restoring networks progressively.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  6. The 5 Enterprise Security Takeaways Every CTO Must Implement
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌────────────────────────────────────────────────────────────────────────────────────────┐
│                   THE POST-BINANCE ENTERPRISE DEFENSE BLUEPRINT                        │
└────────────────────────────────────────────────────────────────────────────────────────┘

 [ 1. The Sandboxed Hiring Pipeline ]    [ 2. AI Tool &amp;amp; Dependency Governance ]
   ├── Air-gapped disposable VMs          ├── Strictly audited package mirrors
   ├── Zero local code execution          ├── Ephemeral sandbox for code assistants
   └── Out-of-band identity checks        └── Sanitized prompt &amp;amp; credential masks
                 │                                      │
                 ▼                                      ▼
 ┌──────────────────────────────────────────────────────────────────────────────────────┐
 │                [ 3. Complete Air-Gapping of Signing Services ]                       │
 │    ├── Developer machines NEVER communicate directly with dispatch pipelines         │
 │    ├── Multi-party approval (MPC / Multi-sig) on velocity changes                    │
 │    └── Ephemeral, short-lived tokens with strict mutual TLS (mTLS)                   │
 └──────────────────────────────────────────────────────────────────────────────────────┘
                                    │
                                    ▼
 [ 4. Automated Velocity Circuit Breakers ]  [ 5. Cryptographic Proof of Reserves ]
   ├── Hard hourly/daily disbursement caps     ├── Public or customer-verifiable PoR
   ├── Out-of-band PagerDuty freeze signals    ├── 3-2-1 air-gapped immutable backups
   └── Mandatory human review on anomaly spikes└── Real-time solvency auditing
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  1. Air-Gap the Hiring Pipeline
&lt;/h3&gt;

&lt;p&gt;Never permit employees to download, build, or execute technical assessments or candidate code on production-connected hardware. Mandate that all candidate evaluations and untrusted software run exclusively inside &lt;strong&gt;disposable, cloud-hosted developer environments&lt;/strong&gt; with zero access to internal VPNs.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Lock Down Developer AI Tools and Package Mirrors
&lt;/h3&gt;

&lt;p&gt;Block direct connections from developer laptops to public registries. Route all package requests through private internal mirrors that execute automated malware scanning, and enforce strict least-privilege indexing on internal AI coding assistants.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Cryptographically Isolate Automated Execution Engines
&lt;/h3&gt;

&lt;p&gt;Developer laptops must never possess network routes to production signing clusters. Enforce strict mTLS certificates tied to hardware identities (SPIFFE/SPIRE with TPMs) to prevent stolen container tokens from being reused outside their authorized host.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Implement True Velocity Circuit Breakers
&lt;/h3&gt;

&lt;p&gt;Every automated disbursement pipeline must have hard transaction caps based on historical standard deviations. When unusual velocity or anomalous withdrawal patterns are detected, the system must automatically sever outbound pipelines.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Build Proof of Resilience as a Competitive Advantage
&lt;/h3&gt;

&lt;p&gt;Regular tabletop exercises, automated failovers, and adversarial red-teaming are prerequisites for doing business in the modern threat landscape.&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://www.klytron.com/blog/binance-heist-fake-interviews-ai-supply-chain-recovery" rel="noopener noreferrer"&gt;Read the complete deep-dive with the full code repository and bonus security checklist on klytron.com&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>cybersecurity</category>
      <category>security</category>
      <category>web3</category>
    </item>
    <item>
      <title>PHP2Shell Exposed: The Critical 9.2 RCE Vulnerabilities (CVE-2026-109618 &amp; CVE-2026-109619) and Why WordPress Updates Will Not Save You</title>
      <dc:creator>Michael Laweh</dc:creator>
      <pubDate>Sun, 01 Nov 2026 00:00:31 +0000</pubDate>
      <link>https://dev.to/klytron/php2shell-exposed-the-critical-92-rce-vulnerabilities-cve-2026-109618-cve-2026-109619-and-why-1hb8</link>
      <guid>https://dev.to/klytron/php2shell-exposed-the-critical-92-rce-vulnerabilities-cve-2026-109618-cve-2026-109619-and-why-1hb8</guid>
      <description>&lt;p&gt;Over the past 48 hours, mainstream global news outlets, cybersecurity emergency response teams (CERTs), Canonical, and the &lt;strong&gt;National Security Agency (NSA)&lt;/strong&gt; have issued urgent security directives regarding &lt;strong&gt;PHP2Shell&lt;/strong&gt; (cataloged as &lt;strong&gt;CVE-2026-109618&lt;/strong&gt; and &lt;strong&gt;CVE-2026-109619&lt;/strong&gt;). Rated at a staggering &lt;strong&gt;9.2 out of 10 on the CVSS v4.0 severity scale&lt;/strong&gt;, these vulnerabilities represent one of the most critical threats to the global internet infrastructure in recent history.&lt;/p&gt;

&lt;p&gt;Unlike typical application-level bugs, PHP2Shell is an &lt;strong&gt;unauthenticated Remote Code Execution (RCE)&lt;/strong&gt; flaw living inside the core C runtime engine of PHP itself. It affects virtually every version in active production use, spanning legacy PHP 5.4 all the way through modern PHP 8.5.&lt;/p&gt;

&lt;p&gt;If your web servers, e-commerce stores, custom SaaS backends, or client platforms run PHP, remote attackers can execute arbitrary shell commands on your server without needing a username, password, or existing session.&lt;/p&gt;

&lt;p&gt;As a Solutions Architect who has engineered and secured production server infrastructure for over 16 years, I want to cut through the panic, break down the dual-CVE root cause, expose a dangerous misconception currently leaving millions of WordPress sites exposed, review official advisories from Canonical and Laravel, and provide an exact, battle-tested patching runbook you can execute right now.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The Anatomy of PHP2Shell: The Dual-CVE Breakdown
&lt;/h2&gt;

&lt;p&gt;The PHP2Shell vulnerability was uncovered with the assistance of next-generation AI security auditing models and coordinated for emergency public disclosure. Security researchers identified two distinct, mutually compounding attack vectors:&lt;/p&gt;

&lt;h3&gt;
  
  
  CVE-2026-109618: RCE via Out-of-Memory (OOM) Memory Corruption
&lt;/h3&gt;

&lt;p&gt;During multipart form-data parsing and initial request initialization, carefully crafted malformed input triggers an out-of-memory (OOM) condition inside the Zend memory manager. The runtime attempts to clean up half-initialized data structures, but the cleanup routines erroneously treat invalid or attacker-influenced pointers as valid object references. This desynchronization allows an attacker to overwrite function pointers and pivot execution directly into attacker-supplied shellcode.&lt;/p&gt;

&lt;h3&gt;
  
  
  CVE-2026-109619: RCE via Stale Global State
&lt;/h3&gt;

&lt;p&gt;In this vector, request-scoped internal state in shared memory incorrectly survives after its backing memory allocation has been freed by the garbage collector. Subsequent incoming HTTP requests reuse this dangling memory block. Attackers exploiting this flaw achieve type confusion within OPcache, turning cached bytecode references into remote shell command execution.&lt;/p&gt;

&lt;p&gt;Because both memory corruption vectors trigger during request header parsing and bytecode compilation, &lt;strong&gt;the attack executes before your application framework or CMS even initializes.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Official Advisories: Canonical, the NSA, and Laravel
&lt;/h2&gt;

&lt;p&gt;The severity of PHP2Shell has prompted coordinated alerts across all major infrastructure tiers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Canonical Ubuntu Security Notice (USN-8948-1 &amp;amp; USN-8948-2):&lt;/strong&gt; Canonical issued emergency security notices declaring both CVEs critical across all supported Ubuntu releases (Ubuntu 20.04, 22.04, 24.04 LTS). Ubuntu Pro users can apply direct automated remediation via &lt;code&gt;sudo pro fix USN-8948-1&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;National Security Agency (NSA) Advisory:&lt;/strong&gt; The NSA released a formal cybersecurity advisory urging all enterprise and government web infrastructure operators to apply emergency patches to internet-facing PHP servers immediately.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Laravel Official Security Response:&lt;/strong&gt; The Laravel core team published an advisory clarifying that while Laravel framework code itself does not contain the vulnerability, &lt;strong&gt;all Laravel applications running on unpatched PHP runtimes are vulnerable.&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. The Dangerous Trap: Why Updating WordPress Plugins Will NOT Save You
&lt;/h2&gt;

&lt;p&gt;Right now, webmasters and agency owners around the world are logging into their WordPress, Drupal, or Laravel admin panels, clicking "Update All Plugins", seeing green checkmarks, and assuming their business is safe.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This is a catastrophic illusion.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Application Code vs. Runtime Binary:&lt;/strong&gt; Plugins, themes, and CMS core files are written in PHP text scripts. PHP2Shell is a vulnerability in the &lt;strong&gt;compiled C binary&lt;/strong&gt; (&lt;code&gt;/usr/bin/php&lt;/code&gt;, &lt;code&gt;/usr/sbin/php-fpm&lt;/code&gt;, or &lt;code&gt;libphp.so&lt;/code&gt;) running on the underlying Linux or Windows server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Plugins Cannot Patch the Engine:&lt;/strong&gt; No security plugin running inside PHP can patch a memory corruption bug in the binary executing it. In fact, the vulnerability triggers before security plugins have an opportunity to inspect the request payload.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4. The Immediate Remediation Runbook
&lt;/h2&gt;

&lt;p&gt;The PHP Foundation and major Linux distribution maintainers have released emergency security updates. Here is how to diagnose and protect your servers immediately.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Check Your Active PHP Runtime Version
&lt;/h3&gt;

&lt;p&gt;Log into your server terminal via SSH and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you use FastCGI Process Manager (&lt;code&gt;php-fpm&lt;/code&gt;) with Nginx or Apache, check the specific FPM binary version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php-fpm &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;span class="c"&gt;# Or for specific versions:&lt;/span&gt;
php-fpm8.3 &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The Patched Safe Releases
&lt;/h3&gt;

&lt;p&gt;You must verify that your runtime has been updated to at least the following official patched versions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;PHP 8.2:&lt;/strong&gt; Upgrade to &lt;strong&gt;8.2.35&lt;/strong&gt; or higher&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PHP 8.3:&lt;/strong&gt; Upgrade to &lt;strong&gt;8.3.36&lt;/strong&gt; or higher&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PHP 8.4:&lt;/strong&gt; Upgrade to &lt;strong&gt;8.4.27&lt;/strong&gt; or higher&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PHP 8.5:&lt;/strong&gt; Upgrade to &lt;strong&gt;8.5.12&lt;/strong&gt; or higher&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 2: Update Server Packages (Ubuntu and Debian)
&lt;/h3&gt;

&lt;p&gt;For servers running Ubuntu 20.04, 22.04, 24.04, or Debian, run:&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="nb"&gt;sudo &lt;/span&gt;apt update
&lt;span class="c"&gt;# Upgrade all PHP runtime packages cleanly&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nt"&gt;--only-upgrade&lt;/span&gt; &lt;span class="nb"&gt;install &lt;/span&gt;php&lt;span class="k"&gt;*&lt;/span&gt;&lt;span class="nt"&gt;-cli&lt;/span&gt; php&lt;span class="k"&gt;*&lt;/span&gt;&lt;span class="nt"&gt;-fpm&lt;/span&gt; php&lt;span class="k"&gt;*&lt;/span&gt;&lt;span class="nt"&gt;-common&lt;/span&gt; php&lt;span class="k"&gt;*&lt;/span&gt;&lt;span class="nt"&gt;-opcache&lt;/span&gt;
&lt;span class="c"&gt;# Restart your web server and PHP-FPM service&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart php&lt;span class="k"&gt;*&lt;/span&gt;&lt;span class="nt"&gt;-fpm&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart nginx  &lt;span class="c"&gt;# or sudo systemctl restart apache2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you are running &lt;strong&gt;Ubuntu Pro&lt;/strong&gt;, execute Canonical's automated fix script directly:&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="nb"&gt;sudo &lt;/span&gt;pro fix USN-8948-1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Update Server Packages (RHEL, Rocky Linux, AlmaLinux)
&lt;/h3&gt;

&lt;p&gt;For Enterprise Linux environments utilizing the Remi repository:&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="nb"&gt;sudo &lt;/span&gt;dnf clean all
&lt;span class="nb"&gt;sudo &lt;/span&gt;dnf update php php-fpm php-opcache php-cli
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart php-fpm
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart httpd  &lt;span class="c"&gt;# or nginx&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. Edge Defense: Web Application Firewall (WAF) Mitigations
&lt;/h2&gt;

&lt;p&gt;While waiting for server maintenance windows, apply edge filtering rules immediately:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cloudflare WAF:&lt;/strong&gt; Enable Cloudflare Managed Rulesets (&lt;code&gt;WAF Rule 100720&lt;/code&gt; and related rules) that inspect multipart form payloads and drop known PHP2Shell exploitation vectors.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Origin IP Protection:&lt;/strong&gt; Ensure your origin server does NOT accept direct HTTP/HTTPS connections from the public internet. Restrict ports 80 and 443 exclusively to Cloudflare IP ranges using &lt;code&gt;ufw&lt;/code&gt; or &lt;code&gt;iptables&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://www.klytron.com/blog/php2shell-cve-2026-109618-remote-code-execution-fix" rel="noopener noreferrer"&gt;Read the complete deep-dive with the full code repository and bonus security checklist on klytron.com&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Inside the $6.3 Billion Binance Heist: How an Engineer's Laptop, EIP-7702, and Missing Zero-Trust Shattered History's Largest Crypto Exchange</title>
      <dc:creator>Michael Laweh</dc:creator>
      <pubDate>Fri, 30 Oct 2026 19:19:06 +0000</pubDate>
      <link>https://dev.to/klytron/inside-the-63-billion-binance-heist-how-an-engineers-laptop-eip-7702-and-missing-zero-trust-5ane</link>
      <guid>https://dev.to/klytron/inside-the-63-billion-binance-heist-how-an-engineers-laptop-eip-7702-and-missing-zero-trust-5ane</guid>
      <description>&lt;p&gt;Between October 29 and October 30, 2026, the global financial system witnessed the single largest cyber heist in recorded human history. Hackers penetrated Binance, draining an estimated $6.3 billion across multiple networks in a rapid, automated assault.&lt;/p&gt;

&lt;p&gt;Major stablecoin issuers scrambled into emergency manual containment: Tether froze $1.57 billion in USDT, Circle froze over $800 million in USDC, and Ripple froze $200 million in related assets across multiple ledgers. Blockchain analytics firms quickly identified North Korea's state-sponsored Lazarus Group behind the attack.&lt;/p&gt;

&lt;p&gt;While mainstream headlines obsess over the astronomical dollar figure, engineering leaders must examine the underlying technical autopsy. &lt;strong&gt;Binance was not brought down by an exotic mathematical breakthrough.&lt;/strong&gt; It was brought down by an unprotected developer endpoint, an over-privileged automated system, and the absence of architectural Zero Trust.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The Forensic Autopsy: How $6.3 Billion Vanished in Minutes
&lt;/h2&gt;

&lt;p&gt;According to disclosures from Binance, on-chain telemetry from Etherscan, and threat intelligence reports published by Blockaid and TRM Labs, the attack unfolded across four distinct, methodical phases.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[ Compromised Engineer Laptop ]
              │
              ▼ (Internal Pivot &amp;amp; Credential Harvesting)
[ Internal Infrastructure &amp;amp; Hot-Wallet Orchestration ]
              │
              ▼ (Type-4 Transaction: 50x EIP-7702 Nonce Spray)
[ Binance 14 Hot Wallet (0x28C6...1d60) ]
              │
              ▼ (Code Delegation to Malicious Contract)
[ Unverified Attacker Contract ] ──► Drains 167k ETH + $1.6B USDT + Tokens
              │
              ▼ (Outflow to Receiving Address 0x5227...2f8c)
[ Emergency Containment: Tether ($1.57B) &amp;amp; Circle ($800M) Manual Freezes ]

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Phase 1: The Initial Breach: The Endpoint Delusion
&lt;/h3&gt;

&lt;p&gt;The breach did not begin on the blockchain. It began on an engineer's laptop.&lt;/p&gt;

&lt;p&gt;Binance acknowledged that an initial investigation suggested the breach started with a hacked laptop belonging to one of Binance's engineers, which let an attacker gain access to internal systems and make unauthorized withdrawals.&lt;/p&gt;

&lt;p&gt;This is the vulnerability I warn clients about constantly: &lt;strong&gt;The corporate perimeter no longer ends at your cloud firewall. The perimeter is every single developer and engineer workstation connected to your network.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Phase 2: The Target: Hot Wallet &lt;code&gt;Binance 14&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;The attackers targeted Binance's primary outbound operational hot wallet, known on-chain as &lt;code&gt;Binance 14&lt;/code&gt; (&lt;code&gt;0x28C6c06298d514Db089934071355E5743bf21d60&lt;/code&gt;). Because it handles continuous customer withdrawal requests, it operates automatically, signing thousands of transactions hourly while its account sequence number increments rapidly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Phase 3: The EIP-7702 Delegation Exploit &amp;amp; The 50-Nonce Spray
&lt;/h3&gt;

&lt;p&gt;The attackers leveraged Ethereum's newly adopted &lt;strong&gt;EIP-7702&lt;/strong&gt; standard (Set Code for Externally Owned Accounts), which allows an account to temporarily delegate its code execution to a designated contract address. Executing an EIP-7702 delegation requires signing an authorization payload matching the account's &lt;strong&gt;exact live nonce&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Because &lt;code&gt;Binance 14&lt;/code&gt; was actively firing legitimate transactions, the attackers deployed a high-frequency &lt;strong&gt;"nonce spray"&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The attackers constructed an EIP-7702 Type-4 transaction containing &lt;strong&gt;50 consecutive authorization payloads&lt;/strong&gt;, covering nonces &lt;code&gt;18914775&lt;/code&gt; through &lt;code&gt;18914824&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;They broadcast this payload into the Ethereum mempool with ultra-high gas priority.&lt;/li&gt;
&lt;li&gt;As Binance's automated withdrawal backend continued firing transactions, a legitimate transaction landed inside that 50-nonce window.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The match was made.&lt;/strong&gt; The authorization succeeded, and &lt;code&gt;Binance 14&lt;/code&gt; instantly delegated its execution code to an unverified, malicious smart contract.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Phase 4: The Automated Drain &amp;amp; Centralized Rescue
&lt;/h3&gt;

&lt;p&gt;Once hijacked, the malicious contract drained over &lt;strong&gt;167,464 ETH&lt;/strong&gt; and over &lt;strong&gt;1.615 billion USDT&lt;/strong&gt; alongside hundreds of millions in USDC, WBTC, and altcoins. Tether, Circle, and Ripple central operators scrambled to freeze roughly $2.6 billion in transit, though upwards of &lt;strong&gt;$3.7 billion remains at large&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The Parallel Threat: The Polymarket Supply Chain Breach
&lt;/h2&gt;

&lt;p&gt;Simultaneously, prediction market giant &lt;strong&gt;Polymarket&lt;/strong&gt; suffered a security breach, losing $2 million after hackers injected malicious wallet-draining JavaScript into their frontend web application.&lt;/p&gt;

&lt;p&gt;How? They breached &lt;strong&gt;DebugBear&lt;/strong&gt;, a third-party web performance monitoring vendor whose scripts were embedded on Polymarket's pages. The attackers compromised the vendor's package delivery pipeline and pushed malicious code to users.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Adversaries do not bang their heads against your hardened cloud firewalls anymore. They compromise the machines of engineers or third-party dependencies.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. The 5 Enterprise Security Failures Exposed by the Heist
&lt;/h2&gt;

&lt;p&gt;The architectural breakdowns that doomed Binance exist in 90% of corporate environments today:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Compromised Engineer Laptop:&lt;/strong&gt; Endpoints are the #1 attack vector. Perimeter firewalls cannot protect against an infected internal laptop.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hot-Wallet Nonce Spray:&lt;/strong&gt; Automated services must have hard blast-radius limits, circuit breakers, and rate-limiting gates.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;EIP-7702 Blind Delegation:&lt;/strong&gt; Unchecked protocol features and uninspected code execution create instant privilege escalation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Overwhelmed $1B SAFU Fund:&lt;/strong&gt; Insurance policies and cash reserves will not cover total catastrophe. Prevention is the only viable ROI.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Polymarket / DebugBear Breach:&lt;/strong&gt; Your security is only as strong as the least-secure third-party script running with execution privileges.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4. The Actionable Zero-Trust Hardening Blueprint
&lt;/h2&gt;

&lt;p&gt;Securing modern corporate infrastructure requires shifting from &lt;strong&gt;perimeter defense&lt;/strong&gt; to &lt;strong&gt;continuous Zero Trust verification&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌────────────────────────────────────────────────────────────────────────┐
│                   THE RESILIENT ZERO-TRUST ARCHITECTURE                 │
└────────────────────────────────────────────────────────────────────────┘

 [ 1. Endpoint Hardening ]        [ 2. Least-Privilege IAM ]
   ├── Military-grade EDR          ├── Short-lived, ephemeral STS tokens
   ├── Hardware FIDO2/YubiKeys     ├── Zero persistent credentials on disk
   └── Strict MDM &amp;amp; Device Isolation └── Least-privilege role boundaries
             │                                   │
             ▼                                   ▼
 ┌───────────────────────────────────────────────────────────────────────┐
 │               [ 3. Automated Circuit Breakers &amp;amp; WAF ]                 │
 │     ├── Rate-limiting gateways and velocity anomaly detection         │
 │     ├── Cryptographic payload verification and strict schemas         │
 │     └── Automated kill-switch severs execution on breach signals      │
 └───────────────────────────────────────────────────────────────────────┘
                                     │
                                     ▼
                [ 4. Air-Gapped Disaster Recovery Fabric ]
                  ├── Immutable, decentralized backups (3-2-1)
                  ├── Client-side GPG/AES-256 encryption at rest
                  └── Automated single-command failover &amp;amp; verification

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  1. Implement Military-Grade Endpoint Detection &amp;amp; Response (EDR)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Autonomous Isolation:&lt;/strong&gt; EDR agents must have the authority to sever an infected laptop from local Wi-Fi and VPNs in milliseconds upon anomaly detection.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hardware Security Keys Only:&lt;/strong&gt; Ban SMS/TOTP. Require physical FIDO2/WebAuthn hardware keys (YubiKeys).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero Local Secrets:&lt;/strong&gt; Developers must never store long-lived production secrets locally. Utilize ephemeral credentials (AWS STS, Vault).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Architect Blast-Radius Partitions &amp;amp; Kill Switches
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Velocity Thresholds:&lt;/strong&gt; Enforce hard rate limits at the database and API gateway layer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Circuit Breakers:&lt;/strong&gt; Implement automated kill-switches that suspend processing and notify engineering leadership via out-of-band alerts when anomalous disbursement errors occur.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-Signature Quorums:&lt;/strong&gt; High-impact actions require independent cryptographic approval from multiple designated signers.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Lockdown Software Supply Chains &amp;amp; Third-Party Dependencies
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Subresource Integrity (SRI):&lt;/strong&gt; Never load third-party JavaScript from CDNs without cryptographic SRI hashes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Strict Content Security Policy (CSP):&lt;/strong&gt; Whitelist domains authorized to execute scripts or establish connections.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automated Dependency Auditing:&lt;/strong&gt; Integrate vulnerability scanners into CI/CD pipelines.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Build Immutable, Air-Gapped Disaster Recovery Fabrics
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Air-Gapped &amp;amp; Immutable:&lt;/strong&gt; Backups must replicate to WORM storage where root admins cannot overwrite prior snapshots.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Client-Side Encryption:&lt;/strong&gt; Encrypt data before leaving servers using keys stored outside the cloud provider's ecosystem.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Live Restoration Drills:&lt;/strong&gt; Regularly simulate infrastructure destruction and verify failover runbooks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://www.klytron.com/blog/binance-6-billion-hack-zero-trust-infrastructure-lessons" rel="noopener noreferrer"&gt;Read the complete deep-dive with the full code repository and bonus security checklist on klytron.com&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>PHP2Shell Exposed: The Critical 9.2 RCE Vulnerabilities (CVE-2026-109618 &amp; CVE-2026-109619) and Why WordPress Updates Will Not Save You</title>
      <dc:creator>Michael Laweh</dc:creator>
      <pubDate>Thu, 22 Oct 2026 22:34:57 +0000</pubDate>
      <link>https://dev.to/klytron/php2shell-exposed-the-critical-92-rce-vulnerabilities-cve-2026-109618-cve-2026-109619-and-why-ich</link>
      <guid>https://dev.to/klytron/php2shell-exposed-the-critical-92-rce-vulnerabilities-cve-2026-109618-cve-2026-109619-and-why-ich</guid>
      <description>&lt;p&gt;A critical 9.2 CVSS Remote Code Execution (RCE) vulnerability dubbed &lt;strong&gt;PHP2Shell&lt;/strong&gt; (cataloged under &lt;strong&gt;CVE-2026-109618&lt;/strong&gt; and &lt;strong&gt;CVE-2026-109619&lt;/strong&gt;) has exposed millions of web servers worldwide. Affecting PHP versions from legacy 5.4 all the way to modern 8.5, this unauthenticated flaw allows attackers to execute arbitrary shell commands without credentials.&lt;/p&gt;

&lt;p&gt;As a Solutions Architect who has engineered production infrastructure for over 16 years, I want to dissect the memory corruption mechanics, expose why updating plugins gives a false sense of security, and provide an exact patching runbook.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Dual-CVE Breakdown
&lt;/h2&gt;

&lt;p&gt;Discovered with the aid of advanced AI security models and coordinated for emergency disclosure, PHP2Shell consists of two compounding attack vectors:&lt;/p&gt;

&lt;h3&gt;
  
  
  CVE-2026-109618: RCE via Out-of-Memory (OOM) Memory Corruption
&lt;/h3&gt;

&lt;p&gt;During multipart form-data parsing and request initialization, malformed input triggers an OOM condition in the Zend memory manager. Cleanup routines erroneously treat invalid pointers as valid object references, allowing attackers to overwrite function pointers and pivot directly into shellcode.&lt;/p&gt;

&lt;h3&gt;
  
  
  CVE-2026-109619: RCE via Stale Global State
&lt;/h3&gt;

&lt;p&gt;Request-scoped internal state in shared memory incorrectly survives after its backing memory allocation is freed. Subsequent incoming HTTP requests reuse this dangling memory block, achieving OPcache type confusion and arbitrary command execution.&lt;/p&gt;

&lt;p&gt;Because these vectors execute during request header parsing and bytecode compilation, &lt;strong&gt;the attack happens before your framework or CMS even initializes.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Official Advisories &amp;amp; The Plugin Trap
&lt;/h2&gt;

&lt;p&gt;Major infrastructure entities have rushed to issue warnings:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Canonical:&lt;/strong&gt; Issued emergency security notices (USN-8948-1 &amp;amp; USN-8948-2) across supported Ubuntu releases.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;NSA:&lt;/strong&gt; Released formal advisories urging immediate emergency patching.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Laravel:&lt;/strong&gt; Confirmed framework code is safe, but stressed that underlying PHP runtimes must be upgraded.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Why Updating WordPress Plugins Will NOT Save You
&lt;/h3&gt;

&lt;p&gt;Webmasters logging into WordPress or Laravel to click "Update All Plugins" are facing a dangerous illusion. Plugins, themes, and CMS core scripts are written in PHP text. PHP2Shell is a bug in the &lt;strong&gt;compiled C binary&lt;/strong&gt; (&lt;code&gt;/usr/bin/php&lt;/code&gt;, &lt;code&gt;/usr/sbin/php-fpm&lt;/code&gt;, or &lt;code&gt;libphp.so&lt;/code&gt;). No security plugin can patch a memory corruption bug in the binary executing it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Immediate Remediation Runbook
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Check Your Active PHP Runtime Version
&lt;/h3&gt;

&lt;p&gt;Log into your server via SSH and verify your binaries:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If using FPM with Nginx or Apache:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php-fpm &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;span class="c"&gt;# Or for specific versions:&lt;/span&gt;
php-fpm8.3 &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ensure your runtime meets or exceeds the patched versions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;PHP 8.2:&lt;/strong&gt; Upgrade to &lt;strong&gt;8.2.35+&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PHP 8.3:&lt;/strong&gt; Upgrade to &lt;strong&gt;8.3.36+&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PHP 8.4:&lt;/strong&gt; Upgrade to &lt;strong&gt;8.4.27+&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PHP 8.5:&lt;/strong&gt; Upgrade to &lt;strong&gt;8.5.12+&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 2: Update Server Packages (Ubuntu / Debian)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nt"&gt;--only-upgrade&lt;/span&gt; &lt;span class="nb"&gt;install &lt;/span&gt;php&lt;span class="k"&gt;*&lt;/span&gt;&lt;span class="nt"&gt;-cli&lt;/span&gt; php&lt;span class="k"&gt;*&lt;/span&gt;&lt;span class="nt"&gt;-fpm&lt;/span&gt; php&lt;span class="k"&gt;*&lt;/span&gt;&lt;span class="nt"&gt;-common&lt;/span&gt; php&lt;span class="k"&gt;*&lt;/span&gt;&lt;span class="nt"&gt;-opcache&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart php&lt;span class="k"&gt;*&lt;/span&gt;&lt;span class="nt"&gt;-fpm&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart nginx  &lt;span class="c"&gt;# or apache2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If running Ubuntu Pro:&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="nb"&gt;sudo &lt;/span&gt;pro fix USN-8948-1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Update Server Packages (RHEL / AlmaLinux)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;dnf clean all
&lt;span class="nb"&gt;sudo &lt;/span&gt;dnf update php php-fpm php-opcache php-cli
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart php-fpm
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart httpd  &lt;span class="c"&gt;# or nginx&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Edge Defense: WAF Mitigations
&lt;/h2&gt;

&lt;p&gt;While planning maintenance windows, activate edge filtering:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cloudflare WAF:&lt;/strong&gt; Enable Managed Rulesets to block malicious multipart payloads.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Origin IP Protection:&lt;/strong&gt; Ensure your origin server does not accept direct public internet traffic. Restrict ports 80 and 443 strictly to Cloudflare IPs using &lt;code&gt;ufw&lt;/code&gt; or &lt;code&gt;iptables&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://klytron.com/blog/php2shell-cve-2026-109618-remote-code-execution-fix" rel="noopener noreferrer"&gt;Read the complete deep-dive with the full code repository and bonus security checklist on klytron.com&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>The Invisible Architect: Managing a Real Estate Empire’s Digital Core</title>
      <dc:creator>Michael Laweh</dc:creator>
      <pubDate>Sun, 18 Oct 2026 00:00:48 +0000</pubDate>
      <link>https://dev.to/klytron/the-invisible-architect-managing-a-real-estate-empires-digital-core-25h6</link>
      <guid>https://dev.to/klytron/the-invisible-architect-managing-a-real-estate-empires-digital-core-25h6</guid>
      <description>&lt;p&gt;In the high-pressure world of real estate development, a single security breach or a downed communication channel can cost millions. But for one of my most prominent clients—a multi-city developer—these were risks they never had to face because I operated as their &lt;strong&gt;Invisible Architect&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For years, I served as their outsourced IT Manager, an elite technical partner moving behind the scenes to ensure their entire digital operation remained impenetrable, efficient, and years ahead of the curve. True IT consultancy isn't about submitting support tickets; it's about taking strategic ownership.&lt;/p&gt;

&lt;h2&gt;
  
  
  Beyond the Employee Mindset
&lt;/h2&gt;

&lt;p&gt;The secret to a successful high-level consultancy isn't about being on the payroll; it's about being on the &lt;strong&gt;strategic front lines&lt;/strong&gt;. By remaining an independent consultant, I provided my client with something an employee rarely can: objective, unfiltered technical leadership and a relentless drive for innovation.&lt;/p&gt;

&lt;p&gt;I didn't just fix problems as they arose; I designed resilient ecosystems that prevented them from occurring in the first place.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Pillars of a Managed Infrastructure
&lt;/h2&gt;

&lt;p&gt;Managing the digital core of a real estate empire requires a multi-faceted approach spanning security, communication, and high-availability systems. Here are the core pillars of the operation I built:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Fortress-Grade Security &amp;amp; Encryption
&lt;/h3&gt;

&lt;p&gt;Data is the lifeblood of real estate deals—contracts, bank details, and proprietary strategic blueprints. I implemented a security posture that would make traditional financial institutions jealous:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;End-to-End Encryption:&lt;/strong&gt; Every piece of sensitive data was shielded by military-grade encryption protocols, ensuring that even if intercepted, it remained completely useless to prying eyes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Network Hardening:&lt;/strong&gt; I architected and managed their entire network infrastructure, deploying advanced firewalls and intrusion detection systems that worked 24/7.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. The Command Center: Email &amp;amp; Communication
&lt;/h3&gt;

&lt;p&gt;Communication is the pulse of a fast-moving real estate operation. I managed a high-uptime, high-deliverability email system ensuring that every deal-breaking message arrived instantly and securely. No spam, no downtime, no excuses.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Web Presence: The Digital Storefront
&lt;/h3&gt;

&lt;p&gt;I built and meticulously managed their entire suite of web properties. These weren't just static business cards—they were high-performance tools integrated directly with their property management systems and investor portals, engineered to be fast, secure, and visually striking.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Proactive IT Management
&lt;/h3&gt;

&lt;p&gt;As their outsourced IT Manager, I owned the entire lifecycle of their technical assets. From cloud migrations to infrastructure scaling, I ensured the technology grew at the exact same pace as their real estate portfolio.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Result: Total Technical Freedom
&lt;/h2&gt;

&lt;p&gt;The greatest value I provided to my client wasn't just the code, the servers, or the security patches—it was &lt;strong&gt;freedom&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;By taking the entire weight of the IT operation onto my shoulders, the client was free to focus on what they do best: building skyscrapers and closing deals. They slept soundly knowing their digital assets were under the watchful eye of a technical partner who treats every server rack as his own investment.&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://klytron.com/blog/outsourced-it-manager-real-estate-mogul" rel="noopener noreferrer"&gt;Read the complete deep-dive with the full code repository and bonus security checklist on klytron.com&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Zero-Password Security: Implementing the Official Laravel Passkeys Stack</title>
      <dc:creator>Michael Laweh</dc:creator>
      <pubDate>Sun, 27 Sep 2026 00:01:35 +0000</pubDate>
      <link>https://dev.to/klytron/zero-password-security-implementing-the-official-laravel-passkeys-stack-5dli</link>
      <guid>https://dev.to/klytron/zero-password-security-implementing-the-official-laravel-passkeys-stack-5dli</guid>
      <description>&lt;p&gt;Password-based authentication is a legacy security model. Phishing, credential stuffing, and weak password management continue to be the primary attack vectors for modern web applications.&lt;/p&gt;

&lt;p&gt;To solve this, the technology industry has rallied around &lt;strong&gt;WebAuthn and Passkeys&lt;/strong&gt;—a cryptographic standard enabling users to log in using biometric sensors (such as TouchID or FaceID), PINs, or physical security keys. Laravel has made this standard accessible by releasing &lt;code&gt;laravel/passkeys&lt;/code&gt; on the backend, alongside &lt;code&gt;@laravel/passkeys&lt;/code&gt; on the client.&lt;/p&gt;

&lt;p&gt;Here is how to set up the official Laravel passkeys stack in your application.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Passkeys Work Under the Hood
&lt;/h2&gt;

&lt;p&gt;Unlike passwords, passkeys rely on public-key cryptography:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Registration&lt;/strong&gt;: The user's device generates a unique cryptographic key pair. The private key remains securely stored on the device's hardware enclave, while the public key is sent to the Laravel application.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Authentication&lt;/strong&gt;: The Laravel server sends a challenge. The device signs this challenge using its private key (after biometric verification) and returns it. The server verifies the signature using the stored public key.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At no point does the server store or receive private keys, biometrics, or passwords.&lt;/p&gt;

&lt;h2&gt;
  
  
  Server-Side Installation
&lt;/h2&gt;

&lt;p&gt;Start by pulling in the first-party server-side package:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer require laravel/passkeys
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, publish the database migrations:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan vendor:publish &lt;span class="nt"&gt;--tag&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;passkeys-migrations
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the migrations to create the &lt;code&gt;passkeys&lt;/code&gt; table, which will store the public credentials associated with your users:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan migrate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Implementing the User Contract
&lt;/h3&gt;

&lt;p&gt;Your &lt;code&gt;User&lt;/code&gt; model must implement the &lt;code&gt;PasskeyUser&lt;/code&gt; contract and utilize the &lt;code&gt;PasskeyAuthenticatable&lt;/code&gt; trait:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;App\Models&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Foundation\Auth\User&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nc"&gt;Authenticatable&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Laravel\Passkeys\Contracts\PasskeyUser&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Laravel\Passkeys\Traits\PasskeyAuthenticatable&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Authenticatable&lt;/span&gt; &lt;span class="kd"&gt;implements&lt;/span&gt; &lt;span class="nc"&gt;PasskeyUser&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;PasskeyAuthenticatable&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// ...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Integrating with Laravel Fortify
&lt;/h2&gt;

&lt;p&gt;If you use Laravel Fortify or Jetstream, passkey support can be enabled directly within &lt;code&gt;config/fortify.php&lt;/code&gt; under the features array:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="s1"&gt;'features'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="nc"&gt;Features&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;registration&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
    &lt;span class="nc"&gt;Features&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;resetPasswords&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
    &lt;span class="nc"&gt;Features&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;passkeys&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="c1"&gt;// Enable official passkey authentication&lt;/span&gt;
&lt;span class="p"&gt;],&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Frontend Integration with the JS SDK
&lt;/h2&gt;

&lt;p&gt;To handle the browser-level WebAuthn ceremonies, Laravel provides a companion NPM library. Install it via your package manager:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; @laravel/passkeys
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Registering a New Passkey
&lt;/h3&gt;

&lt;p&gt;To allow a logged-in user to create a new passkey, import the registration helper and call it using Vanilla JS:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;registerPasskey&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@laravel/passkeys&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;createPasskeyButton&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;create-passkey&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;createPasskeyButton&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;click&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// 1. Request options from the Laravel backend&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/passkeys/register-options&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;options&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

        &lt;span class="c1"&gt;// 2. Trigger biometric verification on the device&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;credential&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;registerPasskey&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;options&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="c1"&gt;// 3. Send the public key credential back to Laravel&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;saveResponse&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/passkeys/register&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;X-CSRF-TOKEN&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;meta[name="csrf-token"]&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;getAttribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;content&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;credential&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;

        &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;saveResponse&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nf"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Passkey registered successfully!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Passkey registration failed:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Authenticating a User
&lt;/h3&gt;

&lt;p&gt;To log a user in without a password, implement the login flow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;authenticatePasskey&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@laravel/passkeys&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;loginButton&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;login-passkey&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;loginButton&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;click&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;email&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;email&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// 1. Fetch authentication challenge for this email&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/passkeys/login-options&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;email&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;options&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

        &lt;span class="c1"&gt;// 2. Perform WebAuthn browser challenge&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;assertion&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;authenticatePasskey&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;options&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="c1"&gt;// 3. Submit assertion to login route&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;loginResponse&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/passkeys/login&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;X-CSRF-TOKEN&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;meta[name="csrf-token"]&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;getAttribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;content&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;assertion&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;

        &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;loginResponse&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;href&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/dashboard&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Passkey login failed:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Security and Operational Edge Cases
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cross-Device Syncing&lt;/strong&gt;: Modern operating systems sync passkeys natively (e.g., Apple iCloud Keychain or Google Password Manager). Your application doesn't need to manage this.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fallback Strategies&lt;/strong&gt;: Never enforce passkeys as the &lt;em&gt;only&lt;/em&gt; authentication mechanism. Always provide magic links or TOTP fallback options.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://klytron.com/blog/laravel-passkeys-security-webauthn" rel="noopener noreferrer"&gt;Read the complete deep-dive with the full code repository and bonus security checklist on klytron.com&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>authentication</category>
      <category>laravel</category>
      <category>php</category>
      <category>security</category>
    </item>
    <item>
      <title>Production SQLite in 2026: Running Laravel Without a Database Server</title>
      <dc:creator>Michael Laweh</dc:creator>
      <pubDate>Fri, 25 Sep 2026 19:41:45 +0000</pubDate>
      <link>https://dev.to/klytron/production-sqlite-in-2026-running-laravel-without-a-database-server-1dnh</link>
      <guid>https://dev.to/klytron/production-sqlite-in-2026-running-laravel-without-a-database-server-1dnh</guid>
      <description>&lt;p&gt;When Laravel 11 made SQLite the default database for new applications, it sparked a massive debate across the ecosystem. For years, standard engineering practice dictated using SQLite solely for local testing and spinning up MySQL or PostgreSQL for staging and production.&lt;/p&gt;

&lt;p&gt;By mid-2026, the developer landscape has shifted. Fueled by the raw performance of modern NVMe SSDs, Write-Ahead Logging (WAL), and real-time streaming replication tools, SQLite is now a viable, low-maintenance production choice for read-heavy and single-server workloads.&lt;/p&gt;

&lt;p&gt;As a Senior IT Consultant and Digital Solutions Architect, I've spent the last decade designing scalable infrastructures. Here is my battle-tested operational blueprint to configure, optimize, and run SQLite in a production Laravel environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  When to Run SQLite in Production
&lt;/h2&gt;

&lt;p&gt;SQLite is not a silver bullet replacement for enterprise databases in every scenario. To make a sound architectural decision, you must understand its strengths and operational boundaries.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Ideal Use Cases
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Read-Heavy Applications&lt;/strong&gt;: Content management systems, blogs, marketing sites, and documentation portals.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Low-to-Medium Write Concurrency&lt;/strong&gt;: Sites where database updates occur primarily through backend administration panels or scheduled background jobs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Single-Server Deployments&lt;/strong&gt;: Monolithic applications running cleanly on a single virtual private server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resource-Constrained Environments&lt;/strong&gt;: Applications where maintaining a separate database daemon (like MySQL/PostgreSQL) consumes unnecessary CPU and RAM.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  When to Avoid It
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;High Write Concurrency&lt;/strong&gt;: SQLite locks the database file during writes. High numbers of concurrent write queries result in database locks and timeout exceptions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ephemeral Architectures&lt;/strong&gt;: Platforms that reset local filesystems on every deployment will wipe out local SQLite files unless mounted to persistent storage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Horizontal Scaling&lt;/strong&gt;: Running an application across multiple web servers requires shared storage or distributed database solutions like libSQL/Turso.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Tuning SQLite for Production Performance
&lt;/h2&gt;

&lt;p&gt;To run SQLite in production without bottlenecking, you must optimize its behavior using performance pragmas. In Laravel, you can apply these pragmas directly within your database configuration.&lt;/p&gt;

&lt;h3&gt;
  
  
  Enable Write-Ahead Logging (WAL)
&lt;/h3&gt;

&lt;p&gt;By default, SQLite uses rollback journals, which lock the database during transactions. Enabling WAL mode allows readers to access the database even while a write operation is in progress, drastically improving concurrency.&lt;/p&gt;

&lt;p&gt;You can configure this in your &lt;code&gt;.env&lt;/code&gt; file or directly in your database config using these pragmas:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="n"&gt;PRAGMA&lt;/span&gt; &lt;span class="n"&gt;journal_mode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;WAL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;PRAGMA&lt;/span&gt; &lt;span class="n"&gt;busy_timeout&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;PRAGMA&lt;/span&gt; &lt;span class="n"&gt;synchronous&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;NORMAL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;PRAGMA&lt;/span&gt; &lt;span class="n"&gt;foreign_keys&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;journal_mode = WAL&lt;/code&gt;: Enables Write-Ahead Logging.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;busy_timeout = 5000&lt;/code&gt;: Instructs SQLite to wait up to 5 seconds to acquire a lock before throwing a "database is locked" exception.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;synchronous = NORMAL&lt;/code&gt;: Safely relaxes file syncing constraints in WAL mode. Data integrity remains protected during application crashes, trading extreme power outage risk for a 10x write speed boost.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Custom Laravel Database Configuration
&lt;/h3&gt;

&lt;p&gt;Update the &lt;code&gt;connections.sqlite&lt;/code&gt; configuration block in &lt;code&gt;config/database.php&lt;/code&gt; to include your production pragmas:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="s1"&gt;'sqlite'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s1"&gt;'driver'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'sqlite'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s1"&gt;'url'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;env&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'DB_URL'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="s1"&gt;'database'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;env&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'DB_DATABASE'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;database_path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'database.sqlite'&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt;
    &lt;span class="s1"&gt;'prefix'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s1"&gt;'foreign_key_constraints'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;env&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'DB_FOREIGN_KEYS'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="s1"&gt;'journal_mode'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'WAL'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s1"&gt;'synchronous'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'NORMAL'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s1"&gt;'busy_timeout'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;5000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;],&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Real-Time Backups with Litestream
&lt;/h2&gt;

&lt;p&gt;The primary anxiety around running SQLite in production is file corruption or server hardware failure. Since the database is a single file on disk, a sudden server crash could lead to catastrophic data loss.&lt;/p&gt;

&lt;p&gt;To solve this, we use &lt;strong&gt;Litestream&lt;/strong&gt;, an open-source backup tool that streams WAL frames to cloud storage (like AWS S3, Cloudflare R2, or Backblaze B2) in near real-time.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Install Litestream on the Host
&lt;/h3&gt;

&lt;p&gt;For Linux environments, download and install the package:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wget https://github.com/benbjohnson/litestream/releases/download/v0.3.13/litestream-v0.3.13-linux-amd64.deb
&lt;span class="nb"&gt;sudo &lt;/span&gt;dpkg &lt;span class="nt"&gt;-i&lt;/span&gt; litestream-v0.3.13-linux-amd64.deb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Configure &lt;code&gt;/etc/litestream.yml&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Point Litestream to your SQLite database path and define your backup destination:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;dbs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/var/www/html/database/database.sqlite&lt;/span&gt;
    &lt;span class="na"&gt;replicas&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;s3&lt;/span&gt;
        &lt;span class="na"&gt;bucket&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my-laravel-backups&lt;/span&gt;
        &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;database.sqlite&lt;/span&gt;
        &lt;span class="na"&gt;access-key-id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;env.AWS_ACCESS_KEY_ID&lt;/span&gt;
        &lt;span class="na"&gt;secret-access-key&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;env.AWS_SECRET_ACCESS_KEY&lt;/span&gt;
        &lt;span class="na"&gt;region&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;us-east-1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Run the Daemon
&lt;/h3&gt;

&lt;p&gt;Enable and start the Litestream service to handle continuous replication:&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="nb"&gt;sudo &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;litestream
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start litestream
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If your server experiences total failure, restoring your database to the latest second is as simple as running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;litestream restore &lt;span class="nt"&gt;-o&lt;/span&gt; /var/www/html/database/database.sqlite s3://my-laravel-backups/database.sqlite
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://klytron.com/blog/production-sqlite-laravel" rel="noopener noreferrer"&gt;Read the complete deep-dive with the full code repository and bonus security checklist on klytron.com&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>backend</category>
      <category>database</category>
      <category>laravel</category>
      <category>sql</category>
    </item>
    <item>
      <title>Moving Off PaaS: Deploying Production Laravel Stacks with Kamal 2</title>
      <dc:creator>Michael Laweh</dc:creator>
      <pubDate>Sun, 13 Sep 2026 00:00:54 +0000</pubDate>
      <link>https://dev.to/klytron/moving-off-paas-deploying-production-laravel-stacks-with-kamal-2-2h0j</link>
      <guid>https://dev.to/klytron/moving-off-paas-deploying-production-laravel-stacks-with-kamal-2-2h0j</guid>
      <description>&lt;p&gt;Platform-as-a-Service (PaaS) providers make launching a web application simple. You push code, and they handle the infrastructure. However, as your application grows, the cost scales aggressively. What starts as a $20/month hobby server can scale to hundreds or thousands of dollars for simple database upgrades, extra RAM, or custom background workers.&lt;/p&gt;

&lt;p&gt;In the past, moving off a PaaS meant adopting complex container orchestrators like Kubernetes or spending hours writing custom server setup scripts.&lt;/p&gt;

&lt;p&gt;Kamal 2 (created by 37signals) offers a middle ground. It is an infrastructure-agnostic deployment tool that allows you to deploy containerized applications to any virtual private server (like Hetzner, DigitalOcean, or bare metal) with zero downtime, using a clean SSH-based workflow.&lt;/p&gt;

&lt;p&gt;Here is a practical engineering guide to deploying a production Laravel application using Kamal 2.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Prerequisites and Docker Setup
&lt;/h2&gt;

&lt;p&gt;To deploy with Kamal, your application must be containerized. We need a production-ready &lt;code&gt;Dockerfile&lt;/code&gt; that packages PHP-FPM, Nginx, and the necessary PHP extensions.&lt;/p&gt;

&lt;p&gt;Create a &lt;code&gt;Dockerfile&lt;/code&gt; in the root of your Laravel project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="s"&gt; php:8.4-fpm-alpine&lt;/span&gt;

&lt;span class="c"&gt;# Install system dependencies and PHP extensions&lt;/span&gt;
&lt;span class="k"&gt;RUN &lt;/span&gt;apk add &lt;span class="nt"&gt;--no-cache&lt;/span&gt; &lt;span class="se"&gt;\
&lt;/span&gt;    nginx &lt;span class="se"&gt;\
&lt;/span&gt;    supervisor &lt;span class="se"&gt;\
&lt;/span&gt;    postgresql-dev &lt;span class="se"&gt;\
&lt;/span&gt;    libxml2-dev &lt;span class="se"&gt;\
&lt;/span&gt;    oniguruma-dev &lt;span class="se"&gt;\
&lt;/span&gt;    libpng-dev &lt;span class="se"&gt;\
&lt;/span&gt;    zip &lt;span class="se"&gt;\
&lt;/span&gt;    unzip &lt;span class="se"&gt;\
&lt;/span&gt;    git &lt;span class="se"&gt;\
&lt;/span&gt;    curl &lt;span class="se"&gt;\
&lt;/span&gt;    bash

&lt;span class="k"&gt;RUN &lt;/span&gt;docker-php-ext-install pdo_pgsql mbstring xml gd bcmath opcache

&lt;span class="c"&gt;# Copy Nginx and Supervisor configs&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; docker/nginx.conf /etc/nginx/nginx.conf&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; docker/supervisord.conf /etc/supervisord.conf&lt;/span&gt;

&lt;span class="c"&gt;# Copy application files\WORKDIR /var/www/html&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; . .&lt;/span&gt;

&lt;span class="c"&gt;# Install composer dependencies&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; --from=composer:latest /usr/bin/composer /usr/bin/composer&lt;/span&gt;
&lt;span class="k"&gt;RUN &lt;/span&gt;composer &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--no-dev&lt;/span&gt; &lt;span class="nt"&gt;--optimize-autoloader&lt;/span&gt; &lt;span class="nt"&gt;--no-interaction&lt;/span&gt;

&lt;span class="c"&gt;# Set directory permissions&lt;/span&gt;
&lt;span class="k"&gt;RUN &lt;/span&gt;&lt;span class="nb"&gt;chown&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache

&lt;span class="c"&gt;# Expose port 80 and boot supervisor&lt;/span&gt;
&lt;span class="k"&gt;EXPOSE&lt;/span&gt;&lt;span class="s"&gt; 80&lt;/span&gt;
&lt;span class="k"&gt;CMD&lt;/span&gt;&lt;span class="s"&gt; ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. Installation and Initializing Kamal
&lt;/h2&gt;

&lt;p&gt;Ensure you have Docker running locally. Then, install Kamal on your local development machine:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gem &lt;span class="nb"&gt;install &lt;/span&gt;kamal
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once installed, run the initialization command in your Laravel project root:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kamal init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command generates three key files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;config/deploy.yml&lt;/code&gt;&lt;/strong&gt;: The primary deployment configuration file.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;.env&lt;/code&gt;&lt;/strong&gt;: Locally contains secret keys and registry passwords (ignored by git).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;.kamal/secrets&lt;/code&gt;&lt;/strong&gt;: Scripts for managing secrets securely.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Configuring &lt;code&gt;config/deploy.yml&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;deploy.yml&lt;/code&gt; file defines your servers, your container image registry, and your service configurations. Here is a production configuration setting up a Laravel app and a Redis server on a single VPS:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;service&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my-laravel-app&lt;/span&gt;

&lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;klytron/my-laravel-app&lt;/span&gt;

&lt;span class="na"&gt;servers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;web&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;hosts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;192.0.2.1&lt;/span&gt; &lt;span class="c1"&gt;# Your VPS IP address&lt;/span&gt;
    &lt;span class="na"&gt;labels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;traefik.http.routers.my-laravel-app.rule&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Host(`app.example.com`)"&lt;/span&gt;

&lt;span class="na"&gt;registry&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;username&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;klytron&lt;/span&gt;
  &lt;span class="na"&gt;password&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;KAMAL_REGISTRY_PASSWORD&lt;/span&gt;

&lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;clear&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;DB_CONNECTION&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;pgsql&lt;/span&gt;
    &lt;span class="na"&gt;DB_HOST&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;192.0.2.1&lt;/span&gt;
    &lt;span class="na"&gt;DB_PORT&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5432&lt;/span&gt;
    &lt;span class="na"&gt;DB_DATABASE&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my_database&lt;/span&gt;
    &lt;span class="na"&gt;REDIS_HOST&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my-laravel-app-redis&lt;/span&gt;
  &lt;span class="na"&gt;secret&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;APP_KEY&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;DB_PASSWORD&lt;/span&gt;

&lt;span class="na"&gt;accessories&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;redis&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;redis:7.2-alpine&lt;/span&gt;
    &lt;span class="na"&gt;roles&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;web&lt;/span&gt;
    &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;6379:6379"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Managing Environment Secrets
&lt;/h2&gt;

&lt;p&gt;To prevent sensitive API keys or database passwords from leaking, Kamal retrieves secrets from your local &lt;code&gt;.env&lt;/code&gt; file on deployment and injects them into the running container securely.&lt;/p&gt;

&lt;p&gt;Define your local variables in your local &lt;code&gt;.env&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;KAMAL_REGISTRY_PASSWORD=dckr_pat_your_docker_hub_token
APP_KEY=base64:your_production_laravel_key
DB_PASSWORD=your_production_database_password
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you deploy, Kamal reads these values and writes them to an encrypted environment file inside the target server.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Executing the First Deployment
&lt;/h2&gt;

&lt;p&gt;With your servers, registry, and environment variables configured, run the setup routine:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;```bash\ kamal setup&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


This command will:
1. SSH into your target server.
2. Install Docker (if not present).
3. Install Traefik as a reverse proxy.
4. Boot configured accessories like Redis.
5. Build, push, and pull your Docker images.
6. Start containers and manage traffic routing.

For subsequent updates, run `kamal deploy` for seamless zero-downtime rolling updates.

👉 **[Read the complete deep-dive with the full code repository and bonus security checklist on klytron.com](https://klytron.com/blog/moving-off-paas-kamal-2-laravel)**
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>deployment</category>
      <category>devops</category>
      <category>laravel</category>
      <category>php</category>
    </item>
    <item>
      <title>Distributed Background Processing: Scaling Temporal Workflows with Laravel</title>
      <dc:creator>Michael Laweh</dc:creator>
      <pubDate>Sun, 30 Aug 2026 00:01:20 +0000</pubDate>
      <link>https://dev.to/klytron/distributed-background-processing-scaling-temporal-workflows-with-laravel-267j</link>
      <guid>https://dev.to/klytron/distributed-background-processing-scaling-temporal-workflows-with-laravel-267j</guid>
      <description>&lt;p&gt;Laravel's queue system is excellent. Redis-backed queues and supervisors can handle millions of standard jobs efficiently. However, when background processing evolves into complex, multi-day, retry-sensitive state machines, standard queues begin to show limits.&lt;/p&gt;

&lt;p&gt;Consider a multi-step user onboarding flow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Send a welcome email.&lt;/li&gt;
&lt;li&gt;Wait 3 days.&lt;/li&gt;
&lt;li&gt;Check if the user uploaded a profile picture.&lt;/li&gt;
&lt;li&gt;If not, send a reminder.&lt;/li&gt;
&lt;li&gt;Wait another 4 days.&lt;/li&gt;
&lt;li&gt;If still incomplete, flag the account for manual sales outreach.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Implementing this with standard Laravel jobs requires writing complex database state tracking, configuring multiple delayed dispatch loops, and managing manual retry intervals. If a server reboots mid-process, tracking which step a user was on becomes an operational nightmare.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Temporal&lt;/strong&gt; solves this. It is a workflow orchestration engine that guarantees state progression. It allows you to write standard PHP code while Temporal handles state persistence, timeouts, queryable statuses, and complex retries.&lt;/p&gt;

&lt;p&gt;Here is how to integrate Temporal into your Laravel application.&lt;/p&gt;

&lt;h2&gt;
  
  
  Core Architecture: Workflows vs. Activities
&lt;/h2&gt;

&lt;p&gt;Temporal separates execution logic into two distinct concepts to ensure reliability and fault tolerance:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Workflows&lt;/strong&gt;: The orchestrator. Workflows &lt;strong&gt;must be deterministic&lt;/strong&gt;. They dictate the flow of execution, handle sleep intervals, and coordinate steps. Because they are deterministic, they must not interact directly with external systems, databases, or random functions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Activities&lt;/strong&gt;: The execution layer. Activities can be non-deterministic. They perform the actual work: making database queries, querying third-party APIs, sending emails, or writing files.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Setting Up Temporal in Laravel
&lt;/h2&gt;

&lt;p&gt;To communicate with a Temporal cluster, install the official Temporal PHP SDK via Composer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer require temporal/sdk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, configure your Temporal environment. In your &lt;code&gt;.env&lt;/code&gt;, define the location of your Temporal address (by default, a local installation runs on port &lt;code&gt;7233&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;TEMPORAL_ADDRESS=127.0.0.1:7233
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Writing Your First Workflow and Activity
&lt;/h2&gt;

&lt;p&gt;Let’s implement the user onboarding flow described earlier using clean, maintainable PHP classes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Define the Activity Interface and Implementation
&lt;/h3&gt;

&lt;p&gt;Activities contain your standard Laravel logic, such as Eloquent database queries and mailing services.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;App\Temporal\Activities&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Temporal\Activity\ActivityInterface&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Temporal\Activity\Method\ActivityMethod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="na"&gt;#[ActivityInterface]&lt;/span&gt;
&lt;span class="kd"&gt;interface&lt;/span&gt; &lt;span class="nc"&gt;OnboardingActivitiesInterface&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;#[ActivityMethod]&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;sendWelcomeEmail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nv"&gt;$userId&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="na"&gt;#[ActivityMethod]&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;checkProfileStatus&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nv"&gt;$userId&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="na"&gt;#[ActivityMethod]&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;sendProfileReminder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nv"&gt;$userId&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, implement the activities using Laravel’s dependency injection container:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;App\Temporal\Activities&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;App\Models\User&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;App\Mail\WelcomeMail&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;App\Mail\ReminderMail&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Support\Facades\Mail&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;OnboardingActivities&lt;/span&gt; &lt;span class="kd"&gt;implements&lt;/span&gt; &lt;span class="nc"&gt;OnboardingActivitiesInterface&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;sendWelcomeEmail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nv"&gt;$userId&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;findOrFail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$userId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nc"&gt;Mail&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;to&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$user&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;WelcomeMail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$user&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;checkProfileStatus&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nv"&gt;$userId&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;findOrFail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$userId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="k"&gt;empty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$user&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;avatar_path&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;sendProfileReminder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nv"&gt;$userId&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;findOrFail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$userId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nc"&gt;Mail&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;to&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$user&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ReminderMail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$user&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Define the Workflow Interface and Implementation
&lt;/h3&gt;

&lt;p&gt;The workflow dictates the timing and business logic. It orchestrates the activities without executing side effects directly.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;App\Temporal\Workflows&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Temporal\Workflow\WorkflowInterface&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Temporal\Workflow\WorkflowMethod&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="na"&gt;#[WorkflowInterface]&lt;/span&gt;
&lt;span class="kd"&gt;interface&lt;/span&gt; &lt;span class="nc"&gt;OnboardingWorkflowInterface&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;#[WorkflowMethod]&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;runOnboarding&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nv"&gt;$userId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Implement the workflow, utilizing Temporal’s built-in time mechanics:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;App\Temporal\Workflows&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Carbon\CarbonInterval&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Temporal\Workflow&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;App\Temporal\Activities\OnboardingActivitiesInterface&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;OnboardingWorkflow&lt;/span&gt; &lt;span class="kd"&gt;implements&lt;/span&gt; &lt;span class="nc"&gt;OnboardingWorkflowInterface&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="nv"&gt;$activities&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;__construct&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// Bind the activities interface with retry settings&lt;/span&gt;
        &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;activities&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Workflow&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;newActivityStub&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="nc"&gt;OnboardingActivitiesInterface&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="nc"&gt;Workflow\ActivityOptions&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
                &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;withStartToCloseTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;CarbonInterval&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;seconds&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
        &lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;runOnboarding&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nv"&gt;$userId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// 1. Send welcome email immediately&lt;/span&gt;
        &lt;span class="k"&gt;yield&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;activities&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;sendWelcomeEmail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$userId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="c1"&gt;// 2. Sleep for 3 days&lt;/span&gt;
        &lt;span class="k"&gt;yield&lt;/span&gt; &lt;span class="nc"&gt;Workflow&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;timer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;CarbonInterval&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;days&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

        &lt;span class="c1"&gt;// 3. Check if they uploaded an avatar&lt;/span&gt;
        &lt;span class="nv"&gt;$hasUploadedAvatar&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;yield&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;activities&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;checkProfileStatus&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$userId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nv"&gt;$hasUploadedAvatar&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="c1"&gt;// 4. Send reminder email&lt;/span&gt;
            &lt;span class="k"&gt;yield&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;activities&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;sendProfileReminder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$userId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Booting the PHP Worker
&lt;/h2&gt;

&lt;p&gt;Unlike standard Laravel queues which run via &lt;code&gt;artisan queue:work&lt;/code&gt;, Temporal requires a worker daemon to boot, register your workflows and activities, and poll the Temporal server for tasks.&lt;/p&gt;

&lt;p&gt;Create an Artisan command &lt;code&gt;app/Console/Commands/TemporalWorker.php&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;App\Console\Commands&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Console\Command&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Temporal\WorkerFactory&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;App\Temporal\Workflows\OnboardingWorkflow&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;App\Temporal\Activities\OnboardingActivities&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;TemporalWorker&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Command&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="nv"&gt;$signature&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'temporal:work'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="nv"&gt;$description&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Start the Temporal PHP worker'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Starting Temporal PHP Worker..."&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="nv"&gt;$factory&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;WorkerFactory&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="nv"&gt;$worker&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$factory&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;newWorker&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'onboarding-task-queue'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="c1"&gt;// Register implementations&lt;/span&gt;
        &lt;span class="nv"&gt;$worker&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;registerWorkflowTypes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;OnboardingWorkflow&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nv"&gt;$worker&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;registerActivityImplementations&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;OnboardingActivities&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;

        &lt;span class="nv"&gt;$factory&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keep this worker running in production using a battle-tested process manager like &lt;strong&gt;Supervisor&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Dispatching the Workflow
&lt;/h2&gt;

&lt;p&gt;To trigger the onboarding process when a user registers, dispatch the workflow from your Laravel Controller or Event Listener:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;App\Http\Controllers&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Temporal\Client\WorkflowClientInterface&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;App\Temporal\Workflows\OnboardingWorkflowInterface&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;AuthController&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Controller&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;register&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;WorkflowClientInterface&lt;/span&gt; &lt;span class="nv"&gt;$workflowClient&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// Create user registration record...&lt;/span&gt;
        &lt;span class="nv"&gt;$user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Auth&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;user&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

        &lt;span class="c1"&gt;// Start onboarding workflow asynchronously&lt;/span&gt;
        &lt;span class="nv"&gt;$run&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$workflowClient&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;start&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="nv"&gt;$workflowClient&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;newWorkflowStub&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;OnboardingWorkflowInterface&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="nv"&gt;$workflowClient&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;start&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$run&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$user&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;response&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="s1"&gt;'message'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'Registration complete.'&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Temporal shifts the complexity of managing background state machines away from your application database. By separating timing orchestration (workflows) from operational code (activities), you build highly readable, fault-tolerant background systems that scale reliably.&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://klytron.com/blog/scaling-temporal-workflows-laravel" rel="noopener noreferrer"&gt;Read the complete deep-dive with the full code repository and bonus security checklist on klytron.com&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>backend</category>
      <category>laravel</category>
      <category>php</category>
    </item>
    <item>
      <title>The Fractional CTO Guide: How to Audit Your Business for AI Automation ROI</title>
      <dc:creator>Michael Laweh</dc:creator>
      <pubDate>Sun, 05 Jul 2026 00:01:35 +0000</pubDate>
      <link>https://dev.to/klytron/the-fractional-cto-guide-how-to-audit-your-business-for-ai-automation-roi-6lp</link>
      <guid>https://dev.to/klytron/the-fractional-cto-guide-how-to-audit-your-business-for-ai-automation-roi-6lp</guid>
      <description>&lt;p&gt;It's an exciting time to be in tech, with AI making headlines daily and business leaders eager to leverage its power. Yet, as a Senior IT Consultant and Digital Solutions Architect with over a decade of experience, I've observed a recurring pattern: many companies enthusiastically adopt AI tools, only to find their balance sheets reflect increased software licensing costs but no tangible improvement in core operational metrics like processing times, customer support turnaround, or error rates.&lt;/p&gt;

&lt;p&gt;This is what I call the &lt;strong&gt;AI adoption gap&lt;/strong&gt;. The issue isn't the capability of Large Language Models (LLMs) or automation tools themselves; it's the absence of a structured integration strategy. Simply purchasing individual tool licenses rarely translates into automated business processes or measurable value. True transformation requires a deeper, more thoughtful approach.&lt;/p&gt;

&lt;p&gt;My role as a Fractional CTO often involves guiding businesses through this challenge—moving them from mere AI adoption to strategic AI integration. Over the years, I've refined a step-by-step audit framework that helps identify high-leverage automation points and design integrations that genuinely deliver measurable business returns. Let's dive into how you can apply this framework within your organization.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Step 1: Mapping High-Volume, Linear Workflows
&lt;/h2&gt;

&lt;p&gt;Before you can automate anything, you need a crystal-clear understanding of the process itself. This initial phase of an automation audit is all about documenting your existing business workflows. You cannot effectively automate what hasn't been precisely mapped.&lt;/p&gt;

&lt;p&gt;When identifying candidates for automation, I look for workflows that exhibit specific characteristics, as these offer the highest potential for immediate and impactful ROI:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;High Volume&lt;/strong&gt;: Focus on tasks that are performed dozens, hundreds, or even thousands of times per week. Automating a task that happens once a month, while potentially valuable, won't move the needle on overall operational efficiency as much as a daily, repetitive task.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Linear Progression&lt;/strong&gt;: The workflow should have clear, predictable inputs, well-defined intermediate transformation steps, and a standardized output structure. Think of it like a recipe: a clear sequence of actions that, when followed, always leads to the same outcome.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Low Judgment Complexity&lt;/strong&gt;: The decisions required within the workflow should be primarily rule-based and not demand extensive subjective evaluation, creative problem-solving, or nuanced human judgment. If a task requires complex emotional intelligence or abstract reasoning, it's likely a poor candidate for full automation (though AI might assist in parts).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Practical Example: Automating Vendor Invoice Processing
&lt;/h3&gt;

&lt;p&gt;Consider a common scenario many businesses face: processing vendor invoices. Let's break down a typical manual workflow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Input&lt;/strong&gt;: A PDF invoice arrives in a generic Accounts Payable (AP) email inbox.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Transformation&lt;/strong&gt;: A human employee downloads the attachment, opens the PDF, manually reads the text, extracts critical information (vendor name, invoice number, total amount, individual line items), and then manually enters this data into the company's accounting software (e.g., Xero, QuickBooks, SAP).&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Output&lt;/strong&gt;: A pending transaction record is created in the accounting system, awaiting further approval.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This workflow is a near-perfect candidate for automation. The inputs are structured (PDF text, which can be read by OCR), the actions are highly repetitive (data extraction, data entry), and the output is standardized (API-based transaction creation). By automating this, you're not just saving time; you're reducing human error and freeing up your AP team for more strategic financial analysis.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Step 2: Drawing the Decision Boundary (Human-in-the-Loop)
&lt;/h2&gt;

&lt;p&gt;One of the biggest mistakes I see companies make is attempting to fully automate processes where high-risk decisions are involved. While AI agents excel at tasks like data extraction, summarization, and initial drafting, they are generally not suited for making final, high-stakes calls without human oversight. The risk of hallucination or subtle errors impacting critical financial or customer systems is too high.&lt;/p&gt;

&lt;p&gt;This is where defining the 'human-in-the-loop' checkpoint becomes critical. For every candidate workflow, you must isolate the &lt;strong&gt;decision layer&lt;/strong&gt; and design your automation system around it. The goal is to leverage AI for efficiency while maintaining human accountability and error mitigation.&lt;/p&gt;

&lt;p&gt;Here's the structured workflow I advocate:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;graph LR
    A[Input Document] --&amp;gt; B[AI Pipeline: Extraction &amp;amp; Formatting]
    B --&amp;gt; C{Human Review &amp;amp; Approval}
    C -- Approved --&amp;gt; D[System Execution]
    C -- Rejected/Flagged --&amp;gt; E[Human Exception Handling]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Represented more simply in code flow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Simplified AI Automation Workflow with Human-in-the-Loop
&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;process_document_with_ai&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;document_path&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# 1. AI Pipeline: Extraction &amp;amp; Formatting
&lt;/span&gt;    &lt;span class="n"&gt;extracted_data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;ai_extract_and_format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;document_path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# e.g., extract invoice details
&lt;/span&gt;
    &lt;span class="c1"&gt;# 2. Human Review &amp;amp; Approval
&lt;/span&gt;    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Review required for document: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;document_path&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;AI Extracted Data: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;extracted_data&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# In a real system, this would be a UI where a human reviews and clicks 'Approve' or 'Reject'
&lt;/span&gt;    &lt;span class="n"&gt;user_input&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Approve (A) or Reject/Flag (R)? &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;upper&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;user_input&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;A&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="c1"&gt;# 3. System Execution (if approved)
&lt;/span&gt;        &lt;span class="nf"&gt;system_execute_action&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;extracted_data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# e.g., post to accounting software API
&lt;/span&gt;        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Document processed and action executed successfully.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="c1"&gt;# 4. Human Exception Handling (if rejected/flagged)
&lt;/span&gt;        &lt;span class="nf"&gt;handle_exception&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;document_path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;extracted_data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Human flagged for review.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Document flagged for manual review and exception handling.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;

&lt;span class="c1"&gt;# Example usage:
# process_document_with_ai("path/to/invoice.pdf")
&lt;/span&gt;
&lt;span class="c1"&gt;# Placeholder functions for demonstration
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;ai_extract_and_format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# Simulate AI processing
&lt;/span&gt;    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;AI extracting data from &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;doc&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;vendor&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Acme Corp&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;total&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;1234.56&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;items&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;item1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;item2&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]}&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;system_execute_action&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# Simulate API call to accounting software
&lt;/span&gt;    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Executing system action with data: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;handle_exception&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;reason&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# Simulate logging or routing to a human queue
&lt;/span&gt;    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Exception handler: Document &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;doc&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; with data &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; was flagged. Reason: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;reason&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By structuring your workflows this way, you achieve significant benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  The AI handles the vast majority (90-95%) of the manual, repetitive labor—scanning, matching, drafting, and initial data entry.&lt;/li&gt;
&lt;li&gt;  The human role shifts dramatically from a &lt;strong&gt;data enterer&lt;/strong&gt; to an &lt;strong&gt;auditor&lt;/strong&gt; or &lt;strong&gt;exception handler&lt;/strong&gt;. Their focus moves to reviewing edge cases, correcting AI outputs, and ultimately clicking "approve."&lt;/li&gt;
&lt;li&gt;  The risk of AI hallucinations or errors negatively impacting your critical business systems is virtually eliminated, as a human is always the final gatekeeper for sensitive actions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This blended approach is often the sweet spot for maximizing efficiency while maintaining robustness and trust in your automated systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Step 3: Auditing Your Data Infrastructure
&lt;/h2&gt;

&lt;p&gt;An AI automation system, particularly one leveraging Retrieval-Augmented Generation (RAG) or intricate rule-based decision-making, is only as effective as the data it can access and interpret. This might sound obvious, but I've seen countless automation projects stall or fail because the underlying data infrastructure was fragmented, inaccessible, or simply unreliable.&lt;/p&gt;

&lt;p&gt;If your company’s internal operational policies, product specifications, customer records, and historical knowledge are scattered across individual employee email accounts, local hard drives, unsearchable PDFs, or informal chat threads, an AI agent simply cannot help. It lacks the cohesive, structured information environment it needs to function effectively.&lt;/p&gt;

&lt;p&gt;Before embarking on any significant AI integration, you must conduct a thorough audit of your data readiness. Here are the key areas to focus on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Centralization&lt;/strong&gt;: Are your standard operating procedures (SOPs), knowledge base articles, product documentation, and internal guides housed in a central, searchable wiki (like Confluence or Notion), a well-organized shared drive, or a dedicated document management system? AI needs a single, authoritative source of truth.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;API Accessibility&lt;/strong&gt;: Do your core line-of-business applications—your CRM (e.g., Salesforce), ERP (e.g., NetSuite), billing system, project management tools—expose reliable, well-documented REST APIs? For AI to trigger actions or retrieve real-time data, it needs programmatic access to these systems. If not, this becomes a foundational pre-requisite for integration.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Data Sanitation and Quality&lt;/strong&gt;: Is your customer database clean? Does your inventory system have accurate, up-to-date records? Are there duplicated entries, inconsistent formatting, or outdated information? Garbage in, garbage out applies rigorously to AI. An automation audit frequently begins as a data organization and cleanliness project. Investing in data quality upfront will save you immeasurable headaches down the line.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Think of it this way: AI is like a brilliant new employee. But even the smartest employee can't perform if they can't find the relevant files, don't know where the manuals are, or can't access the necessary systems. Once your company data flows through centralized, accessible, and clean APIs, integrating AI triggers and RAG systems becomes remarkably more straightforward and reliable.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Step 4: Measuring Success and ROI
&lt;/h2&gt;

&lt;p&gt;This step is non-negotiable. Never, under any circumstances, should you begin an AI integration project without clearly defining what success looks like in concrete business metrics. Vague goals like "making things faster" or "improving efficiency" are not business metrics; they are aspirations. You need quantifiable targets.&lt;/p&gt;

&lt;p&gt;Before writing a single line of code or signing a new SaaS contract, you must define your metrics with precision. This involves understanding your current baseline, projecting your post-automation targets, and articulating the measurable business return on investment.&lt;/p&gt;

&lt;p&gt;Let's revisit our invoice processing example and expand on the metrics:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Current Metric&lt;/th&gt;
&lt;th&gt;Projected Post-Automation Metric&lt;/th&gt;
&lt;th&gt;Measurable Business ROI&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;15 minutes&lt;/strong&gt; manual entry per invoice&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;20 seconds&lt;/strong&gt; human review time per invoice&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;97% reduction&lt;/strong&gt; in labor hours for this task, allowing AP staff to be reallocated to higher-value financial analysis or exception handling, avoiding new hires.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;48-hour&lt;/strong&gt; customer reply time&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;10-minute&lt;/strong&gt; automated email draft (human-reviewed)&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Improved customer satisfaction&lt;/strong&gt; scores, &lt;strong&gt;reduced support ticket volume&lt;/strong&gt; (as initial queries are resolved faster), freeing support agents for complex issues.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;4%&lt;/strong&gt; human transcription error rate&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;0.1%&lt;/strong&gt; structured extraction error rate&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Lower rework costs&lt;/strong&gt; due to data entry mistakes, &lt;strong&gt;fewer administrative delays&lt;/strong&gt; in processing orders/payments, improved data accuracy for reporting and analytics.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;$50,000/year&lt;/strong&gt; in missed renewal opportunities from churned clients&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;$10,000/year&lt;/strong&gt; after proactive AI-driven outreach&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Increased revenue retention&lt;/strong&gt; by identifying at-risk customers early and automating personalized engagement strategies, directly impacting the bottom line.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Notice how each projected metric ties directly to a tangible business benefit: cost reduction, revenue increase, improved customer satisfaction, or reduced operational risk. This clarity allows you to justify your AI investment, track progress, and demonstrate unequivocal value to stakeholders.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion: Strategic Integration for Real Value
&lt;/h2&gt;

&lt;p&gt;The businesses that will truly capture sustainable value from artificial intelligence are not merely the ones adopting the newest, flashiest tools. They are the ones that systematically audit their operational bottlenecks, meticulously clean and organize their data pipelines, and design custom integration architectures that blend AI capabilities with human oversight.&lt;/p&gt;

&lt;p&gt;As a Fractional CTO, my commitment is to help you move beyond the hype and implement practical, results-driven AI solutions. If you're a business leader looking to map automation opportunities, optimize your existing software stack, or secure a seasoned technology partner to lead your digital transformation roadmap, an infrastructure audit is the critical first step.&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://klytron.com/blog/fractional-cto-business-ai-roi" rel="noopener noreferrer"&gt;Read the complete deep-dive on designing your AI integration roadmap, including advanced security considerations and a full project planning template, on klytron.com&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>automation</category>
      <category>leadership</category>
      <category>productivity</category>
    </item>
    <item>
      <title>The Hybrid Architecture: Blending Physical IoT with Cloud Computing</title>
      <dc:creator>Michael Laweh</dc:creator>
      <pubDate>Sun, 21 Jun 2026 00:01:17 +0000</pubDate>
      <link>https://dev.to/klytron/the-hybrid-architecture-blending-physical-iot-with-cloud-computing-5120</link>
      <guid>https://dev.to/klytron/the-hybrid-architecture-blending-physical-iot-with-cloud-computing-5120</guid>
      <description>&lt;p&gt;As software engineers, we often architect solutions in a virtual ideal: fast networks, elastic resources, and servers that never physically degrade. But what happens when your carefully crafted systems need to interact with the messy, unpredictable physical world? Think factory floor monitors, real estate camera networks, or remote tracking devices. Suddenly, those cloud assumptions about infinite uptime and perfect connectivity crumble.&lt;/p&gt;

&lt;p&gt;My journey, particularly architecting and maintaining a continuous 24/7 camera livestream for a real estate group over six years, has been a masterclass in this reality. It's revealed that true reliability in the physical realm demands a hybrid approach – one that intelligently merges the power of edge computing with the scalability and data insights of the cloud. This isn't just about connecting devices; it's about building resilience into the very fabric of your architecture.&lt;/p&gt;

&lt;p&gt;In this article, I'll share the battle-tested strategies and design principles that enable systems to not just survive, but thrive, despite the harsh realities of physical deployment.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The Core Strategy: Smart Edge, Simple Cloud
&lt;/h2&gt;

&lt;p&gt;One of the most common pitfalls in hybrid architecture design is treating the edge device as a mere 'dumb' terminal, solely responsible for streaming raw data to a powerful cloud backend. This approach creates a critical single point of failure: if the network drops, the entire system grinds to a halt.&lt;/p&gt;

&lt;p&gt;Instead, I advocate for a &lt;strong&gt;Smart Edge, Simple Cloud&lt;/strong&gt; architecture. This principle establishes a clear division of responsibility:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;The Edge&lt;/strong&gt;: This is where the magic happens locally. The edge system should be robust enough to handle &lt;strong&gt;local processing&lt;/strong&gt;, &lt;strong&gt;data filtering&lt;/strong&gt;, &lt;strong&gt;buffering&lt;/strong&gt;, and &lt;strong&gt;immediate hardware control&lt;/strong&gt;. Critically, it must be capable of operating autonomously for extended periods without an active cloud connection. Think of it as a mini data center, designed for self-sufficiency.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Benefits of a Smart Edge&lt;/strong&gt;: Reduced bandwidth costs, lower latency for critical actions, enhanced security (less raw data egress), and continued operation during network outages.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;The Cloud&lt;/strong&gt;: The cloud's role is elevated to a more strategic level. It handles &lt;strong&gt;global metadata accumulation&lt;/strong&gt;, &lt;strong&gt;alerting&lt;/strong&gt;, &lt;strong&gt;long-term analytical storage&lt;/strong&gt;, and &lt;strong&gt;user-facing dashboards&lt;/strong&gt;. It becomes the central brain for insights and management, not the real-time grunt worker.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Benefits of a Simple Cloud&lt;/strong&gt;: Scalability for analytics, centralized management, global accessibility, and reduced complexity (it doesn't need to handle every raw data point).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This clear separation ensures that local operations remain robust even when the connection to the wider internet is interrupted, allowing the cloud to focus on its strengths.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Designing for Intermittent Connections (Offline-First)
&lt;/h2&gt;

&lt;p&gt;Assuming continuous network uptime is a fundamental design flaw for any system interacting with the physical world. Your local services must be engineered with an &lt;strong&gt;offline-first&lt;/strong&gt; mindset, meaning they can collect, store, and even process data for significant periods without a cloud connection.&lt;/p&gt;

&lt;h3&gt;
  
  
  Local Cache and Queue (MQTT/SQLite)
&lt;/h3&gt;

&lt;p&gt;Rather than attempting to send telemetry, sensor data, or log events directly to a cloud API endpoint, which is prone to failure during disconnects, implement a local queuing mechanism.&lt;/p&gt;

&lt;p&gt;Consider a setup where data is first routed to a &lt;strong&gt;local broker&lt;/strong&gt; (like Mosquitto MQTT) for event-driven data or written to a &lt;strong&gt;local lightweight database&lt;/strong&gt; (like SQLite) for structured, time-series, or batch data.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Local Sensors / Inputs] ➔ [Local SQLite / Queue] ➔ [Local Network Daemon] ➔ (Active WAN?) ➔ [Cloud API]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Mosquitto MQTT&lt;/strong&gt; is an excellent choice for real-time sensor data, events, and command &amp;amp; control messages. Its publish/subscribe model is inherently resilient, and messages can be configured with Quality of Service (QoS) levels to ensure delivery, even with intermittent client connections.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SQLite&lt;/strong&gt; is ideal for storing larger volumes of historical data, logs, or structured telemetry locally. It's a file-based database, meaning zero configuration, perfect for embedded systems and edge devices. You can define tables for different data types and query them directly on the edge.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Local Network Daemon&lt;/strong&gt;: This daemon is the unsung hero. It continuously monitors the internet connection's status. When connectivity is detected, it intelligently flushes the queued records from MQTT buffers or SQLite tables to the appropriate cloud API endpoints. When offline, it diligently continues to write to the local store.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cache Rotation Policies&lt;/strong&gt;: To prevent the local drive from running out of disk space, implement robust cache rotation policies. This could involve:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;FIFO (First-In, First-Out)&lt;/strong&gt;: Discarding the oldest data once a certain storage limit is reached.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Time-based Expiry&lt;/strong&gt;: Deleting data older than a specified duration (e.g., 7 days).&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Prioritization&lt;/strong&gt;: Flagging certain data as critical, ensuring it's never discarded before cloud sync, while less critical data can be pruned.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These mechanisms ensure that data is retained during outages and reliably transferred once connectivity is restored, without overwhelming local storage.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Physical Network Failover Routing
&lt;/h2&gt;

&lt;p&gt;For edge applications demanding near-real-time connectivity, such as critical security monitoring, industrial control, or continuous live video streams, relying on a single internet connection is a non-starter. Redundant network routing at the physical site is paramount.&lt;/p&gt;

&lt;p&gt;A typical robust production setup I've implemented includes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Primary ISP&lt;/strong&gt;: Often a high-speed, low-latency fiber or cable internet connection. This is your workhorse.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Secondary WAN&lt;/strong&gt;: A cellular 4G/5G router, connected via a robust industrial gateway. This serves as your critical backup. Advances in cellular technology make this a viable and often necessary solution.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Dynamic Routing (WAN Load Balancing/Failover)&lt;/strong&gt;: The local router (e.g., a Ubiquiti EdgeRouter, pfSense box, or even enterprise-grade gear) is configured for automatic failover. This isn't just about plug-and-play; it requires thoughtful configuration:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Health Checks&lt;/strong&gt;: The router periodically pings a reliable external DNS server (like &lt;code&gt;1.1.1.1&lt;/code&gt; or &lt;code&gt;8.8.8.8&lt;/code&gt;) or a known highly available web service. If the primary gateway fails to respond to a series of these pings, the router automatically reroutes all outbound traffic through the cellular network.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Load Balancing&lt;/strong&gt;: In some configurations, you can even use both WAN connections simultaneously, with traffic distributed based on policies, though failover is the primary concern for resilience.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Adaptive Strategies&lt;/strong&gt;: When failing over to cellular, the system should adapt. This might involve automatically lowering video streaming bitrates, reducing the frequency of telemetry uploads, or pausing non-critical data transfers to conserve cellular data and maintain a stable connection.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This level of redundancy prevents service interruptions, ensuring your critical data streams continue, albeit potentially at a reduced capacity, during primary network outages.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Hardware Self-Healing and Remote Orchestration
&lt;/h2&gt;

&lt;p&gt;In the cloud, if a virtual machine begins to degrade or becomes unresponsive, the standard operating procedure is simple: destroy it and spin up a new instance. In the physical world, rebooting a frozen edge device often requires a human technician to physically travel to the site – a process that is both slow and expensive. Therefore, your edge systems must be designed with &lt;strong&gt;self-healing&lt;/strong&gt; capabilities.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hardware Watchdog Timers
&lt;/h3&gt;

&lt;p&gt;A hardware watchdog is a dedicated physical chip present on many edge device motherboards (commonly found on Raspberry Pis, industrial PCs, and single-board computers). Its function is elegantly simple yet incredibly powerful.&lt;/p&gt;

&lt;p&gt;Here's how it works:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; The edge operating system (or a specific application within it) must periodically write a signal – often referred to as 'patting the dog' – to this chip.&lt;/li&gt;
&lt;li&gt; This signal indicates that the system is alive and responsive.&lt;/li&gt;
&lt;li&gt; If the system freezes, crashes, or an application hangs, it will stop sending this signal.&lt;/li&gt;
&lt;li&gt; After a pre-configured timeout (e.g., 60 seconds), the watchdog chip will interpret the lack of signal as a system failure.&lt;/li&gt;
&lt;li&gt; The watchdog then directly interrupts the power line or sends a reset signal, triggering a hard reboot of the machine, effectively bringing it back to a known working state without human intervention.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Modern Linux systems often provide a &lt;code&gt;/dev/watchdog&lt;/code&gt; interface for user-space applications to interact with the hardware watchdog. Implementing a simple daemon to periodically write to this device is a foundational step in creating self-healing edge systems.&lt;/p&gt;

&lt;h3&gt;
  
  
  Smart Power Outlets
&lt;/h3&gt;

&lt;p&gt;While hardware watchdogs are fantastic for the primary compute unit, what about external peripherals like IP cameras, modems, or other connected sensors that don't have built-in watchdogs? For these devices, network-controlled relays or smart power bars (like those from Shelly or other IoT brands) are invaluable.&lt;/p&gt;

&lt;p&gt;By connecting the power lines of these external devices to such smart outlets, you can programmatically control their power state. Consider a simple bash script running on your local edge host:&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;#!/bin/bash&lt;/span&gt;

&lt;span class="c"&gt;# Configuration variables&lt;/span&gt;
&lt;span class="nv"&gt;CAMERA_IP&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"192.168.1.50"&lt;/span&gt;
&lt;span class="nv"&gt;RELAY_API&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"http://192.168.1.100/api/relay/0"&lt;/span&gt; &lt;span class="c"&gt;# Adjust for your smart power outlet's API&lt;/span&gt;
&lt;span class="nv"&gt;LOG_FILE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"/var/log/camera_watchdog.log"&lt;/span&gt;

&lt;span class="c"&gt;# Ensure log file exists&lt;/span&gt;
&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;dirname&lt;/span&gt; &lt;span class="nv"&gt;$LOG_FILE&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;
&lt;span class="nb"&gt;touch&lt;/span&gt; &lt;span class="nv"&gt;$LOG_FILE&lt;/span&gt;

log_message&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt; &lt;span class="s1"&gt;'+%Y-%m-%d %H:%M:%S'&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt; - &lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; | &lt;span class="nb"&gt;tee&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt; &lt;span class="nv"&gt;$LOG_FILE&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;# Ping the camera to check connectivity&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt; ping &lt;span class="nt"&gt;-c&lt;/span&gt; 3 &lt;span class="nt"&gt;-W&lt;/span&gt; 1 &lt;span class="nv"&gt;$CAMERA_IP&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /dev/null&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
    &lt;/span&gt;log_message &lt;span class="s2"&gt;"Camera &lt;/span&gt;&lt;span class="nv"&gt;$CAMERA_IP&lt;/span&gt;&lt;span class="s2"&gt; is offline. Attempting power cycle via relay."&lt;/span&gt;

    &lt;span class="c"&gt;# Power Off (state=0)&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="nt"&gt;-X&lt;/span&gt; POST &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s2"&gt;"state=0"&lt;/span&gt; &lt;span class="nv"&gt;$RELAY_API&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
        &lt;/span&gt;log_message &lt;span class="s2"&gt;"Relay power OFF command sent successfully."&lt;/span&gt;
        &lt;span class="nb"&gt;sleep &lt;/span&gt;10 &lt;span class="c"&gt;# Wait for device to power down and discharge&lt;/span&gt;

        &lt;span class="c"&gt;# Power On (state=1)&lt;/span&gt;
        &lt;span class="k"&gt;if &lt;/span&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="nt"&gt;-X&lt;/span&gt; POST &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s2"&gt;"state=1"&lt;/span&gt; &lt;span class="nv"&gt;$RELAY_API&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
            &lt;/span&gt;log_message &lt;span class="s2"&gt;"Relay power ON command sent successfully. Camera should reboot."&lt;/span&gt;
        &lt;span class="k"&gt;else
            &lt;/span&gt;log_message &lt;span class="s2"&gt;"Error: Failed to send relay power ON command."&lt;/span&gt;
        &lt;span class="k"&gt;fi
    else
        &lt;/span&gt;log_message &lt;span class="s2"&gt;"Error: Failed to send relay power OFF command. Check relay API and network."&lt;/span&gt;
    &lt;span class="k"&gt;fi
else
    &lt;/span&gt;log_message &lt;span class="s2"&gt;"Camera &lt;/span&gt;&lt;span class="nv"&gt;$CAMERA_IP&lt;/span&gt;&lt;span class="s2"&gt; is online. No action needed."&lt;/span&gt;
&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This script, scheduled to run via &lt;code&gt;cron&lt;/code&gt; every few minutes, effectively creates a software watchdog for your external devices. By automatically power-cycling frozen or unresponsive cameras or modems, it prevents the vast majority of physical maintenance trips, drastically improving system uptime and reducing operational costs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Building robust solutions that connect the physical world to the cloud demands a fundamental shift from optimistic, 'happy path' programming to a deeply defensive systems design. By implementing &lt;strong&gt;smart edge nodes&lt;/strong&gt; capable of autonomous operation, designing with &lt;strong&gt;offline-first queues&lt;/strong&gt; for data resilience, structuring &lt;strong&gt;automatic network failovers&lt;/strong&gt; for continuous connectivity, and engineering &lt;strong&gt;hardware self-healing scripts&lt;/strong&gt; for physical device recovery, you can create hybrid systems that operate reliably not just for months, but for years on end, weathering the unpredictable storms of the real world.&lt;/p&gt;

&lt;p&gt;These principles have been the backbone of systems that have run continuously for half a decade, proving that with thoughtful architecture, the physical-digital divide can be bridged with robust, long-lasting solutions.&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://klytron.com/blog/hybrid-iot-cloud-livestream" rel="noopener noreferrer"&gt;Read the complete deep-dive with bonus security hardening strategies for edge devices and extended code examples for network daemons on klytron.com&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>cloudcomputing</category>
      <category>iot</category>
      <category>systemdesign</category>
    </item>
  </channel>
</rss>
