<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Deepak Bhaskaran on Medium]]></title>
        <description><![CDATA[Stories by Deepak Bhaskaran on Medium]]></description>
        <link>https://medium.com/@deepak.bhaskaran?source=rss-7c5b1b326f1f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*wi2uMAQYBAyUM1bp7o1IIg.jpeg</url>
            <title>Stories by Deepak Bhaskaran on Medium</title>
            <link>https://medium.com/@deepak.bhaskaran?source=rss-7c5b1b326f1f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 01:23:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@deepak.bhaskaran/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Morris Worm: When the Internet First Broke]]></title>
            <link>https://medium.com/@deepak.bhaskaran/the-morris-worm-when-the-internet-first-broke-3ba26f228f15?source=rss-7c5b1b326f1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ba26f228f15</guid>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Deepak Bhaskaran]]></dc:creator>
            <pubDate>Mon, 22 Jun 2026 02:56:34 GMT</pubDate>
            <atom:updated>2026-06-22T02:56:34.039Z</atom:updated>
            <content:encoded><![CDATA[<p>On the evening of November 2, 1988, around 6 PM EST, a program was launched onto the Internet from one or more hosts. Within hours, thousands of machines running BSD UNIX were so overloaded with rogue processes that they could not function. Systems ran out of swap space. Process tables filled up. Administrators disconnected entire networks in a panic. The Internet had experienced its first major self-inflicted wound.</p><p>The program responsible was a worm written by Robert T. Morris, a graduate student at Cornell. Eugene Spafford’s technical analysis of the decompiled code, published just weeks after the incident, remains one of the most thorough postmortems in computing history. What it reveals is not a work of genius, but something more instructive: a mediocre program that succeeded because the systems it attacked were unprepared for even a mediocre adversary.</p><h4>How the Worm Spread</h4><p>The worm targeted Sun 3 and VAX machines running 4 BSD UNIX. It used three attack vectors to break into new hosts.</p><p>The first was a buffer overflow in fingerd. The finger daemon used the C library function gets to read network input into a fixed-size buffer without bounds checking. The worm sent a carefully constructed 536-byte string that overflowed the buffer, overwrote the return address on the stack, and caused the program to execute /bin/sh. On VAX machines, this gave the worm a remote shell. On Suns, it produced a core dump instead, because the shellcode was VAX-specific.</p><p>The second was a debug mode in sendmail. The worm issued the DEBUG command to sendmail and then specified a set of shell commands as the recipient of a message. This debug feature was not supposed to be enabled in production, but it was present in the code for testing mail delivery, and many vendors and administrators left it compiled in. The worm exploited this to pipe commands directly to /bin/sh.</p><p>The third was password guessing combined with trust relationships. The worm read /etc/passwd, attempted to crack passwords using the account name, variations of the user&#39;s real name, and a built-in dictionary of 432 words. When it broke a password, it used rsh and rexec to reach other machines where that user had accounts, exploiting the common practice of reusing passwords across hosts.</p><h4>The Infection Sequence</h4><p>The worm had two components: a main program and a bootstrap called the vector program. Once the worm obtained a shell on a target machine through any of the three attack methods, it followed a precise sequence.</p><p>It compiled and ran the vector program on the target. The vector connected back to the infecting machine on a predetermined TCP port, authenticated with a challenge number, and downloaded three files: a Sun 3 binary of the worm, a VAX binary, and the vector source code. The infecting worm then sent shell commands to try each binary. If one ran successfully, the new host was marked as infected.</p><p>The newly running worm immediately hid itself. It changed its process name, unlinked its binary from disk, killed its parent process, loaded the worm binaries into memory, encrypted them, and deleted the files. From that point on, it existed only in memory with no obvious filesystem footprint.</p><h4>Why It Got Out of Control</h4><p>The worm included a mechanism to avoid reinfecting machines. Running copies would listen on TCP port 23357 on localhost. A new worm arriving on an already-infected host would connect to that port, exchange random numbers, and based on the result, one of the two would exit.</p><p>This mechanism was fatally flawed in two ways. First, one out of every seven worms would skip the check entirely and become “immortal,” ignoring any other worms on the same machine. Spafford concludes this was deliberate, designed to prevent administrators from running a fake listener on the worm port to kill incoming copies. Second, even worms marked for self-destruction would continue running through at least one full password-cracking cycle before exiting. The result was exponential growth: each pass through the main loop forced the worm to infect at least one local host, and multiple copies on a single machine would each do the same.</p><p>The worm’s author apparently did not understand the propagation dynamics of his own program. The code contained mechanisms to limit growth, which suggests awareness that uncontrolled replication was undesirable. But those mechanisms were insufficient, producing the catastrophic load that made the worm so visible and so disruptive.</p><h4>The Response</h4><p>By late Wednesday night, personnel at UC Berkeley and MIT had captured copies of the program and begun analyzing it. By 5 AM Thursday, less than 12 hours after the worm appeared, the Berkeley Computer Systems Research Group had published an interim set of defenses: a patch to sendmail and a suggestion to rename the C compiler to prevent the worm from building itself on new hosts.</p><p>By 7 PM Thursday, a simpler defense was discovered at Purdue: creating a directory named sh in /usr/tmp caused the worm&#39;s shell test ( if [ -f sh ]) to fail, blocking further infection without renaming any system utilities. This worked because the worm used the -f flag, which tests for a regular file but returns false for directories. The author had used [ instead of the more portable test command, and -f instead of -e, both signs of limited experience with shell scripting.</p><p>On November 8, the National Computer Security Center convened a hastily-organized workshop in Baltimore. The attendees agreed not to distribute their reverse-engineered source code publicly. By that date, Spafford was aware of at least eleven independent decompilations of the worm. The genie was already out of the bottle.</p><h4>What the Code Revealed</h4><p>Spafford’s analysis of the reverse-engineered code is ruthless in its assessment. The worm was not the work of a genius. The code quality was mediocre. Local variables went uninitialized. Functions were called with wrong numbers of arguments. Return codes from system calls were never checked. Data structures were uniformly linked lists with linear searches, where hash tables would have been trivial to implement and far more efficient.</p><p>The one section that showed genuine sophistication was the password-cracking routine, which ran nine times faster than the standard Berkeley crypt function. Spafford notes that this code does not appear to have been written by the same person who wrote the rest of the worm. It included support for both encryption and decryption, even though the worm only needed encryption.</p><p>The worm did not write to the filesystem except during infection. It did not transmit any information from infected systems to any external location. It did not exploit root access even when it cracked root passwords. Spafford finds this last omission difficult to attribute to deliberate restraint, suggesting instead that the author simply did not think of it.</p><p>The program could have been far more dangerous. The fingerd exploit worked only on VAX, not Sun, likely because the author never built a Sun version of the shellcode. Three Purdue graduate students replicated the Sun exploit in under three hours when asked. The worm’s password-cracking dictionary was only 432 words. It did not gather hostnames from .rhosts files early in its execution. It failed to infect local network hosts due to a bug in the routing logic.</p><h4>The Larger Lessons</h4><p>The worm exposed problems that the UNIX community had long known about but never fixed. The gets function had no bounds checking and was documented as dangerous, yet it remained in the standard C library and in production daemons. Sendmail&#39;s debug mode was a known risk that administrators tolerated for convenience. Password hashes were stored in world-readable files, allowing offline cracking. Trust relationships between hosts via .rhosts and hosts.equiv created lateral movement paths that one compromised account could traverse.</p><p>Spafford’s recommendations read like a modern security checklist written decades early: replace unbounded string functions with bounded alternatives, audit all network-facing code for their use, run each daemon under its own user ID (least privilege), implement shadow password files, enforce password complexity, and establish coordinated vulnerability disclosure mechanisms.</p><p>The response to the incident was ad hoc and nearly failed. Patches were distributed via Usenet and mailing lists, but those communication channels depended on the same Internet that was under attack. Sites that disconnected for self-protection could not receive the fixes. Three weeks after the incident, some sites had still not reconnected.</p><p>The worm demonstrated that the internet’s openness was simultaneously its greatest strength and its greatest vulnerability. The same properties that allowed researchers across the country to collaborate on a fix in under 12 hours also allowed a single program to propagate across thousands of machines in the same timeframe.</p><h4>References</h4><p>- Eugene H. Spafford, “The Internet Worm Program: An Analysis,” Purdue Technical Report CSD-TR-823, 1988</p><p><em>Originally published at </em><a href="https://onsitereliability.com/The-Morris-Worm-When-the-Internet-First-Broke/"><em>https://onsitereliability.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ba26f228f15" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Enterprise-Wide AI Enablement for Engineering Teams]]></title>
            <link>https://medium.com/@deepak.bhaskaran/enterprise-wide-ai-enablement-for-engineering-teams-2941e40e9d8f?source=rss-7c5b1b326f1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/2941e40e9d8f</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ai-engineering]]></category>
            <category><![CDATA[enterprise-technology]]></category>
            <dc:creator><![CDATA[Deepak Bhaskaran]]></dc:creator>
            <pubDate>Sun, 07 Jun 2026 19:45:23 GMT</pubDate>
            <atom:updated>2026-06-07T19:45:23.629Z</atom:updated>
            <content:encoded><![CDATA[<p>Most engineering organizations have given their developers access to an AI coding assistant and called it AI enablement. Copilot in the IDE, maybe Claude Code for some teams, perhaps a chatbot for answering questions about internal documentation. That is table stakes. It is the equivalent of giving every engineer a laptop and calling it a digital transformation.</p><p>The real opportunity is not in the IDE. It is across the entire engineering operation: project management, reporting, talent assessments, UI design, testing, deployments, and incident triage. The organizations that figure this out are not going to get a marginal productivity bump. They are going to operate at a fundamentally different speed, and the gap between them and everyone else is going to widen fast.</p><p>I am helping lead the operations side of my organization into this era, and what I am seeing across the industry is a clear split. On one side, there are teams using AI as a glorified autocomplete. On the other, there are teams weaving AI into every layer of how they build, ship, and run software. This post walks through what AI enablement actually looks like when you take it seriously across the full engineering lifecycle.</p><h4>Project Management</h4><p>Sprint planning, backlog grooming, and status reporting are some of the most time-consuming activities in engineering, and most of that time is spent on synthesis rather than decision-making. An engineering manager spends hours reading through tickets, correlating them with sprint goals, and writing an update that summarizes where things stand. AI can do most of that work.</p><p>Practical AI enablement in project management means connecting your AI tools to your ticketing system and letting them draft sprint summaries, identify blocked work, flag tickets that have been idle for too long, and generate stakeholder updates from the raw data in Jira or Linear. The human still makes the decisions: what to prioritize, what to cut, when to escalate. But the synthesis work that precedes those decisions can be largely automated.</p><p>The shift is from “the project manager writes the update” to “AI drafts, human edits.” That is not a small change. It means your PMs and engineering managers spend their time on judgment calls instead of copy-pasting ticket titles into a slide deck. It also means updates happen more frequently, because the cost of producing them drops dramatically.</p><h4>Reporting and Communication</h4><p>This is closely related to project management but deserves its own treatment because the audience is different. Engineering teams generate enormous amounts of data: deployment frequency, incident counts, error budgets, on-call load, PR cycle times. Turning that data into something an executive can act on is a skill that most engineers have not been trained in.</p><p>AI is exceptionally good at this translation layer. Feed it your incident data from the last quarter and ask for an executive summary. Give it your deployment metrics and ask it to highlight the trends that matter. The output will not be perfect on the first try, but it will be 80% of the way there, and the engineer or manager reviewing it only needs to adjust framing and add context rather than starting from a blank page.</p><p>I learned this lesson the hard way during an incident when I had to brief senior leadership. My first draft was six pages of technical detail. The final version that actually landed was one paragraph. AI can help you get to that one paragraph faster, because it is good at stripping away detail that does not serve the audience. The key is telling it who the audience is and what they need to decide based on this information.</p><h4>Talent and Team Assessments</h4><p>This is the area where most people get uncomfortable, and understandably so. But the opportunity is not in using AI to judge people. It is in using AI to surface data that was previously too expensive to gather.</p><p>On-call load distribution is a concrete example. Is one engineer taking 60% of the pages while the rest of the team takes 10% each? That pattern is invisible unless someone manually audits the PagerDuty data, which nobody does until someone burns out. AI can surface that imbalance automatically.</p><p>PR review patterns are another one. Who is reviewing whose code? Are reviews distributed evenly, or is one person a bottleneck? Are there engineers who never get reviews from senior team members? These patterns affect team health and growth, and they are buried in data that already exists in your version control system.</p><p>The point is not to automate performance reviews. The point is to give engineering managers better data so they can have better conversations. AI does not replace judgment here. It makes judgment more informed by surfacing patterns that were always there but too labor-intensive to find.</p><h4>UI Design</h4><p>AI-assisted design is moving fast, and the teams that are adopting it are collapsing the cycle time from concept to working frontend in ways that were not possible a year ago.</p><p>The most immediate application is prototyping. Describe what you want in natural language, and AI generates a working layout. It will not match your design system perfectly out of the box, but it gets you to a starting point that you can iterate on in minutes rather than hours. For internal tools and admin interfaces, where pixel-perfect design is less important than getting something functional in front of users, this is a significant accelerator.</p><p>Beyond prototyping, AI is useful for accessibility audits, responsive design checks, and generating component variations. It can take a design mockup and produce the HTML and CSS that implements it. It can review an existing interface and flag accessibility issues that a manual audit would take hours to find.</p><p>The teams getting the most out of this are the ones that feed their design system tokens and component library into the AI context, so the output is not generic but already aligned with their visual language.</p><h4>Testing</h4><p>This is where AI enablement has the most obvious payoff outside of code completion, and yet most organizations are barely scratching the surface.</p><p>The basic level is AI-generated unit tests. That is useful but limited. The next level is AI that understands the change you are making and generates tests that specifically target the risk introduced by that change. If you modify a payment processing function, the AI should know that edge cases around currency rounding and idempotency matter more than testing the happy path.</p><p>Beyond test generation, AI is valuable for test maintenance. Flaky tests are one of the biggest drags on engineering velocity, and triaging them is tedious work that nobody wants to do. AI can analyze test failure patterns, identify which failures are flaky versus genuine, and in many cases suggest or implement fixes. It can look at a test suite and identify coverage gaps: not just line coverage, but functional coverage. “You have tests for the create path but nothing for the update-with-concurrent-modification path.”</p><p>The organizations that are ahead on this are using AI not just to write tests but to reason about what should be tested. That is a qualitative shift in how testing works.</p><h4>Deployments</h4><p>Safe deployment is something I have written about before, and AI adds a powerful layer on top of the practices that should already be in place.</p><p>AI-assisted canary analysis means your deployment pipeline does not just check whether error rates went up. It looks at the full picture: latency distribution changes, log pattern anomalies, resource utilization shifts, and makes a recommendation about whether the canary is healthy enough to proceed. This is more nuanced than threshold-based checks, which either trigger too aggressively (causing unnecessary rollbacks) or too conservatively (letting bad deploys through).</p><p>Change risk scoring is another application. Before a deployment starts, AI can analyze the diff, the services affected, the time of day, the current on-call staffing, and recent incident history to produce a risk assessment. A routine config change on a Tuesday morning gets a low risk score. A database migration affecting a payment service on a Friday afternoon gets a high one. This does not replace human judgment about whether to proceed, but it makes sure the relevant context is surfaced before the decision is made.</p><p>Deployment runbook generation is the most straightforward application. Every deployment should have a runbook. In practice, many do not, because writing them is tedious. AI can generate a deployment runbook from the change description, the service architecture, and the team’s incident history. The engineer reviews and adjusts rather than writing from scratch.</p><h4>Incident Triage</h4><p>The on-call engineer at 2 AM is the person who benefits most from AI enablement, and they are often the last person organizations think about when rolling out AI tools.</p><p>Alert correlation is the first opportunity. When multiple alerts fire within a short window, they are usually symptoms of the same underlying issue. AI can group related alerts, identify the most likely root cause based on the alert pattern and recent changes, and present the on-call engineer with a starting hypothesis instead of a wall of noise.</p><p>Automated incident summarization saves time during and after the incident. As the incident progresses, AI can maintain a running summary of what has been tried, what worked, what did not, and what the current status is. After resolution, it can draft the incident report, pulling in timeline data from your monitoring tools and chat logs. The engineer reviews and adds the analysis that only a human can provide, but the mechanical work of assembling the facts is handled.</p><p>Customer impact analysis is where this gets particularly valuable. During an incident, leadership wants to know which customers are affected and how. If your knowledge management system has structured data about customer relationships and service dependencies, AI can cross-reference the impacted services with customer data and produce an impact assessment in minutes rather than the hours it would take to do manually.</p><h4>What It Takes to Get There</h4><p>None of this happens by buying licenses and sending an email. Enterprise-wide AI enablement is an organizational change problem, not a tooling problem.</p><p>Governance comes first. You need clear policies on what data AI tools can access, where prompts and outputs are stored, and how sensitive information is handled. Without this, either security shuts everything down or teams adopt tools in shadow IT fashion with no guardrails.</p><p>Data access is the practical blocker that kills most AI initiatives. AI tools are only as useful as the context you can give them. If your ticketing system, monitoring platform, deployment pipeline, and knowledge base are all siloed behind different access controls with no integration points, your AI tools cannot do the cross-cutting work that makes them valuable. Investing in MCP servers, API integrations, and structured data stores is a prerequisite, not an afterthought.</p><p>Training is not optional, and it is not a one-time workshop. Engineers need to learn how to write effective prompts, how to structure their repositories and documentation for AI legibility, and how to evaluate AI output critically. The skills that make someone effective with AI tools are different from the skills that make them effective without them.</p><p>Cultural shift is the hardest part. Engineering teams have deep habits around how work gets done. Convincing a senior engineer that AI can draft a meaningful incident report or that an AI-generated test suite is worth reviewing requires trust that builds over time, not a mandate. Start with the pain points where AI delivers obvious value (incident triage, test maintenance, status reporting) and let the results build momentum.</p><h4>The Widening Gap</h4><p>The difference between organizations that treat AI as a developer convenience and those that treat it as an operational capability is going to become impossible to ignore. An engineering org that uses AI across project management, reporting, testing, deployments, and incident response is not just faster. It is operating with better information, more consistent processes, and fewer of the gaps that cause incidents, delays, and burnout.</p><p>The organizations that get this right will not just keep up. They will set the pace, and the distance between them and everyone else will keep growing.</p><p><em>Originally published at </em><a href="https://onsitereliability.com/Enterprise-Wide-AI-Enablement-for-Engineering-Teams/"><em>https://onsitereliability.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2941e40e9d8f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Knowledge Management System with Structured Memory]]></title>
            <link>https://medium.com/@deepak.bhaskaran/building-a-knowledge-management-system-with-structured-memory-6b04012dcb13?source=rss-7c5b1b326f1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b04012dcb13</guid>
            <dc:creator><![CDATA[Deepak Bhaskaran]]></dc:creator>
            <pubDate>Sun, 07 Jun 2026 19:42:09 GMT</pubDate>
            <atom:updated>2026-06-07T19:42:09.898Z</atom:updated>
            <content:encoded><![CDATA[<p>Operational knowledge about complex systems lives across dozens of chat threads, ticketing systems, wikis, and people’s heads. When a question comes up (“Which customers were affected by recent incidents?”), answering it requires searching multiple systems and reconstructing context from scratch every time. The information exists, but it is scattered and unstructured, which means it might as well not exist when you need it fast.</p><p>I built a file-based knowledge management system using Claude Code’s persistent memory to solve this problem. The system stores knowledge as individual Markdown files with structured YAML frontmatter. Each file represents one discrete unit of knowledge: an incident, a service architecture, a customer relationship, or operational feedback. The approach is simple, but the structure is what makes it work.</p><h4>How a Memory File Is Structured</h4><p>Every memory file has three parts, and each part serves a specific purpose.</p><p>The frontmatter is YAML at the top of the file. It contains a name, a one-line description, and a type classification. The description matters more than you might think. It is written to support relevance matching in future lookups, so it needs to be specific enough that the system can decide whether this file is worth reading for a given question. A description like “Q4 incident” is almost useless. A description like “Database connection pool exhaustion caused 45-minute outage affecting billing service, October 2025” is immediately useful.</p><p>The body is the actual knowledge, structured consistently by type. Incident files follow a template: timeline, root cause, resolution, customer impact, retro findings. Architecture files capture service relationships, failure modes, and operational procedures. The consistency matters because it makes cross-cutting queries possible. If every incident file has a Customer Impact section in the same format, you can ask “which customers were affected across all incidents” and get a reliable answer.</p><p>The last section is a “Why / How to apply” footer. This is what distinguishes the system from a simple note archive. It encodes judgment: not just what happened, but when this knowledge should influence a decision. A memory file about a database failover incident might end with “Apply when: evaluating connection pool sizing for new services, or when diagnosing intermittent timeout errors in services that share the same database cluster.” This lets the system surface relevant context proactively rather than only responding to exact keyword matches.</p><h4>The Index</h4><p>A single file called MEMORY.md serves as the table of contents. Each entry is one line, organized by topic rather than chronologically. This file is always loaded into conversation context, so it acts as a retrieval hint. When a question comes in, the system scans the index to decide which detailed files to read. It does not need to open every file on every question. It reads the index, identifies the relevant files by their one-line descriptions, and pulls only what is needed.</p><p>This is the same principle behind the AGENTS.md approach described in OpenAI’s harness engineering experiment: give the system a map, not a thousand-page instruction manual. A short index with pointers to deeper sources of truth scales far better than a monolithic document that tries to contain everything.</p><h4>The Type System</h4><p>Four memory types serve different purposes, and keeping them separate matters for retrieval quality.</p><p>Project memories capture incidents, architecture decisions, and ongoing initiatives. These are the most frequently created and the most likely to go stale. An incident memory is useful for weeks or months after the event. An architecture memory stays relevant until the architecture changes.</p><p>User memories record who the person is, their role, and their preferences. These help the system tailor its responses. An engineer asking about a service gets different context than an executive asking about the same service.</p><p>Feedback memories capture corrections and confirmed approaches. When someone says “don’t mock the database in these tests” or “yes, the single bundled PR was the right call here,” that guidance gets recorded so it carries forward. Corrections are easy to notice. Confirmations are quieter but equally important. If you only save corrections, the system avoids past mistakes but drifts away from approaches that have already been validated.</p><p>Reference memories are pointers to external systems. They record that bugs are tracked in a specific Linear project, or that a particular Grafana dashboard is what on-call watches. The system cannot access those external systems directly, but knowing where to look is often enough to be useful.</p><h4>Why Separation and Structure Matter</h4><p>The key design choices are separation and structure. Each topic gets its own file rather than appending to a single document. This means updates do not risk corrupting unrelated knowledge. If you need to update the customer impact section of an incident memory, you are editing one file, not navigating a sprawling document where a misplaced edit could break something else.</p><p>Consistent internal structure makes the system queryable in ways that unstructured notes never are. When every incident file follows the same template, questions that span multiple incidents become straightforward. “What patterns appear across recent incidents?” is answerable because the data is organized the same way every time.</p><h4>Where This Approach Fits</h4><p>This works well for teams managing dozens of services with recurring incidents, complex customer relationships, and institutional knowledge that would otherwise be lost to staff turnover or buried in chat history. The structured format makes it possible to ask questions that span multiple knowledge domains without manually correlating information from separate systems.</p><p>The limitation is staleness. Memory files are snapshots. Tickets close, customers resolve issues, architecture changes. The system mitigates this by treating memories as starting context to verify against current state, not as authoritative truth. Before acting on a memory that names a specific function or file path, the system checks whether it still exists. A memory that says “X exists” is not the same as “X exists now.”</p><p>Active maintenance is still required. Outdated files need to be updated or removed. But the cost of that maintenance is low compared to the alternative: rebuilding context from scratch every time someone asks a question that the team answered three months ago in a chat thread that nobody can find.</p><h4>References</h4><ul><li><a href="https://code.claude.com/docs/en/memory.md">Claude Code Memory Documentation</a> covers CLAUDE.md files, auto memory, and the MEMORY.md index system</li><li><a href="https://docs.anthropic.com/en/docs/claude-code/overview">Claude Code Overview</a> for the broader context on how Claude Code works as an agentic coding tool</li><li><a href="https://www.openai.com/index/harness-engineering/">Harness Engineering (OpenAI)</a> describes the AGENTS.md approach to repository knowledge management referenced in this post</li></ul><p><em>Originally published at </em><a href="https://onsitereliability.com/Building-a-Knowledge-Management-System-with-Structured-Memory/"><em>https://onsitereliability.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b04012dcb13" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Operational Expectations for Production Services]]></title>
            <link>https://medium.com/@deepak.bhaskaran/operational-expectations-for-production-services-82dd0095793e?source=rss-7c5b1b326f1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/82dd0095793e</guid>
            <dc:creator><![CDATA[Deepak Bhaskaran]]></dc:creator>
            <pubDate>Mon, 06 Apr 2026 00:00:19 GMT</pubDate>
            <atom:updated>2026-04-07T02:59:41.930Z</atom:updated>
            <content:encoded><![CDATA[<p>Running a service in production is not the same as running it in a lab. The gap between “it works on my machine” and “it works reliably for customers at 3 AM on a holiday weekend” is filled with operational discipline. This post walks through the expectations every production service should meet, regardless of the underlying technology stack, and explains why each one matters.</p><p>Think of this as a production readiness checklist with context. If you are launching a new service, migrating an existing one, or inheriting something that has been running on autopilot for too long, this is the bar.</p><h4>Safe Deployment</h4><p>Deploying to production should never be an all-or-nothing event. A progressive rollout strategy (canary deploys, blue-green switches, ring-based rollouts) limits the blast radius when something goes wrong. If a bad build only reaches 1% of traffic before automated health checks catch it, you have a minor incident instead of a major outage.</p><p>Automated rollback is the companion to progressive rollout. If your deploy pipeline can detect a problem (elevated error rates, failed health checks, latency spikes) it should be able to roll back without waiting for a human to wake up and click a button. The goal is to make the time between “something is wrong” and “we are back to the last known good state” as short as possible.</p><p>Infrastructure should be defined as code and reconciled from a single source of truth. If your infrastructure lives in Terraform, Pulumi, CloudFormation, or Kubernetes manifests, you have a versioned, reviewable, reproducible description of what should exist. Drift detection closes the loop: if someone makes a manual change in the console, the system notices and either corrects it or alerts on it. Without this, your infrastructure slowly diverges from what you think it is, and that divergence bites you at the worst possible time.</p><h4>Scaling and Availability</h4><p>Horizontal scaling based on load signals (CPU, memory, request rate, queue depth) means your service can absorb traffic spikes without manual intervention. The key is choosing the right signals. CPU-based autoscaling works for compute-bound workloads, but a service that is mostly waiting on I/O might need to scale on request rate or queue depth instead.</p><p>Distributing workloads across failure domains (availability zones, physical hosts, regions) protects you from correlated failures. If all your instances sit in a single availability zone and that zone has a network partition, you are down. Spread across zones, you lose a fraction of capacity and stay up.</p><p>Disruption budgets prevent too many instances from being taken down at once during maintenance, rolling updates, or node drains. Kubernetes PodDisruptionBudgets are the most common implementation, but the concept applies everywhere. If you have five replicas, you might allow at most one to be unavailable at any time. This keeps your service healthy even while the platform underneath it is being patched.</p><h4>Health Management</h4><p>Readiness and liveness signals are how your service communicates its state to the platform running it. A readiness probe says “I have finished starting up and I am ready to serve traffic.” A liveness probe says “I am still running correctly.” These are distinct and should stay distinct. A service that is alive but not ready (still warming a cache, waiting for a dependency) should not receive traffic. A service that is ready but no longer alive (deadlocked, stuck in an infinite loop) should be restarted.</p><p>Graceful shutdown is about respecting in-flight work. When the platform tells your service to stop (during a deploy, a scale-down, a node drain), the service should stop accepting new requests, finish the ones it is already processing, and then exit. Without this, you get dropped connections, partial writes, and unhappy users during every deploy.</p><h4>Security Posture</h4><p>Security in production is not a single gate you pass through at launch. It is a set of ongoing constraints.</p><p>Least-privilege execution means your service runs with only the permissions it actually needs. If your API server does not need to read from S3, it should not have an IAM policy that allows it. Overly broad permissions sit there quietly until an attacker or a bug exploits them.</p><p>Network segmentation restricts ingress and egress to what the service actually needs. Your internal data processing service should not be reachable from the public internet. Your frontend service should not be able to talk directly to the database. Network policies, security groups, and service mesh configurations enforce these boundaries.</p><p>Container and runtime hardening policies (read-only root filesystems, dropped capabilities, non-root execution) reduce the attack surface. Restricting image sources to approved registries prevents someone from accidentally (or maliciously) deploying an unvetted image.</p><p>Secrets must never be stored in plain text, environment variables, or source control. This sounds obvious, but it remains one of the most common findings in security reviews. Environment variables are readable by anyone who can exec into a container. Source control retains history forever. Use a proper secrets manager.</p><p>Application security reviews and risk registries round this out. The review catches issues before launch. The risk registry tracks known gaps so they do not get quietly forgotten.</p><h4>Identity, Certificates, and Encryption</h4><p>All service-to-service communication should be encrypted in transit. Mutual TLS (mTLS) is the gold standard because it authenticates both sides of the connection, not just the server. Without encryption in transit, anyone with network access can read or tamper with the traffic between your services.</p><p>Certificates should come from a trusted internal CA, auto-renew before they expire, and trigger automatic workload restarts when they rotate. Certificate expiry is one of the most preventable causes of outages. If your certificates are managed manually, it is a matter of when, not if, someone forgets to renew one.</p><p>Workload identity should be tied to the service itself, not to a shared or static credential. A service mesh identity (SPIFFE, Kubernetes service accounts with bound tokens) gives each workload a cryptographically verifiable identity that does not depend on a long-lived secret sitting in a config file somewhere.</p><h4>Secrets Management</h4><p>Secrets should come from a centralized, access-controlled store (HashiCorp Vault, AWS Secrets Manager, Azure Key Vault, GCP Secret Manager). They should be refreshable without redeploying the service: your secret store rotates the database password, and the service picks up the new one on its next refresh cycle. Scoping secrets appropriately (per-deployment, per-region, global) limits the damage if one is compromised.</p><h4>Observability</h4><p>You cannot fix what you cannot see. Observability has three pillars, and you need all three.</p><p>Metrics give you the quantitative view: request rate, error rate, latency percentiles, resource utilization, queue depth, and business signals (orders placed, logins succeeded). These feed your dashboards and your alerts.</p><p>Distributed tracing follows a request as it crosses service boundaries. When a user reports that a particular action is slow, tracing lets you see exactly which service in the chain is adding latency. Without tracing, debugging in a microservices architecture devolves into grepping through logs from six different services and trying to correlate timestamps.</p><p>Dashboards should exist for each service and for shared infrastructure. The on-call engineer at 2 AM should be able to open a dashboard and immediately see whether the service is healthy, what changed recently, and where the problem might be.</p><p>Database and data-store monitoring is often overlooked. Slow queries, connection pool exhaustion, replication lag: these are some of the most common root causes of production incidents, and they are invisible if you are only watching application-level metrics.</p><p>Runbooks should exist for every critical alert. The alert fires, the on-call engineer opens the runbook, and the runbook tells them what to check, what to try, and when to escalate. Runbooks turn tribal knowledge into documented procedures that anyone on the rotation can follow.</p><h4>Logging</h4><p>Application and system logs should be forwarded to a centralized, searchable platform (Elasticsearch, Splunk, Datadog, CloudWatch Logs). If your only option for reading logs is to SSH into a production host and tail a file, you are one disk failure away from losing your debugging history.</p><p>Access logs serve double duty: they are essential for troubleshooting (“did the request actually reach the service?”) and for audit (“who accessed what, and when?”). Log retention policies should be defined and enforced. Keep logs long enough to be useful for incident investigation and compliance, but not so long that storage costs spiral or you retain data you are obligated to delete.</p><h4>Alerting and Incident Response</h4><p>Alerts should be defined for the things that matter: certificate expiry, resource health, provider-level events, error budget burn rate. Routing alerts to the responsible team through a notification channel (PagerDuty, Opsgenie, a team Slack channel) seems basic, but misconfigured routing is a surprisingly common cause of delayed incident response.</p><p>Automated remediation for known, repeatable failure modes saves time and reduces mean time to recovery. If a specific alert always results in the same manual action (restart the service, clear the cache, drain the node), automate that action and alert on the automation failing instead.</p><p>Failure scenarios should be identified with documented escalation paths. “The database is unreachable” is a different escalation than “the CDN is returning stale content.” Knowing who to call and when to call them before the incident starts makes the response faster and calmer.</p><p>Gameday or tabletop exercises validate that your incident response process actually works. They expose gaps in runbooks, stale contact lists, and assumptions about what “automatic” actually means. Run them regularly.</p><h4>Backup and Disaster Recovery</h4><p>Data stores should be backed up on a defined schedule with retention policies. Backup success and failure should be reported automatically. It is not enough to set up a backup job and assume it is working: backup jobs fail silently more often than anyone would like.</p><p>The recovery process should be documented and periodically tested. An untested backup is not a backup. If you have never actually restored from your backups, you do not know whether they work, how long the restore takes, or what state the data will be in after restoration.</p><h4>CI/CD Validation</h4><p>Changes should be validated before merge: linting, schema checks, policy enforcement. Catching a misconfigured Kubernetes manifest or a deprecated API call in the pull request is vastly cheaper than catching it in production.</p><p>Deprecated APIs and configurations should be detected before they reach production. Cloud providers deprecate APIs, Kubernetes removes beta resources, libraries drop support for old versions. If your CI pipeline flags these, you fix them on your schedule instead of scrambling when something breaks.</p><p>Scoped pipelines (only testing the components affected by a change) keep your CI fast. If you changed one microservice, you should not have to wait for the entire monorepo to build and test. Fast CI encourages small, frequent merges. Slow CI encourages large, risky batches.</p><h4>Resource Accountability</h4><p>Every cloud resource should be tagged with an owning team or contact. When an alert fires for an orphaned resource, someone needs to be responsible for it. Untagged resources become everyone’s problem, which means they become no one’s problem.</p><p>Workload identity should use short-lived, scoped credentials. Long-lived API keys are a liability: they do not expire, they get shared, they end up in places they should not be. Short-lived tokens from an identity provider are revocable, auditable, and scoped to exactly what the workload needs.</p><p>Node and instance lifecycle should be managed gracefully. Drain workloads before terminating nodes. Give pods time to migrate before scaling down. Abrupt termination causes the kind of intermittent failures that are hardest to debug.</p><p>Cloud cost should be estimated, tracked, and reported to a responsible party. Cost surprises are operational incidents too. An autoscaler that spins up 200 instances because of a traffic spike is doing its job, but someone should know about it and understand the cost implications.</p><h4>Privacy and Data Governance</h4><p>PII must be encrypted in transit and at rest. PII must not cross data residency boundaries without authorization. These are not optional: they are legal and contractual requirements in most jurisdictions.</p><p>Customer data should be purged when an account is deleted. Customer log retention settings should be respected. If a customer deletes their account and their data is still sitting in your logs six months later, you have a compliance problem.</p><p>Third-party services should be reviewed for sub-processor and contractual obligations. If your service sends customer data to a third-party analytics provider, that provider becomes a sub-processor under regulations like GDPR. Your contracts and your data processing agreements need to account for this.</p><h4>Service Level Expectations</h4><p>A customer-facing SLA defines the uptime or availability commitment you are making to your customers. It is a contract with consequences (usually financial) for not meeting it.</p><p>An internal SLO is the target you set for yourself, typically stricter than the external SLA. If your SLA promises 99.9% availability, your SLO might target 99.95%, giving you a buffer before you breach the SLA.</p><p>An error budget is the inverse of the SLO: if your target is 99.95%, you have a 0.05% error budget. When the budget is exhausted, you should have a defined response: freeze feature work, focus on reliability, conduct a review. Error budgets give engineering teams a quantitative framework for balancing velocity and reliability instead of arguing about it in meetings.</p><p>Severity and priority classifications should be documented for the service. Not every bug is a P1. Not every outage is a Sev1. Having clear definitions prevents the adrenaline of an incident from distorting the response.</p><h4>Performance Validation</h4><p>Load testing identifies capacity limits and breaking points before your customers find them. It answers questions like: “How many concurrent users can this service handle before latency degrades?” and “What happens when the database connection pool is exhausted?”</p><p>Performance criteria should be defined and met before production launch. If you do not have a latency target, you cannot tell whether a deploy made things worse. If you do not have a throughput target, you cannot tell whether you are provisioned correctly.</p><p>Sufficient test coverage across unit, integration, and end-to-end layers gives you confidence that changes do not break existing behavior. The emphasis is on “sufficient,” not “100%.” Focus coverage on the paths that matter most: the happy path, the error paths that customers hit, and the edge cases that have caused incidents before.</p><h4>Documentation and Ownership</h4><p>Architecture should be documented with diagrams and component descriptions. This does not need to be a 50-page design document. A clear diagram showing how the service fits into the broader system, what it depends on, and what depends on it is often enough.</p><p>Service ownership should be clearly attributed to a team. When something goes wrong, there should be no ambiguity about who is responsible. Ownership means the team is accountable for the service’s health, security, and operational posture.</p><p>Data migration strategies should be defined if applicable. How do you move data between schema versions? What happens if a migration fails partway through? Can you roll back?</p><p>Maintenance and remediation procedures should be scripted where possible. If a human has to follow 15 manual steps to recover from a failure, at least some of those steps can and should be automated.</p><h4>Launch and On-call Readiness</h4><p>The rollback process should be defined with thresholds that trigger it. “If error rate exceeds 5% for 10 minutes, roll back” is a clear, actionable threshold. “Roll back if things look bad” is not.</p><p>A monitoring burn-in period at full production load should be completed before handing the service off to an on-call team. This period lets you tune alerts, identify noisy signals, and build confidence that the monitoring actually catches real problems.</p><p>Alert volume and remediation patterns should be journaled during burn-in. If the same alert fires 20 times in a week and the response is always the same, that is a candidate for automation or a sign that the threshold needs adjustment.</p><p>Internal and external stakeholders should be notified of launch and on-call transitions. The team taking on-call responsibility needs to know the service exists, what it does, and where to find the runbooks. Surprising an on-call engineer with a new service they have never heard of is a recipe for slow incident response and team frustration.</p><p>This list is long, and that is the point. Production is an environment that demands rigor across deployment, security, observability, resilience, and governance. No single item on this list is exotic or controversial. Each one exists because skipping it has caused real outages, real security incidents, or real compliance findings at real organizations. The goal is not perfection on day one. The goal is a clear, shared understanding of what “production ready” means, and a systematic approach to closing the gaps.</p><p><em>Originally published at </em><a href="https://onsitereliability.com/Operational-Expectations-For-Production-Services/"><em>https://onsitereliability.com</em></a><em> on April 6, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82dd0095793e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Converting Selenium Tests to Playwright]]></title>
            <link>https://medium.com/@deepak.bhaskaran/converting-selenium-tests-to-playwright-c9ee972f24e5?source=rss-7c5b1b326f1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/c9ee972f24e5</guid>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[selenium]]></category>
            <category><![CDATA[playwright-test]]></category>
            <dc:creator><![CDATA[Deepak Bhaskaran]]></dc:creator>
            <pubDate>Sat, 04 Apr 2026 00:00:38 GMT</pubDate>
            <atom:updated>2026-04-05T03:22:14.416Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why move away from Selenium?</h3><p>Selenium has been the default choice for browser automation for over a decade. It works. Teams have built massive test suites on it. But if you have been maintaining a Selenium test suite for any length of time, you already know the pain points.</p><p>Flaky tests are the big one. Selenium interacts with browsers through the WebDriver protocol, which means every command is a separate HTTP request to a browser driver process. This architecture introduces latency and race conditions. You end up littering your code with explicit waits, retry loops, and sleep statements. Tests that pass locally fail in CI. Tests that pass in CI fail when you add a new one to the suite. The phrase “just re-run it” becomes part of your team’s vocabulary, and that is a problem.</p><p>Playwright was built at Microsoft by engineers who previously worked on Google’s Puppeteer project. It was designed from the ground up to solve the reliability and developer experience problems that Selenium never fully addressed. It communicates with browsers over a persistent WebSocket connection using the Chrome DevTools Protocol (for Chromium) and equivalent internal protocols for Firefox and WebKit. This means commands are faster, state is more consistent, and the framework has much deeper visibility into what the browser is actually doing.</p><p>Here is what you get by switching:</p><ul><li><strong>Auto-waiting built in.</strong> Playwright automatically waits for elements to be actionable before interacting with them. No more WebDriverWait with expected_conditions. No more time.sleep(2) scattered through your tests.</li><li><strong>Better isolation.</strong> Each test can run in its own browser context, which is lighter than a full browser instance. Contexts share a browser process but have completely separate cookies, storage, and cache. This means true parallel execution without interference.</li><li><strong>Network interception.</strong> Playwright lets you intercept, modify, and mock network requests natively. In Selenium, you need a proxy like BrowserMob or a separate tool entirely.</li><li><strong>Tracing and debugging.</strong> Playwright’s trace viewer gives you a step-by-step replay of your test with screenshots, DOM snapshots, network logs, and console output. Debugging a failed test in CI goes from guesswork to straightforward analysis.</li><li><strong>Multi-browser from one API.</strong> Chromium, Firefox, and WebKit are all first-class citizens with the same API surface. No driver management, no compatibility surprises.</li></ul><h3>The mental model shift</h3><p>The biggest adjustment is not syntax. It is how you think about waiting and element interaction.</p><p>In Selenium, the default mental model is imperative: find an element, then act on it, and hope it is ready. You learn to distrust the framework and add defensive code everywhere.</p><pre># Selenium: defensive by necessity<br>from selenium.webdriver.support.ui import WebDriverWait<br>from selenium.webdriver.support import expected_conditions as EC<br>from selenium.webdriver.common.by import By<br><br>wait = WebDriverWait(driver, 10)<br>element = wait.until(EC.element_to_be_clickable((By.CSS_SELECTOR, &quot;#submit-btn&quot;)))<br>element.click()</pre><p>In Playwright, the mental model is declarative: tell the framework what you want to do, and it figures out when the element is ready.</p><pre># Playwright: auto-waits for the element to be clickable<br>page.locator(&quot;#submit-btn&quot;).click()</pre><p>That single line handles visibility checks, enabled state, stable position, and receiving pointer events. If the element is not ready within the timeout, you get a clear error message telling you exactly why.</p><h3>Mapping Selenium patterns to Playwright</h3><p>Here is a practical reference for the most common patterns you will encounter during conversion.</p><h4>Browser and driver setup</h4><pre># Selenium<br>from selenium import webdriver<br>driver = webdriver.Chrome()<br>driver.get(&quot;https://example.com&quot;)<br># ... tests ...<br>driver.quit()<br><br># Playwright<br>from playwright.sync_api import sync_playwright<br>with sync_playwright() as p:<br>    browser = p.chromium.launch()<br>    page = browser.new_page()<br>    page.goto(&quot;https://example.com&quot;)<br>    # ... tests ...<br>    browser.close()</pre><p>With Playwright, there is no driver binary to manage. playwright install downloads the browsers once and you are done.</p><h4>Finding elements</h4><p>Selenium uses find_element with a By strategy. Playwright uses locators, which are lazy and auto-waiting.</p><pre># Selenium<br>driver.find_element(By.ID, &quot;username&quot;)<br>driver.find_element(By.CSS_SELECTOR, &quot;.login-form input[type=&#39;email&#39;]&quot;)<br>driver.find_element(By.XPATH, &quot;//button[contains(text(), &#39;Submit&#39;)]&quot;)<br><br># Playwright<br>page.locator(&quot;#username&quot;)<br>page.locator(&quot;.login-form input[type=&#39;email&#39;]&quot;)<br>page.get_by_role(&quot;button&quot;, name=&quot;Submit&quot;)</pre><p>Playwright’s get_by_role, get_by_text, get_by_label, and get_by_placeholder methods encourage writing locators that mirror how users actually find elements on a page. This makes tests more resilient to DOM structure changes.</p><h4>Filling forms</h4><pre># Selenium<br>driver.find_element(By.ID, &quot;email&quot;).clear()<br>driver.find_element(By.ID, &quot;email&quot;).send_keys(&quot;user@example.com&quot;)<br><br># Playwright<br>page.locator(&quot;#email&quot;).fill(&quot;user@example.com&quot;)</pre><p>fill clears the field first automatically.</p><h4>Dropdowns</h4><pre># Selenium<br>from selenium.webdriver.support.ui import Select<br>select = Select(driver.find_element(By.ID, &quot;country&quot;))<br>select.select_by_visible_text(&quot;Canada&quot;)<br><br># Playwright<br>page.locator(&quot;#country&quot;).select_option(label=&quot;Canada&quot;)</pre><h4>Waiting for conditions</h4><pre># Selenium<br>WebDriverWait(driver, 10).until(<br>    EC.visibility_of_element_located((By.CSS_SELECTOR, &quot;.results&quot;))<br>)<br><br># Playwright<br>page.locator(&quot;.results&quot;).wait_for(state=&quot;visible&quot;)<br># Or often you don&#39;t need this at all, since actions auto-wait</pre><h4>Assertions</h4><p>If you are using pytest with Selenium, your assertions probably look like raw assert statements that check element properties manually. Playwright provides built-in assertions that auto-retry.</p><p>The Playwright assertion will retry for up to 5 seconds (configurable) before failing. This eliminates an entire class of timing-related flaky tests.</p><h4>Handling iframes</h4><pre># Selenium<br>driver.switch_to.frame(&quot;iframe-name&quot;)<br>driver.find_element(By.ID, &quot;inner-element&quot;).click()<br>driver.switch_to.default_content()<br><br># Playwright<br>page.frame_locator(&quot;#iframe-name&quot;).locator(&quot;#inner-element&quot;).click()<br># No need to switch back, the main page locators still work</pre><h4>File uploads</h4><pre># Selenium<br>driver.find_element(By.CSS_SELECTOR, &quot;input[type=&#39;file&#39;]&quot;).send_keys(&quot;/path/to/file.pdf&quot;)<br><br># Playwright<br>page.locator(&quot;input[type=&#39;file&#39;]&quot;).set_input_files(&quot;/path/to/file.pdf&quot;)</pre><h4>Screenshots</h4><pre># Selenium<br>driver.save_screenshot(&quot;screenshot.png&quot;)<br><br># Playwright<br>page.screenshot(path=&quot;screenshot.png&quot;)<br># Or capture just one element<br>page.locator(&quot;.chart&quot;).screenshot(path=&quot;chart.png&quot;)</pre><p>Selenium 4 added element-level screenshots, but Playwright’s version is more consistent across browsers and integrates with its tracing infrastructure.</p><h3>Conversion strategy</h3><p>Do not try to convert everything at once. Here is an approach that works.</p><p><strong>1. Start with your most flaky tests.</strong> These are the ones that will benefit the most from Playwright’s auto-waiting. They are also the tests your team trusts the least, so improving them first builds confidence in the migration.</p><p><strong>2. Run both frameworks in parallel.</strong> Keep your existing Selenium suite running in CI while you convert tests one by one or one module at a time. Do not delete the old tests until the new ones have proven stable over several CI runs.</p><p><strong>3. Convert page objects, not just tests.</strong> If you are using the Page Object pattern (and you should be), convert the page objects first. The test logic on top often translates almost directly once the underlying interactions are updated.</p><pre># Before: Selenium page object<br>class LoginPage:<br>    def __init__(self, driver):<br>        self.driver = driver<br><br>    def login(self, username, password):<br>        self.driver.find_element(By.ID, &quot;username&quot;).send_keys(username)<br>        self.driver.find_element(By.ID, &quot;password&quot;).send_keys(password)<br>        self.driver.find_element(By.ID, &quot;login-btn&quot;).click()<br>        WebDriverWait(self.driver, 10).until(<br>            EC.url_contains(&quot;/dashboard&quot;)<br>        )<br><br># After: Playwright page object<br>class LoginPage:<br>    def __init__(self, page):<br>        self.page = page<br><br>    def login(self, username, password):<br>        self.page.locator(&quot;#username&quot;).fill(username)<br>        self.page.locator(&quot;#password&quot;).fill(password)<br>        self.page.locator(&quot;#login-btn&quot;).click()<br>        self.page.wait_for_url(https://medium.com/&quot;**/dashboard&quot;)</pre><p><strong>4. Use Playwright’s codegen for complex flows.</strong> If you have a test that exercises a complicated UI workflow and you are unsure about the right locators, run playwright codegen to record the interaction. It generates usable code that you can clean up and incorporate.</p><p><strong>5. Update your CI configuration.</strong> Playwright needs browsers installed. Add playwright install --with-deps to your CI setup step. The --with-deps flag handles system-level dependencies on Linux.</p><h3>What to watch out for</h3><p><strong>Custom waits with business logic.</strong> If your Selenium tests have custom wait conditions that check application-specific state (like polling an API until a background job completes), those will not automatically translate. You will need to reimplement them using Playwright’s page.wait_for_function or custom polling logic.</p><p><strong>Browser-specific behavior.</strong> If your Selenium tests only ran on Chrome via ChromeDriver, running Playwright across Chromium, Firefox, and WebKit might surface cross-browser issues that were always there but never tested. This is a feature, not a bug, but it means your first CI run might have unexpected failures.</p><p><strong>Third-party Selenium plugins.</strong> If you depend on Selenium Grid for distributed execution, Playwright has its own parallelism model built into the test runner. If you use Selenium with Appium for mobile testing, that is a separate consideration. Playwright’s mobile support is limited to emulation, not real device testing.</p><p><strong>Authentication state.</strong> A common Selenium pattern is logging in once and reusing the browser session. Playwright has a cleaner version of this: you can save and reuse authentication state across tests using storage_state.</p><pre># Save auth state after login<br>context.storage_state(path=&quot;auth.json&quot;)<br><br># Reuse in another test<br>context = browser.new_context(storage_state=&quot;auth.json&quot;)</pre><h3>Is it worth it?</h3><p>If your team spends meaningful time debugging flaky tests, re-running failed CI pipelines, or working around Selenium’s limitations, yes. The migration is not trivial for a large test suite, but the payoff is a test suite that is faster, more reliable, and significantly easier to debug when something does fail.</p><p>The best part: you do not have to commit fully up front. Start with a handful of tests, measure the difference, and let the results make the case for continuing.</p><p><em>Originally published at </em><a href="https://onsitereliability.com/Selenium-To-Playwright/"><em>https://onsitereliability.com</em></a><em> on April 4, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9ee972f24e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Harness Engineering]]></title>
            <link>https://medium.com/@deepak.bhaskaran/harness-engineering-d50960e497d0?source=rss-7c5b1b326f1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d50960e497d0</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[harness-engineering]]></category>
            <dc:creator><![CDATA[Deepak Bhaskaran]]></dc:creator>
            <pubDate>Sun, 22 Mar 2026 00:00:00 GMT</pubDate>
            <atom:updated>2026-03-22T16:08:54.480Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is Harness Engineering?</h3><p>OpenAI published a post in February 2026 by Ryan Lopopolo describing an experiment their team ran: building and shipping an internal software product with zero lines of manually-written code. Every line of application logic, tests, CI configuration, documentation, observability setup, and internal tooling was written by Codex. The product had daily internal users and external alpha testers. It shipped, deployed, broke, and got fixed, all driven by agents.</p><p>The team estimates they built the product in roughly 1/10th the time it would have taken to write the code by hand.</p><p>The core philosophy: <em>Humans steer. Agents execute.</em></p><p>The term “harness engineering” refers to the discipline of building the environment, scaffolding, and feedback loops that make this kind of agent-driven development possible. The harness is not the product code itself. It is the infrastructure of intent, constraints, and context that allows an agent to do reliable work at scale.</p><h3>The numbers</h3><p>The first commit landed in late August 2025. Five months later, the repository contained roughly one million lines of code across application logic, infrastructure, tooling, and documentation. About 1,500 pull requests were opened and merged by a small team of three engineers driving Codex, translating to an average of 3.5 pull requests per engineer per day. Throughput actually increased as the team grew to seven engineers.</p><p>Humans never directly contributed code. That constraint was the point. By holding that line, the team was forced to build what was actually necessary to make agents effective, rather than falling back on manual work when things got hard.</p><h3>Redefining the engineer’s role</h3><p>Early progress was slower than expected, not because Codex was incapable, but because the environment was underspecified. The agent lacked the tools, abstractions, and internal structure needed to make progress on high-level goals.</p><p>The primary job of the engineering team became: <em>enable the agents to do useful work.</em></p><p>In practice this meant working depth-first. Break down a larger goal into smaller building blocks. Prompt the agent to construct those blocks. Use them to unlock more complex tasks. When something failed, the fix was almost never “try harder.” The question was always: what capability is missing, and how do we make it both legible and enforceable for the agent?</p><p>Human interaction with the system happened almost entirely through prompts. An engineer describes a task, runs the agent, and allows it to open a pull request. Codex was instructed to review its own changes locally, request additional agent reviews, respond to feedback, and iterate in a loop until all agent reviewers were satisfied. Pull requests could be reviewed by humans, but humans were not required. Over time, the team pushed almost all review effort towards agent-to-agent.</p><h3>Making the application legible to agents</h3><p>As code throughput increased, the bottleneck shifted to human QA capacity. Since human time and attention were the fixed constraint, the team worked to make the application itself directly legible to Codex.</p><p>They made the app bootable per git worktree, so Codex could launch and drive a separate instance per change. The Chrome DevTools Protocol was wired into the agent runtime, giving Codex skills for working with DOM snapshots, screenshots, and navigation. This let Codex reproduce bugs, validate fixes, and reason about UI behavior directly without a human watching.</p><p>The same approach was applied to observability. Logs, metrics, and traces were exposed to Codex via a local observability stack that was ephemeral for any given worktree. Codex could query logs with LogQL and metrics with PromQL. This made prompts like “ensure service startup completes in under 800ms” or “no span in these four critical user journeys exceeds two seconds” directly tractable. The team regularly saw single Codex runs work on a task for upwards of six hours, often while humans were sleeping.</p><h3>Repository knowledge as the system of record</h3><p>Context management is one of the biggest challenges in making agents effective at complex tasks. One of the team’s earliest lessons: give Codex a map, not a 1,000-page instruction manual.</p><p>They tried the “one big AGENTS.md” approach. It failed in predictable ways:</p><ul><li>Context is a scarce resource. A giant instruction file crowds out the task, the code, and the relevant docs, so the agent misses key constraints or optimizes for the wrong ones.</li><li>Too much guidance becomes non-guidance. When everything is “important,” nothing is. Agents pattern-match locally instead of navigating intentionally.</li><li>It rots instantly. A monolithic manual turns into a graveyard of stale rules. Agents cannot tell what is still true, humans stop maintaining it, and the file quietly becomes an attractive nuisance.</li><li>It is hard to verify. A single blob does not lend itself to mechanical checks like coverage, freshness, or ownership, so drift is inevitable.</li></ul><p>Instead, the team treats AGENTS.md as the table of contents, not the encyclopedia. A short AGENTS.md of roughly 100 lines serves as a map, with pointers to deeper sources of truth in a structured docs/ directory. The directory holds design docs, execution plans, product specs, architectural references, and generated artifacts like the database schema.</p><p>Plans are treated as first-class artifacts. Ephemeral plans are used for small changes. Complex work is captured in execution plans with progress and decision logs, checked into the repository. Active plans, completed plans, and known technical debt are versioned and co-located, so agents can operate without relying on external context.</p><p>This enables progressive disclosure: agents start with a small, stable entry point and are taught where to look next, rather than being overwhelmed up front. Dedicated linters and CI jobs validate that the knowledge base is up to date, cross-linked, and structured correctly. A recurring “doc-gardening” agent scans for stale documentation and opens fix-up pull requests.</p><h3>Agent legibility is the goal</h3><p>The repository is optimized first for Codex’s legibility. In the same way a team improves navigability for a new engineering hire, the human engineers’ goal was making it possible for an agent to reason about the full business domain directly from the repository itself.</p><p>From the agent’s point of view, anything it cannot access in-context while running effectively does not exist. Knowledge in Google Docs, chat threads, or people’s heads is not accessible to the system. Repository-local, versioned artifacts such as code, markdown, schemas, and executable plans are all it can see.</p><p>The practical consequence: that Slack discussion that aligned the team on an architectural pattern is illegible to the agent if it never made it into the repo. The same way it would be unknown to a new hire joining three months later.</p><p>This framing clarified many tradeoffs. The team favored dependencies and abstractions that could be fully internalized and reasoned about in-repo. Technologies often described as “boring” tend to be easier for agents to model due to composability, API stability, and representation in the training set. In some cases it was cheaper to have the agent reimplement subsets of functionality than to work around opaque upstream behavior. For example, rather than pulling in a generic concurrency-limiting package, they implemented their own map-with-concurrency helper: tightly integrated with their OpenTelemetry instrumentation, with 100% test coverage, behaving exactly the way their runtime expected.</p><h3>Enforcing architecture and taste</h3><p>Documentation alone does not keep a fully agent-generated codebase coherent. The team’s approach: enforce invariants, not implementations. By encoding architectural rules mechanically, agents could ship fast without causing drift or decay.</p><p>The application was built around a rigid layered model. Each business domain is divided into a fixed set of layers with strictly validated dependency directions and a limited set of permissible edges. Cross-cutting concerns such as auth, connectors, telemetry, and feature flags enter through a single explicit interface: Providers. These constraints are enforced via custom linters and structural tests.</p><p>This is the kind of architecture teams usually postpone until they have hundreds of engineers. With coding agents, it becomes an early prerequisite. The constraints are what allow speed without architectural drift.</p><p>The team also maintained a small set of “taste invariants” enforced statically: structured logging, naming conventions for schemas and types, file size limits, platform-specific reliability requirements. Because the lints were custom, the error messages were written to inject remediation instructions directly into agent context. In a human-first workflow, these rules might feel pedantic. With agents, they become multipliers: once encoded, they apply everywhere at once.</p><p>The principle was: enforce boundaries centrally, allow autonomy locally. Within those boundaries, agents have significant freedom in how solutions are expressed. The resulting code does not always match human stylistic preferences, and that is accepted. As long as the output is correct, maintainable, and legible to future agent runs, it meets the bar.</p><p>Human taste gets fed back into the system continuously through review comments, refactoring pull requests, and user-facing bugs, captured as documentation updates or encoded directly into tooling.</p><h3>Throughput changes the merge philosophy</h3><p>As Codex’s throughput increased, many conventional engineering norms became counterproductive.</p><p>The repository operates with minimal blocking merge gates. Pull requests are short-lived. Test flakes are often addressed with follow-up runs rather than blocking progress indefinitely. In a system where agent throughput far exceeds human attention, corrections are cheap, and waiting is expensive. This would be irresponsible in a low-throughput environment. Here, it is often the right tradeoff.</p><h3>Entropy and garbage collection</h3><p>Full agent autonomy introduces novel problems. Codex replicates patterns that already exist in the repository, including uneven or suboptimal ones. Over time, this leads to drift.</p><p>Initially, humans addressed this manually, spending every Friday cleaning up what the team called “AI slop.” That did not scale.</p><p>Instead, the team encoded “golden principles” directly into the repository and built a recurring cleanup process. These are opinionated, mechanical rules that keep the codebase legible and consistent for future agent runs. For example: prefer shared utility packages over hand-rolled helpers to keep invariants centralized, and validate data boundaries rather than probing “YOLO-style.” On a regular cadence, background Codex tasks scan for deviations, update quality grades, and open targeted refactoring pull requests. Most can be reviewed in under a minute and automerged.</p><p>The framing here is garbage collection. Technical debt is like a high-interest loan: almost always better to pay it down continuously in small increments than to let it compound. Human taste is captured once, then enforced continuously on every line of code. Bad patterns get caught and resolved daily rather than spreading for weeks.</p><h3>What this means for software engineering</h3><p>The clearest takeaway from this experiment is that building software in an agent-first world still demands discipline, but the discipline shows up in the scaffolding rather than the code. The tooling, abstractions, and feedback loops that keep a codebase coherent are increasingly where the engineering leverage lives.</p><p>The engineer’s job shifts: less time writing code, more time designing environments, specifying intent, and building feedback loops. When an agent struggles, the right question is not “how do I fix this code” but “what capability is missing from the environment, and how do I make it legible and enforceable for the agent?”</p><p>The most difficult challenges in this model center on designing control systems that help agents accomplish complex, reliable work at scale. That is what harness engineering is: the practice of building those systems well.</p><p><em>Originally published at </em><a href="https://onsitereliability.com/Harness-Engineering/"><em>https://onsitereliability.com</em></a><em> on March 22, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d50960e497d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Executive Communication]]></title>
            <link>https://medium.com/@deepak.bhaskaran/executive-communication-12f477525777?source=rss-7c5b1b326f1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/12f477525777</guid>
            <category><![CDATA[communication]]></category>
            <category><![CDATA[executive-communication]]></category>
            <category><![CDATA[business-communication]]></category>
            <dc:creator><![CDATA[Deepak Bhaskaran]]></dc:creator>
            <pubDate>Sat, 28 Feb 2026 00:00:54 GMT</pubDate>
            <atom:updated>2026-04-05T04:06:34.983Z</atom:updated>
            <content:encoded><![CDATA[<p>I received some feedback recently. Updates to execs need to be crisp, and to the point. If more detail is needed, that can be provided later.</p><p>In the middle of a critical outage, I had to provide an update to senior leadership. It took a few tries for me to get to the right level of clarity in my message. The first version was a really long document that was about 6 pages long, with all the details. Then it became a 1 pager, with a 3 paragraph summary. The final version I sent out was one paragraph. It was well received and sufficient for the moment. A day later I was asked for more detail, and the one pager I prepared came in handy for the task.</p><p>I wish I’d gotten to this level on the first try but hey, now I know. And I’m going to work on this.</p><h4>What was I missing?</h4><p>I was not thinking about my audience, and thus, I likely did not give them what they were looking for. I was just writing how I knew how to write. Two of the execs I shared my answer with, gave me some feedback. They asked me to think about who the audience of my report was, what were the top three questions they’d get when they shared it with their audience, and to answer those questions in my report.</p><h4>Key points</h4><p><strong>Who is the audience?</strong> I did not think about that. I was writing for myself. I did not try to find all the relevant information in this situation and then I wrote a report. I was not really writing for the General Manager of a business unit at Cisco. I was probably also not writing for the SVP of Engineering of that business unit at Cisco. Did they need all the technical details or did they need to know just what happened, how long it lasted and how we were addressing it? Probably the latter.</p><p><strong>What is your immediate audience going to do, who are they going to explain this to?</strong> Another key bit of feedback was to think about who they were going to share this with. Was the GM going to take it to a customer, or someone internal like Sales or Customer Success? Would I change something about the report if it was going to be shared externally? And what I would I do differently if it was an internal only report? Those would have been good things to think about. If I was writing for an internal audience, I would have provided a lot more detail. Even if there was a lot of detail, I should have provided a crisp summary instead of a really long document. Just because we collected all the details, it did not mean that we should have put all that into the report.</p><p><strong>What are the top three questions those folks are going to ask?</strong> If a regional Sales head was given my document, what would they get out of it? And what else would they ask? I think they might want to know what happened, what was the impact and how we’re going to prevent it from happening again. I should start with the answers to those, and only then provide additional detail. Any detail that did not answer these questions, was not going to be helpful and would only end up confusing the readers.</p><h4>Conclusion</h4><p>The lesson here is simple but easy to forget in the moment: start with your audience, not your data. When you’re deep in an incident, the instinct is to dump everything you know into a document. But the people reading your update are not looking for a full investigation. They need to know what happened, what the impact was, and what you’re doing about it. Everything else is supporting detail that can come later if asked for.</p><p>I’ve started applying this framework to every update I write. Before I start typing, I ask myself three questions: who is going to read this, what are they going to do with it, and what are the first three questions they’ll ask? If my update answers those questions in the first paragraph, I’ve done my job. The rest is appendix material.</p><h4>References</h4><ul><li><a href="https://medium.com/lessons-from-mckinsey/the-pyramid-principle-f0885dd3c5c7">The Pyramid Principle</a></li><li><a href="https://lethain.com/pyramid-principle/">Notes on The Pyramid Principle.</a></li></ul><p><em>Originally published at </em><a href="https://onsitereliability.com/Executive-Communication/"><em>https://onsitereliability.com</em></a><em> on February 28, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=12f477525777" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Art of the Code Review]]></title>
            <link>https://medium.com/@deepak.bhaskaran/the-art-of-the-code-review-901ce7b0f358?source=rss-7c5b1b326f1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/901ce7b0f358</guid>
            <dc:creator><![CDATA[Deepak Bhaskaran]]></dc:creator>
            <pubDate>Sat, 21 Feb 2026 00:00:25 GMT</pubDate>
            <atom:updated>2026-03-15T12:57:26.373Z</atom:updated>
            <content:encoded><![CDATA[<p>Code reviews are one of the most valuable practices in software engineering. Done well, they catch bugs, spread knowledge, and raise the quality bar across your team. Done poorly, they become adversarial gatekeeping rituals that slow everyone down and erode trust. The difference comes down to how you approach them.</p><p>I have had the privilege of working with some exceptional code reviewers over the years. The best ones share a common trait: they treat reviews as a conversation, not an inspection. Here is what I have learned from watching them work.</p><h4>Ask Questions Instead of Making Demands</h4><p>When something looks off in a pull request, resist the urge to say “Change this to X.” Instead, ask “Why was this approach chosen?” or “What if we did X instead?” This is a small shift in language, but it changes the entire dynamic. You are assuming the author knows something you don’t, and you are inviting them to share that context. Sometimes they have a great reason. Sometimes the question itself helps them realize there is a better way. Either way, the outcome is better than a demand.</p><p>A question like “Will returning zero for an unknown location be helpful to all callers?” does more work than “Don’t return zero here.” It prompts the author to think about the broader impact and come to the right answer themselves.</p><h4>Distinguish Must-Fix From Nice-to-Have</h4><p>Not every comment on a PR needs to block the merge. One of the most respectful things you can do as a reviewer is to clearly distinguish between issues that must be addressed and suggestions that are optional. A simple prefix like “Non-blocking:” before optional suggestions, style preferences, or minor improvements goes a long way. It shows respect for the author’s time while still sharing useful insights. The author can choose to address these in a follow-up or not at all, and the PR keeps moving.</p><h4>Explain the Why</h4><p>Don’t just flag problems. Explain the reasoning, the potential consequences, and the alternatives. If you are pointing out that time.sleep() should not be used on the main reactor thread, don&#39;t stop at &quot;Don&#39;t use time.sleep() here.&quot; Explain that it blocks the reactor, which adds latency for other requests and can wreak havoc on background coroutines like Redis keepalives. When you explain the full consequence chain, you are not just fixing one line of code. You are teaching the author something they will carry into every future PR.</p><p>Link to documentation when it helps. The goal is to leave the author better equipped than before.</p><h4>Be Appreciative</h4><p>Call out good code explicitly. When you see something well done, say so. “Nice!”, “Great idea!”, “These tests are impressive” — these small affirmations matter more than you think. Code reviews that are nothing but criticism, even constructive criticism, are draining. Recognizing good work creates a culture where people want to write better code, not just code that passes review.</p><h4>Use a Friendly Tone</h4><p>Your reviews should feel like helpful advice from a friend, not criticism from a gatekeeper. This does not mean being vague or avoiding hard feedback. It means delivering that feedback in a way that keeps the relationship healthy. An occasional :) or a lighthearted comment goes a long way toward keeping things human.</p><h4>Technical Areas Worth Your Attention</h4><p>Beyond tone and philosophy, good reviewers develop an eye for specific technical risks. Here are some areas that consistently deserve close attention:</p><p><strong>Async patterns.</strong> In codebases that use async frameworks like Twisted or asyncio, watch for missing decorators that bridge async and sync code, blocking calls on the main thread, and unmanaged background tasks that can silently fail.</p><p><strong>Logging.</strong> Good logging is what makes code debuggable in production. Look for error logs that are missing stack traces, string formatting where structured keyword arguments would make logs searchable, and API calls that silently swallow log arguments.</p><p><strong>Database safety.</strong> SQL injection via string interpolation is still one of the most common vulnerabilities. Always suggest parameterized queries. On schema migrations, check for proper locking strategies to avoid locking production tables. Question unbounded caches that can cause memory leaks — lru_cache(maxsize=N) is almost always safer than an unbounded cache.</p><p><strong>Security.</strong> Flag shell=True in subprocess calls. Watch for potential SSRF in URL handling. Validate any interpolated values in URLs and SQL. These patterns are easy to miss in review and easy to exploit in production.</p><p><strong>Testing.</strong> When code is removed, ask whether the tests covering that code were intentionally removed or accidentally lost. Edge case tests should survive refactors. And if a PR mixes formatting changes with functional changes, suggest splitting it into separate PRs. Mixed PRs are harder to review and harder to revert.</p><p><strong>Thread safety.</strong> Shared mutable state accessed from multiple threads without locks is a recipe for intermittent bugs that are painful to reproduce. Compression and decompression libraries may not be thread-safe due to shared internal buffers. These are the kinds of issues that only show up under load.</p><p><strong>Code style.</strong> Small things add up. Prefer time.monotonic() over time.time() for duration measurements since it is not affected by system clock changes. Suggest trailing commas in multi-line structures for cleaner diffs. Recommend removesuffix() and removeprefix() over manual slicing. In tests, prefer assertEqual(a, b) over assertTrue(a == b) because the former gives you a useful diff on failure.</p><h4>Think About Production</h4><p>The best reviewers think beyond correctness. They think about what happens when this code is deployed, rolled back, or running alongside the previous version during a rolling deploy. Will this change break things if rolled back? During rolling deploys, old and new code run simultaneously, so two requests could hit different versions. Are cache keys compatible between versions? Will changes to metric names or log formats break monitoring dashboards?</p><p>These are the questions that separate good code from production-ready code.</p><h4>Conclusion</h4><p>Great code reviews make the whole team better. They are not about catching mistakes. They are about sharing knowledge, raising standards, and building trust. Ask questions. Explain your reasoning. Be kind. And always remember that there is a person on the other side of that PR who is trying their best.</p><p><em>Originally published at </em><a href="https://onsitereliability.com/The-Art-of-the-Code-Review/"><em>https://onsitereliability.com</em></a><em> on February 21, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=901ce7b0f358" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lets talk about Non-Human Identities (NHIs)]]></title>
            <link>https://medium.com/@deepak.bhaskaran/lets-talk-about-non-human-identities-nhis-726048fb91f3?source=rss-7c5b1b326f1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/726048fb91f3</guid>
            <dc:creator><![CDATA[Deepak Bhaskaran]]></dc:creator>
            <pubDate>Sun, 21 Dec 2025 00:00:48 GMT</pubDate>
            <atom:updated>2026-03-15T13:00:25.070Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p><strong>Non-Human Identity</strong> is any digital identity that is used by something that is not a person but still needs to log in or get access. Any entity that needs to:</p><ul><li>Talk to an API</li><li>Connect to a database</li><li>SSH into a server</li><li>Run tasks automatically</li></ul><p>…usually needs an identity. If that identity is not tied to a human employee, that is an NHI.</p><h3>Examples of NHIs</h3><p>Examples of NHIs include:</p><ul><li>Service / System Accounts: Accounts that run applications, databases, schedulers, backup jobs.</li><li>APIs &amp; Integrations: API keys, OAuth clients, webhooks, and tokens connecting SaaS apps together.</li><li>Cloud &amp; DevOps: IAM roles, workload identities, CI/CD agents, deployment bots, Kubernetes service accounts, containers, microservices</li><li>Devices &amp; “Things”: IoT sensors, cameras, badge readers, smart manufacturing gear.</li><li>Bots &amp; AI Agents: Chatbots, RPA bots, agentic AI services making calls and decisions on your behalf.</li></ul><p><strong>Note:</strong> All of these need credentials and permissions just like human users. The credentials could be tokens, certificates, keys, passwords etc and need to be managed.</p><h3>Why do NHIs matter?</h3><p>In most organizations there are thouands of NHIs, often more than human identities. Some studies have found that NHIs can outnumber human identities by 10:1.</p><p>Because NHIs are so widespread (and growing), they deserve the same level of rigor as human identity security-both in how they are created and how they are managed over time.</p><h4>Common Gaps:</h4><p>NHIs often have:</p><ul><li><strong>Powerful access</strong></li><li><strong>Poor visibility</strong></li><li><strong>No central inventory</strong> — information is spread across code, config files, cloud management consoles, and vendor-specific admin consoles</li><li><strong>Unclear ownership</strong></li><li><strong>No periodic review</strong> of what’s still needed or what needs to change</li></ul><h3>Why attackers care</h3><p>These gaps make NHIs attractive targets. If an attacker compromises an NHI, they can potentially gain long-lived, privileged, and under-monitored access to critical resources inside an organization.</p><h3>A mental model for managing NHIs</h3><p><strong>Key Principle:</strong> Think of NHIs as no different from humans and manage them similarly.</p><p>At a high level:</p><ol><li><strong>Inventory</strong> — Create and maintain an inventory of NHIs.</li><li><strong>Ownership</strong> — Make it clear who owns which NHI.</li><li><strong>Purpose</strong> — Define the scope and responsibility of each NHI.</li><li><strong>Least Privilege</strong> — Grant the least amount of access needed to fulfill that purpose.</li><li><strong>Short-lived credentials</strong> — Minimize credential lifetime and automate rotation.</li><li><strong>Lifecycle</strong> — Standardize how you create, change, and retire NHIs.</li></ol><p>Below is a bit more detail on each.</p><h3>Inventory of NHIs</h3><p>You need to know what exists before you can manage it.</p><p><strong>Goal:</strong> Create a map of every non-human identity and credential in your environment.</p><p>It is useful to think of this in terms of categories including:</p><ul><li>Service accounts (cloud, on-prem)</li><li>API keys and OAuth clients</li><li>Cloud IAM roles and workload identities</li><li>CI/CD and infrastructure automation (pipelines and deployment bots)</li><li>AI Agents and other autonomous things</li></ul><h3>Ownership of NHIs</h3><p>Every NHI needs an owner, ideally a team with a business and technical owner. This allows us to have a person or team accountable for:</p><ul><li>Making necessary changes</li><li>Evaluating scope</li><li>Applying new security policies</li></ul><p><strong>Benefit:</strong> This makes responding to security issues and overall incident management go faster.</p><p><strong>Critical Step:</strong> Once we’ve identified an owner for every NHI, we also need to ensure that the owner field is <strong>mandatory</strong> at the time of creating an NHI, so that we can prevent the problem from getting worse.</p><h3>Purpose of NHIs</h3><p>Every NHI should have a <strong>clear reason for existence</strong> that is well documented, including what critical systems it interacts with.</p><p>This documentation serves as input to least-privilege design. A major source of NHI risk is over-privileged, general-purpose accounts that can “do everything,” often due to shortcuts taken during initial setup.</p><h4>Practical steps to take:</h4><ul><li>Make “a one-line purpose” <strong>mandatory</strong> in the pipeline or form that creates NHIs.</li><li>Prefer narrow, task-specific identities over mega-accounts.</li><li>During reviews, quarantine or retire any NHI whose purpose cannot be explained.</li></ul><h3>Least Privileged Access</h3><p>Give NHIs only the access required to perform their purpose-nothing more. Use role-based or policy-based access for NHIs just as you do for humans.</p><h4>Practical steps to take:</h4><p>Run regular reporting for high-risk NHIs that have:</p><ul><li>Privileged access</li><li>Long-lived credentials</li><li>Internet reachability</li></ul><p>Block creation of new NHIs with * or global admin permissions unless they go through an explicit approval flow.</p><h3>Short-Lived Credentials</h3><p>Minimize the window in which a stolen credential is useful. Many NHI breaches have at their core, static, long-lived secrets:</p><ul><li>Embedded API keys</li><li>Old service account keys</li><li>Certificates that never expire</li></ul><p>Most frameworks and vendors now push toward <strong>short-lived tokens</strong> and <strong>automated rotation</strong>.</p><h4>Practical steps to take:</h4><p><strong>Prefer short-lived tokens</strong> issued via:</p><ul><li>Cloud IAM roles/workload identities</li><li>OAuth/OIDC service principals</li></ul><p><strong>Store any long-lived material</strong> you must have in a secrets manager, and <strong>never</strong> in:</p><ul><li>Source code</li><li>CI/CD variables in plain text</li><li>Wiki pages/runbooks/chat logs</li></ul><p><strong>Automate rotation:</strong></p><ul><li>Create pipelines that automatically rotate keys/tokens and update dependents</li><li>Build health checks around this process to detect any issues early</li></ul><h3>Lifecycle of NHIs</h3><p>Take your join/move/lifecycle processes and tooling and apply them to NHIs. There’s no reason for an exception.</p><h4>Creating a new NHI</h4><p>When you create a new NHI (triggered by the creation of a new app, integration, pipeline, etc.), that process must automatically collect:</p><ul><li>Owner information</li><li>Scope information</li><li>Initial least privilege information</li><li>Secrets provisioning via approved mechanisms</li></ul><h4>Changing an NHI</h4><p>When the app or workflow changes, the NHI’s permissions and purpose should be updated in the same pull request/change. Access escalations require review, just like giving a human elevated rights.</p><h4>Retiring an NHI</h4><p>When you retire an NHI (triggered by the service being retired, project ending, or being replaced with a new identity pattern, etc.), you would:</p><ul><li>Revoke keys/tokens/roles</li><li>Delete or disable the identity</li><li>Clean up any remaining dependencies</li></ul><h4>Practical steps to take:</h4><ul><li>If you retire a system, NHIs die automatically as part of the same change, not months later when someone remembers</li><li>Setup periodic jobs that look for NHIs unused for N days and propose them for decommissioning</li></ul><h3>Conclusion</h3><p>Non-Human Identities are a critical but often overlooked aspect of security. By treating them with the same rigor as human identities — maintaining inventories, establishing ownership, defining purpose, enforcing least privilege, minimizing credential lifetime, and managing their full lifecycle — organizations can significantly reduce their attack surface and improve their overall security posture.</p><p><em>Originally published at </em><a href="https://onsitereliability.com/All-about-Non-Human-Identities-NHIs/"><em>https://onsitereliability.com</em></a><em> on December 21, 2025.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=726048fb91f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Avoid ArgoCD-Related Outages]]></title>
            <link>https://medium.com/@deepak.bhaskaran/how-to-avoid-argocd-related-outages-0e40b409572a?source=rss-7c5b1b326f1f------2</link>
            <guid isPermaLink="false">https://medium.com/p/0e40b409572a</guid>
            <dc:creator><![CDATA[Deepak Bhaskaran]]></dc:creator>
            <pubDate>Sat, 15 Mar 2025 00:00:12 GMT</pubDate>
            <atom:updated>2025-03-18T01:24:12.967Z</atom:updated>
            <content:encoded><![CDATA[<p>GitOps tool ArgoCD offers powerful Kubernetes deployment automation but can introduce significant operational risks if not properly configured and managed. This document identifies five critical failure modes that commonly lead to production outages: manifest synchronization failures, resource pruning incidents, Git repository misconfiguration, RBAC access control issues, and resource health assessment failures. Additionally, complex interactions between ArgoCD and cluster autoscaling mechanisms present unique challenges that require careful planning.</p><p>For each risk area, we provide concrete preventative measures focusing on progressive deployment strategies, proper validation procedures, and careful configuration management. By implementing these safeguards, DevOps teams can harness ArgoCD’s capabilities while maintaining production stability and preventing widespread service disruptions. This guide serves as a critical resource for teams looking to adopt or improve their GitOps practices using ArgoCD in production environments.</p><h4>What is ArgoCD?</h4><p>ArgoCD is a declarative, GitOps continuous delivery tool for Kubernetes. It helps DevOps teams automate and manage the deployment of applications to Kubernetes clusters. ArgoCD ensures that the actual state of your deployed applications in Kubernetes clusters matches the desired state defined in Git repositories It continuously monitors both the Git repo and the cluster, automatically synchronizing them when differences are detected</p><h4>Key Concepts in ArgoCD</h4><ul><li><strong>Application:</strong> A group of Kubernetes resources as defined by a manifest. This is a Custom Resource Definition (CRD).</li><li><strong>Application:</strong> source type Which Tool is used to build the application.</li><li><strong>Target state:</strong> The desired state of an application, as represented by files in a Git repository.</li><li><strong>Live state:</strong> The live state of that application. What pods etc are deployed.</li><li><strong>Sync status:</strong> Whether or not the live state matches the target state. Is the deployed application the same as Git says it should be?</li><li><strong>Sync:</strong> The process of making an application move to its target state. E.g. by applying changes to a Kubernetes cluster.</li><li><strong>Sync operation status:</strong> Whether or not a sync succeeded.</li><li><strong>Refresh:</strong> Compare the latest code in Git with the live state. Figure out what is different.</li><li><strong>Health:</strong> The health of the application, is it running correctly? Can it serve requests?</li><li><strong>Tool:</strong> A tool to create manifests from a directory of files. E.g. Kustomize. See Application Source Type.</li><li><strong>Configuration management tool:</strong> See Tool.</li><li><strong>Configuration management plugin:</strong> A custom tool.</li><li><strong>Finalizer:</strong> a Kubernetes resource annotation that prevents the deletion of resources until certain conditions are met or specific cleanup operations are completed. Finalizers are an important mechanism in ArgoCD’s resource management and play a crucial role in maintaining system integrity.</li></ul><h4>How Does ArgoCD Work?</h4><p>Argo CD follows the GitOps pattern of using Git repositories as the source of truth for defining the desired application state. Kubernetes manifests can be specified in several ways:</p><ul><li>Kustomize applications</li><li>Helm charts</li><li>Jsonnet files</li><li>Plain directory of YAML/json manifests</li><li>Any custom config management tool configured as a config management plugin</li></ul><p>Argo CD automates the deployment of the desired application states in the specified target environments. Application deployments can track updates to branches, tags, or be pinned to a specific version of manifests at a Git commit.</p><h4>Finalizers and the Role They Play in ArgoCD</h4><p>Here’s how finalizers work in ArgoCD:</p><ul><li><strong>Resource Protection:</strong> When ArgoCD manages resources, it adds finalizers to prevent resources from being deleted before ArgoCD can properly handle the deletion process.</li><li><strong>Cascade Deletion:</strong> The resources-finalizer.argocd.argoproj.io/background finalizer ensures proper cascading deletion of resources. When you delete an Application in ArgoCD, this finalizer ensures that all child resources are properly cleaned up before the parent Application is removed.</li><li><strong>Orphaned Resource Management:</strong> Finalizers help ArgoCD track and manage orphaned resources (resources that were created by ArgoCD but are no longer defined in Git).</li><li><strong>Deletion Hooks:</strong> ArgoCD uses finalizers to ensure that any pre-deletion hooks or cleanup operations are completed before a resource is permanently removed.</li><li><strong>Synchronization Safety:</strong> They prevent race conditions where resources might be deleted while ArgoCD is still performing operations on them.</li></ul><p>If you ever encounter situations where resources seem “stuck” in a terminating state, it’s often because a finalizer is still present and ArgoCD is either waiting for conditions to be met or experiencing an issue with the deletion process. In such cases, you might need to manually remove the finalizer, though this should be done cautiously as it bypasses ArgoCD’s normal cleanup processes.</p><h4>What Are Some Ways in Which ArgoCD Can Cause Outages?</h4><p>Here are 5 ways production outages can unintentionally occur through ArgoCD:</p><p>Each of these scenarios highlights the importance of implementing proper safeguards, review processes, and progressive deployment strategies when using GitOps tools like ArgoCD.</p><h4>ArgoCD and Autoscaling</h4><p>Another area worth noting is the interaction of ArgoCD and Autoscaling mechanisms. Cluster autoscaling mechanisms (both node and pod autoscaling) can create complex interactions with ArgoCD deployments that aren’t immediately obvious. These interactions can lead to outages if not properly managed.</p><p>Here’s a comprehensive look at how ArgoCD interfaces with cluster autoscaling and how to prevent related outages:</p><ol><li>Resource Pressure During Deployments When ArgoCD deploys applications with substantial resource requirements to a cluster with autoscaling enabled, the cluster may attempt to scale up nodes to accommodate the new workloads. During this scaling period, pods may remain in Pending state, causing ArgoCD to potentially mark applications as degraded, timeout during health checks, or even trigger unnecessary rollbacks.</li></ol><p>Preventative Measures:</p><ul><li>Resource Requests and Limits: Always define resource requests and limits for all applications to ensure the autoscaler can make informed decisions.</li><li>Pre-Deployment Capacity Checks: Use pre-deployment hooks to check cluster capacity before deploying large applications.</li><li>Staggered Deployments: Implement staggered deployments to avoid overwhelming the cluster during peak load times.</li></ul><p>2. Autoscaler Interference with ArgoCD Sync Horizontal Pod Autoscaler (HPA) or Vertical Pod Autoscaler (VPA) can change resource allocations or replica counts during or after ArgoCD sync operations, causing:</p><ul><li>Differences between desired state (in Git) and live state</li><li>Continuous reconciliation loops as autoscalers and ArgoCD compete</li><li>Health assessment failures as pod counts fluctuate</li></ul><p>Preventative Measures:</p><ul><li>Disable Autoscaling During Deployments: Temporarily disable autoscaling during critical deployments.</li><li>Use ArgoCD Sync Waves: Implement sync waves to control the order of resource deployment and ensure that autoscalers are not triggered prematurely.</li><li>Monitor Autoscaler Events: Set up alerts for autoscaler events to quickly identify and resolve conflicts.</li></ul><p>3. Autoscaling and Resource Limits When cluster autoscaling is enabled, ResourceQuotas may create conflicts with ArgoCD deployments by:</p><ul><li>Blocking new pods while nodes are scaling up</li><li>Creating race conditions between quota enforcement and autoscaling</li><li>Causing inconsistent deployment states that ArgoCD tries to reconcile</li></ul><p>Preventative Measures:</p><ul><li>Define ResourceQuotas: Clearly define ResourceQuotas for namespaces to avoid conflicts with autoscaling.</li><li>Monitor Quota Usage: Regularly monitor resource quota usage to ensure that autoscaling can function effectively.</li><li>Use Namespace Isolation: Isolate critical applications in separate namespaces to minimize the impact of resource quotas.</li></ul><p><em>Originally published at </em><a href="https://onsitereliability.com/How-to-avoid-ArgoCD-related-outages/"><em>https://onsitereliability.com</em></a><em> on March 15, 2025.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0e40b409572a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>