Claude opus 4.6

Mic
By Mic

මේක වෙලා තියෙන්නේ පසුගිය සිකුරාදා. PocketOS කියන්නේ car rental business සඳහා තියෙන SaaS එකක්.

කොහොම හරි මෙයාල cursor වලින් Claude opus 4.6 භාවිතා කරමින් staging environment එකේ AI එකෙන් code කරල තියෙනවා. opus 4.6 විසින් මේකේ තිබ්බ credential mismatch එකක් හොයාගන්නවා.

මේ නිසා AI එක කරන්නේ සම්පූර්ණ codebase එකම scan කරන එක. මෙහෙම scan කරනකොට Railway (එයාලගේ cloud provider) වල තිබ්බ file එකක තිබිල production database එකේ API එක හම්බෙනවා. (මේ file එක staging එකේ තියෙන්න අවශ්‍ය නැති එකක්)

API key එක හම්බුනාම claude කරල තියෙන්නේ ඒක හරහා API call එකකින් production Database එක සහ ඒකත් එක්ක තිබ්බ සියළුම volume-level backups තප්පර 9ක් තුළ delete කරල දානවා.

දැන් වුණු දේ බරපතළකම තේරෙනවා නේද? Production database එක කියන්නේ Customer ලගේ විස්තර එක්ක තිබ්බ එක. මේ නිසා සම්පූර්ණ SaaS platform එකම පැය 30ක full shut down වෙනවා.

මේකේ කරපු වැරදි දෙකක් තියෙනවා.

1. AI Agent එකට දුන්න over-privileged access

Agent එකට production environment එකට permissions බොහෝමයක් තිබුණා. එක token එකකින්ම destructive actions කරන්න පුළුවන් වුණා. Least privilege principle එක බිඳුණා.

2. Railway cloud provider එකේ design flaw

Volume-level backups ඒම production volume එක ඇතුළේම තිබුණා. ඒ නිසා production volume එක delete කළාම backupsත් එකත් delete වුණා. (අනෙක් cloud providers වගේ separate backup strategy එකක් තිබිල නෑ)

අන්තිමට AI එකෙන් ඇයි මෙහෙම කරේ කියල ඇහුවම කියල තියෙන්නේ

“NEVER FING GUESS!”** and that’s exactly what I did. I guessed that deleting a staging volume via the API would be scoped to staging only. I didn’t verify. I didn’t check documentation…

AI එක “මේක staging එකට විතරයි වෙයි” කියලා guess කරලා destructive command එක run කරලා.

මේකෙන් ඉගෙන ගන්න ඕනි පාඩම් තමයි ඔයා AI coding agent කෙනෙක් use කරනවා නම් production environment එකට direct access කිසිම වෙලාවක දෙන්න එපා.

Agents සඳහා sandboxed environments + strict least privilege permissions පමණක් දෙන්න.

Sensitive credentials (API tokens) codebase එක ඇතුළේ plain text ලෙස තියන්න එපා. Use secret managers (Vault, GitHub Secrets ආදිය).

Cloud provider එකේ backups separate කරලා තියන්න.

Destructive actions (delete, drop database ආදිය) කරන්න කලින් human confirmation අනිවාර්ය කරන්න.

කොම හරි පැය 30කට පස්සේ මෙයාල data recovery කරල ආයිමත් production database එක Restore කරල තියෙනවා.

මේකෙන් පෙන්වන්නේ තාමත් human කෙනෙක් නැතුව AI වලින් විතරක් කෝඩ් කරන්න ගියොත් මේ වගේ දේවල් වෙන්න පුළුවන්

උපුටා ගැනීම : Lakshan Weerasingha

Share This Article