<?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:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Rotimi's Substack]]></title><description><![CDATA[My personal Substack]]></description><link>https://www.rotimiakinyele.ai</link><image><url>https://substackcdn.com/image/fetch/$s_!iTvo!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb28af134-707b-4d27-9a4a-38d3cd9cf97b_144x144.png</url><title>Rotimi&apos;s Substack</title><link>https://www.rotimiakinyele.ai</link></image><generator>Substack</generator><lastBuildDate>Thu, 23 Apr 2026 13:55:20 GMT</lastBuildDate><atom:link href="https://www.rotimiakinyele.ai/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Rotimi Akinyele]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[rotimiakinyele@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[rotimiakinyele@substack.com]]></itunes:email><itunes:name><![CDATA[Rotimi Akinyele]]></itunes:name></itunes:owner><itunes:author><![CDATA[Rotimi Akinyele]]></itunes:author><googleplay:owner><![CDATA[rotimiakinyele@substack.com]]></googleplay:owner><googleplay:email><![CDATA[rotimiakinyele@substack.com]]></googleplay:email><googleplay:author><![CDATA[Rotimi Akinyele]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Why half your AI SAST findings are wrong (and how to fix them)]]></title><description><![CDATA[AI-powered SAST catches patterns fast, but without context it produces false positives. Here&#8217;s why security teams need static analysis, authorization mapping, and dynamic testing together.]]></description><link>https://www.rotimiakinyele.ai/p/why-half-your-ai-sast-findings-are</link><guid isPermaLink="false">https://www.rotimiakinyele.ai/p/why-half-your-ai-sast-findings-are</guid><dc:creator><![CDATA[Rotimi Akinyele]]></dc:creator><pubDate>Wed, 01 Apr 2026 10:18:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!DZty!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0a0897d-d3fa-4958-8bd0-4a2ba49bb7e3_3435x3141.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I&#8217;m a big fan of using AI in security. We&#8217;ve been running AI-powered code scanners on every pull request for close to two years now, alongside the usual stack, your CodeQLs, Trivys, TruffleHogs, Dependabots. We even built custom AI agents to hunt for specific vulnerability classes.</p><p>So when Claude found a blind SQL injection in Ghost (50,000 GitHub stars, zero critical vulnerabilities in its entire history) in 90 minutes, I wasn&#8217;t shocked. I&#8217;ve been watching these models get better in real time. And when Claude Mythos leaked a few days ago, described as &#8220;far ahead of any other AI model in cyber capabilities,&#8221; and cybersecurity stocks dropped 3 to 7%, yeah, I get the excitement. I share it.</p><p>But if you actually run this stuff in production, you know it&#8217;s not that simple.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!5I8Y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66d57cce-6668-4dfe-a3be-41047b5823d9_994x982.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5I8Y!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66d57cce-6668-4dfe-a3be-41047b5823d9_994x982.png 424w, https://substackcdn.com/image/fetch/$s_!5I8Y!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66d57cce-6668-4dfe-a3be-41047b5823d9_994x982.png 848w, https://substackcdn.com/image/fetch/$s_!5I8Y!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66d57cce-6668-4dfe-a3be-41047b5823d9_994x982.png 1272w, https://substackcdn.com/image/fetch/$s_!5I8Y!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66d57cce-6668-4dfe-a3be-41047b5823d9_994x982.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5I8Y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66d57cce-6668-4dfe-a3be-41047b5823d9_994x982.png" width="994" height="982" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/66d57cce-6668-4dfe-a3be-41047b5823d9_994x982.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:982,&quot;width&quot;:994,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:830236,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://derivai.substack.com/i/192540406?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66d57cce-6668-4dfe-a3be-41047b5823d9_994x982.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!5I8Y!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66d57cce-6668-4dfe-a3be-41047b5823d9_994x982.png 424w, https://substackcdn.com/image/fetch/$s_!5I8Y!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66d57cce-6668-4dfe-a3be-41047b5823d9_994x982.png 848w, https://substackcdn.com/image/fetch/$s_!5I8Y!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66d57cce-6668-4dfe-a3be-41047b5823d9_994x982.png 1272w, https://substackcdn.com/image/fetch/$s_!5I8Y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66d57cce-6668-4dfe-a3be-41047b5823d9_994x982.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>When you actually run AI SAST across a real production codebase, day in, day out, you learn to live with a specific reality: <em><strong>the thing works, but it also lies to you. A lot.</strong></em></p><p>You point your AI scanner at a codebase, and it comes back with a list. SQL injection here. SSRF there. Insecure deserialization in this library. Hardcoded credentials in that config. Broken access control on this endpoint. Some of those are real, and give you that w000t moment. </p><p>But a lot of them aren&#8217;t. I don&#8217;t mean edge cases or theoretical stuff. I mean, the scanner is flat-out wrong. It&#8217;s flagging things that can&#8217;t actually be exploited because it doesn&#8217;t have the full picture.</p><p>Your AI scanner reads a function, sees a user-supplied parameter going into a database query, and flags it. Possible SQL injection. Severity: High. Makes sense on paper. But what it doesn&#8217;t know, what it <em>can&#8217;t</em> know just from reading source code, is that three layers up, there&#8217;s an API gateway stripping special characters before the request ever reaches this function. Or there&#8217;s middleware parameterizing the query. Or that &#8220;user-supplied&#8221; input is actually coming from an internal service that already validated it.</p><p>The scanner sees the code. It doesn&#8217;t get the full picture.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Y3sV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b71baf4-b688-451c-abbf-172ff293f5cd_1416x3255.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Y3sV!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b71baf4-b688-451c-abbf-172ff293f5cd_1416x3255.png 424w, https://substackcdn.com/image/fetch/$s_!Y3sV!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b71baf4-b688-451c-abbf-172ff293f5cd_1416x3255.png 848w, https://substackcdn.com/image/fetch/$s_!Y3sV!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b71baf4-b688-451c-abbf-172ff293f5cd_1416x3255.png 1272w, https://substackcdn.com/image/fetch/$s_!Y3sV!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b71baf4-b688-451c-abbf-172ff293f5cd_1416x3255.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Y3sV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b71baf4-b688-451c-abbf-172ff293f5cd_1416x3255.png" width="1416" height="3255" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1b71baf4-b688-451c-abbf-172ff293f5cd_1416x3255.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:3255,&quot;width&quot;:1416,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:504490,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://derivai.substack.com/i/192540406?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b71baf4-b688-451c-abbf-172ff293f5cd_1416x3255.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!Y3sV!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b71baf4-b688-451c-abbf-172ff293f5cd_1416x3255.png 424w, https://substackcdn.com/image/fetch/$s_!Y3sV!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b71baf4-b688-451c-abbf-172ff293f5cd_1416x3255.png 848w, https://substackcdn.com/image/fetch/$s_!Y3sV!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b71baf4-b688-451c-abbf-172ff293f5cd_1416x3255.png 1272w, https://substackcdn.com/image/fetch/$s_!Y3sV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b71baf4-b688-451c-abbf-172ff293f5cd_1416x3255.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Same thing with access control. The scanner sees an account ID passed as a parameter and forwarded downstream without an ownership check in that file. Flags it Critical. But it has no idea whether the API gateway injects a verified client identity header upstream, or whether the downstream service validates against it. The enforcement might live in a completely different service, maybe even on a different platform. The scanner can&#8217;t tell.</p><p>So what actually happens? Your AI hands you 200 findings, and your team spends the next two weeks triaging them. Half are real. Half are garbage. And the only way to figure out which is which is to manually check each one against the running system.</p><p>Nobody has time for that. So this is what I&#8217;ve been building instead.</p><p>What if you didn&#8217;t stop at the SAST results? What if you took those findings and actually <em>tested</em> them?</p><p><strong>The philosophy is simple: code first, exploit second.</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!YHrU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7043b4ea-9cdd-4d28-8281-b5d80250f096_3543x3188.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!YHrU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7043b4ea-9cdd-4d28-8281-b5d80250f096_3543x3188.png 424w, https://substackcdn.com/image/fetch/$s_!YHrU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7043b4ea-9cdd-4d28-8281-b5d80250f096_3543x3188.png 848w, https://substackcdn.com/image/fetch/$s_!YHrU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7043b4ea-9cdd-4d28-8281-b5d80250f096_3543x3188.png 1272w, https://substackcdn.com/image/fetch/$s_!YHrU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7043b4ea-9cdd-4d28-8281-b5d80250f096_3543x3188.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!YHrU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7043b4ea-9cdd-4d28-8281-b5d80250f096_3543x3188.png" width="1456" height="1310" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7043b4ea-9cdd-4d28-8281-b5d80250f096_3543x3188.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1310,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:883654,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://derivai.substack.com/i/192540406?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7043b4ea-9cdd-4d28-8281-b5d80250f096_3543x3188.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!YHrU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7043b4ea-9cdd-4d28-8281-b5d80250f096_3543x3188.png 424w, https://substackcdn.com/image/fetch/$s_!YHrU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7043b4ea-9cdd-4d28-8281-b5d80250f096_3543x3188.png 848w, https://substackcdn.com/image/fetch/$s_!YHrU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7043b4ea-9cdd-4d28-8281-b5d80250f096_3543x3188.png 1272w, https://substackcdn.com/image/fetch/$s_!YHrU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7043b4ea-9cdd-4d28-8281-b5d80250f096_3543x3188.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Instead of running a generic scan and dumping results on someone&#8217;s desk, you structure it. You map every endpoint to its full middleware chain, its auth requirements, its authorization checks. Most of this stuff is code, by the way. Your API gateway config, your middleware handlers, your route definitions, they&#8217;re all sitting in repos. But nobody points the scanner at all of it together. The gateway config is in one repo, the back-end in another, auth rules in YAML somewhere else, WAF in a Terraform file. Teams scan the application code and call it a day. The full picture never makes it into one scan.</p><p>So you build it yourself. I&#8217;ve been building what I call an authorization matrix for every endpoint in your API surface.</p><p>At its simplest, it&#8217;s a structured map that answers four questions for every route:</p><ul><li><p><strong>Who is the caller?</strong> (auth mechanism: JWT, session, API key)</p></li><li><p><strong>Where does identity come from?</strong> (header, token claim, request param)</p></li><li><p><strong>What checks are enforced?</strong> (middleware, service-level validation)</p></li><li><p><strong>Where are those checks implemented?</strong> (gateway, app, downstream service)</p></li></ul><p>Most of this data already exists, just scattered:</p><ul><li><p>API gateway configs (routing, auth injection)</p></li><li><p>Middleware chains in application code</p></li><li><p>Infrastructure definitions (WAF, proxies, service mesh)</p></li><li><p>Downstream service validation logic</p></li></ul><p>The matrix stitches all of that into a single view. It shows you every gap at once instead of hunting through endpoints one at a time.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!DZty!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0a0897d-d3fa-4958-8bd0-4a2ba49bb7e3_3435x3141.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DZty!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0a0897d-d3fa-4958-8bd0-4a2ba49bb7e3_3435x3141.png 424w, https://substackcdn.com/image/fetch/$s_!DZty!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0a0897d-d3fa-4958-8bd0-4a2ba49bb7e3_3435x3141.png 848w, https://substackcdn.com/image/fetch/$s_!DZty!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0a0897d-d3fa-4958-8bd0-4a2ba49bb7e3_3435x3141.png 1272w, https://substackcdn.com/image/fetch/$s_!DZty!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0a0897d-d3fa-4958-8bd0-4a2ba49bb7e3_3435x3141.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DZty!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0a0897d-d3fa-4958-8bd0-4a2ba49bb7e3_3435x3141.png" width="1456" height="1331" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e0a0897d-d3fa-4958-8bd0-4a2ba49bb7e3_3435x3141.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1331,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:767819,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://derivai.substack.com/i/192540406?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0a0897d-d3fa-4958-8bd0-4a2ba49bb7e3_3435x3141.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!DZty!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0a0897d-d3fa-4958-8bd0-4a2ba49bb7e3_3435x3141.png 424w, https://substackcdn.com/image/fetch/$s_!DZty!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0a0897d-d3fa-4958-8bd0-4a2ba49bb7e3_3435x3141.png 848w, https://substackcdn.com/image/fetch/$s_!DZty!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0a0897d-d3fa-4958-8bd0-4a2ba49bb7e3_3435x3141.png 1272w, https://substackcdn.com/image/fetch/$s_!DZty!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0a0897d-d3fa-4958-8bd0-4a2ba49bb7e3_3435x3141.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Then you organize findings into categories that actually map to your system. Not generic OWASP buckets, but patterns you can grep for in your own code:</p><ul><li><p>Endpoints accepting identity parameters that don&#8217;t route through your ownership validation function. That&#8217;s a potential IDOR. You confirm it by searching the codebase for everywhere that the identity parameter flows and checking which middleware chains include the authorization check.</p></li><li><p>Webhook handlers that might not validate signatures. Your API gets callbacks from third-party providers. Does the handler verify the HMAC? Constant-time comparison? Nonce or timestamp check? You can answer all of this from the source code before sending a single request.</p></li><li><p>PATCH handlers that exist in the back-end but might not be exposed through the gateway. Routes say one thing, back-end says another. If there&#8217;s a catch-all proxy rule, the handler might still be reachable. Static analysis tells you. Dynamic testing confirms.</p></li><li><p>Mass assignment where the request body flows straight to the database without field filtering. Does your PUT handler accept audit fields, status flags, role parameters that a regular user shouldn&#8217;t touch? Read the code, trace the flow.</p></li></ul><p>Here&#8217;s the shift: you only move to dynamic testing <em>when the code confirms a gap</em>. Not before. You&#8217;re not blind-fuzzing 200 endpoints. You&#8217;re actually testing the 15 that the code tells you are worth testing.</p><p>And when you do test, you&#8217;re not throwing generic payloads. You authenticate as User A, request User B&#8217;s data, and observe the result. You craft exact parameters, supply the right tokens and the right headers. You&#8217;re not asking, &#8220;Is this endpoint vulnerable to anything?&#8221; You&#8217;re asking, &#8220;This specific code path is missing this specific check. Can I actually reach it from the outside?&#8221;</p><p>Instead of 200 findings where half are noise, you get maybe 15 confirmed, exploitable vulnerabilities. With reproduction steps. With evidence. With severity validated against the actual production environment. With the exact code location for the fix. That&#8217;s something your engineering team can actually work with.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.rotimiakinyele.ai/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://www.rotimiakinyele.ai/subscribe?"><span>Subscribe now</span></a></p><p>I recently ran this exact approach against an internal service. Static analysis mapped 46 endpoints across two repos, built the full authorization matrix, and identified 10 vulnerability categories worth investigating. Webhook handlers with no signature validation. Endpoints accepting identity params without ownership checks. Internal APIs potentially exposed through catch-all gateway rules. PATCH handlers bypassing immutability checks.</p><p>Dynamic testing then confirmed which were actually exploitable. Some were. Most weren&#8217;t, because a gateway or middleware I hadn&#8217;t accounted for was doing its job. But I <em>knew</em> before I tested. The static analysis gave me a prioritized hit list, not a pile of maybes.</p><p>The industry excitement about AI finding zero-days is warranted. The Ghost demo is impressive. Claude Code Security is impressive. Mythos will probably be more so. But the challenge was never just <em>finding</em> potential vulnerabilities. We&#8217;ve had tools generating long lists of potential issues for decades. The challenge is knowing which ones are real.</p><p>SAST alone, even AI-powered, can&#8217;t tell you that. It reads code. Code is an incomplete picture of reality. Your actual security posture depends on how the thing is deployed, how it&#8217;s configured, what sits in front of it, what happens at runtime.</p><p>This is the loop: static analysis builds the map, authorization matrix shows where the gaps are, dynamic testing tells you which gaps are actually exploitable. What you end up with is a short list of things that are actually broken, with proof.</p><p>I&#8217;m building this. I think everyone should be.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7vb4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5cbcc1c-87a0-498c-91c8-86ce94ae95c3_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7vb4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5cbcc1c-87a0-498c-91c8-86ce94ae95c3_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!7vb4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5cbcc1c-87a0-498c-91c8-86ce94ae95c3_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!7vb4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5cbcc1c-87a0-498c-91c8-86ce94ae95c3_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!7vb4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5cbcc1c-87a0-498c-91c8-86ce94ae95c3_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7vb4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5cbcc1c-87a0-498c-91c8-86ce94ae95c3_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f5cbcc1c-87a0-498c-91c8-86ce94ae95c3_1536x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:971,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:273886,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://derivai.substack.com/i/192540406?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5cbcc1c-87a0-498c-91c8-86ce94ae95c3_1536x1024.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!7vb4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5cbcc1c-87a0-498c-91c8-86ce94ae95c3_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!7vb4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5cbcc1c-87a0-498c-91c8-86ce94ae95c3_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!7vb4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5cbcc1c-87a0-498c-91c8-86ce94ae95c3_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!7vb4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5cbcc1c-87a0-498c-91c8-86ce94ae95c3_1536x1024.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="pullquote"><p><em><strong><a href="https://www.linkedin.com/in/rotimiakinyele/">Rotimi Akinyele</a> is the Vice President of Security at Deriv.</strong></em></p><p style="text-align: center;"><em><strong>Follow our <a href="https://www.linkedin.com/company/derivdotcom/posts/">official LinkedIn page</a> for company updates and upcoming events.</strong></em></p><p style="text-align: center;"><em><strong><a href="https://deriv.com/careers">Join our team</a> to work on projects like this.</strong></em></p></div>]]></content:encoded></item><item><title><![CDATA[Building an AI agent that actually remembers]]></title><description><![CDATA[How we fixed the AI agent's amnesia in production]]></description><link>https://www.rotimiakinyele.ai/p/building-an-ai-agent-that-actually</link><guid isPermaLink="false">https://www.rotimiakinyele.ai/p/building-an-ai-agent-that-actually</guid><dc:creator><![CDATA[Rotimi Akinyele]]></dc:creator><pubDate>Mon, 09 Feb 2026 10:14:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!aCQ-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3aa0644-37cf-47b8-a797-03edbb334310_1024x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>TL;DR</strong></p><p>We built an AI agent. It worked brilliantly until it suddenly forgot everything it had just done. Fixed it with three changes: made memory loading architectural (not optional), merged all threads into one session, and added safeguard mode to preserve context during compaction. Now the agent actually remembers.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.rotimiakinyele.ai/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Rotimi's Substack! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tCOE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F033e364a-9c14-474c-9667-0b94b87a771b_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tCOE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F033e364a-9c14-474c-9667-0b94b87a771b_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!tCOE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F033e364a-9c14-474c-9667-0b94b87a771b_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!tCOE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F033e364a-9c14-474c-9667-0b94b87a771b_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!tCOE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F033e364a-9c14-474c-9667-0b94b87a771b_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tCOE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F033e364a-9c14-474c-9667-0b94b87a771b_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/033e364a-9c14-474c-9667-0b94b87a771b_1536x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:971,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:322445,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://derivai.substack.com/i/186424002?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F033e364a-9c14-474c-9667-0b94b87a771b_1536x1024.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!tCOE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F033e364a-9c14-474c-9667-0b94b87a771b_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!tCOE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F033e364a-9c14-474c-9667-0b94b87a771b_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!tCOE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F033e364a-9c14-474c-9667-0b94b87a771b_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!tCOE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F033e364a-9c14-474c-9667-0b94b87a771b_1536x1024.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>How it started</h2><p>If you were on AI Twitter last week, you probably saw the chaos: Clawdbot became Moltbot, then became OpenClaw. Three names in one week.</p><p>The open-source AI agent project went viral 3 weeks back, then Anthropic sent a trademark request about the &#8220;Clawd&#8221; name being too close to &#8220;Claude.&#8221; Developer Peter Steinberger renamed it Moltbot (because lobsters molt, get it?). Then, in the chaos of the rename, crypto scammers hijacked his old username, fake tokens launched, and everything went sideways. Now it&#8217;s OpenClaw. Finally.</p><p>The project itself is actually useful: an autonomous AI agent that runs locally and executes tasks across messaging platforms. Not just a chatbot, but an agent that actually <em>does</em> things.</p><p>We caught the bug early. Downloaded Clawdbot (back when it was still called that), saw what it could do, and thought: &#8220;What if we built an agent that does internal audits?&#8221;</p><p>Not a chatbot that answers audit questions. <strong>A full autonomous agent that extracts regulatory requirements, designs test procedures, collaborates across Slack threads, and maintains context over days-long conversations.</strong> An AI colleague, not just a tool.</p><p>We had the agent running and set it loose. It worked beautifully. Until someone asked a question in a different Slack thread within the same channel.</p><p>The agent responded: &#8220;I don&#8217;t have access to Slack.&#8221;</p><p><strong>What the actual ****.</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!aCQ-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3aa0644-37cf-47b8-a797-03edbb334310_1024x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aCQ-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3aa0644-37cf-47b8-a797-03edbb334310_1024x1024.png 424w, https://substackcdn.com/image/fetch/$s_!aCQ-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3aa0644-37cf-47b8-a797-03edbb334310_1024x1024.png 848w, https://substackcdn.com/image/fetch/$s_!aCQ-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3aa0644-37cf-47b8-a797-03edbb334310_1024x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!aCQ-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3aa0644-37cf-47b8-a797-03edbb334310_1024x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aCQ-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3aa0644-37cf-47b8-a797-03edbb334310_1024x1024.png" width="1024" height="1024" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a3aa0644-37cf-47b8-a797-03edbb334310_1024x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1024,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1505011,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://derivai.substack.com/i/186424002?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3aa0644-37cf-47b8-a797-03edbb334310_1024x1024.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!aCQ-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3aa0644-37cf-47b8-a797-03edbb334310_1024x1024.png 424w, https://substackcdn.com/image/fetch/$s_!aCQ-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3aa0644-37cf-47b8-a797-03edbb334310_1024x1024.png 848w, https://substackcdn.com/image/fetch/$s_!aCQ-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3aa0644-37cf-47b8-a797-03edbb334310_1024x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!aCQ-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3aa0644-37cf-47b8-a797-03edbb334310_1024x1024.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>You just had a fifty-message conversation. The agent posted detailed findings, created comprehensive reports. And now it claims it&#8217;s never seen Slack before?</p><p>Welcome to the world of AI agent amnesia. This is the story of how we fixed it and what we learned about building agents that actually remember.</p><div><hr></div><h2>The three problems</h2><h3>1. Memory loading was just advice</h3><p>Our <code>AGENTS.md</code> file said:</p><blockquote><p>&#8220;Before doing anything else: Read SOUL.md, USER.md, and memory/YYYY-MM-DD.md&#8221;</p></blockquote><p>These were just <em>instructions</em> - text in a prompt. The agent could ignore them. And it did. Sometimes it would read the memory files. Sometimes it wouldn&#8217;t.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ucBp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F281c6c3a-855b-45a9-8252-fb891405dc74_1024x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ucBp!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F281c6c3a-855b-45a9-8252-fb891405dc74_1024x1024.png 424w, https://substackcdn.com/image/fetch/$s_!ucBp!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F281c6c3a-855b-45a9-8252-fb891405dc74_1024x1024.png 848w, https://substackcdn.com/image/fetch/$s_!ucBp!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F281c6c3a-855b-45a9-8252-fb891405dc74_1024x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!ucBp!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F281c6c3a-855b-45a9-8252-fb891405dc74_1024x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ucBp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F281c6c3a-855b-45a9-8252-fb891405dc74_1024x1024.png" width="1024" height="1024" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/281c6c3a-855b-45a9-8252-fb891405dc74_1024x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1024,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2125249,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://derivai.substack.com/i/186424002?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F281c6c3a-855b-45a9-8252-fb891405dc74_1024x1024.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!ucBp!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F281c6c3a-855b-45a9-8252-fb891405dc74_1024x1024.png 424w, https://substackcdn.com/image/fetch/$s_!ucBp!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F281c6c3a-855b-45a9-8252-fb891405dc74_1024x1024.png 848w, https://substackcdn.com/image/fetch/$s_!ucBp!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F281c6c3a-855b-45a9-8252-fb891405dc74_1024x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!ucBp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F281c6c3a-855b-45a9-8252-fb891405dc74_1024x1024.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Memory loading was advice, not architecture.</p><h3>2. Threads broke everything</h3><p>Clawdbot&#8217;s default: Each Slack thread = separate session.</p><pre><code><code>Thread 1: agent:main:slack:channel:xxxxxxxxxx:thread:1234
Thread 2: agent:main:slack:channel:xxxxxxxxxx:thread:5678
</code></code></pre><p>Makes sense for general chat. Pizza recommendations shouldn&#8217;t share context with database migrations.</p><p>But for audit work? Threads are just organizational tools. When someone says &#8220;Re-extract Chapter 1&#8221; in Thread 2, they&#8217;re continuing the audit from Thread 1.</p><p>Different thread = complete amnesia.</p><h3>3. Compaction threw away the good stuff</h3><p>When the context window fills up (~180K tokens), Clawdbot compacts older messages. Necessary - you can&#8217;t keep infinite history.</p><p>But without saving critical information <em>before</em> compaction, important details just vanished.</p><div><hr></div><h2>The three solutions</h2><h3>Solution 1: Custom memory hooks</h3><p><strong>The insight: Make memory loading architectural, not optional.</strong></p><p>Built a hook that triggers on every message, loads memory files, and injects them <em>before</em> the LLM sees anything.</p><pre><code><code>export default async function memoryContextHook(event) {
    if (event.type !== 'message' || event.action !== 'before') return;
    
    const memoryContext = await loadMemoryContextCached(workspaceDir);
    if (memoryContext) {
        ctx.Body = `${memoryContext}${ctx.Body || ''}`;
    }
}
</code></code></pre><p><strong>Before:</strong> Message &#8594; LLM decides &#8594; (maybe reads memory) &#8594; Respond</p><p><strong>After:</strong> Message &#8594; <strong>LOAD MEMORY</strong> &#8594; Inject into context &#8594; Respond</p><p>Memory loading is now <strong>deterministic</strong>. The agent can&#8217;t forget because the memory is already there.</p><p><strong>Trade-off:</strong> Adds ~2-5K tokens per message. Worth it. <strong>An agent that remembers is infinitely more useful than one that saves tokens.</strong></p><h3>Solution 2: Channel-wide sessions</h3><p><strong>The insight: Threads aren&#8217;t conversation boundaries &#8212; they&#8217;re organizational tools.</strong></p><p>One line change in <code>session-key.js</code>:</p><pre><code><code>// BEFORE:
const useSuffix = params.useSuffix ?? true;

// AFTER:
const useSuffix = params.useSuffix ?? false;
</code></code></pre><p><strong>Result:</strong> All threads in a channel share one session. Full context continuity.</p><h3>Solution 3: Safeguard mode + memory flush</h3><p><strong>The insight: Save critical info before compaction throws it away.</strong></p><p>We configured Clawdbot&#8217;s compaction to use &#8220;safeguard mode&#8221;:</p><pre><code><code>{
  "compaction": {
    "mode": "safeguard",
    "memoryFlush": {
      "enabled": true
    }
  }
}</code></code></pre><p><strong>Safeguard mode</strong> keeps the last 10-15 messages in full detail (active memory) while compressing older messages into a summary. When compaction triggers:</p><ol><li><p><strong>Memory flush runs first</strong> - Agent extracts critical information: requirements, evidence mappings, test procedures, decisions, findings, ongoing work</p></li><li><p><strong>Saves to memory files</strong> - Writes to daily memory files (<code>memory/YYYY-MM-DD.md</code>)</p></li><li><p><strong>Active memory preserved</strong> - Recent 10-15 messages stay in full detail</p></li><li><p><strong>Older messages compressed</strong> - Summarized into compact form</p></li><li><p><strong>Context available</strong> - Memory files auto-loaded via hooks on next message</p></li></ol><p>Think of it like taking notes before clearing your whiteboard. Recent messages stay in full detail, older messages get summarized, but you&#8217;ve written down everything that matters.</p><h3>Rolling memory pattern</h3><p>This creates a <strong>rolling memory system</strong>:</p><ul><li><p><strong>Active memory</strong> - Last 10-15 messages in full detail</p></li><li><p><strong>Compact summary</strong> - Older messages compressed</p></li><li><p><strong>Memory files</strong> - Critical information extracted and saved</p></li><li><p><strong>Auto-loaded context</strong> - Yesterday&#8217;s and today&#8217;s memory files injected into every message</p></li></ul><p>The agent maintains both short-term context (recent messages) and long-term memory (extracted to files), without losing critical information when the context window fills up.</p><p><strong>In practice:</strong> A three-day audit with hundreds of messages stays coherent. The agent remembers requirements extracted on Day 1, references evidence mapped on Day 2, and builds on test procedures designed earlier - even though the original messages are long compressed.</p><div><hr></div><h2>The complete architecture</h2><pre><code><code>Message arrives
    &#8595;
Derive session: agent:main:slack:channel:xxxxxxxxxx
(All threads share this session)
    &#8595;
[HOOK] Load memory files:
  - AGENTS.md
  - MEMORY.md  
  - memory/today.md
  - memory/yesterday.md
    &#8595;
Inject memory into message body
    &#8595;
LLM processes with full context
    &#8595;
[On compaction] 
  Memory flush &#8594; Save critical info
  Keep last 10-15 messages in full detail (active memory)
  Compress older messages into summary
</code></code></pre><p><strong>Four layers of context:</strong></p><ol><li><p><strong>Active memory</strong> - Last 10-15 messages in full detail (safeguard mode)</p></li><li><p><strong>Compact summary</strong> - Older messages compressed (safeguard mode)</p></li><li><p><strong>Memory files</strong> - Persistent context loaded via hooks</p></li><li><p><strong>Memory flush</strong> - Critical info saved during compaction</p></li></ol><p>This architecture ensures the agent has:</p><ul><li><p><strong>Immediate context</strong> from recent messages (active memory)</p></li><li><p><strong>Historical context</strong> from older messages (compact summary)</p></li><li><p><strong>Persistent context</strong> from workspace files (memory hooks)</p></li><li><p><strong>Preserved context</strong> across compactions (memory flush)</p></li></ul><div><hr></div><h2>Before and after</h2><h3>Before</h3><pre><code><code>Thread 1:
You: "What audit are you working on?"
Agent: "ISO 27001:2022 audit. 317 requirements extracted..."

Thread 2:
Teammate: "Re-extract Chapter 1"
Agent: "I don't have access to Slack or context about this audit."
</code></code></pre><h3>After</h3><pre><code><code>Thread 1:
You: "What audit are you working on?"
Agent: "ISO 27001:2022 audit. 317 requirements extracted..."

Thread 2:
Teammate: "Re-extract Chapter 1"
Agent: "I'll re-extract Chapter 1 from ISO 27001:2022..."
</code></code></pre><p>The agent just... works. Conversations across threads, hours-long breaks - it maintains continuity.</p><div><hr></div><h2>What we learned</h2><h3>1. Architecture &gt; Instructions</h3><p>You can&#8217;t rely on prompts. We spent days tweaking instructions: &#8220;Remember to read memory.&#8221; &#8220;Always load context first.&#8221;</p><p>None of it worked reliably.</p><p>The memory hook fixed it immediately. <strong>If something is critical, make it architectural.</strong></p><h3>2. Default behaviors matter</h3><p>Clawdbot&#8217;s thread isolation default makes sense for general chat. But for focused project work, it was completely wrong.</p><p>One line change solved our biggest problem. <strong>Question your defaults.</strong></p><h3>3. Context management is a system</h3><p>None of these solutions worked alone:</p><ul><li><p>Memory hooks without channel-wide sessions &#8594; lost context across threads</p></li><li><p>Channel-wide sessions without memory flush &#8594; lost context after compaction</p></li><li><p>Memory flush without hooks &#8594; agent forgot to load the flushed memory</p></li></ul><p><strong>You need all three layers working together.</strong></p><h3>4. Token costs are worth it</h3><p>Memory hooks add 2-5K tokens per message. For a high-volume chatbot, that&#8217;s expensive.</p><p>But for multi-day audit work? The cost is irrelevant compared to having an agent that remembers.</p><p><strong>Optimize for usefulness first, efficiency second.</strong></p><h3>5. Test in real workflows</h3><p>Everything looked great in testing. Then we started actual audit work and everything broke.</p><p>The edge cases only appear under real conditions: multi-thread conversations, day-long sessions, multiple collaborators.</p><div><hr></div><h2>Implementation</h2><p><strong>Full implementation available on GitHub:</strong> <a href="https://github.com/rotimi-deriv/clawdbot-memory-continuity/">clawdbot-memory-continuity</a></p><p><strong>Quick version:</strong></p><ol><li><p><strong>Custom hook:</strong> <code>~/.clawdbot/hooks/memory-context/index.js</code> (~130 lines)</p></li><li><p><strong>Core modification:</strong> <code>/opt/homebrew/lib/node_modules/clawdbot/dist/routing/session-key.js</code> (line 70, one boolean flip)</p></li><li><p><strong>Configuration:</strong> <code>~/.clawdbot/clawdbot.json</code> (enable safeguard mode + memory flush)</p></li></ol><p><strong>Maintenance:</strong> Hook survives updates. Core modification needs re-applying after <code>npm update</code> (30 seconds with included script).</p><p>See the <a href="https://github.com/rotimi-deriv/clawdbot-memory-continuity/">GitHub repository</a> for:</p><ul><li><p>Complete installation guide</p></li><li><p>Auto-apply script for core patch</p></li><li><p>Configuration examples</p></li><li><p>Troubleshooting guide</p></li><li><p>Maintenance instructions</p></li></ul><div><hr></div><h2>When to use this</h2><p><strong>Works great for:</strong></p><ul><li><p>Focused project channels</p></li><li><p>Long-running workflows (audits, investigations)</p></li><li><p>Collaborative work requiring context</p></li><li><p>Professional agents (auditors, analysts)</p></li></ul><p><strong>Might not work for:</strong></p><ul><li><p>High-traffic general channels</p></li><li><p>Independent support threads</p></li><li><p>Cost-sensitive high-volume applications</p></li><li><p>One-off conversations</p></li></ul><p><strong>The key question:</strong> Do threads represent separate conversations or organizational structure within one conversation?</p><p>Separate &#8594; use thread isolation (Clawdbot default)</p><p>Organizational &#8594; use channel-wide sessions (our modification)</p><div><hr></div><h3>Maintenance after updates</h3><p>When you run <code>npm install -g clawdbot@latest</code>:</p><p><strong>What survives:</strong></p><ul><li><p>&#9989; Custom hooks</p></li><li><p>&#9989; Configuration</p></li></ul><p><strong>What gets overwritten:</strong></p><ul><li><p>&#10060; <code>session-key.js</code> modification</p></li></ul><p><strong>To re-apply:</strong></p><pre><code><code># 1. Backup new version
cp /opt/homebrew/lib/node_modules/clawdbot/dist/routing/session-key.js \
   /opt/homebrew/lib/node_modules/clawdbot/dist/routing/session-key.js.backup

# 2. Edit line 70: change useSuffix ?? true to useSuffix ?? false

# 3. Restart gateway
clawdbot gateway stop
clawdbot gateway install
</code></code></pre><p><strong>Or use the auto-apply script from the GitHub repo:</strong></p><pre><code><code>cd clawdbot-memory-continuity
./scripts/apply-patch.sh
</code></code></pre><div><hr></div><h3>Verification</h3><p><strong>Check memory loading:</strong></p><pre><code><code>clawdbot logs --follow | grep memory-context
</code></code></pre><p>Should see:</p><pre><code><code>[memory-context] Injected memory context into message body
</code></code></pre><p><strong>Check session keys:</strong></p><pre><code><code>clawdbot logs --follow | grep -E "session.*slack.*channel"
</code></code></pre><p>Should see the same session key for all messages in a channel, with no <code>:thread:</code> suffix.</p><div><hr></div><p><em>Sometimes the best solutions are the simplest: Make memory architectural, not optional. Make threads organizational, not isolating. Make preservation automatic, not manual.</em></p><p><em>That&#8217;s how you build an agent that actually remembers.</em></p><div class="pullquote"><p><em><strong><a href="https://www.linkedin.com/in/rotimiakinyele/">Rotimi Akinyele</a> is the Vice President of Security at Deriv.</strong></em></p><p><em><strong>Follow our <a href="https://www.linkedin.com/company/derivdotcom/posts/">official LinkedIn page</a> for company updates and upcoming events.</strong></em></p><p><em><strong><a href="https://deriv.com/careers">Join our team</a> to work on projects like this.</strong></em></p></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.rotimiakinyele.ai/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Rotimi's Substack! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Securing AI-assisted engineering ]]></title><description><![CDATA[A new 5-part series on building code safely at scale]]></description><link>https://www.rotimiakinyele.ai/p/securing-ai-assisted-engineering</link><guid isPermaLink="false">https://www.rotimiakinyele.ai/p/securing-ai-assisted-engineering</guid><dc:creator><![CDATA[Rotimi Akinyele]]></dc:creator><pubDate>Tue, 09 Dec 2025 09:58:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!GlLh!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32b1cd5c-ef7a-4dff-9a5f-17db02da9724_2000x1379.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GlLh!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32b1cd5c-ef7a-4dff-9a5f-17db02da9724_2000x1379.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GlLh!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32b1cd5c-ef7a-4dff-9a5f-17db02da9724_2000x1379.jpeg 424w, https://substackcdn.com/image/fetch/$s_!GlLh!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32b1cd5c-ef7a-4dff-9a5f-17db02da9724_2000x1379.jpeg 848w, https://substackcdn.com/image/fetch/$s_!GlLh!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32b1cd5c-ef7a-4dff-9a5f-17db02da9724_2000x1379.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!GlLh!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32b1cd5c-ef7a-4dff-9a5f-17db02da9724_2000x1379.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GlLh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32b1cd5c-ef7a-4dff-9a5f-17db02da9724_2000x1379.jpeg" width="1456" height="1004" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/32b1cd5c-ef7a-4dff-9a5f-17db02da9724_2000x1379.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1004,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:146066,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://derivai.substack.com/i/180946290?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32b1cd5c-ef7a-4dff-9a5f-17db02da9724_2000x1379.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!GlLh!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32b1cd5c-ef7a-4dff-9a5f-17db02da9724_2000x1379.jpeg 424w, https://substackcdn.com/image/fetch/$s_!GlLh!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32b1cd5c-ef7a-4dff-9a5f-17db02da9724_2000x1379.jpeg 848w, https://substackcdn.com/image/fetch/$s_!GlLh!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32b1cd5c-ef7a-4dff-9a5f-17db02da9724_2000x1379.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!GlLh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32b1cd5c-ef7a-4dff-9a5f-17db02da9724_2000x1379.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>As an organisation that moves fast on AI and low-code/no-code development, we produce a large amount of code/solutions very quickly.</strong> That speed is a strength, but it also means we have to pay close attention to the places where mistakes can hide. The Deriv security team has spent the last year examining how AI-assisted engineering works in practice, identifying potential pitfalls, and developing safer practices around it.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!pJqX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff135ecc1-81ba-44a4-803d-96d1cf4c478d_2816x1536.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pJqX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff135ecc1-81ba-44a4-803d-96d1cf4c478d_2816x1536.png 424w, https://substackcdn.com/image/fetch/$s_!pJqX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff135ecc1-81ba-44a4-803d-96d1cf4c478d_2816x1536.png 848w, https://substackcdn.com/image/fetch/$s_!pJqX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff135ecc1-81ba-44a4-803d-96d1cf4c478d_2816x1536.png 1272w, https://substackcdn.com/image/fetch/$s_!pJqX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff135ecc1-81ba-44a4-803d-96d1cf4c478d_2816x1536.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pJqX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff135ecc1-81ba-44a4-803d-96d1cf4c478d_2816x1536.png" width="1456" height="794" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f135ecc1-81ba-44a4-803d-96d1cf4c478d_2816x1536.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:794,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:4747558,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://derivai.substack.com/i/180946290?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff135ecc1-81ba-44a4-803d-96d1cf4c478d_2816x1536.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!pJqX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff135ecc1-81ba-44a4-803d-96d1cf4c478d_2816x1536.png 424w, https://substackcdn.com/image/fetch/$s_!pJqX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff135ecc1-81ba-44a4-803d-96d1cf4c478d_2816x1536.png 848w, https://substackcdn.com/image/fetch/$s_!pJqX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff135ecc1-81ba-44a4-803d-96d1cf4c478d_2816x1536.png 1272w, https://substackcdn.com/image/fetch/$s_!pJqX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff135ecc1-81ba-44a4-803d-96d1cf4c478d_2816x1536.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>AI-assisted coding is in an awkward phase. It feels helpful and clever, and it saves time, so it quietly becomes part of everything we build. But the more we rely on it, the more we see a simple truth. <strong>AI will default to generating code that works, not code that is secure</strong>, unless you explicitly guide it. It has never lived through an outage. It has never been paged at 2 am with news that one of your externally exposed apps has been breached.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.rotimiakinyele.ai/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Rotimi's Substack! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>It just predicts what looks right. That is the gap.</p><p>Most AI-introduced vulnerabilities are small. They look reasonable. They slip past reviews. They compile cleanly. They appear harmless until the right scenario triggers them or the wrong person finds them first. This is why guardrails are not optional. They are the minimum layer of safety.</p><p>So the Deriv Security team is launching a new 5-part series on securing AI-assisted engineering. Not because the industry needs more talk, but because it needs a clear, practical framework for a world where code is no longer written only by humans and old habits no longer fully apply.</p><p>Here is what the series will cover:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!CVIj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c56eefa-2438-4cb7-afd3-9275937ce858_1024x1024.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!CVIj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c56eefa-2438-4cb7-afd3-9275937ce858_1024x1024.webp 424w, https://substackcdn.com/image/fetch/$s_!CVIj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c56eefa-2438-4cb7-afd3-9275937ce858_1024x1024.webp 848w, https://substackcdn.com/image/fetch/$s_!CVIj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c56eefa-2438-4cb7-afd3-9275937ce858_1024x1024.webp 1272w, https://substackcdn.com/image/fetch/$s_!CVIj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c56eefa-2438-4cb7-afd3-9275937ce858_1024x1024.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!CVIj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c56eefa-2438-4cb7-afd3-9275937ce858_1024x1024.webp" width="1024" height="1024" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6c56eefa-2438-4cb7-afd3-9275937ce858_1024x1024.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1024,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:78732,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/webp&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://derivai.substack.com/i/180946290?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c56eefa-2438-4cb7-afd3-9275937ce858_1024x1024.webp&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!CVIj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c56eefa-2438-4cb7-afd3-9275937ce858_1024x1024.webp 424w, https://substackcdn.com/image/fetch/$s_!CVIj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c56eefa-2438-4cb7-afd3-9275937ce858_1024x1024.webp 848w, https://substackcdn.com/image/fetch/$s_!CVIj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c56eefa-2438-4cb7-afd3-9275937ce858_1024x1024.webp 1272w, https://substackcdn.com/image/fetch/$s_!CVIj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c56eefa-2438-4cb7-afd3-9275937ce858_1024x1024.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>The 5-part series</h2><p><strong>Part 1: Guardrails for AI-assisted and low-code/no-code development (published)</strong></p><p>The <a href="https://derivai.substack.com/p/threat-modelling-for-multi-low-codeno?r=4187fc">essential boundaries that keep AI-generated code and LCNC workflows safe</a>. What they must always enforce, what they must never allow, and why the safest place to stop failures is at the point of generation before the code or workflow enters an opaque runtime you can no longer fully control.</p><p><strong>Part 2: Enforcing secure defaults inside AI development tools</strong></p><p>The practical mechanics. How to embed rules directly into IDEs so insecure code never reaches a repository in the first place.</p><p><strong>Part 3: AI-powered code review and automated scanning</strong></p><p>How AI can catch mistakes that slip past humans. A look at real patterns, real issues, and blind spots that appear when humans assume AI output is safe.</p><p><strong>Part 4: Real examples of AI-introduced vulnerabilities &amp; pentesting AI/LCNC solutions</strong></p><p>Small snippets that seem harmless but have real-world consequences. For example:</p><pre><code><code>// looks fine at a glance
const user = req.query.user;
const result = await db.query(
  `SELECT * FROM clients WHERE name = &#8216;${user}&#8217;`
);</code></code></pre><p>Compared to a guarded version:</p><pre><code><code>const schema = z.object({ user: z.string().min(1).max(50) });
const parsed = schema.safeParse(req.query);
if (!parsed.success) return res.status(400).send(&#8221;Invalid input&#8221;);

const result = await db.query(
  &#8220;SELECT * FROM clients WHERE name = $1&#8221;,
  [parsed.data.user]
);</code></code></pre><p>One trusts the world too much. The other knows the world can be complicated and full of people who type things they should not.</p><p><strong>Part 5: A blueprint for responsible AI-driven engineering</strong></p><p>How all the pieces fit together. A practical model that combines guardrails, IDE enforcement, PR scanning, LCNC governance, secret lifecycle automation, runtime isolation, observability, and AI change tracking into one secure engineering workflow. This part outlines the architecture, approval flows, monitoring pipelines, and habits needed to operate AI-assisted development safely at scale.</p><h2>Why this matters</h2><p>We now generate code faster than we can understand it. Humans write some of it. AI writes the rest. But only one of them understands consequences.</p><p>Most AI-generated code works, and that is the danger. When something works, you trust it. When you trust it, you stop checking. That is how small problems grow quietly into serious ones.</p><p>AI is helping us build faster. The real challenge is maintaining safety at the same pace.</p><div class="pullquote"><p><a href="https://www.linkedin.com/in/rotimiakinyele/">Rotimi Akinyele</a> is the Vice President of Security at Deriv.</p><p><em>Follow our <a href="https://www.linkedin.com/company/derivdotcom/posts/">official LinkedIn page</a> for company updates and upcoming events.</em></p></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.rotimiakinyele.ai/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Rotimi's Substack! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item></channel></rss>