<?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:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Isaac Tonyloi on Medium]]></title>
        <description><![CDATA[Stories by Isaac Tonyloi on Medium]]></description>
        <link>https://medium.com/@isaactonyloi-it?source=rss-6f3c3436c8d3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*lvwitsam-4zqYtRsImBASQ.jpeg</url>
            <title>Stories by Isaac Tonyloi on Medium</title>
            <link>https://medium.com/@isaactonyloi-it?source=rss-6f3c3436c8d3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 16:43:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@isaactonyloi-it/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[One warehouse, six audiences- Branch-level analytics for a Kenyan bank]]></title>
            <link>https://isaactonyloi-it.medium.com/one-warehouse-six-audiences-branch-level-analytics-for-a-kenyan-bank-485850101836?source=rss-6f3c3436c8d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/485850101836</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[dbt]]></category>
            <category><![CDATA[financial-analysis]]></category>
            <category><![CDATA[metabase]]></category>
            <category><![CDATA[data-analysis]]></category>
            <dc:creator><![CDATA[Isaac Tonyloi]]></dc:creator>
            <pubDate>Thu, 29 Oct 2026 18:53:27 GMT</pubDate>
            <atom:updated>2026-10-29T18:53:27.147Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>The problem with one set of dashboards</strong></h3><p>A Kenyan bank with branches from Mombasa to Busia wants every regional manager looking at the same scorecard, but each of them should only see their own region’s customers and loans. The usual answer is a region filter on every dashboard, which works until someone forgets to set it, opens the SQL editor, or exports a question someone else built.</p><p>I built the alternative for a fictional bank, Mavuno Bank, and enforced the rule in the warehouse itself. Because Postgres decides which rows each login can read, the rule holds in the dashboards, in Metabase’s query builder and in hand-written SQL alike, and no dashboard needs a filter to stay safe.</p><h3>At a glance</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rGDYo0O4Wbcigfa2DnHH0Q.png" /></figure><h3>What was built</h3><p>One dbt project turns a core-banking extract into a month-end loan book classified with the Central Bank of Kenya’s arrears bands, plus a branch scorecard, roll rates, vintage curves, a collections worklist and a data quality register. Every one of those tables carries a region code and a row-level security policy.</p><p>One YAML file defines the Metabase layer of models, metrics and dashboards, and a deploy script publishes it six times, once for head office and once for each region, each copy on a connection that logs in as a different warehouse reader.</p><p>The access rule was proven rather than assumed. One script logs in to Postgres as each reader and counts what it can see, and another signs in to Metabase as a test user for each audience. Every regional user sees only their own region, even when they write their own SQL, and is refused on every other audience’s connection and question.</p><h3>What the data shows</h3><p>Lending booked in a new branch’s first year went bad at almost three times the rate of everything else, at 24.1% against 8.5% after twelve months on the books. A four-month delay in county salaries pushed 41.6% of county employees’ check-off loans into the Watch class, and almost all of it cured within three months, which made it a payroll problem rather than a credit one.</p><p>Across the bank, the non-performing loan ratio rose from 15.5% to 16.7% through 2024 and fell to 13.6% by December 2025, close to the path the sector as a whole reported.</p><h3>A fictional bank with realistic numbers</h3><p>No bank publishes customer-level data, so Mavuno Bank’s data is simulated, but every headline figure is scaled to published Kenyan banking numbers. A seeded Python simulator writes the same seven files a nightly core-banking extract would deliver: branches, customers, accounts, transactions, loans, repayment schedules and repayments.</p><p>The branches sit in real towns, grouped into five regions: Nairobi Metro, Mount Kenya, Coast, Rift Valley, and Western &amp; Nyanza. The customer mix follows the regions too, so farmers make up about a quarter of individual customers in Mount Kenya and the Rift Valley but only 4% in Nairobi.</p><h3>How the simulator behaves</h3><p>Customers are generated first, 22,000 who joined before 2023 and about 235 a month after that, and each gets a segment, an income, a home branch and a personal risk factor. Every account then runs month by month with a real running balance. Salaries, cooperative payments and deposits come in, spending goes out, and a withdrawal can never take a balance below zero, so the extract’s balance column is internally consistent.</p><p>Loans are the heart of it. Each month, a loan that is still paying can default with a probability set by its product, then multiplied by the state of the economy that month, a branch effect, a loan officer effect and the borrower’s own risk. The economy curve rises through 2024 and eases in 2025, following the shape of the sector’s NPL trend.</p><p>A performing loan pays on time 87% of the time, pays 1 to 25 days late 9.5% of the time, and skips an instalment and catches up the next month in the remaining cases. A defaulted loan cures with a small monthly probability, makes occasional part-payments, and is written off between 540 and 1,260 days past due, which reflects how slowly Kenyan banks write loans off. Mobile loans are written off at 180 days.</p><h3>Calibration</h3><p>The simulator had to be tuned four times before the loan book behaved like a Kenyan one. The first run produced a non-performing loan ratio of about 7%, less than half the sector’s level, and deposits that doubled in three years.</p><p>Raising default rates, holding bad loans longer before write-off, flattening the economic cycle and slowing deposit growth brought it into line. The counter share needed tuning too, because the first run left 13% of transactions in the banking hall.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qvgdE9c1raxx2x1RTIw1IQ.png" /></figure><p>Sources: the <a href="https://eastleighvoice.co.ke/loan%20defaults%20kenya/195609/loan-defaults-surged-to-17-per-cent-in-2024-due-to-tough-business-climate---cbk">CBK figures as reported by Eastleigh Voice</a>, <a href="https://www.kenyans.co.ke/featured/110146-co-op-bank-records-ksh348-billion-profits-2024-its-highest-history">Co-op Bank’s 2024 results as reported by Kenyans.co.ke</a>, and the <a href="https://www.centralbank.go.ke/wp-content/uploads/2016/08/PRUDENTIAL-GUIDELINES.pdf">CBK Prudential Guidelines</a>.</p><p>By December 2025 the bank holds KES 18.5 billion of loans against KES 26.0 billion of deposits.</p><h3>Scenarios built in</h3><p>Three scenarios were built into the simulation so the analysis would have something real to find. Branches opened in 2024 were pushed to originate three times the normal volume in their first year, and that lending carries 2.6 times the usual default risk.</p><p>County government salaries ran late from March to June 2024, arriving 30 to 55 days after payday. That delays check-off loan repayments, which come straight out of payroll, without the borrowers being any less able to pay.</p><p>One Nairobi branch, Moi Avenue, closed at the end of June 2025 and its book moved to Kenyatta Avenue. Anything dated after the closure has to report to the branch that absorbed it.</p><h3>Faults built in</h3><p>The extract also arrives with the faults a real one has, and the pipeline has to catch every one of them:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ijMMRBv6XQVRSgGe0lvD9A.png" /></figure><h3>How the pieces fit</h3><p>The extract flows through a Postgres warehouse built with dbt into Metabase, and the access rule sits in the middle, inside the warehouse.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k5J6tCOPRDJblpQUNKPs1g.png" /></figure><h3>Loading the extract</h3><p>A Python loader copies every file into a raw schema with every column as text, so a malformed value can never stop a load and all typing happens in dbt where it can be tested. It uses Postgres COPY and records each file&#39;s SHA-256, size and row count in a raw._loads manifest, then skips any file whose checksum hasn&#39;t changed. The full 9.4 million rows land in 22 seconds.</p><p>When a file does change, the loader empties and refills the table in place rather than dropping it, because dbt’s staging views depend on the raw tables and Postgres won’t drop a table that a view still reads.</p><h3>Staging: types, duplicates and personal data</h3><p>Staging is where the extract’s mess is dealt with, and it is the last place names, ID numbers and phone numbers exist. The transactions model keeps one row per transaction ID with distinct on (txn_id), which removes the 3,974 rows the extract job wrote twice, and it is materialised as an indexed table because everything downstream reads it.</p><p>The customer model reduces personal data to what analysis needs. A national ID becomes a SHA-256 hash, which is enough to spot the same person under two customer numbers. Phone numbers in any of the four formats found in the extract are normalised to +2547… or +2541…. A KRA PIN is valid only if it matches ^A\d{9}[A-Z]$ for an individual or ^P\d{9}[A-Z]$ for a business, and a birth date is plausible only if the customer was at least 18 when they joined.</p><h3>Branch closures as a macro</h3><p>When Moi Avenue closed, its customers, accounts and loans moved to Kenyatta Avenue, but its history before the closure still belongs to Moi Avenue. A small macro handles that wherever a record is attributed to a branch on a date:</p><pre>{% macro reporting_branch(branch_code, on_date, b=&#39;b&#39;) %}<br>    case when {{ b }}.closed_on is not null and {{ on_date }} &gt; {{ b }}.closed_on<br>         then {{ b }}.merged_into else {{ branch_code }} end<br>{% endmacro %}</pre><h3>Intermediate models</h3><p>The intermediate layer works out each loan’s position at every month end, covered in the next section, and each account’s balance at every month end. Accounts don’t transact every month, so the balance has to be carried forward through quiet months. Postgres has no IGNORE NULLS for window functions, so the model numbers each run of months by counting the non-empty balances so far and takes the first value in each run.</p><h3>The marts</h3><p>The ten marts are the only tables Metabase reads. Transaction-level rows are deliberately not published there, because a branch manager needs patterns rather than individual customers’ payments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qOBgBT2W_d29yfzNUTaljA.png" /></figure><p>The branch scorecard holds only additive components such as balances, counts and values. Ratios like the NPL ratio or the counter share are computed in Metabase as a ratio of sums, so they stay correct when branches are rolled up into regions.</p><h3>Into Metabase</h3><p>Every mart carries a region_code column and a row-level security policy, which is the core of the design. Metabase then gets six connections, one for each warehouse login, and the same models, metrics and dashboards are deployed on each of them from a single YAML file.</p><h3>Turning schedules and repayments into a loan book</h3><p>The core system doesn’t say how late a loan is, so days past due are derived from the repayment schedule and the payments received, the way a bank’s arrears engine would do it. Everything about loan quality in the project, from the NPL ratio to the collections worklist, rests on getting this one calculation right.</p><h3>The arrears rule</h3><p>Payments are applied to instalments oldest first, and an instalment counts as covered once everything due up to and including it has been paid. A loan’s days past due at a month end run from the due date of its oldest uncovered instalment, which is how the CBK guideline counts arrears on instalment loans.</p><p>The model first builds a month-end spine for every loan that was open on that date, and totals the repayments received by each month end. A schedule model adds a running total of what was due and of the principal within it. In SQL the position then comes down to one join from each loan’s month ends to its instalments:</p><pre>select<br>    p.loan_id,<br>    p.month_end,<br>    coalesce(max(s.cumulative_principal) filter (where s.cumulative_due &lt;= p.cumulative_paid + 0.5), 0)<br>        as principal_repaid,<br>    min(s.due_date) filter (where s.cumulative_due &gt; p.cumulative_paid + 0.5 and s.due_date &lt;= p.month_end)<br>        as oldest_unpaid_due_date<br>from paid p<br>join int_loan_schedule_cumulative s on s.loan_id = p.loan_id<br>group by 1, 2</pre><p>Outstanding principal is the loan’s principal less the principal of the covered instalments, and the arrears amount is what was due by the month end less what was paid. The 50-cent tolerance stops rounding in the schedule from leaving a loan one cent in arrears forever. A loan leaves the book in the month it is repaid, settled early or written off.</p><h3>Classifying with the CBK bands</h3><p>Each loan position is then classified with the bands in the Central Bank of Kenya’s prudential guideline on asset classification, CBK/PG/04. The bands and provision rates are stored as a dbt seed, so the rule sits in version control rather than buried in a CASE statement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qOBgBT2W_d29yfzNUTaljA.png" /></figure><p>The result is fct_loan_month_end, with 420,535 loan positions across 36 month ends. It also carries the reporting branch on each date, the disbursement quarter, months on book, and whether the loan was booked in a new branch&#39;s first year.</p><h3>Built on the loan book</h3><p>Roll rates join each loan’s position at one month end to its position at the next. A loan missing from the next month is labelled Repaid or Written off from its closure reason, so the movements add up to the whole of the starting balance.</p><p>Vintage curves follow loans disbursed from 2023 onwards and record the first month on book at which each one passed 90 days. A loan only counts towards a month on book it has actually reached by December 2025, so a young vintage isn’t flattered by months it hasn’t lived through yet.</p><p>The collections worklist takes every loan in arrears on the last month end, and the branch scorecard sums the loan book with deposits, disbursements, write-offs, customers and channel counts per branch and month.</p><h3>Testing</h3><p>The build runs 91 steps in about 90 seconds, and 89 pass outright. Alongside the usual unique, not-null, relationship and accepted-value tests, three generic tests are written in the project itself, so it needs no packages. They check that amounts are positive, that balances are never negative and that composite keys are unique.</p><p>Three singular tests carry most of the weight. The ledger test rebuilds the core system’s running balance from the transactions on every one of 7.9 million rows, and only passes once the extract’s duplicate rows are removed. The reconciliation test checks that the branch scorecard carries the whole loan book in every month, including after the closed branch’s loans move. The classification test checks that every loan position lands in exactly one CBK class, which would catch a gap or overlap in the bands.</p><p>The two warnings are deliberate: 60 loans booked to the closed branch and 9 loans whose principal no longer matches their schedule. Both are real data problems the bank would have to fix at source, so they are reported on every build and listed for the teams that own them rather than failing the pipeline.</p><h3>Who sees what, and how I know</h3><p>Metabase’s own row-level permissions, which it calls sandboxing, are a paid feature, and this Metabase is the free open-source edition, so the rule had to live somewhere else. I put it in Postgres, which turned out to be the stronger design, because a rule in the warehouse protects every tool that connects to it and not just one dashboard product.</p><h3>In the warehouse</h3><p>There are six warehouse logins, one for head office and one for each region, created when the warehouse is first initialised. All of them belong to a bank_readers role, and that role is the only thing granted anything: usage on the marts and security schemas and read access to the marts through dbt&#39;s grants config. The readers have no access at all to raw, staging or intermediate.</p><p>Which regions each login may see is a dbt seed with ten rows, five for head office and one for each regional login, loaded into the security schema. A change of access is therefore a reviewed pull request with a diff, rather than a click in an admin screen.</p><p>A dbt post-hook adds the same policy to every mart each time it is rebuilt, so a new mart can’t ship without it:</p><pre>alter table {{ this }} enable row level security;<br>create policy region_access on {{ this }} for select to bank_readers<br>    using (region_code in (<br>        select r.region_code from security.reader_regions r where r.role_name = current_user));<br>analyze {{ this }}</pre><p>The policy’s subquery doesn’t cost a lookup per row. Postgres plans it as a hashed subplan that runs once per query and then filters the table against it, which I checked with EXPLAIN ANALYZE as the head office reader. The tables are owned by the dbt user, which is unaffected by the policy, so the build itself always sees everything.</p><h3>In Metabase</h3><p>Metabase permissions add up across a user’s groups, which makes one default dangerous. The built-in All Users group gets full query access to every new database, so without changing it every user could have queried the head office connection.</p><p>A setup script, access.py, does the whole Metabase side through the API and can be rerun safely. For each audience it creates a connection to the warehouse at host.docker.internal:5435 that logs in as that audience&#39;s reader and only syncs the marts schema. It also creates a group, a collection under a root &quot;Mavuno Bank (fictional)&quot; collection, and a test user in the group.</p><p>It then writes two permission graphs. In the data graph, each group can use the query builder and native SQL on its own connection and nothing on the other five, and All Users gets no query or download access on any bank connection. In the collection graph, each group can read its own collection only and All Users sees none of them. Test-user passwords are generated straight into the project’s .env file and never printed.</p><h3>Proving it works</h3><p>The rule was tested from both sides. The warehouse check, check_access.py, first confirms that every mart has row-level security switched on. It then logs in as each of the six readers and counts rows by region in all ten marts.</p><p>The regional counts add up exactly to head office’s, for example 8,885 + 6,805 + 4,209 + 5,548 + 5,700 = 31,147 customers, and every reader is refused the raw and staging schemas.</p><p>The Metabase check, verify_access.py, signs in as each test user through the API and runs five tests. It lists the collections the user can see, runs their own NPL chart and reads which regions come back, and runs free SQL on their own connection. It also tries free SQL on another audience&#39;s connection and tries to open another audience&#39;s question.</p><pre>test user                          collections        dashboard regions      own SQL regions        other audience<br>head.office@mavuno.test            Head office        all five               all five               refused<br>nairobi.manager@mavuno.test        Nairobi Metro      Nairobi Metro          Nairobi Metro          refused<br>mountkenya.manager@mavuno.test     Mount Kenya        Mount Kenya            Mount Kenya            refused<br>coast.manager@mavuno.test          Coast              Coast                  Coast                  refused<br>riftvalley.manager@mavuno.test     Rift Valley        Rift Valley            Rift Valley            refused<br>westernnyanza.manager@mavuno.test  Western &amp; Nyanza   Western &amp; Nyanza       Western &amp; Nyanza       refused<br>all Metabase access checks passed</pre><p>The “own SQL regions” column is the important one. Each test user ran select distinct region_name from marts.dim_branch on their own connection, and the warehouse returned only their region, because the policy applies whatever the query says. The screenshots in the next two sections were taken the same way, signed in as the relevant test user, so no dashboard ever needed a public link.</p><h3>What head office sees</h3><h4>How the dashboards are defined</h4><p>The Metabase layer is code. One YAML file defines seven models, which are curated SQL datasets with named and typed columns, and seventeen metrics such as the NPL ratio, PAR30, the loan-to-deposit ratio and the counter share. It also defines five dashboards with 34 cards between them.</p><p>Most questions are built in Metabase’s visual editor from the models and metrics rather than in SQL, so a manager can open any chart and keep exploring it. The YAML uses a short notation, @month_end|month for a column grouped by month and metric:NPL ratio for a shared metric, which the deploy script expands into Metabase&#39;s query format.</p><p>The deploy script, deploy.py, matches every item by its type and name inside each audience&#39;s collection and updates it in place. A --prune flag archives anything the YAML no longer defines. It also sets each model&#39;s column metadata through the API, which is how amounts display in Kenyan shillings everywhere without per-chart formatting.</p><p>The text card at the top of each scorecard is templated with the audience’s name and what its login can see. Two charts on the collections page filter the whole page when clicked.</p><h3>The scorecard</h3><p>Head office sees a bank whose loan quality improved through 2025 while deposits grew by a fifth, with the problems concentrated in a few branches and products. The KPI cards compare each December with the one before, because balances summed across months mean nothing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tkZw7RUu2sUbWlM8lnX2Sg.png" /></figure><h3>New branches lent too fast</h3><p>The league table is sorted by NPL ratio, and the top of it is where a credit manager would start. Syokimau, opened in March 2024, already has 22.9% of its loans non-performing and has lent out twice what it holds in deposits.</p><p>The three new branches lent KES 1.1 billion between them in their first twelve months, Syokimau alone KES 483 million, under a push to build their books quickly.</p><p>The vintage chart shows what that push cost. It follows each loan disbursed in 2024 and measures how much of the principal has ever reached 90 days past due, by months on book, with mobile loans left out because they only run for 30 days.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kcWVRfZMNd-jwSAKa6aKVQ.png" /></figure><p>Twelve months in, 24.1% of first-year lending at the new branches had gone bad, against 8.5% for the rest of the bank, and the gap keeps widening. Acquisition targets for new branches need to come with tighter credit approval, or at least a second signature above a set loan size.</p><h3>A payroll problem, not a credit problem</h3><p>Not every jump in arrears is a credit problem. Check-off loans are repaid straight from the borrower’s payslip, so when county governments paid salaries late between March and June 2024, the repayments were late too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RNzgiFe-E3NyPeOOb-6ZCw.png" /></figure><p>The share of county employees’ check-off loans in the Watch class went from under 1% to 41.6% in April 2024 and back to 0.8% by August, without moving the other employer groups at all.</p><p>A collections team that read this as a wave of defaults would have spent three months chasing borrowers whose money was in the post. Knowing that it was a payroll problem, the right response was a call to the county treasuries.</p><h3>Watch is where collections pay off</h3><p>The roll-rate matrix shows where each class’s balance went a month later, averaged over 2025. Each row adds up to 100%, including the balances that were repaid or written off.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LWV8v4okB4ocqTEo8TsXKQ.png" /></figure><p>Only 1% of the Normal book slips into Watch each month, but 41.7% of Watch balances move on to Substandard a month later, and only 13.9% recover to Normal. Watch is the stage where collections effort pays, and the collections worklist below is built around it.</p><h3>Weakest and strongest products</h3><p>By product, SME working capital is the weakest book at 30.5% non-performing, and check-off loans the strongest at 7.1%. Mortgages and corporate term loans sit in between at 12.2% and 9.6%.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2zgCk5QCRP70yqS4p83FMw.png" /></figure><h3>Nairobi: one borrower can move a region</h3><p>One result I didn’t plan for was Nairobi’s NPL ratio rising from 15.8% to 19.1% during 2025 while every other region improved. The cause is concentration.</p><p>A KES 101 million corporate loan at Kenyatta Avenue went past 90 days late in the final quarter, and Nairobi also carries large mortgage and corporate defaults that haven’t yet reached write-off. Six loans now make up 27% of Nairobi’s non-performing balance.</p><p>A regional ratio built on a few large exposures can move sharply on one borrower, which is worth knowing before anyone reads it as a decline across the region.</p><h3>What a regional manager sees</h3><p>The Coast manager opens the same five dashboards and sees seven branches instead of forty-three, with no filter to set and nothing to forget. These screenshots were taken signed in as the Coast test user, so they show exactly what that account can reach.</p><h3>The Coast scorecard</h3><p>The Coast’s NPL ratio fell from 17.2% to 13.2% over 2025, and its deposits grew 22% to KES 4.1 billion. The league table makes the next question obvious, because Mtwapa carries 33.8% non-performing loans on a KES 281 million book, more than double any other Coast branch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FYrRm3JFeU4xa4UBkPpB2A.png" /></figure><h3>The collections worklist</h3><p>The collections worklist turns that into the day’s work. It lists every loan in arrears on 31 December 2025, with the loans that turn non-performing within 30 days first, because a payment collected at 75 days past due keeps a loan out of the NPL ratio while one collected at 120 days doesn’t.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lEFYRvilkqm5saKYuqXC_g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Idw7OsGavAQC6IP6qSfiKQ.png" /></figure><p>Those 24 loans are a list one team can work through in a week. Clicking an officer in the arrears chart filters the worklist to that officer’s loans, and one Mtwapa officer is carrying far more arrears than anyone else in the region. Clicking a stage does the same for the arrears stage.</p><p>Each row carries a next step from an illustrative collections policy. The steps are my own suggestion for how a bank might escalate, not a CBK rule:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B1077NU0-SzD_9W3FfsuKA.png" /></figure><h3>Channels</h3><p>The channel dashboards show how customers are moving away from the counter. Across the bank, counter transactions fell from 9.3% of customer-initiated transactions in 2023 to 6.4% in 2025. System postings such as salaries, fees and interest are left out of that measure, because no customer chose a channel for them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wsG-V3-DlqzlVe8dPodYmw.png" /></figure><p>Nairobi Metro is the most digital region and Western &amp; Nyanza the least, but every region is falling at about the same rate. New customers are moving too, with mobile app onboarding growing every year while branch onboarding drifts slightly down.</p><h3>Data quality</h3><p>The data quality dashboard gives each branch its own list of problems to fix, with the team responsible for each one. The rules live in a seed, so adding a check means adding a row and a query.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-hFETJ2rm_4lVqIoXxBsZg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GQ6t8OvIzBqLNBUmIxUjyg.png" /></figure><p>The extract holds 5,748 issues, 513 of them high severity. Overall KYC completeness is 95.6%, but three branches sit well below it: Kapsabet at 86.5%, Mtwapa at 87.5% and Ongata Rongai at 87.9%.</p><p>At those three branches 43% of agent-onboarded customers have incomplete KYC against 4% of everyone else, and agents account for 103 of the 133 incomplete records, which points to agent supervision rather than branch staff.</p><p>The 158 suspected duplicate customers matter for credit too, because a borrower with two customer records can hold two loans that no single exposure check would ever add up.</p><h3>What went wrong along the way</h3><h3>A chart that took four minutes</h3><p>The most instructive problem was a chart that took four minutes to load. The check-off chart timed out in Metabase after three minutes, and the same SQL run directly in Postgres as the head office reader took 243 seconds.</p><p>The query plan explained it. The product name was a CASE expression in the Metabase model, the freshly built tables had no statistics, and the planner couldn’t estimate the row-level security filter. It expected a single matching row and chose a nested loop that scanned the whole customer table for every loan row:</p><pre>Nested Loop Left Join  (rows=1)<br>  Join Filter: (f.customer_id = c.customer_id)<br>  -&gt;  Hash Join  (rows=1)<br>        -&gt;  Parallel Seq Scan on fct_loan_month_end f  (rows=295)<br>  -&gt;  Seq Scan on dim_customer c  (rows=15574)</pre><p>In reality about 135,000 loan rows matched, each one scanning 31,147 customers. I fixed it in the warehouse rather than in Metabase, so every tool benefits. Product names moved into the marts as a real column from a seed, the customer and branch keys got indexes, and the security post-hook now runs ANALYZE straight after adding the policy. The same query then ran in 156 milliseconds.</p><h3>A permission default that would have leaked</h3><p>The obvious way to set up the Metabase permissions would have leaked. Metabase gives the All Users group full query access to every new database, and because permissions add up across groups, every regional user would have inherited query access to the head office connection.</p><p>The setup script now removes that access explicitly. The Metabase check exists so that a regression like it can’t pass unnoticed, since it tries the head office connection as every regional user.</p><h3>A branch with a 187% counter share</h3><p>A chart also showed a branch with a counter share of 187%. Metabase groups the smallest categories of a bar chart into an “Other” bar by adding their values together, which is harmless for counts but meaningless for a ratio, because thirty-one branch ratios added together say nothing.</p><p>Turning the grouping off and limiting those charts to the top twelve branches fixed it. Every ratio in the project is now defined as a ratio of sums, so it stays correct at any level of roll-up.</p><h3>A calibration query that never finished</h3><p>My first check of the simulator’s calibration was a quick SQL query against the raw tables that used correlated subqueries on text columns. It ran for ten minutes without finishing. Writing the arrears logic properly as dbt models, with typed columns, running totals and one set-based join, turned the same check into a few seconds and gave me the production models at the same time.</p><h3>Two pipeline fixes</h3><p>Reloading the extract failed because the loader dropped the raw tables that dbt’s staging views depend on, so it now empties and refills a table whose columns haven’t changed. A dbt seed loaded the CBK provision rates as floating-point numbers, which Postgres’s round rejects, so the seed now declares that column as numeric.</p><h3>Limits, next steps and running it</h3><h3>Limits</h3><p>The data is simulated, so the findings show what the pipeline can surface rather than facts about any real bank. The scenarios were planted deliberately, and the value of the work is that the models, tests and dashboards found them, along with the Nairobi concentration that nobody planted.</p><p>The loan book also simplifies a few things a bank’s system would track. Penalty interest and fees are left out, a partial payment only counts once it covers a whole instalment, and provisions use the CBK minimums before collateral is taken into account. Overdrafts and off-balance-sheet items, which the guideline also covers, aren’t modelled at all.</p><p>Deploying per audience means six copies of everything in Metabase: 198 questions, 102 metrics, 42 models and 30 dashboards. Because they are generated from one YAML file in about 80 seconds, that is easy to live with.</p><p>A bank on Metabase’s paid tier could use one copy with sandboxing on top of the same warehouse policies. The policies would still be worth keeping, since they protect every other tool that connects to the warehouse.</p><h3>Next steps</h3><ul><li>a weekly email of each region’s collections worklist to its manager, using Metabase subscriptions</li><li>a CI job that runs the dbt build and both access checks on every pull request, so a change to the access seed can’t merge without proof</li><li>IFRS 9 staging and expected credit loss beside the CBK classes, which is how Kenyan banks report impairment in their accounts</li><li>incremental models for the transactions, which are rebuilt in full today</li></ul><h3>Running it</h3><p>The whole project rebuilds from nothing with eight commands, and the simulator uses a fixed seed. Before the dbt step, the warehouse credentials have to be exported into the shell from the project’s .env file.</p><pre>docker compose up -d warehouse<br>python -I simulator/generate.py data/extract<br>python -I ingest/load_raw.py data/extract<br>(cd dbt &amp;&amp; dbt build)<br>python -I warehouse/check_access.py<br>python -I metabase/access.py<br>python -I metabase/deploy.py --prune<br>python -I metabase/verify_access.py</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B4G-vf9PU1gUv0fCLZ7GXw.png" /></figure><p>The stack is Python 3.13, Postgres 16 in Docker, dbt-core 1.12 and Metabase 0.63, open-source edition.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=485850101836" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a credit risk report for a Kenyan bank]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://isaactonyloi-it.medium.com/building-a-credit-risk-report-for-a-kenyan-bank-1dc40f3b9dfe?source=rss-6f3c3436c8d3------2"><img src="https://cdn-images-1.medium.com/max/1388/1*KNDuf4sbgEa6CjEWUxy-fg.png" width="1388"></a></p><p class="medium-feed-snippet">I built the report a credit risk team puts together every month, for a made-up mid-sized lender I called Mwangaza Bank.</p><p class="medium-feed-link"><a href="https://isaactonyloi-it.medium.com/building-a-credit-risk-report-for-a-kenyan-bank-1dc40f3b9dfe?source=rss-6f3c3436c8d3------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://isaactonyloi-it.medium.com/building-a-credit-risk-report-for-a-kenyan-bank-1dc40f3b9dfe?source=rss-6f3c3436c8d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/1dc40f3b9dfe</guid>
            <dc:creator><![CDATA[Isaac Tonyloi]]></dc:creator>
            <pubDate>Mon, 26 Oct 2026 11:01:24 GMT</pubDate>
            <atom:updated>2026-10-26T11:03:06.537Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Why Contoso stopped growing]]></title>
            <link>https://isaactonyloi-it.medium.com/why-contoso-stopped-growing-b5e36cd35210?source=rss-6f3c3436c8d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/b5e36cd35210</guid>
            <category><![CDATA[customer-analytics]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[retail-analytics]]></category>
            <category><![CDATA[dbt]]></category>
            <dc:creator><![CDATA[Isaac Tonyloi]]></dc:creator>
            <pubDate>Sun, 25 Oct 2026 16:24:58 GMT</pubDate>
            <atom:updated>2026-10-25T16:24:58.213Z</atom:updated>
            <content:encoded><![CDATA[<p>Contoso is an electronics retailer with 74 stores across eight countries and a busy online shop. Its revenue nearly quadrupled between 2017 and 2023, from $119 million to $450 million, and then fell by a third over the following two years to $300 million in 2025.</p><p>The company is fictional, but the pattern is a familiar one, and it leads to the question any commercial director asks when growth stalls. Where did the growth come from in the first place, and why did it stop?</p><p>This <a href="https://github.com/isaactony/retail-customer-analytics">case study </a>answers that question using close to a million orders. I modelled and tested the data in dbt and built Metabase dashboards that business users can filter and explore for themselves, so the findings can be checked by anyone who wants to look.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EiEJggh76-JFHJq_eNl0xw.png" /></figure><h3>The brief</h3><p>I framed the work around four questions that a commercial director at a retailer like Contoso would want answered before deciding where to invest next.</p><ol><li>Where do revenue and margin come from, by channel, country and product?</li><li>Do customers come back, and how much are they worth over time?</li><li>Which groups of customers deserve attention right now, and what should the business do about each of them?</li><li>How are the stores performing, and what happens to their customers when one closes?</li></ol><p>Each question maps to a dashboard, and most of them can be filtered by date, channel, country or customer segment without writing any SQL.</p><h3>The data</h3><p>Contoso comes from SQLBI’s Contoso Data Generator, a realistic simulation of a retail business that is widely used in the Power BI and SQL community and published under the MIT licence. I used the extract with about a million orders, which covers May 2016 to December 2025.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UDT7Vkq6JMtk932rloR3kA.png" /></figure><p>The customer file includes made-up names, street addresses, birthdays and employers. None of that is needed to answer the brief, so the first modelling step drops it and keeps only country, state, gender and birth year. It is simulated data, but treating it as if it were real is the habit that matters.</p><p>Before building anything on top of the data, I checked three things that would quietly distort every number if I guessed them wrong.</p><ul><li><strong>Which currency the prices are in.</strong> Each order carries an exchange rate, and it was not obvious whether prices were stored in dollars or in the local currency. Unit prices sit at roughly 1.12 to 1.16 times the list price in every currency, which only makes sense if they are all in US dollars, so revenue is modelled in dollars throughout.</li><li><strong>Whether the two copies of the orders agree.</strong> The extract contains a combined sales table as well as separate order and order line tables. All 2,349,091 lines match with no differences, and that comparison now runs as a test on every build.</li><li><strong>How discounts and costs behave.</strong> About 61% of order lines carry a discount, averaging 5.9%, and no line is ever sold below cost, so gross margin is safe to report without special cases.</li></ul><h3>How it was built</h3><p>The pipeline follows the same shape a small analytics team would use in production, with every step either tested or reproducible from code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6NjPGLLKcaRvuwZCJlKniQ.png" /></figure><p>A short Python script unpacks the archive, checks that no file inside it tries to write outside its folder, and copies the eight files into Postgres exactly as delivered. It records a checksum for each file, so running it again only reloads files that have actually changed. The whole load takes about nine seconds.</p><p>All of the cleaning happens in dbt, where each step is visible and tested. The staging layer sets data types, converts money to US dollars and removes personal details. An intermediate model places every order in its customer’s history, so the analysis knows whether it was a first order or a tenth, and how long the customer waited since the last one. The marts on top of that hold the facts and dimensions, along with tables built for specific questions such as cohort retention, customer segments and the effect of store closures.</p><p>The build runs 60 steps, and two of the tests compare the models against data they were not built from. Revenue in the order line fact table has to match the separate order lines file to the cent, and the order details repeated on every sales line have to match the orders file exactly.</p><h3>Metabase as a semantic layer</h3><p>It is easy to treat Metabase as a place to paste SQL, with every chart its own query. I wanted to use it the way business teams tend to, where analysts define things once and everyone else builds on them.</p><ul><li><strong>Three models</strong> act as curated datasets for orders, order lines and customers, with readable column names, currency formatting and a country type that powers the world map.</li><li><strong>Nine metrics</strong> such as net revenue, gross margin percentage, average order value and repeat customer rate are each defined in one place, so every chart that uses them agrees.</li><li><strong>Most questions are built in the visual editor</strong> on top of those models and metrics, which means a business user can open any of them and change it without touching SQL.</li><li><strong>Filters and click-to-filter</strong> let people narrow a dashboard by date, channel or country, and clicking a segment on the customer dashboard filters the whole page to that segment.</li></ul><p>All of this lives in a single YAML file in the repository. A deploy script turns it into Metabase API calls using an API key, updates anything that already exists and archives anything that has been removed, so the dashboards are version-controlled like the rest of the code.</p><h3>Finding 1: growth was running on existing customers</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E2El2MwWRU2B9w5MrGkIFA.png" /></figure><p>The monthly revenue chart shows a business that grew steadily, dipped in 2020 and 2021, surged in 2023 and has been sliding since. Looking only at revenue, it is tempting to read 2023 as a breakthrough year for winning customers, but the customer data tells a very different story.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p5iZ_3o84FaCi5EtmF7XVQ.png" /></figure><p>Contoso won 22,969 new customers in 2017. By 2020 that had fallen to 4,348, and in 2025 it was just 731, a drop of 97% in eight years. Over the same period the number of customers buying in a given year rose from 37,370 in 2018 to 65,562 in 2023, because existing customers kept coming back and bought more often. In 2018 an active customer placed 1.4 orders a year, and by 2023 that had risen to 3.0.</p><p>So the 2023 peak came from a loyal and ageing customer base buying more frequently, while the pipeline of new customers had almost dried up. When order frequency eased back to 2.7 in 2024 and 2025, there were no new customers to make up the difference, and revenue fell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W3KbDB0evbPEbOFeXd3kwA.png" /></figure><p>The retention table explains why the existing base was so valuable. In any single month only around 3% to 11% of a cohort places an order, but over their lifetime 93% of customers come back at least once. Contoso’s customers are loyal over the long run, which makes losing the flow of new ones even more costly.</p><h3>Finding 2: orders did not shrink, the products got cheaper</h3><p>The second thing pulling revenue down is the average order value, which fell from $2,930 in 2018 to $1,854 in 2025, a decline of 37%. The obvious explanations would be smaller baskets or the shift to online shopping, which grew from 13% of revenue in 2016 to more than half today, but neither holds up once you look at the detail.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xs3Qqmnari9vJEPdJ2aLiQ.png" /></figure><p>Customers still buy about 7.5 items per order, exactly as they did in 2016. What changed is the price of those items, with revenue per item falling from $392 to $245 over the same period. The two lines in the chart sit almost on top of each other, which is what you would expect when basket size stays constant and only prices move. The pattern is also the same in both channels, with online order value falling from $2,908 to $1,865 and store order value from $2,935 to $1,840.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YJSCJgy3bvkE92gEk9-4uw.png" /></figure><p>The cause is the product mix. Computers made up 50% of revenue in 2018 and 35% in 2025, while cheaper categories grew, with cell phones rising from 12% to 20% and music, movies and audio books from 3% to 8%. Because margins are similar across categories, at around 54% to 59%, the overall gross margin has held steady at about 56%. Contoso is not earning less on each sale in percentage terms, it is simply selling cheaper things, so every order brings in fewer dollars.</p><h3>Finding 3: almost a third of customers have lapsed</h3><p>With new customers scarce, keeping existing ones matters more than ever, and here the data points to a sizeable opportunity. As of 31 December 2025, 26,719 customers, or 31% of everyone who has ever ordered, had not bought anything for more than a year. Together they spent $379 million with Contoso over their lifetimes.</p><p>To decide who to go after, I scored every customer on recency, frequency and spend, a technique known as RFM, and grouped them into eleven segments with a recommended action for each.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-LK7ZipZXOyT5mpSVT1HYw.png" /></figure><p>Contoso’s best customers carry the business, with Champions and Loyal customers making up 34% of the customer base but accounting for 55% of all lifetime revenue. They still order regularly, so the priority with them is to keep them happy and introduce them to higher-margin products.</p><p>The more urgent group sits further along the chart, in the segment labelled Can’t lose them, which contains 1,883 customers who have placed 20 orders each on average, more than almost anyone else, yet whose last order was over a year ago. Next to them are 9,086 At risk customers, with an average of 12 orders and no purchase for around 17 months. These two segments together hold 16% of lifetime revenue, and they are exactly the people a win-back campaign should target first.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JHdaGDwwTwh0I6xIgK7kww.png" /></figure><p>The dashboard pairs each segment with an action, and clicking a segment filters the whole page, including a win-back list of customer IDs sorted by lifetime value. That list is the practical output of the analysis, because a marketing team can export it and start working on it the same day.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LLzogDTHLbMbzv1ZrSRXrA.png" /></figure><p>The channel through which a customer was first won also makes a difference, since customers whose first purchase was in a store are worth $27,238 on average over their lifetime, compared with $23,050 for those first won online, and 94.5% of store-acquired customers come back, against 88.6% of online ones.</p><h3>Finding 4: closing a store loses a third of its customers</h3><p>Seven Contoso stores closed while this data was being recorded, between 2016 and 2019, which makes it possible to see what happened to the people who used to shop there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y-gWLPVyPyugrmcHFeE_dw.png" /></figure><p>I looked at the 5,618 customers who had ordered at one of those stores in the year before it closed and followed them for the next twelve months. Two thirds of them, 3,777 people, kept buying from Contoso, but 1,841 never ordered again. Leaving aside one store that had only 14 recent customers, the share who stayed varied widely, from 48% in Caltanissetta to 80% in Delaware. Across all seven stores, the customers’ combined spending fell by 36% in the year after closure, from $31.1 million to $20.1 million.</p><p>The more surprising result is where the loyal customers went. Contoso might reasonably expect them to move online, but only 385 of the 3,777 did so, and the remaining 3,392 simply started shopping at a different store. For a business planning further closures, that suggests the online shop does not automatically catch customers who lose their local store, although this data cannot show how far each customer lived from the stores that remained.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WtXMIfRep2436q-ZBCWFAw.png" /></figure><p>Online fulfilment, on the other hand, has improved steadily. An online order took 8.8 days to arrive on average in 2016 and 2.9 days in 2025, while store orders are handed over the same day, so the experience gap between the two channels has narrowed considerably.</p><h3>What I would recommend</h3><p>If I were presenting this to Contoso’s commercial director, these are the actions I would put forward, in the order I would tackle them.</p><ol><li><strong>Treat new customer acquisition as the top priority.</strong> Acquisition has fallen by 97% since 2017, and the existing base cannot keep growing its order frequency forever. Store-acquired customers are worth about 18% more over their lifetime, so in-store sign-up and first-purchase offers deserve as much attention as online marketing.</li><li><strong>Run a win-back campaign for the Can’t lose them and At risk segments.</strong> These 10,969 customers hold 16% of all lifetime revenue and have a long history of buying. I would test a personal offer on half of the list and hold back the other half, so the campaign’s real effect can be measured instead of assumed.</li><li><strong>Work on the value of each order rather than the number of orders.</strong> Customers still buy 7.5 items per order, but each item is worth 37% less than in 2018. Bundles that pair phones and media with accessories, or that bring computers back into the basket, address the actual cause of the decline in order value.</li><li><strong>Plan every store closure as a customer migration.</strong> One in three customers of a closing store never orders again, and very few of them move online on their own. Contacting those customers directly, with details of the nearest store and an online offer, should retain a meaningful share of the 36% of spending that is otherwise lost.</li></ol><h3>Behind the project</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QU5exqQ2HrEGFeHdf5iGNw.png" /></figure><p>One practical lesson came from the infrastructure rather than the data. The first large join failed with a “no space left on device” error, even though the disk had plenty of room. Docker gives containers only 64 MB of shared memory by default, which is not enough for Postgres to run parallel joins on a few million rows, and raising it to 1 GB in the compose file fixed it.</p><p>The whole project rebuilds from scratch with a handful of commands, given Docker, Python 3.11 or later and make.</p><pre>git clone https://github.com/isaactony/retail-customer-analytics &amp;&amp; cd retail-customer-analytics<br>cp .env.example .env      # set your own passwords<br>make setup up data load build</pre><p>Once Metabase is connected to the warehouse and an API key is saved in the environment file, running python metabase/deploy.py creates or updates every model, metric, and dashboard.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b5e36cd35210" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Britain after coal]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://isaactonyloi-it.medium.com/britain-after-coal-7c83eb7d134d?source=rss-6f3c3436c8d3------2"><img src="https://cdn-images-1.medium.com/max/1334/1*NfQQKGNeH0mpHWM8jyJUBQ.png" width="1334"></a></p><p class="medium-feed-snippet">On 30 September 2024, Ratcliffe-on-Soar power station in Nottinghamshire shut down for good. It was the last coal plant in Britain, the&#x2026;</p><p class="medium-feed-link"><a href="https://isaactonyloi-it.medium.com/britain-after-coal-7c83eb7d134d?source=rss-6f3c3436c8d3------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://isaactonyloi-it.medium.com/britain-after-coal-7c83eb7d134d?source=rss-6f3c3436c8d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c83eb7d134d</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[dbt]]></category>
            <category><![CDATA[data-analysis]]></category>
            <dc:creator><![CDATA[Isaac Tonyloi]]></dc:creator>
            <pubDate>Thu, 15 Oct 2026 16:59:47 GMT</pubDate>
            <atom:updated>2026-10-15T16:59:47.044Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Engineering for Regional Erasure: What AWS me-south-1 Teaches Engineering Leaders]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://isaactonyloi-it.medium.com/engineering-for-regional-erasure-what-aws-me-south-1-teaches-engineering-leaders-e3af6f834751?source=rss-6f3c3436c8d3------2"><img src="https://cdn-images-1.medium.com/max/1600/1*jC8kycPlUlGuz7_1_O-bvw.png" width="1600"></a></p><p class="medium-feed-snippet">On September 15, 2026, AWS told customers that data held only in its Bahrain region (me-south-1), or only in one UAE availability zone&#x2026;</p><p class="medium-feed-link"><a href="https://isaactonyloi-it.medium.com/engineering-for-regional-erasure-what-aws-me-south-1-teaches-engineering-leaders-e3af6f834751?source=rss-6f3c3436c8d3------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://isaactonyloi-it.medium.com/engineering-for-regional-erasure-what-aws-me-south-1-teaches-engineering-leaders-e3af6f834751?source=rss-6f3c3436c8d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/e3af6f834751</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[failure]]></category>
            <category><![CDATA[resilience]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[Isaac Tonyloi]]></dc:creator>
            <pubDate>Wed, 23 Sep 2026 17:05:43 GMT</pubDate>
            <atom:updated>2026-09-23T17:06:23.294Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Prompt injection defenses, actually red-teamed and scored, not just described]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://isaactonyloi-it.medium.com/prompt-injection-defenses-actually-red-teamed-and-scored-not-just-described-62a2f84f89c0?source=rss-6f3c3436c8d3------2"><img src="https://cdn-images-1.medium.com/max/1280/0*THQNMnmjoOMCQT5o.png" width="1280"></a></p><p class="medium-feed-snippet">Ask almost any team building an LLM agent how they handle prompt injection, and you&#x2019;ll get an architecture diagram, input sanitization&#x2026;</p><p class="medium-feed-link"><a href="https://isaactonyloi-it.medium.com/prompt-injection-defenses-actually-red-teamed-and-scored-not-just-described-62a2f84f89c0?source=rss-6f3c3436c8d3------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://isaactonyloi-it.medium.com/prompt-injection-defenses-actually-red-teamed-and-scored-not-just-described-62a2f84f89c0?source=rss-6f3c3436c8d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/62a2f84f89c0</guid>
            <category><![CDATA[prompt-injection-attack]]></category>
            <category><![CDATA[llm-security]]></category>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[agents]]></category>
            <dc:creator><![CDATA[Isaac Tonyloi]]></dc:creator>
            <pubDate>Sun, 20 Sep 2026 04:33:14 GMT</pubDate>
            <atom:updated>2026-09-20T04:33:46.400Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Enforcing data contracts in CI]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://isaactonyloi-it.medium.com/the-pr-that-should-have-failed-enforcing-data-contracts-in-ci-b8636c6d7b21?source=rss-6f3c3436c8d3------2"><img src="https://cdn-images-1.medium.com/max/1600/1*LJshxntdo5JclWuTrXtNGw.png" width="1600"></a></p><p class="medium-feed-snippet">A producer team renames a column, or quietly changes it from optional to required, and nothing breaks on their end.</p><p class="medium-feed-link"><a href="https://isaactonyloi-it.medium.com/the-pr-that-should-have-failed-enforcing-data-contracts-in-ci-b8636c6d7b21?source=rss-6f3c3436c8d3------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://isaactonyloi-it.medium.com/the-pr-that-should-have-failed-enforcing-data-contracts-in-ci-b8636c6d7b21?source=rss-6f3c3436c8d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8636c6d7b21</guid>
            <category><![CDATA[data-contract]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[dtb]]></category>
            <dc:creator><![CDATA[Isaac Tonyloi]]></dc:creator>
            <pubDate>Fri, 18 Sep 2026 18:28:58 GMT</pubDate>
            <atom:updated>2026-09-19T03:19:04.689Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Skills Are Eating Prompts: A Technical Guide to How I’m Using Claude’s Agent Skills]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://isaactonyloi-it.medium.com/skills-are-eating-prompts-a-technical-guide-to-how-im-using-claude-s-agent-skills-059cdfc45b67?source=rss-6f3c3436c8d3------2"><img src="https://cdn-images-1.medium.com/max/1760/1*iogcOT9_bj51apPHZZXO7Q.png" width="1760"></a></p><p class="medium-feed-snippet">If you&#x2019;ve used Claude Code or the API for more than a few weeks, there&#x2019;s a good chance you&#x2019;ve pasted the same instructions into more than&#x2026;</p><p class="medium-feed-link"><a href="https://isaactonyloi-it.medium.com/skills-are-eating-prompts-a-technical-guide-to-how-im-using-claude-s-agent-skills-059cdfc45b67?source=rss-6f3c3436c8d3------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://isaactonyloi-it.medium.com/skills-are-eating-prompts-a-technical-guide-to-how-im-using-claude-s-agent-skills-059cdfc45b67?source=rss-6f3c3436c8d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/059cdfc45b67</guid>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[skills]]></category>
            <category><![CDATA[agents]]></category>
            <category><![CDATA[claude-skills]]></category>
            <dc:creator><![CDATA[Isaac Tonyloi]]></dc:creator>
            <pubDate>Thu, 17 Sep 2026 18:04:35 GMT</pubDate>
            <atom:updated>2026-09-17T18:07:27.187Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Can a language model tell you what it memorized? I built a detector to find out]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://isaactonyloi-it.medium.com/can-a-language-model-tell-you-what-it-memorized-i-built-a-detector-to-find-out-3db2ca9e1a89?source=rss-6f3c3436c8d3------2"><img src="https://cdn-images-1.medium.com/max/1654/1*0QxgMXN4E2ArW6O3O21tww.png" width="1654"></a></p><p class="medium-feed-snippet">Over a weekend, I tried to answer a question that sits underneath a lot of current AI controversy. Given a language model and a specific&#x2026;</p><p class="medium-feed-link"><a href="https://isaactonyloi-it.medium.com/can-a-language-model-tell-you-what-it-memorized-i-built-a-detector-to-find-out-3db2ca9e1a89?source=rss-6f3c3436c8d3------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://isaactonyloi-it.medium.com/can-a-language-model-tell-you-what-it-memorized-i-built-a-detector-to-find-out-3db2ca9e1a89?source=rss-6f3c3436c8d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/3db2ca9e1a89</guid>
            <category><![CDATA[ai-memory]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[agents]]></category>
            <dc:creator><![CDATA[Isaac Tonyloi]]></dc:creator>
            <pubDate>Tue, 08 Sep 2026 16:42:37 GMT</pubDate>
            <atom:updated>2026-09-08T16:42:37.109Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[What Actually Happens When PostgreSQL Executes a Query]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://isaactonyloi-it.medium.com/what-actually-happens-when-postgresql-executes-a-query-2ca5efd8081b?source=rss-6f3c3436c8d3------2"><img src="https://cdn-images-1.medium.com/max/1048/1*WUuNGAq4BdNxn1JGMrD9Ig.png" width="1048"></a></p><p class="medium-feed-snippet">You write this:</p><p class="medium-feed-link"><a href="https://isaactonyloi-it.medium.com/what-actually-happens-when-postgresql-executes-a-query-2ca5efd8081b?source=rss-6f3c3436c8d3------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://isaactonyloi-it.medium.com/what-actually-happens-when-postgresql-executes-a-query-2ca5efd8081b?source=rss-6f3c3436c8d3------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ca5efd8081b</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[query]]></category>
            <dc:creator><![CDATA[Isaac Tonyloi]]></dc:creator>
            <pubDate>Sun, 06 Sep 2026 04:05:57 GMT</pubDate>
            <atom:updated>2026-09-06T04:05:57.817Z</atom:updated>
        </item>
    </channel>
</rss>