<?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: Renan Souza</title>
    <description>The latest articles on DEV Community by Renan Souza (@oitydobcrypto).</description>
    <link>https://dev.to/oitydobcrypto</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%2F4094633%2F86dd2d9b-4e5c-44f5-9108-c104f91dab3d.png</url>
      <title>DEV Community: Renan Souza</title>
      <link>https://dev.to/oitydobcrypto</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/oitydobcrypto"/>
    <language>en</language>
    <item>
      <title>From community review to a shipped security hardening with Codex</title>
      <dc:creator>Renan Souza</dc:creator>
      <pubDate>Tue, 25 Aug 2026 18:24:37 +0000</pubDate>
      <link>https://dev.to/oitydobcrypto/from-community-review-to-a-shipped-security-hardening-with-codex-3g1p</link>
      <guid>https://dev.to/oitydobcrypto/from-community-review-to-a-shipped-security-hardening-with-codex-3g1p</guid>
      <description>&lt;p&gt;I’ve been building a small open-source TypeScript toolkit called &lt;strong&gt;Tenant Evidence Kit&lt;/strong&gt; for private, multi-tenant evidence workflows on Supabase.&lt;/p&gt;

&lt;p&gt;The project started from a very specific problem:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How do you attach photos, documents, or other evidence to a business object without making files public, leaking tenant data, or duplicating authorization logic across the application?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The toolkit keeps that infrastructure deliberately small and domain-agnostic.&lt;/p&gt;

&lt;p&gt;It currently provides:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;private Supabase Storage;&lt;/li&gt;
&lt;li&gt;evidence metadata separated from file bytes;&lt;/li&gt;
&lt;li&gt;tenant isolation with Row Level Security;&lt;/li&gt;
&lt;li&gt;short-lived signed URLs;&lt;/li&gt;
&lt;li&gt;compensating cleanup when metadata persistence fails;&lt;/li&gt;
&lt;li&gt;reference migrations for tenant membership and evidence authorization.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But the interesting part of the latest release was not the original implementation.&lt;/p&gt;

&lt;p&gt;It was the review loop.&lt;/p&gt;

&lt;h2&gt;
  
  
  A community review found real problems
&lt;/h2&gt;

&lt;p&gt;I shared the project with the Supabase community and received a detailed security review.&lt;/p&gt;

&lt;p&gt;The feedback raised several important questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;roles existed, but authorization was still too close to flat membership;&lt;/li&gt;
&lt;li&gt;evidence deletion needed a more explicit privilege boundary;&lt;/li&gt;
&lt;li&gt;the lack of UPDATE support needed to be intentional rather than accidental;&lt;/li&gt;
&lt;li&gt;RLS assumptions around &lt;code&gt;service_role&lt;/code&gt;, table owners and &lt;code&gt;BYPASSRLS&lt;/code&gt; needed to be documented;&lt;/li&gt;
&lt;li&gt;authorization needed behavioral tests, not only static SQL assertions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That feedback was good enough that I didn’t want to treat it as a documentation exercise.&lt;/p&gt;

&lt;p&gt;I turned it into an implementation task.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using Codex as the implementation loop
&lt;/h2&gt;

&lt;p&gt;Instead of asking Codex something broad like:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Improve the security.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I gave it a tightly scoped issue with explicit acceptance criteria.&lt;/p&gt;

&lt;p&gt;The workflow became:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;community review → scoped issue → Codex implementation → human review → correction pass → CI → release&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The first implementation was useful, but the review still found problems.&lt;/p&gt;

&lt;p&gt;For example, it initially changed existing INSERT behavior and modified only the original migration, which would not safely upgrade installations that had already applied it.&lt;/p&gt;

&lt;p&gt;So the task went back for another pass.&lt;/p&gt;

&lt;p&gt;That second pass produced the version I actually wanted to ship.&lt;/p&gt;

&lt;h2&gt;
  
  
  What changed in v0.1.3
&lt;/h2&gt;

&lt;p&gt;Tenant Evidence Kit &lt;code&gt;v0.1.3&lt;/code&gt; now includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;operation-specific evidence permissions;&lt;/li&gt;
&lt;li&gt;evidence deletion restricted to &lt;code&gt;owner&lt;/code&gt; and &lt;code&gt;admin&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;existing read/create behavior preserved for active members;&lt;/li&gt;
&lt;li&gt;evidence metadata explicitly append-only;&lt;/li&gt;
&lt;li&gt;a separate &lt;code&gt;0002_authorization_hardening.sql&lt;/code&gt; migration for existing installations;&lt;/li&gt;
&lt;li&gt;real Supabase/pgTAP authorization tests;&lt;/li&gt;
&lt;li&gt;CI coverage for database authorization;&lt;/li&gt;
&lt;li&gt;explicit documentation of the RLS execution boundary, including &lt;code&gt;service_role&lt;/code&gt;, table owners and &lt;code&gt;BYPASSRLS&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Storage and Postgres now use the same permission model for evidence operations.&lt;/p&gt;

&lt;p&gt;The goal was not to build a large authorization framework.&lt;/p&gt;

&lt;p&gt;It was to make the existing security boundary more explicit, testable and upgrade-safe.&lt;/p&gt;

&lt;h2&gt;
  
  
  One thing I learned
&lt;/h2&gt;

&lt;p&gt;The most useful part of using an agent here was not code generation.&lt;/p&gt;

&lt;p&gt;It was giving the agent a &lt;strong&gt;reviewable engineering boundary&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A vague request like “make this more secure” leaves too much room for interpretation.&lt;/p&gt;

&lt;p&gt;A task like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;preserve current read/create behavior;&lt;/li&gt;
&lt;li&gt;restrict sensitive deletion;&lt;/li&gt;
&lt;li&gt;add an upgrade migration;&lt;/li&gt;
&lt;li&gt;prove the authorization model with behavioral tests;&lt;/li&gt;
&lt;li&gt;document the RLS bypass boundary;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;is much easier to evaluate.&lt;/p&gt;

&lt;p&gt;The human review step still mattered.&lt;/p&gt;

&lt;p&gt;A lot.&lt;/p&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;p&gt;GitHub:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/oitydob-crypto/tenant-evidence-kit" rel="noopener noreferrer"&gt;https://github.com/oitydob-crypto/tenant-evidence-kit&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;npm:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/tenant-evidence-kit" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/tenant-evidence-kit&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Current release: &lt;strong&gt;v0.1.3&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I’d be interested to hear how other developers are structuring agent tasks when the input is &lt;strong&gt;external technical review&lt;/strong&gt; rather than a normal feature request.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>typescript</category>
      <category>supabase</category>
      <category>security</category>
    </item>
  </channel>
</rss>
