<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Safety on Bhavya Tiwary</title>
    <link>https://bhavyatiwary.com/tags/safety/</link>
    <description>Recent content in Safety on Bhavya Tiwary</description>
    <image>
      <title>Bhavya Tiwary</title>
      <url>https://bhavyatiwary.com/og.png</url>
      <link>https://bhavyatiwary.com/og.png</link>
    </image>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Fri, 05 Jun 2026 23:10:06 +0530</lastBuildDate>
    <atom:link href="https://bhavyatiwary.com/tags/safety/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Cyber-resilience in the Age of AI </title>
      <link>https://bhavyatiwary.com/posts/cyberresilience_and_ai/</link>
      <pubDate>Fri, 05 Jun 2026 23:10:06 +0530</pubDate>
      <guid>https://bhavyatiwary.com/posts/cyberresilience_and_ai/</guid>
      <description>How AI agents cause irreversible damage through bad prompts, hallucinations or prompt injection, and how to build backups and recovery that survive it.</description>
      <content:encoded><![CDATA[<p>AI Agents and assistants help us countless number of times to automate boring tasks, complete tasks for us when we&rsquo;re over-loaded etc. But, expecting that they never falter or have the capability to fix bad instructions is a bit much isn&rsquo;t it? Agents mess up even if the percentage may be &gt;1% but what then? And what if the consequence of the mistake are too extreme? It&rsquo;s always best to have a backup or fallback option and that&rsquo;s what we&rsquo;ll discuss.</p>
<h2 id="the-core-problem">The core problem</h2>
<p>AI is deeply embedded in our lives They can read files, call APIs, write to databases, send emails, and execute shell commands. This power comes with a category of risk that didn&rsquo;t exist before: <strong>AI-initiated irreversible damage</strong>, triggered not by a human attacker, but by your own tool acting on bad instructions, misconfiguration, or plain ol&rsquo; manipulation.</p>
<p>I&rsquo;m broadly categorizing the source or what may cause this damage into three distinct origins:</p>
<ul>
<li>Wrong prompts / misconfiguration — the user or operator creates conditions where the AI acts destructively with good intent. This also includes unintended consequences. Think The Streisand Effect or Macquarie Island (rabbits introduced for lost sailors to hunt when stranded ended destabilizing the island ecosystem).</li>
<li>Hallucination in action — the model fabricates a confident but wrong plan and executes it. Happens to the best of us and models are no exception.</li>
<li>Adversarial manipulation — prompt injection, supply chain poisoning, or MCP exploitation causes the agent to act against the user&rsquo;s interests.</li>
</ul>
<h4 id="pocketos-the-9-second-production-wipe-april-2026">PocketOS: The 9-Second Production Wipe (April 2026)</h4>
<p>One of the latest incidents which prompted me to write this article finally. PocketOS, a SaaS platform serving car rental businesses, was using Cursor powered by Anthropic&rsquo;s Claude Opus 4.6 to work on a routine task in the staging environment. The agent encountered a credential mismatch and entirely on its own initiative decided to fix the problem by deleting a Railway volume. The deletion took 9 seconds. The agent had found an API token in an unrelated file; that token was created for managing custom domains via the Railway CLI, but its permissions weren&rsquo;t scoped to those actions. Railway&rsquo;s API allowed the destructive call without a confirmation step, and the platform stored volume-level backups on the same volume as the source data — so everything went at once. <a href="https://www.techradar.com/pro/it-took-9-seconds-tech-founder-outlines-how-rogue-claude-powered-ai-tool-wiped-entire-company-database-and-backups-but-says-theres-no-such-thing-as-bad-publicity">Link for an TechRadar deep-dive</a> on this incident for anyone curious.</p>
<h4 id="user-looses-data--6657449328">User looses data  (#6657449328)</h4>
<p>Some instances of people loosing their data due to mishaps and no backups:</p>
<ul>
<li>A user watched their dissertation, operating system, applications, and personal data get deleted while asking Cursor to find duplicate articles. <a href="https://quasa.io/media/when-cursor-wiped-a-user-s-pc-a-cautionary-tale-of-ai-overreach">Link</a></li>
<li>Summer Yu, Meta’s Director of AI Alignment and Safety, went viral in Feb 2026 for tweeting that the AI agent OpenClaw deleted her entire Gmail inbox despite her explicit instructions to confirm actions first. <a href="https://www.hindustantimes.com/trending/meta-ai-safety-researcher-recalls-moment-openclaw-agent-deleted-her-emails-101771907169972.html">Link</a></li>
<li>Nick Davidov, a VC, tweeted that Claude Cowork accidentally deleted 15 years of family photos from his wife’s computer while attempting to organize her desktop. <a href="https://economictimes.indiatimes.com/news/new-updates/venture-capitalist-nearly-had-a-heart-attack-after-he-asked-ai-agent-claude-cowork-to-organise-his-wifes-desktop-its-next-step-was-unbelievable/articleshow/128104917.cms?from=mdr">Link</a>
Yeah yeah, my initial source were the tweets but I can&rsquo;t find them so here are some articles.<br>
Also, I don&rsquo;t believe it&rsquo;s the</li>
</ul>
<h2 id="why-this-may-happen">Why this may happen?</h2>
<p>I believe this is not an AI/LLM issue but a design flaw. The general setup of agents/AI tools is that it works in sessions. At the end of each session, the context is lost akin to our LLMs true nature of being stateless which basically just means that each inference call starts with a fresh context window, and the model retains no memory of prior interactions or intermediate computations once the call ends. So technically speaking our agents make a locally-coherent decision based on incomplete information for each prompt/iteration. Also, I feel we can not provide the optimum context anyways.  If we take an example of deleting marketing mails from mailbox, banks send marketing mails and policy updates about credit cards etc so it is plausible for the agent to accidentally delete policy update or awareness mails or in case of e-commerce, delete the purchase receipts. As a user, I had not specified what is considered spam etc just to delete unimportant mails.</p>
<p>Let&rsquo;s delve deeper into this based on each category:</p>
<ol>
<li><strong>Misconfiguration</strong>:
The key structural difference: traditional systems fail according to their configuration. AI agents fail according to their reasoning about their configuration.</li>
</ol>
<p>A misconfigured permission in a traditional system is dormant until exploited. A misconfigured permission in an AI agent&rsquo;s context is a capability the agent may discover and apply autonomously in ways the operator never anticipated. The agent is, in a sense, doing creative problem-solving with whatever tools it can find — which is exactly what makes it useful, and exactly what makes misconfiguration so dangerous.</p>
<p>Secondly implicit vs. explicit scope. When you configure a traditional tool, you specify what it does. When you configure an AI agent, you specify constraints — and the agent operates in the space <em>between</em> them. That space is never fully specified, which means your configuration is always incomplete by design. Any gap in your constraints is potential autonomous action the agent may fill in with its own judgment. You&rsquo;re not writing a program; you&rsquo;re drawing a fence around a reasoning system, and the fence will always have gaps you didn&rsquo;t see.</p>
<ol start="2">
<li><strong>Hallucination</strong>
By the way, researches have called it a feature not a bug so do with this info whatever you want. Hallucination is often described as &ldquo;the model getting facts wrong,&rdquo; which makes it sound like a reliability problem — similar to a buggy function returning the wrong value. That framing misses what makes it dangerous in agentic systems.</li>
</ol>
<p>The structural difference is this: traditional software fails silently or noisily, but predictably. Hallucinating agents fail confidently and act on the failure.</p>
<p>A buggy function returns a wrong value. The system either catches it (error handling), surfaces it (wrong output), or crashes. In none of these cases does the function also <em>decide what to do next based on its wrong answer</em>.</p>
<p>An AI agent that hallucinates doesn&rsquo;t just produce wrong output — it produces a wrong internal model of the world, and then plans and executes against that wrong model. The hallucination isn&rsquo;t just an output artifact; it&rsquo;s the premise for subsequent actions. If the agent incorrectly believes it&rsquo;s operating in the staging environment (when it&rsquo;s actually in prod), every correct action it takes against that false belief is destructive.</p>
<p>There&rsquo;s also a confidence symmetry problem that has no analogue in traditional software. A function that returns a wrong value typically doesn&rsquo;t also assert that it&rsquo;s confident in the result. LLMs produce outputs with uniform fluency and apparent certainty regardless of whether they&rsquo;re correct or hallucinating. There&rsquo;s no native hesitation signal, no error state, no stack trace. The model that correctly identifies the database schema looks and sounds identical to the model that&rsquo;s confabulating one.</p>
<p>This is compounded by what you might call hallucination in chain: in a multi-step agentic workflow, a hallucinated premise in step 2 propagates as ground truth into step 3, 4, and 5. Each subsequent step is locally coherent — the agent is reasoning correctly from its (wrong) premises. By the time the damage is done, the chain of reasoning looks internally consistent and intentional. There&rsquo;s no obvious point of failure to trace back to; the entire workflow ran &ldquo;correctly&rdquo; against a false model of the world.</p>
<p>The final structural issue is irreversibility asymmetry. Hallucination in a chatbot produces wrong text — you read it, notice it&rsquo;s wrong, discard it. The cost is negligible. Hallucination in an agent that has write access to infrastructure produces wrong <em>actions</em>, and those actions may not be reversible. The asymmetry between the cost of the mistake and the ability to recover from it grows dramatically as agents gain more capability. The same model behavior that&rsquo;s a minor nuisance in a Q&amp;A context is catastrophic in an agentic one.</p>
<ol start="3">
<li><strong>Prompt Injection</strong>:
Traditional threat: attacker needs access → privilege escalation → executes payload.</li>
</ol>
<p>AI agent threat: the agent already has access, and it makes judgment calls. Prompt injection, hallucination, or misconfiguration simply redirects its existing permissions toward destruction.</p>
<p>Prompt injection exploits an architectural property of how LLMs process language — one that can be mitigated but not patched away. LLMs process both trusted system instructions and untrusted user inputs as identical text sequences. The model receives system prompts, conversation history, user input, and retrieved documents as a single continuous stream of tokens. You cannot parameterize natural language, so there&rsquo;s no structural separation to tell the model which instructions to trust.</p>
<h2 id="what-to-do">What to do?</h2>
<p>The design or architecture flaws are really unfixable in LLMs at individual level right? So what now?
Here are some things you need to figure out before giving AI full access- <strong>BACKUP AND ROLLBACK</strong> is the gist
<em>For businesses:</em></p>
<ol>
<li><strong>DO NOT BELIEVE VENDOR PROMISES THAT YOU CAN&rsquo;T VERIFY</strong> (why am I shouting because this needs to register in everyone&rsquo;s head)
If someone says that they have implemented guardrails, ask them how were these created and tested. A lot of times people believe it&rsquo;s a big corp like Google, Microsoft and Palo Alto so whatever they say must be right. Not true, anyone and everyone can make mistakes so verify before you trust. Everything may be nice 99.9% of the time but the 0.01% can really cause damage. Check for benchmarks, red-team reports, user reviews etc during vendor eval.
If your business is small/medium sized, just have someone from IT/Dev go through a vendor&rsquo;s trust portal and verify industry certifications and if it&rsquo;s a startup ask for pentest reports, backup plans etc.</li>
</ol>
<p>2.<strong>Principle of Least Privilege</strong>
Every token, credential, or API key an AI agent can access must be scoped to exactly what it needs. The Cursor agent found an API token in an unrelated file whose permissions were far broader than the task required. Railway&rsquo;s API allowed destructive actions without any confirmation check. This is a configuration problem that exists regardless of AI — AI just executes it faster. <a href="https://www.techradar.com/pro/it-took-9-seconds-tech-founder-outlines-how-rogue-claude-powered-ai-tool-wiped-entire-company-database-and-backups-but-says-theres-no-such-thing-as-bad-publicity">TechRadar</a></p>
<ul>
<li>Scope all tokens to specific actions, not resource-level access</li>
<li>Use separate credentials for read vs. write vs. destructive operations</li>
<li>Rotate and audit tokens agents can reach</li>
<li>Store the creds in a vault or secrets manager.</li>
</ul>
<ol start="3">
<li><strong>Backups That Agents Can&rsquo;t Reach</strong>
The PocketOS disaster was compounded because Railway stored backups on the same volume as data. This is also an S3/cloud bucket misconfiguration pattern: if your agent has credentials that can write to prod, check whether those same credentials can delete the backup.</li>
</ol>
<ul>
<li>Offsite, immutable backups (S3 Object Lock, Azure Immutable Blob Storage)</li>
<li>Cross-region replication that is <em>write-only from prod</em> — no delete rights/soft delete</li>
<li>Determine criticality of the apps etc and establish BC/DR Plan. It will help no matter how inconvenient.</li>
</ul>
<ol>
<li><strong>Human-in-the-Loop for Important Actions</strong>
Deleting anything? Take user consent. Overwriting an old file? Take user consent. Approving a big transaction? Take user constent.
You get it right? Basically the human will review everything and take accountability of the agent/workflow they created. Capabilities cover every tool added, every Skill installed. The discipline of allowlists that&rsquo;s the key. Pinning MCP server versions so they don&rsquo;t silently update to a poisoned release, and reviewing which skill may actually be necessary.</li>
</ol>
<ul>
<li>Never give agents write/delete access to prod in automated flows without a human approval gate</li>
<li>Use normal mode instead of auto-approve modes. Annoying but not costly.</li>
<li>For irreversible operations (volume deletion, mass email, financial transfers), require explicit confirmation with a description of what will be destroyed. If it&rsquo;s that important, take approval twice.</li>
</ul>
<p><strong>5. MCP Server Hygiene</strong></p>
<ul>
<li>Hundreds of MCP servers on the web are misconfigured, unnecessarily exposing users to cyberattacks. Around 7,000 MCP servers are open on the web, approximately half the total. Thus, only connect MCP servers you&rsquo;ve reviewed. Pin versions. Don&rsquo;t use archived/unmaintained servers.</li>
<li>Treat third-party MCP servers like third-party npm packages.</li>
<li>Create MCP Registry for allowing approved servers that way each new version and each new servers needs to be validated. Use InvariantLabs/Snyk&rsquo;s Agent scan to detect issues and vulnerabilities.</li>
</ul>
<p><strong>6. AI Governance Before Deployment</strong>
Before deploying agents into production workflows, document: what can this agent access, what&rsquo;s the blast radius if it acts incorrectly, and who reviews its actions. Have a dedicated team (can be one person for small companies) to review the workflows, review compliance, cross-check safety controls before prod deployment. For small or similar usecases, you may automate some scans etc but still human review is important because LLM can&rsquo;t come out of the screen and smack the developer for not following guidelines. PS: Workplace violence is wrong, beat them out side the campus where there are no camera./s</p>
<p><strong>6. Monitoring and Audit Trails</strong>
Agents should log every action they take — every API call, every file write, every tool invocation. Without this you can&rsquo;t reconstruct what happened or demonstrate compliance. This is the foundation. Use ELK Stack and OpenTelemetry for performance benchmarks etc.</p>
<p><em>For Individuals / Personal Users:</em>
<strong>1. Never run AI agents with admin/root</strong> Don&rsquo;t give coding agents or MCP tools elevated OS permissions. Run them as a limited user. If an agent needs to install something, it should ask you — not execute as root.</p>
<p><strong>2. Version control everything you care about</strong> If you&rsquo;re using AI to edit code, documents, or configuration files, those files should be in git (or at minimum, have Time Machine / VSS snapshots on). An AI that refactors your codebase incorrectly is recoverable if you have a commit history. Without it, you have whatever the agent left behind.</p>
<p><strong>3. Treat AI-suggested commands with the same skepticism as Stack Overflow answers</strong> A model that confidently tells you to run <code>rm -rf node_modules &amp;&amp; npm install</code> is not wrong — until it autocompletes a broader path due to a hallucination or context confusion. Review destructive commands before executing them.</p>
<p><strong>4. Don&rsquo;t paste credentials into AI chat windows</strong> Even if you trust the model, MCP servers, browser extensions, and third-party tools in the pipeline may log or leak context. Hundreds of misconfigured MCP servers have been found exposing AI models to remote code execution and other cyberattacks, acting as bridges between AI tools and private data.</p>
<p><strong>5. Compartmentalize what AI can touch</strong> Don&rsquo;t give your AI assistant access to your email, calendar, GitHub, and cloud storage simultaneously unless you understand the full chain. Each integration multiplies what can go wrong.</p>
<p><strong>6. Backup your Data</strong>
Use OneDrive, ProtonDrive, pCloud etc so that you can get back important data. Easiest and most convenient way.
Use USBs, hard disks or NAS for a offline copy of very important data like dissertation, research, lawyer files etc.</p>
]]></content:encoded>
    </item>
  </channel>
</rss>
