<?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: Harikrishnan P H</title>
    <description>The latest articles on DEV Community by Harikrishnan P H (@harikris2012).</description>
    <link>https://dev.to/harikris2012</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%2F488052%2F4d2de4cf-a72f-4298-bb7d-4b3c5a3f8f9d.png</url>
      <title>DEV Community: Harikrishnan P H</title>
      <link>https://dev.to/harikris2012</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/harikris2012"/>
    <language>en</language>
    <item>
      <title>From Kernel Hardening to AI Agents: What the Metal Taught Me About Building AI That Survives Production</title>
      <dc:creator>Harikrishnan P H</dc:creator>
      <pubDate>Mon, 29 Jun 2026 11:10:14 +0000</pubDate>
      <link>https://dev.to/harikris2012/from-kernel-hardening-to-ai-agents-what-the-metal-taught-me-about-building-ai-that-survives-4n07</link>
      <guid>https://dev.to/harikris2012/from-kernel-hardening-to-ai-agents-what-the-metal-taught-me-about-building-ai-that-survives-4n07</guid>
      <description>&lt;p&gt;Most people writing about AI agents today started about six months ago.&lt;/p&gt;

&lt;p&gt;I started in firmware.&lt;/p&gt;

&lt;p&gt;My first real project out of college was a small streaming dongle — the kind of device that has to run Netflix, Prime, and YouTube on roughly &lt;strong&gt;500MB of memory and 800 MFLOPS of compute&lt;/strong&gt;. No thermal headroom. No margin for error. I owned most of the stack: RDK-V, a custom embedded browser, Bluetooth, WiFi, driver configuration, kernel hardening. And because shipping it meant five different companies' code had to behave as one product, I spent as much time on the seams between systems as on any one of them.&lt;/p&gt;

&lt;p&gt;For years after that I lived in that world — set-top boxes, C++, an open-source WebKit browser, network failover routing that had to switch between Ethernet and WiFi without the user ever noticing. It is about as far from "prompt an LLM" as engineering gets.&lt;/p&gt;

&lt;p&gt;And yet, now that I build production multi-agent AI for a living, I've realized something I didn't expect: &lt;strong&gt;embedded didn't make me a worse AI engineer. It made me a better one.&lt;/strong&gt; Here's why.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the metal actually drills into you
&lt;/h2&gt;

&lt;p&gt;Embedded systems teach you a worldview before they teach you any particular skill. Three things stuck:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What can fail, will fail.&lt;/strong&gt; When you've hardened a kernel, you stop trusting the happy path. You assume every input is hostile, every dependency will time out, every "this can't happen" eventually happens at 2am in someone's living room. (More on the bug that taught me this in a moment — it's my favorite.) That kind of debugging rewires you permanently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Resources are not free.&lt;/strong&gt; When your entire budget is 500MB and 800 MFLOPS, you develop a physical sense for cost and latency. You feel a wasted allocation. You don't get to wave it away and add a bigger box.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The best code is the boring code.&lt;/strong&gt; My second engagement, on a WebKit-based browser, is where I learned that writing code that &lt;em&gt;works&lt;/em&gt; is the easy part — writing code that's readable, maintainable, and documented is the real craft. A clever solution that no one can maintain is a liability, not an achievement.&lt;/p&gt;

&lt;h2&gt;
  
  
  The bug that rewired me
&lt;/h2&gt;

&lt;p&gt;The story I still tell to explain how I think about systems is about a clock.&lt;/p&gt;

&lt;p&gt;Screens on the dongle would freeze. Randomly. No pattern we could pin down and — worse — nothing we could reproduce on demand. The one thing we noticed was that it seemed to happen more the longer a device had been running. So we did what everyone does: we blamed heat. Thermal throttling, long sessions, a hardware stress problem. It's the kind of explanation that &lt;em&gt;feels&lt;/em&gt; right and quietly eats a week of your life.&lt;/p&gt;

&lt;p&gt;We tore through the entire stack chasing it. The application. The media player. Down into the firmware. Then the hardware itself. Nothing. Every layer looked innocent in isolation.&lt;/p&gt;

&lt;p&gt;The real cause was nowhere near where the symptom showed up. When the WiFi connection dropped — even for a second — the system clock reset to epoch: January 1, 1970. And the media player, suddenly handed a timestamp that had jumped backward by decades, simply froze. A network event, three layers away, surfacing as a frozen screen the user blamed on the app.&lt;/p&gt;

&lt;p&gt;Nobody would have guessed that from the symptom. You only find it by refusing to trust the obvious story and tracing the whole system, end to end, until the pieces line up.&lt;/p&gt;

&lt;p&gt;That bug rewired me permanently. It's why, to this day, the symptom is never where I start — and why "it's probably the heat" (or today, "it's probably the model") is the explanation I distrust most.&lt;/p&gt;

&lt;p&gt;Then I made the jump that scared me: new language, new domain, new stack, into AI and data. Almost nothing transferred at the surface level. The only thing I could reuse was that worldview. It turned out to be enough.&lt;/p&gt;

&lt;h2&gt;
  
  
  The bridge: treating agents like production systems, not magic
&lt;/h2&gt;

&lt;p&gt;Here's the first place the metal shows up. When something feels off in one of our agents, my reflex isn't to re-prompt and hope. It's to debug — exhaust every mechanism I have, from logs to search to AI assistance — and if nothing works, go looking for a different approach entirely. And I judge that approach the way I learned to judge any dependency: &lt;strong&gt;is it maintained, is it documented, does it actually solve the problem?&lt;/strong&gt; Not "is it new," not "is it clever." Maintainability is a feature.&lt;/p&gt;

&lt;p&gt;That sounds obvious. It isn't, in this field. A lot of AI engineering right now is built on the assumption that the model is magic and the surrounding system is an afterthought. The embedded instinct is the exact opposite: the model is just one more component that will fail in ways you didn't predict, so you design for the failure path first. "Wrong call costs real money" isn't a slogan when your agent is moving real inventory for a real retailer — it's the reason you treat it like a production system instead of a feature.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where it actually pays off, part 1: the data fights back
&lt;/h2&gt;

&lt;p&gt;If you ask me the single hardest thing about shipping retail agents, it isn't the coordination between agents. Coordination you can engineer your way out of with clean contracts. &lt;strong&gt;The data is the part that fights back.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A retailer's reality lives across a handful of legacy vendor systems, each of which defines a "SKU" — and the truth — a little differently. The actual work is pulling that out, reconciling it, and shaping it into something an agent can reason over — &lt;em&gt;and&lt;/em&gt; doing all of it fast enough that the person on the other end never feels the lag. Correctness and latency pulling in opposite directions is the real design problem, and it's the same tension I first met on a 500MB device. The metal prepared me for this exactly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where it pays off, part 2: the war story
&lt;/h2&gt;

&lt;p&gt;The best illustration I have is the part of our product that decides how to move inventory — allocation and rebalancing.&lt;/p&gt;

&lt;p&gt;It started almost trivially: get inventory from the warehouse to the stores. So I wrote what you'd expect. A greedy algorithm. Move the stock to where it's needed most, simplest rule first.&lt;/p&gt;

&lt;p&gt;Then reality showed up — one conversation with the customer at a time.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;What if inventory is starved?&lt;/em&gt; Then you can't just feed the hungriest store; you have to decide between giving it all to the best store or spreading it fairly. &lt;em&gt;What about size coverage?&lt;/em&gt; A store should carry at least some minimum percentage of sizes or the assortment is useless. &lt;em&gt;And then another rule. And another.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Greedy stopped working, so I moved to custom scoring — rank every option, weigh the trade-offs. That held for a while. Then it didn't. Every new constraint meant re-tuning the scoring, and the weights started fighting each other.&lt;/p&gt;

&lt;p&gt;The moment I remember clearly is this: &lt;strong&gt;I'd fix one constraint, and another would fall straight out the window.&lt;/strong&gt; Patch the size-coverage rule, break the fairness rule. Fix fairness, break something else. I was adding special case on top of special case, and the algorithm was becoming genuinely unmanageable.&lt;/p&gt;

&lt;p&gt;That feeling — fix one thing, break another, complexity you can no longer hold in your head — is exactly the feeling embedded taught me to distrust. It's the signal that you're hand-rolling a worse version of a tool that already exists. I wasn't writing an allocation algorithm anymore. I was writing a bad, undocumented constraint solver.&lt;/p&gt;

&lt;p&gt;So I stopped patching and switched approaches entirely — away from hand-rolled heuristics, toward a declarative model where you &lt;em&gt;express&lt;/em&gt; the rules rather than code the logic that enforces them.&lt;/p&gt;

&lt;p&gt;The difference is the whole point. With heuristics, every rule is imperative — you write the logic, and the rules tangle and fight each other. With a declarative approach, you state the rules — minimum size coverage, fairness under scarcity, warehouse limits — and let the system find an assignment that satisfies all of them at once. A new merchant requirement stops being an algorithm rewrite and becomes just one more rule.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Illustrative — not our actual code

# Before: imperative heuristics that fight each other
score = w1*need + w2*fairness + w3*size_coverage - ...
# every new rule means re-tuning the weights and hoping

# After: declarative rules the system reconciles
require  allocation[store] &amp;lt;= demand[store]
require  size_coverage[store] &amp;gt;= MIN_COVERAGE
require  fair_split  when inventory is scarce
# add a rule -&amp;gt; add a line, not a rewrite
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The lesson isn't about any one technique. It's the embedded lesson, again: &lt;strong&gt;know when to stop being clever and reach for the right tool.&lt;/strong&gt; The same instinct that makes you choose a boring, maintainable library over a clever hack is the one that tells you a pile of special cases has outgrown its paradigm.&lt;/p&gt;

&lt;h2&gt;
  
  
  The throughline
&lt;/h2&gt;

&lt;p&gt;Embedded didn't teach me machine learning. It taught me something that turned out to matter more: assume failure, respect constraints, prize maintainability, and recognize when the thing you're building has outgrown the approach you're using.&lt;/p&gt;

&lt;p&gt;The internet is overflowing with AI demos. What it's short on is people who've watched a system fall over in production and learned to design for that moment first. If you came to AI from systems, or telecom, or logistics, or anywhere with real stakes and real failure — you have an advantage you might be underrating. The model is the easy part. Everything around it is the engineering, and that part you already know.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;I'm writing more about building AI that survives production — multi-agent systems, integrating with legacy enterprise data, and earning trust from expert users. If that's your world too, let's compare scars.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This post was originally published on &lt;a href="https://hariph.hashnode.dev/from-kernel-hardening-to-ai-agents-what-the-metal-taught-me-about-building-ai-that-survives-production" rel="noopener noreferrer"&gt;my blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>softwareengineering</category>
      <category>career</category>
    </item>
  </channel>
</rss>
