<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Umer Amin Durrani</title>
    <description>The latest articles on DEV Community by Umer Amin Durrani (@umeramindurrani).</description>
    <link>https://dev.to/umeramindurrani</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4212627%2Fd8514a1f-178f-48c3-870b-d6d4d1077670.jpg</url>
      <title>DEV Community: Umer Amin Durrani</title>
      <link>https://dev.to/umeramindurrani</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/umeramindurrani"/>
    <language>en</language>
    <item>
      <title>AI Agent Permissions: Decide What Can Run Without Approval</title>
      <dc:creator>Umer Amin Durrani</dc:creator>
      <pubDate>Thu, 19 Nov 2026 09:39:08 +0000</pubDate>
      <link>https://dev.to/umeramindurrani/ai-agent-permissions-decide-what-can-run-without-approval-425j</link>
      <guid>https://dev.to/umeramindurrani/ai-agent-permissions-decide-what-can-run-without-approval-425j</guid>
      <description>&lt;p&gt;An AI workflow does not need unrestricted access to be useful. The hard part is deciding which actions are safe to automate, which need a human check, and how to limit the damage if a tool call goes wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  Classify actions by impact
&lt;/h2&gt;

&lt;p&gt;Read-only search is usually lower risk than sending a message, changing a record, issuing a refund, or modifying production infrastructure. Classify each tool by the data it can access, whether it creates an external side effect, and how difficult that side effect is to reverse.&lt;/p&gt;

&lt;h2&gt;
  
  
  Apply the least privilege
&lt;/h2&gt;

&lt;p&gt;Give the workflow a dedicated identity with only the permissions it needs. Separate read and write tools where possible. Limit scope by resource, action, and time. Use short-lived credentials and keep secrets outside prompts and logs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Set approval boundaries
&lt;/h2&gt;

&lt;p&gt;Let low-impact, reversible steps run automatically when they can be monitored. Require confirmation for consequential, external, or hard-to-reverse actions. The approval request should show the intended action, target, and relevant context—not just ask “Proceed?”&lt;/p&gt;

&lt;p&gt;Add limits such as maximum amount, record count, allowed recipients, or deployment environments. Make denials and timeouts fail closed. Log the approval and final result so operators can audit what happened.&lt;/p&gt;

&lt;p&gt;Review permissions as the workflow changes. A tool that was harmless in a prototype may become consequential when connected to real customer data or production systems.&lt;/p&gt;

&lt;p&gt;More practical AI delivery notes: &lt;a href="https://umer-amin.vercel.app/" rel="noopener noreferrer"&gt;https://umer-amin.vercel.app/&lt;/a&gt;. What action in your workflow should always require a human approval?&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>automation</category>
      <category>security</category>
    </item>
    <item>
      <title>AI Project Readiness: Start With the Workflow, Not the Model</title>
      <dc:creator>Umer Amin Durrani</dc:creator>
      <pubDate>Thu, 19 Nov 2026 09:38:14 +0000</pubDate>
      <link>https://dev.to/umeramindurrani/ai-project-readiness-start-with-the-workflow-not-the-model-c5o</link>
      <guid>https://dev.to/umeramindurrani/ai-project-readiness-start-with-the-workflow-not-the-model-c5o</guid>
      <description>&lt;p&gt;AI projects often start with a model demo before anyone has agreed what problem it should solve. A better first question is: which repeated task is costly, slow, or inconsistent today—and what would a useful improvement look like?&lt;/p&gt;

&lt;h2&gt;
  
  
  Map the current work
&lt;/h2&gt;

&lt;p&gt;Write down who performs the task, what information they need, which systems they touch, where exceptions happen, and how success is checked. This reveals whether the real bottleneck is search, decision making, data quality, approvals, or handoff. AI may help with one step, but it may not be the right answer for the whole process.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check the foundations
&lt;/h2&gt;

&lt;p&gt;Confirm that the needed data is accessible and permitted for the intended use. Identify a workflow owner, an operational owner, and a human fallback. Decide what actions the system may take and which require approval. Define a baseline for quality, time, cost, and failure rate before comparing solutions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Run a bounded pilot
&lt;/h2&gt;

&lt;p&gt;Choose a narrow workflow and representative cases. Test the model and non-AI alternatives against the same outcome criteria. Include edge cases, failure recovery, privacy, and integration effort in the estimate. Agree on a stop condition before expanding scope.&lt;/p&gt;

&lt;p&gt;A readiness review turns “we should use AI” into a decision the team can validate. It can also show that better process design or a small automation will deliver value sooner.&lt;/p&gt;

&lt;p&gt;I share practical product and AI delivery notes at &lt;a href="https://umer-amin.vercel.app/" rel="noopener noreferrer"&gt;https://umer-amin.vercel.app/&lt;/a&gt;. What workflow would you assess first in your organization?&lt;/p&gt;

</description>
      <category>ai</category>
      <category>management</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Platform Engineering for AI: Build the Guardrails Teams Need</title>
      <dc:creator>Umer Amin Durrani</dc:creator>
      <pubDate>Thu, 19 Nov 2026 09:37:24 +0000</pubDate>
      <link>https://dev.to/umeramindurrani/platform-engineering-for-ai-build-the-guardrails-teams-need-25b7</link>
      <guid>https://dev.to/umeramindurrani/platform-engineering-for-ai-build-the-guardrails-teams-need-25b7</guid>
      <description>&lt;p&gt;AI features often begin as a product experiment and quickly become an operational dependency. Platform teams can make that transition safer by providing reusable building blocks: identity, logging, evaluation, secrets handling, deployment patterns, and a clear path to human review.&lt;/p&gt;

&lt;h2&gt;
  
  
  Offer a paved path
&lt;/h2&gt;

&lt;p&gt;Create a standard way to connect approved models and tools. Include secure secret storage, scoped identities, timeouts, retry limits, and structured traces. Give teams a starter template with documented defaults instead of a blank environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make boundaries visible
&lt;/h2&gt;

&lt;p&gt;Separate experimentation from production access. Require explicit ownership for workflows that can write data, send messages, or change infrastructure. Provide policy checks and approval gates for high-impact actions. Keep an audit trail that links the request, decision, tool call, and resulting change.&lt;/p&gt;

&lt;h2&gt;
  
  
  Measure platform outcomes
&lt;/h2&gt;

&lt;p&gt;Track adoption, deployment lead time, failed runs, escalation rates, and the effort teams spend rebuilding common controls. A platform is useful when it lowers the cost of doing the safe thing without hiding important choices.&lt;/p&gt;

&lt;p&gt;Start with one repeated need and co-design the pattern with a product team. Turn successful patterns into documented templates, then improve them from incident and usage feedback.&lt;/p&gt;

&lt;p&gt;For teams, guardrails should feel like a paved road: easy to use, clear about limits, and connected to operational support.&lt;/p&gt;

&lt;p&gt;I share delivery and AI workflow notes at &lt;a href="https://umer-amin.vercel.app/" rel="noopener noreferrer"&gt;https://umer-amin.vercel.app/&lt;/a&gt;. What reusable guardrail would save your team the most time?&lt;/p&gt;

</description>
      <category>ai</category>
      <category>architecture</category>
      <category>devops</category>
      <category>infrastructure</category>
    </item>
    <item>
      <title>AI Agent Costs: Metrics Beyond Token Count</title>
      <dc:creator>Umer Amin Durrani</dc:creator>
      <pubDate>Thu, 19 Nov 2026 09:36:32 +0000</pubDate>
      <link>https://dev.to/umeramindurrani/ai-agent-costs-metrics-beyond-token-count-4da0</link>
      <guid>https://dev.to/umeramindurrani/ai-agent-costs-metrics-beyond-token-count-4da0</guid>
      <description>&lt;p&gt;Token price is easy to quote, but it is not the same as the cost of a useful completed task. An agent may spend tokens on retries, calls, retrieval, orchestration, and human correction. Teams that optimize only the model bill can miss the expensive parts of the workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Measure cost per outcome
&lt;/h2&gt;

&lt;p&gt;Track total cost per successful task, not just per request. Include model usage, search or database calls, tool execution, infrastructure, and review time. Separate successful runs from failed or abandoned ones so a cheap failure does not look like an efficiency win.&lt;/p&gt;

&lt;h2&gt;
  
  
  Find the cost drivers
&lt;/h2&gt;

&lt;p&gt;Break down spend by workflow, step, model, and outcome. Watch for repeated tool calls, oversized context, unnecessary reasoning passes, and retrieval that returns too much material. Pair cost with quality, latency, and escalation rate.&lt;/p&gt;

&lt;p&gt;A smaller model may reduce inference expense but increase retries or human review. A larger model may be justified for a narrow high-risk decision while a simpler model handles classification or routing. Test the tradeoff with representative tasks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Put budgets at the workflow level
&lt;/h2&gt;

&lt;p&gt;Set a maximum step count, retry policy, timeout, and cost threshold. Define a safe fallback when a run approaches its budget. Alert on changes in cost per successful outcome, then investigate the workflow change behind them.&lt;/p&gt;

&lt;p&gt;Cost governance is a product decision: know what outcome you are buying and what quality level is acceptable.&lt;/p&gt;

&lt;p&gt;I write about practical AI delivery at &lt;a href="https://umer-amin.vercel.app/" rel="noopener noreferrer"&gt;https://umer-amin.vercel.app/&lt;/a&gt;. Which cost do you track today: tokens, completed task, or human time?&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>analytics</category>
    </item>
    <item>
      <title>A Practical Incident Runbook for AI Workflows</title>
      <dc:creator>Umer Amin Durrani</dc:creator>
      <pubDate>Thu, 19 Nov 2026 09:36:08 +0000</pubDate>
      <link>https://dev.to/umeramindurrani/a-practical-incident-runbook-for-ai-workflows-anm</link>
      <guid>https://dev.to/umeramindurrani/a-practical-incident-runbook-for-ai-workflows-anm</guid>
      <description>&lt;p&gt;When an AI workflow breaks, responders need to know what it tried to do and which actions may already have happened. A useful incident runbook should help contain the issue first, then preserve evidence and restore service safely.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Stop risky side effects
&lt;/h2&gt;

&lt;p&gt;Disable the affected trigger or tool permission if the agent could repeat a harmful action. Pause queued jobs when duplicate execution is possible. Keep a human path available for urgent requests.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Establish the scope
&lt;/h2&gt;

&lt;p&gt;Record the first known failure time, workflow version, model and prompt changes, affected integrations, and example run IDs. Check whether the issue is a bad answer, tool failure, latency spike, or unintended external change. Avoid copying sensitive prompts or user data into broad incident channels.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Recover deliberately
&lt;/h2&gt;

&lt;p&gt;Use a known-good workflow or manual process while investigating. If external writes occurred, reconcile them with the system of record before replaying jobs. Do not blindly retry a non-idempotent action.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Verify and learn
&lt;/h2&gt;

&lt;p&gt;Test the fix against the failed case and nearby edge cases. Re-enable traffic gradually, watch the completion and error signals, and document who owns the next step. Turn the incident into an evaluation case, alert, or permission boundary.&lt;/p&gt;

&lt;p&gt;The runbook should name an incident lead, a technical owner, rollback criteria, and customer communication owner. Keep it short enough to use under pressure and review it after changes to tools or workflows.&lt;/p&gt;

&lt;p&gt;More notes on operational AI delivery: &lt;a href="https://umer-amin.vercel.app/" rel="noopener noreferrer"&gt;https://umer-amin.vercel.app/&lt;/a&gt;. What is the first action your team takes when an agent starts behaving unpredictably?&lt;/p&gt;

</description>
      <category>ai</category>
      <category>automation</category>
      <category>devops</category>
      <category>security</category>
    </item>
    <item>
      <title>AI Agent Evaluation: How to Test Workflows That Change Their Answers</title>
      <dc:creator>Umer Amin Durrani</dc:creator>
      <pubDate>Thu, 19 Nov 2026 09:35:41 +0000</pubDate>
      <link>https://dev.to/umeramindurrani/ai-agent-evaluation-how-to-test-workflows-that-change-their-answers-2mmn</link>
      <guid>https://dev.to/umeramindurrani/ai-agent-evaluation-how-to-test-workflows-that-change-their-answers-2mmn</guid>
      <description>&lt;p&gt;Traditional tests expect the same input to produce the same output. AI workflows can vary, so testing only exact text matches creates brittle suites—or false confidence when the expected phrase appears but the task failed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Define behavior before scoring output
&lt;/h2&gt;

&lt;p&gt;For each workflow, write the user goal, allowed actions, required evidence, and unacceptable outcomes. A support agent might need to answer from approved policy, cite the relevant source, and ask for help when the source is missing. Those conditions matter more than whether it uses a particular sentence.&lt;/p&gt;

&lt;h2&gt;
  
  
  Build a representative evaluation set
&lt;/h2&gt;

&lt;p&gt;Collect realistic requests, edge cases, ambiguous inputs, and known failure examples. Include cases with missing context, conflicting instructions, malformed data, and tool errors. Keep a stable test set for regressions and a separate fresh set for discovering new problems.&lt;/p&gt;

&lt;p&gt;Score multiple dimensions: task completion, factual grounding, tool selection, policy adherence, escalation behavior, latency, and cost. Use deterministic checks where possible. For open-ended quality, use human review or a calibrated judge, then manually inspect disagreements.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test the workflow, not only the model
&lt;/h2&gt;

&lt;p&gt;Run evaluations across prompt, model, retrieval, and tool changes. Include the whole path: input preparation, permissions, retries, side effects, and final handoff. A model can improve its answer while the workflow becomes less safe.&lt;/p&gt;

&lt;p&gt;Set release thresholds for critical behaviors. If a change drops a safety or task metric, stop rollout or send it to a limited test group. Track production feedback and turn incidents into new evaluation cases.&lt;/p&gt;

&lt;p&gt;Good evaluation is a loop: define success, test representative cases, review failures, and improve the system. It makes model variation measurable instead of mysterious.&lt;/p&gt;

&lt;p&gt;I share practical AI delivery notes at &lt;a href="https://umer-amin.vercel.app/" rel="noopener noreferrer"&gt;https://umer-amin.vercel.app/&lt;/a&gt;. How are you testing behavior when there is no single “correct” sentence?&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>llm</category>
      <category>testing</category>
    </item>
    <item>
      <title>The AI Verification Gap: Review AI Code Without Rubber-Stamping It</title>
      <dc:creator>Umer Amin Durrani</dc:creator>
      <pubDate>Thu, 19 Nov 2026 09:35:15 +0000</pubDate>
      <link>https://dev.to/umeramindurrani/the-ai-verification-gap-review-ai-code-without-rubber-stamping-it-4fkm</link>
      <guid>https://dev.to/umeramindurrani/the-ai-verification-gap-review-ai-code-without-rubber-stamping-it-4fkm</guid>
      <description>&lt;p&gt;AI can produce a patch that looks tidy and still violates an assumption nobody wrote down. The risk is not simply that generated code contains bugs. It is that reviewers become less critical when the diff arrives quickly and reads confidently.&lt;/p&gt;

&lt;h2&gt;
  
  
  Review the change against the goal
&lt;/h2&gt;

&lt;p&gt;Before reading line by line, restate the expected behavior and the boundary of the change. Which user-visible outcome should improve? Which existing behavior must stay the same? What should happen when input is missing, invalid, slow, or repeated?&lt;/p&gt;

&lt;p&gt;Then inspect the diff for hidden scope: new dependencies, permission changes, network calls, data handling, migrations, and fallback behavior. Ask the model to explain the assumptions it used, but verify those assumptions against the codebase and product requirements.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make evidence part of the review
&lt;/h2&gt;

&lt;p&gt;Run focused tests, then inspect what they do not cover. Add a regression test for the original failure, and exercise boundary cases. For infrastructure or automation changes, verify the plan, permissions, rollback, and observable success signal. A green test suite is evidence, not proof that every risk is gone.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use AI as a reviewer, not an approver
&lt;/h2&gt;

&lt;p&gt;Ask for a second pass that looks for security, failure paths, and unintended behavior. Treat its findings as hypotheses to check. Keep a human accountable for accepting the change, especially when it can modify data, grant access, or affect production.&lt;/p&gt;

&lt;p&gt;A small review checklist helps: intent, assumptions, tests, security, operations, rollback, and ownership. The goal is not to slow every patch; it is to make the important questions repeatable.&lt;/p&gt;

&lt;p&gt;More practical notes on AI delivery and project execution: &lt;a href="https://umer-amin.vercel.app/" rel="noopener noreferrer"&gt;https://umer-amin.vercel.app/&lt;/a&gt;. What check catches the most surprising issue in your AI-assisted code reviews?&lt;/p&gt;

</description>
      <category>ai</category>
      <category>code</category>
      <category>security</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>AI Agent Observability: What to Log Before Production</title>
      <dc:creator>Umer Amin Durrani</dc:creator>
      <pubDate>Thu, 19 Nov 2026 09:34:47 +0000</pubDate>
      <link>https://dev.to/umeramindurrani/ai-agent-observability-what-to-log-before-production-45hd</link>
      <guid>https://dev.to/umeramindurrani/ai-agent-observability-what-to-log-before-production-45hd</guid>
      <description>&lt;p&gt;AI agents can fail in ways a normal application log will not explain. A workflow may call the wrong tool, act on stale context, repeat a step, or return a polished answer that hides a broken handoff. If you only log the final response, debugging becomes guesswork.&lt;/p&gt;

&lt;h2&gt;
  
  
  Log the decision path
&lt;/h2&gt;

&lt;p&gt;For each run, capture a run ID, timestamp, workflow and prompt version, model and tool names, and the outcome. Record each meaningful step: what input the agent received, which tool it selected, whether the tool succeeded, and what happened next. Redact secrets and personal data before storing anything.&lt;/p&gt;

&lt;p&gt;Keep the trace structured. A useful event might include run_id, step_id, tool, status, duration_ms, and an error category. Keep full prompts and outputs only when your retention policy and user expectations allow it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Measure more than uptime
&lt;/h2&gt;

&lt;p&gt;Track task completion, retries, tool errors, timeouts, human escalations, and latency. Separate model errors from integration errors. A rising retry rate can be an early warning even while the service still reports healthy.&lt;/p&gt;

&lt;p&gt;Add alerts for actionable conditions: repeated tool failure, unusual run duration, failed handoff, or a drop in verified completion. Avoid alerting on every model variation; route useful signals to the people who can respond.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make incidents diagnosable
&lt;/h2&gt;

&lt;p&gt;A trace should let an operator answer: what did the agent try, what evidence did it use, what changed, and where did it stop? Include links between the user request, workflow run, tool calls, and resulting system action.&lt;/p&gt;

&lt;p&gt;Start with one critical workflow. Define what success means, instrument each decision and external action, then test a deliberately failing dependency. Observability is useful when the team can detect, explain, and safely recover from a bad run.&lt;/p&gt;

&lt;p&gt;I’m documenting practical AI delivery and technical project management at &lt;a href="https://umer-amin.vercel.app/" rel="noopener noreferrer"&gt;https://umer-amin.vercel.app/&lt;/a&gt;. What is the hardest part of tracing your agent today: tool calls, context, or handoffs?&lt;/p&gt;

</description>
      <category>ai</category>
    </item>
    <item>
      <title>Your PostgreSQL Backup Finished. Can You Actually Restore It?</title>
      <dc:creator>Umer Amin Durrani</dc:creator>
      <pubDate>Sat, 07 Nov 2026 08:57:00 +0000</pubDate>
      <link>https://dev.to/umeramindurrani/your-postgresql-backup-finished-can-you-actually-restore-it-53oo</link>
      <guid>https://dev.to/umeramindurrani/your-postgresql-backup-finished-can-you-actually-restore-it-53oo</guid>
      <description>&lt;p&gt;The backup job is green. The file exists. Someone says, “Sorted, bro.”&lt;/p&gt;

&lt;p&gt;Lovely. One tiny question before we all go for chai:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can the application actually use what comes back out of that file?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A completed backup is useful evidence that a backup operation finished. Recovery needs more evidence: that you can access the backup, restore it into a suitable environment, validate the data and bring the service back within acceptable limits.&lt;/p&gt;

&lt;p&gt;A charger in your bag is reassuring. Finding out it fits a different phone is a less enjoyable experience at 2% battery.&lt;/p&gt;

&lt;p&gt;Here is a small PostgreSQL restore exercise you can adapt. It is a lab walkthrough, not a report of a production incident or a measured recovery benchmark.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this exercise proves—and what it doesn't
&lt;/h2&gt;

&lt;p&gt;We will create synthetic data, make a logical backup, restore it into a &lt;strong&gt;new database&lt;/strong&gt;, and compare a few expected results.&lt;/p&gt;

&lt;p&gt;It does not establish disaster recovery for a whole platform. It does not restore your operating system, object storage, application secrets or external services. A logical dump is one component of a recovery strategy; your needs may call for physical backups, WAL archiving or managed-service recovery features instead.&lt;/p&gt;

&lt;p&gt;PostgreSQL documents these distinctions in its &lt;a href="https://www.postgresql.org/docs/18/backup.html" rel="noopener noreferrer"&gt;backup overview&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Start with a disposable environment
&lt;/h2&gt;

&lt;p&gt;Use a non-production PostgreSQL instance and a database role allowed to create databases. The example assumes compatible PostgreSQL client tools are installed and that &lt;code&gt;PGHOST&lt;/code&gt;, &lt;code&gt;PGPORT&lt;/code&gt; and &lt;code&gt;PGUSER&lt;/code&gt; point to that lab instance. Use your normal secure authentication method; keep passwords out of shell history and shared screenshots.&lt;/p&gt;

&lt;p&gt;The commands below do not delete an existing database. Keep them in the same Bash session so their variables remain available.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;-euo&lt;/span&gt; pipefail
&lt;span class="nb"&gt;umask &lt;/span&gt;077

: &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;PGHOST&lt;/span&gt;:?Set&lt;span class="p"&gt; PGHOST to your disposable lab server&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
: &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;PGUSER&lt;/span&gt;:?Set&lt;span class="p"&gt; PGUSER to your lab role&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

&lt;span class="nv"&gt;LAB_DIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;mktemp&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;
&lt;span class="nv"&gt;LAB_SUFFIX&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt; +%s&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;_&lt;/span&gt;&lt;span class="nv"&gt;$$&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="nv"&gt;SOURCE_DB&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"restore_source_&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;LAB_SUFFIX&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="nv"&gt;RESTORE_DB&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"restore_target_&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;LAB_SUFFIX&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

createdb &lt;span class="nt"&gt;--template&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;template0 &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$SOURCE_DB&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check the host before running this. “I thought that terminal was staging” is a sentence with surprisingly expensive punctuation.&lt;/p&gt;

&lt;p&gt;See the &lt;a href="https://www.postgresql.org/docs/18/app-createdb.html" rel="noopener noreferrer"&gt;createdb documentation&lt;/a&gt; for connection and permission details.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Create a small dataset with an actual relationship
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;psql &lt;span class="nt"&gt;--dbname&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$SOURCE_DB&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nt"&gt;--set&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;ON_ERROR_STOP&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1 &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="no"&gt;SQL&lt;/span&gt;&lt;span class="sh"&gt;'
CREATE TABLE customers (
  id integer PRIMARY KEY,
  name text NOT NULL
);

CREATE TABLE orders (
  id integer PRIMARY KEY,
  customer_id integer NOT NULL REFERENCES customers(id),
  amount_paisa integer NOT NULL CHECK (amount_paisa &amp;gt;= 0)
);

INSERT INTO customers VALUES
  (1, 'Lab customer A'),
  (2, 'Lab customer B');

INSERT INTO orders VALUES
  (101, 1, 1000),
  (102, 1, 2200),
  (103, 2, 1000);
&lt;/span&gt;&lt;span class="no"&gt;SQL
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This gives us something more useful than checking that a database name exists: rows, a foreign-key relationship and a numeric total.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Create and inspect the archive
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pg_dump &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;custom &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--file&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$LAB_DIR&lt;/span&gt;&lt;span class="s2"&gt;/application.dump"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$SOURCE_DB&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

pg_restore &lt;span class="nt"&gt;--list&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$LAB_DIR&lt;/span&gt;&lt;span class="s2"&gt;/application.dump"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$LAB_DIR&lt;/span&gt;&lt;span class="s2"&gt;/archive-contents.txt"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first command produces an archive. The second shows its table of contents. &lt;strong&gt;Listing the archive is not a successful restore test.&lt;/strong&gt; It is an intermediate inspection step.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pg_dump&lt;/code&gt; handles one database; global objects such as roles require separate planning. Keep client/server version compatibility in mind. &lt;a href="https://www.postgresql.org/docs/18/app-pgdump.html" rel="noopener noreferrer"&gt;PostgreSQL pg_dump reference&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Restore into a fresh target
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;createdb &lt;span class="nt"&gt;--template&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;template0 &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$RESTORE_DB&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

pg_restore &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--dbname&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$RESTORE_DB&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--single-transaction&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--exit-on-error&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--no-owner&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--no-privileges&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$LAB_DIR&lt;/span&gt;&lt;span class="s2"&gt;/application.dump"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For this small lab, one transaction helps avoid leaving a partially restored result if a restore command fails. Larger restores may need a different strategy; transaction scope, resource use and parallelism involve trade-offs.&lt;/p&gt;

&lt;p&gt;The owner and privilege options deliberately simplify this lab. &lt;strong&gt;They also mean we have not tested restoration of the production permission model.&lt;/strong&gt; Do not silently carry that assumption into a real recovery plan.&lt;/p&gt;

&lt;p&gt;Only restore trusted archives. A database dump can contain executable database definitions. &lt;a href="https://www.postgresql.org/docs/18/app-pgrestore.html" rel="noopener noreferrer"&gt;PostgreSQL pg_restore reference&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Verify useful properties
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;psql &lt;span class="nt"&gt;--dbname&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$RESTORE_DB&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nt"&gt;--set&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;ON_ERROR_STOP&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1 &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="no"&gt;SQL&lt;/span&gt;&lt;span class="sh"&gt;'
SELECT count(*) AS customers FROM customers;
SELECT count(*) AS orders FROM orders;
SELECT sum(amount_paisa) AS total_paisa FROM orders;

SELECT count(*) AS orphan_orders
FROM orders o
LEFT JOIN customers c ON c.id = o.customer_id
WHERE c.id IS NULL;
&lt;/span&gt;&lt;span class="no"&gt;SQL
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For this synthetic dataset, the expected results are &lt;strong&gt;2 customers, 3 orders, 4,200 paisa and 0 orphan orders&lt;/strong&gt;. These values were reproduced during draft verification in an isolated PostgreSQL 18 cluster using synthetic data. They are not results from a production recovery test.&lt;/p&gt;

&lt;p&gt;Counts and totals are useful checks, but they do not prove every value is correct. For a real system, add domain-specific checks: representative records, critical relationships, known transactions and application workflows.&lt;/p&gt;

&lt;p&gt;Then test through the application using its normal restricted role. A restore that works only for an administrator has not yet demonstrated that your service can operate.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Technical PM part: define “recovered” before the incident
&lt;/h2&gt;

&lt;p&gt;Ask the team to agree on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which customer journeys must work before recovery is declared complete?&lt;/li&gt;
&lt;li&gt;How much data loss is acceptable? This informs the recovery point objective, or RPO.&lt;/li&gt;
&lt;li&gt;How long can the service remain unavailable? This informs the recovery time objective, or RTO.&lt;/li&gt;
&lt;li&gt;Who can access backups and keys if the usual operator is unavailable?&lt;/li&gt;
&lt;li&gt;Who owns the decision to resume writes?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Measure retrieval, provisioning, restore, validation and application readiness separately. A stopwatch around &lt;code&gt;pg_restore&lt;/code&gt; alone does not measure the full recovery experience.&lt;/p&gt;

&lt;p&gt;Keep a dated record with the backup identifier, environment, tool versions, checks, timings, failures and follow-up owner. Redact sensitive information before sharing it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The target isn't “a backup exists.” The target is a recovery process your team has evidence for.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What would you check first after a database restore: a row count, an application login, or the customer journey that makes the business money—and why?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Draft prepared with AI support. The synthetic-data walkthrough was checked in an isolated PostgreSQL 18 cluster during draft preparation. Author review and environment-specific testing are still required before publication.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;#PostgreSQL #Linux #DevOps #Beginners&lt;/p&gt;

</description>
      <category>postgres</category>
      <category>beginners</category>
      <category>linux</category>
      <category>devops</category>
    </item>
    <item>
      <title>What Evidence Makes You Trust a Backup?</title>
      <dc:creator>Umer Amin Durrani</dc:creator>
      <pubDate>Sat, 07 Nov 2026 08:56:18 +0000</pubDate>
      <link>https://dev.to/umeramindurrani/what-evidence-makes-you-trust-a-backup-39m0</link>
      <guid>https://dev.to/umeramindurrani/what-evidence-makes-you-trust-a-backup-39m0</guid>
      <description>&lt;p&gt;You know the friend who says, “I'm five minutes away,” while still looking for their keys?&lt;/p&gt;

&lt;p&gt;Sometimes a backup dashboard has that same energy.&lt;/p&gt;

&lt;p&gt;“Completed successfully” sounds like the whole journey. Depending on the job, it may only describe one stage.&lt;/p&gt;

&lt;p&gt;That doesn't make the dashboard useless. It means we should ask what its green tick actually measures.&lt;/p&gt;

&lt;h2&gt;
  
  
  Four different kinds of confidence
&lt;/h2&gt;

&lt;p&gt;Here is a discussion framework, not an industry certification scheme:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Evidence&lt;/th&gt;
&lt;th&gt;What it helps establish&lt;/th&gt;
&lt;th&gt;What remains open&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A recent file exists&lt;/td&gt;
&lt;td&gt;An artefact is present&lt;/td&gt;
&lt;td&gt;Is it complete, trusted and accessible when needed?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The backup operation succeeded&lt;/td&gt;
&lt;td&gt;The operation met its configured success criteria&lt;/td&gt;
&lt;td&gt;Can we restore it into the required environment?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A restore exercise passed&lt;/td&gt;
&lt;td&gt;That tested restoration worked under those conditions&lt;/td&gt;
&lt;td&gt;Can the application and its dependencies operate?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A recovery drill met its targets&lt;/td&gt;
&lt;td&gt;The tested service recovery met defined criteria&lt;/td&gt;
&lt;td&gt;Will changed infrastructure or a different incident break the assumptions?&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The distinction matters because a backup tool, a database administrator and a customer may all mean different things by “working.”&lt;/p&gt;

&lt;p&gt;The customer probably isn't interested in a screenshot of the cron job. Fair enough, honestly.&lt;/p&gt;

&lt;h2&gt;
  
  
  My favourite question for a recovery meeting
&lt;/h2&gt;

&lt;p&gt;Not “Do we have backups?”&lt;/p&gt;

&lt;p&gt;Try:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“What is the most recent recovery evidence, and what did that exercise leave untested?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That question makes room for an honest answer. Maybe the data restored correctly, but nobody tested the application role. Maybe the files are solid, but retrieval depends on one person's account.&lt;/p&gt;

&lt;p&gt;Those are useful findings. They are not reasons to roast whoever ran the drill.&lt;/p&gt;

&lt;p&gt;A practice session that reveals a missing key is doing its job. Finding it during the outage is the inconvenient sequel.&lt;/p&gt;

&lt;h2&gt;
  
  
  A small action worth trying
&lt;/h2&gt;

&lt;p&gt;At the next review, choose one important user journey. Write down how you would prove it works after restoration, which dependencies it requires and who can run that check.&lt;/p&gt;

&lt;p&gt;No dramatic transformation programme needed. Just make one assumption visible.&lt;/p&gt;

&lt;p&gt;For PostgreSQL specifically, the official &lt;a href="https://www.postgresql.org/docs/18/backup.html" rel="noopener noreferrer"&gt;backup and restore chapter&lt;/a&gt; is a useful starting point for understanding the different approaches.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Which recovery assumption has surprised you most: permissions, missing files, unavailable credentials, external integrations—or something completely different?&lt;/strong&gt; Share the lesson without exposing customer data or internal credentials.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Draft prepared with AI support. The examples are discussion scenarios, not claimed personal incidents.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;#Discuss #DevOps #Database #Productivity&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>devops</category>
      <category>database</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Before You Run That AI-Generated Bash Script, Read This</title>
      <dc:creator>Umer Amin Durrani</dc:creator>
      <pubDate>Sat, 07 Nov 2026 08:50:46 +0000</pubDate>
      <link>https://dev.to/umeramindurrani/before-you-run-that-ai-generated-bash-script-read-this-1908</link>
      <guid>https://dev.to/umeramindurrani/before-you-run-that-ai-generated-bash-script-read-this-1908</guid>
      <description>&lt;p&gt;The assistant writes a Bash script in twelve seconds.&lt;/p&gt;

&lt;p&gt;The script has comments, a progress message and a final line saying “Done!”&lt;/p&gt;

&lt;p&gt;Looks professional, mate. Unfortunately, confidence is not a permission boundary.&lt;/p&gt;

&lt;p&gt;Before executing it, ask one question:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What can this script change, and how do I know those are the things I intended?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You don't need to distrust every AI-generated line. You need a review process that doesn't depend on the assistant sounding sensible.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Translate the request into a bounded task
&lt;/h2&gt;

&lt;p&gt;“Clean up my server” is not a specification.&lt;/p&gt;

&lt;p&gt;A more reviewable request would be:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;List regular &lt;code&gt;.log&lt;/code&gt; files older than 14 days inside one specified lab directory. Do not delete, upload, change ownership or follow symbolic-link directories. Print the candidates for human review.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now you have observable boundaries. Directory, age, file type and permitted action are explicit.&lt;/p&gt;

&lt;p&gt;This is the software equivalent of telling someone which cupboard to tidy instead of saying, “Sort the house out.” Your passport should not become collateral damage.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Review four things before the syntax
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Target:&lt;/strong&gt; Does the path resolve to the intended directory? Are remote host and account correct?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Authority:&lt;/strong&gt; Which user executes the script? Can it write outside the target, access secrets or invoke privileged commands?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Inputs:&lt;/strong&gt; Can filenames, environment variables or untrusted text alter the command's meaning?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Effects:&lt;/strong&gt; Does it delete, install, change permissions, send data, stop services or alter databases?&lt;/p&gt;

&lt;p&gt;A syntactically valid command can still act on the wrong environment. Shell linting cannot decide your business intent for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Begin with inspection, not modification
&lt;/h2&gt;

&lt;p&gt;This Bash example only lists candidates. It assumes &lt;strong&gt;GNU find&lt;/strong&gt; on a Linux lab machine:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/usr/bin/env bash&lt;/span&gt;
&lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;-euo&lt;/span&gt; pipefail

&lt;span class="nv"&gt;TARGET&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;1&lt;/span&gt;:?Usage:&lt;span class="p"&gt; inspect-logs.sh /path/to/lab-logs&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$TARGET&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nt"&gt;-L&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$TARGET&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
  &lt;/span&gt;&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'%s\n'&lt;/span&gt; &lt;span class="s1"&gt;'Choose an existing, non-symlink lab directory.'&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&amp;amp;2
  &lt;span class="nb"&gt;exit &lt;/span&gt;1
&lt;span class="k"&gt;fi

&lt;/span&gt;&lt;span class="nv"&gt;TARGET&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;realpath&lt;/span&gt; &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$TARGET&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$TARGET&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; / &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
  &lt;/span&gt;&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'%s\n'&lt;/span&gt; &lt;span class="s1"&gt;'The filesystem root is not an acceptable target.'&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&amp;amp;2
  &lt;span class="nb"&gt;exit &lt;/span&gt;1
&lt;span class="k"&gt;fi

&lt;/span&gt;&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'Inspection only. Target: %q\n'&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$TARGET&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
find &lt;span class="nt"&gt;-P&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$TARGET&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nt"&gt;-xdev&lt;/span&gt; &lt;span class="nt"&gt;-type&lt;/span&gt; f &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s1"&gt;'*.log'&lt;/span&gt; &lt;span class="nt"&gt;-mtime&lt;/span&gt; +14 &lt;span class="nt"&gt;-print0&lt;/span&gt; |
  &lt;span class="k"&gt;while &lt;/span&gt;&lt;span class="nv"&gt;IFS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;read&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt; candidate&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do
    &lt;/span&gt;&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'Candidate: %q\n'&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$candidate&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
  &lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a review exercise, not a containment mechanism. A filesystem can change during inspection; path validation alone does not prevent races. &lt;code&gt;-xdev&lt;/code&gt; also intentionally avoids descending into other mounted filesystems. GNU &lt;code&gt;find&lt;/code&gt; age tests use their documented rounding rules—“older than 14 days” needs a precise definition if a retention policy depends on it.&lt;/p&gt;

&lt;p&gt;There is no deletion step hidden at the end. Inspect first; design the mutation separately if it is actually required.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Check syntax and common shell mistakes
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bash &lt;span class="nt"&gt;-n&lt;/span&gt; inspect-logs.sh
shellcheck inspect-logs.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first checks Bash syntax without executing the script. ShellCheck can identify many common shell issues. Neither proves the script is safe or appropriate for your environment. &lt;a href="https://www.shellcheck.net/" rel="noopener noreferrer"&gt;ShellCheck project&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Use a disposable directory with ordinary files, spaces in filenames, unexpected names, a symbolic link and a file that should not match. Decide the expected candidate list before running the script.&lt;/p&gt;

&lt;p&gt;That makes the result something you can compare, rather than something you can merely admire.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. A prompt is not a security control
&lt;/h2&gt;

&lt;p&gt;An AI assistant may read logs, pages or documents containing instructions you did not author. That makes the distinction between data and instructions important. Prompt wording alone should not be your enforcement layer. &lt;a href="https://cheatsheetseries.owasp.org/cheatsheets/LLM_Prompt_Injection_Prevention_Cheat_Sheet.html" rel="noopener noreferrer"&gt;OWASP prompt-injection guidance&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Put limits in the execution environment: restricted credentials, bounded tools and explicit approval for consequential actions. The model proposes; the surrounding system decides what is permitted.&lt;/p&gt;

&lt;p&gt;Also: adding &lt;code&gt;sudo&lt;/code&gt; because a command failed is not troubleshooting. It's changing the size of the mistake you can make.&lt;/p&gt;

&lt;h2&gt;
  
  
  The habit worth keeping
&lt;/h2&gt;

&lt;p&gt;Before execution, explain the script in your own words, identify every write or network operation, and describe how you'll verify the result.&lt;/p&gt;

&lt;p&gt;If you cannot do that yet, ask for a smaller script or a read-only version. There is no shame in needing an explanation. The server does not award bravery points.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is the first thing you inspect in an unfamiliar shell script: paths, privilege, network calls, quoting—or something else?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Draft prepared with AI support. The illustrative script passed Bash syntax checking and a disposable-file fixture during draft preparation. ShellCheck and author environment-specific review remain outstanding.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;#Linux #Bash #AI #Security&lt;/p&gt;

</description>
      <category>linux</category>
      <category>bash</category>
      <category>ai</category>
      <category>security</category>
    </item>
    <item>
      <title>Which Commands Should an AI Agent Never Run Without Your Approval?</title>
      <dc:creator>Umer Amin Durrani</dc:creator>
      <pubDate>Sat, 07 Nov 2026 08:48:26 +0000</pubDate>
      <link>https://dev.to/umeramindurrani/which-commands-should-an-ai-agent-never-run-without-your-approval-3ph1</link>
      <guid>https://dev.to/umeramindurrani/which-commands-should-an-ai-agent-never-run-without-your-approval-3ph1</guid>
      <description>&lt;p&gt;“Are you sure?”&lt;/p&gt;

&lt;p&gt;Yes, bro. About what, exactly?&lt;/p&gt;

&lt;p&gt;A confirmation button isn't much help if the user cannot see the action, destination or likely effect.&lt;/p&gt;

&lt;p&gt;As assistants gain tools, the interesting question isn't whether they can run commands. It's &lt;strong&gt;which decisions we are comfortable delegating, under which conditions&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Don't classify risk by how short the command looks
&lt;/h2&gt;

&lt;p&gt;A long query might only read a local test table. A tiny command might change a production permission.&lt;/p&gt;

&lt;p&gt;Likewise, “read-only” does not always mean harmless: reading a credential file and sending its contents somewhere can expose a secret without changing the original file.&lt;/p&gt;

&lt;p&gt;I would start an approval design with these questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which environment is affected?&lt;/li&gt;
&lt;li&gt;Is the action reversible through an ordinary, tested process?&lt;/li&gt;
&lt;li&gt;Could it expose confidential data?&lt;/li&gt;
&lt;li&gt;Does it alter access, billing, availability or persisted records?&lt;/li&gt;
&lt;li&gt;Is the target bounded, or can it expand unexpectedly?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  A proposed decision table
&lt;/h2&gt;

&lt;p&gt;This is a starting policy to adapt, not a universal permission standard:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Example action&lt;/th&gt;
&lt;th&gt;Possible treatment&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Read synthetic lab logs&lt;/td&gt;
&lt;td&gt;Allow within a scoped tool&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Inspect production service health&lt;/td&gt;
&lt;td&gt;Allow only through approved, limited access&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Prepare a deployment diff&lt;/td&gt;
&lt;td&gt;Allow preparation; review before applying&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Change production access rules&lt;/td&gt;
&lt;td&gt;Require specific human approval&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Delete retained customer records&lt;/td&gt;
&lt;td&gt;Require the authorised workflow and explicit approval&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Send logs to an external service&lt;/td&gt;
&lt;td&gt;Review the contents, destination and data-sharing permission&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;OWASP's &lt;a href="https://cheatsheetseries.owasp.org/cheatsheets/AI_Agent_Security_Cheat_Sheet.html" rel="noopener noreferrer"&gt;AI Agent Security guidance&lt;/a&gt; discusses scoped tools and human oversight. The practical challenge is turning those principles into permissions your system actually enforces.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make approval a decision, not a reflex
&lt;/h2&gt;

&lt;p&gt;A useful request would say:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Apply this reviewed configuration change to the staging service. It changes these two values. The rollback is this previous configuration.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That gives someone a decision they can inspect.&lt;/p&gt;

&lt;p&gt;Compare it with “Proceed?” after a wall of terminal output. That's less informed approval and more an endurance test.&lt;/p&gt;

&lt;p&gt;I would also bind approval to the reviewed action. If the target, payload or permissions change, the old approval should not become a blank cheque.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where would you draw the boundary for your own team: what can an agent execute independently, and what must always return to a human?&lt;/strong&gt; A concrete example is more useful than “never trust AI” or “automate everything.”&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Draft prepared with AI support. The table is an illustrative policy discussion, not a record of a deployed access-control system.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;#AI #Security #DevOps #Discuss&lt;/p&gt;

</description>
      <category>ai</category>
      <category>security</category>
      <category>devops</category>
      <category>discuss</category>
    </item>
  </channel>
</rss>
