<?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[Tailor Tech - Medium]]></title>
        <description><![CDATA[Tailor Brands Engineering Blog - Medium]]></description>
        <link>https://medium.com/tailor-tech?source=rss----9820ba808869---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Tailor Tech - Medium</title>
            <link>https://medium.com/tailor-tech?source=rss----9820ba808869---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 04:12:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/tailor-tech" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[V3: Your Replica Doesn’t Know You Just Wrote That]]></title>
            <link>https://medium.com/tailor-tech/v3-your-replica-doesnt-know-you-just-wrote-that-001f06dfaa98?source=rss----9820ba808869---4</link>
            <guid isPermaLink="false">https://medium.com/p/001f06dfaa98</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <category><![CDATA[pgpool]]></category>
            <category><![CDATA[replication]]></category>
            <category><![CDATA[postgresql]]></category>
            <dc:creator><![CDATA[Nadav Shatz]]></dc:creator>
            <pubDate>Tue, 22 Sep 2026 08:22:49 GMT</pubDate>
            <atom:updated>2026-09-22T08:23:05.294Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rRg5S8O2ubToajuhftwDZA.jpeg" /></figure><p>Session A commits a write to a table. Microseconds later, session B — a different connection, maybe a different service — reads that same table from a replica that hasn’t caught up yet, and gets the old row. Behind a connection pooler doing load balancing, this is invisible in a demo and expensive in an incident: nothing errors, nothing logs, a user just sees data that used to be true.</p><p>pgpool-II, the PostgreSQL connection pooler and load balancer, already has a partial answer: disable_load_balance_on_write = dml_adaptive. If your transaction writes to table T, later SELECTs against T <em>in that same transaction</em> get routed to the primary instead of a replica, so you don&#39;t read your own write stale. It&#39;s a real fix, and it doesn&#39;t touch the case above at all, because session A and session B don&#39;t share a transaction. dml_adaptive only sees writes inside <em>your</em> session; the read that hurts is happening in someone else&#39;s.</p><p>This post is about dml_adaptive_global, a new pgpool-II mode that closes that gap — what problem it solves, the design decisions that shape it, and how to decide whether to turn it on. It merged into pgpool-II master in April 2026 as commit <a href="https://github.com/pgpool/pgpool2/commit/243463af09513be0413f52917a1045836f50f339">243463af0</a>.</p><h3>What doesn’t work</h3><p>Before landing on a shared, short-lived record of recently-written tables, the obvious alternatives are worth ruling out, because each one is a real thing people do:</p><p><strong>Pin everything to the primary.</strong> Simplest possible fix, and it throws away the replicas you’re paying for. If you’re running read replicas for load, undoing that load balancing globally isn’t a fix, it’s a regression with extra steps.</p><p><strong>Sticky sessions.</strong> Route each client to the same backend for the life of the session, so at least <em>that</em> client always sees its own writes. It does nothing for the cross-session case — session B is still a different client, on a different backend, reading a replica that hasn’t caught up. It also doesn’t compose well with a pooler in front, whose entire job is to spread connections around.</p><p><strong>Handle it in the application.</strong> Every service that cares tracks “did I just write this table” and forces its own primary reads. This works, and it means every service reimplements the same logic, and some of them get it wrong, and none of them know about writes from <em>other</em> services touching the same table.</p><p><strong>LSN or causal-read tracking.</strong> The theoretically correct answer — a client remembers the LSN of its write and a replica proves it’s caught up past that LSN before serving a read. It’s also the wrong shape for a pooler: it needs the client to cooperate (pass along a token, wait on a barrier), and pgpool sits between the client and the database specifically so the client doesn’t have to know any of this.</p><p>What’s left is the shape dml_adaptive_global takes: a shared record of which tables were recently written, visible to every session, with writes expiring off the record once they&#39;re no longer likely to matter.</p><h3>The design: a lease, not a lock</h3><p>dml_adaptive_global tracks recently-written tables in shared memory, readable by every pgpool child process. Any SELECT touching a table on that list gets routed to the primary — not just from the session that wrote it — until the entry&#39;s TTL expires.</p><p>The load-bearing decision is how that TTL is set. It isn’t a flat configured number. It’s derived from measured replication delay: observed_delay × track_table_mutation_ttl_factor (default factor 5.0), floored at 100 ms and capped at an hour. Write a table, and the window during which reads of it get forced to the primary scales with how far behind the replicas actually are right now — not with a guess baked into a config file.</p><p>That’s the real dependency on <a href="https://medium.com/tailor-tech/v2-bridging-the-gap-integrating-aurora-lag-into-pgpool-ii-9dd8c5fc73e7">the previous post in this series</a>, which shipped as commit <a href="https://github.com/pgpool/pgpool2/commit/53844460f">53844460f</a>. On Amazon Aurora, the writer and readers share a storage layer, and pgpool&#39;s usual way of measuring lag — querying pg_stat_replication — often reports zero even when a reader is meaningfully behind. Global adaptive routing is only as good as its lag number; without a trustworthy observed_delay, the TTL formula above has nothing real to multiply. replication_delay_source_cmd, the fix from that post, is what makes this feature possible on Aurora at all.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lIjJsyqQaGQX9REDWZv0_A.png" /></figure><p><em>The window scales with measured replication lag, and the staleness cap bounds a table that keeps getting rewritten.</em></p><h3>The machinery</h3><p>The map is keyed by (table_oid, dboid) — a pair of integers, hashed with FNV-1a into a shared-memory hash table with separate chaining. Not table name and schema, which was the first design and the first thing that changed under review: the same table name can exist in two different schemas, and the same schema can exist in two different databases, so a name-based key can return a <em>wrong</em> answer for a table that was never written, not just a stale one. OIDs don&#39;t have that problem.</p><p>One POSIX semaphore protects the map, not a spinlock — the original patch used one, and the review’s objection was concrete: a spinlock busy-waits, and busy-waiting gets more expensive the longer the hold time runs, which is exactly backwards for something you want to be cheap under load.</p><p>The write path has a constraint worth stating plainly: it does no backend I/O. Table OIDs are resolved while the backend connection is idle, well before any write executes, and the actual shared-memory marking happens in pgpool’s CommandComplete.c, once the backend has already answered. Resolving OIDs with a query at that point — while a command-completion response is in flight — would hang the session. And inside an explicit transaction, the mark is flushed to shared memory only at COMMIT, not when the statement runs. A transaction that writes and rolls back marks nothing. That, too, came out of review: an earlier version marked tables the moment the UPDATE executed, which meant a rolled-back write still forced other sessions onto the primary for no reason.</p><p>The read path is a single new routing function, where_to_send_dml_adaptive_global(): check whether the process just cold-started (more on that below), extract the OIDs the SELECT touches, and route to the primary on the first table found in the map with a live TTL.</p><p>One more thing worth a couple of sentences, because it’s a real number and not a design point: an earlier revision of this feature also built a shared-memory cache for parsed-query results, meant to avoid re-parsing repeated statement shapes. It turned out pgpool’s existing parser was fast enough without it, the cache was never wired in. Deleting it dropped the feature’s shared-memory footprint from roughly 6.4 MB to roughly 80 KB — the map itself is genuinely small; almost all of that memory was dead weight that never should have shipped.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PtMjWgnNNj5A1J9xwzqEDg.png" /></figure><p><em>One session’s committed write changes where a different session’s SELECT gets routed.</em></p><h3>The guardrails, and what each defends against</h3><p>track_table_mutation_max_staleness (default 60 seconds) bounds how long any single table can continuously force primary routing, no matter how often it keeps getting rewritten. The reason it needs one at all is that the mode is global, a table written in a tight loop degrades routing for <em>every</em> session reading it, not just the one doing the writing. Compare that to dml_adaptive, which is purely local — the worst a session can do to itself is force its own reads to the primary. As Tatsuo Ishii, pgpool-II&#39;s maintainer, put it during review:</p><blockquote><em>“With existing dml_adaptive mode, it just hits himself in the foot. Your patch allows him to hit someone else’s foot.”</em></blockquote><p>A per-session mode doesn’t need a hard ceiling on self-inflicted cost. A global one does, because the cost isn’t self-inflicted anymore — and the cap is the answer to exactly that asymmetry.</p><p>Two more guardrails, same theme — bound what a stale or empty view of the map can do. A per-process cold-start window (default 2 seconds) makes a freshly-started pgpool child route conservatively until it’s caught up, rather than trusting an empty map that might just be new. And on a watchdog failover — when a new node becomes the cluster’s coordinator — the entire cluster cold-starts, because the incoming leader’s view of the map may be empty or stale relative to what the old leader actually knew, and there was no way to tell the difference without treating “just took over” the same as “just started.”</p><p>Database-OID scoping in the key is the last one, and it’s documented as a security boundary now, not just an implementation detail: a table in one database can never be confused with a same-named table in another.</p><h3>Turning it on</h3><p>The mode lives under the existing knob: disable_load_balance_on_write = dml_adaptive_global. Five more knobs tune it, all defaulting to something reasonable:</p><ul><li>track_table_mutation_table_buckets (1024) and track_table_mutation_table_size (2048) — the hash table&#39;s shape and capacity.</li><li>track_table_mutation_ttl_factor (5.0) — the multiplier on observed replication delay.</li><li>track_table_mutation_max_staleness (60000 ms) — the hard cap from the previous section.</li><li>track_table_mutation_cold_start_duration (2000 ms) — the per-process warm-up window.</li></ul><p>The one thing to check before flipping this on: it needs a time-based delay source. Without replication_delay_source_cmd or delay_threshold_by_time configured and actually reporting a real number, observed_delay has nothing meaningful to report, the TTL formula floors at 100 ms, and the feature barely does anything — every write&#39;s protection window closes almost immediately. This mode is a consumer of good lag data, not a producer of it.</p><h3>Where it doesn’t reach</h3><p>A few real limits, stated plainly rather than discovered in production. PREPARE’d DML isn’t tracked at all — executing a prepared INSERT or UPDATE doesn’t mark the map, so the tables it writes stay load-balanced. The documented workaround is an explicit transaction or a /*NO LOAD BALANCE*/ hint. A single SELECT can be checked against at most 128 tables; past that, the extra tables aren&#39;t consulted. And dml_adaptive_object_relationship_list, an existing pgpool setting for extending adaptivity across related tables, isn&#39;t compatible with this mode — the two overlap in a way that hasn&#39;t been reconciled yet.</p><p>The bigger limit is conceptual: this is TTL-based and probabilistic, not a guarantee. Early documentation for the feature described it as enabling “lagless replica reads,” and that phrase is gone now, correctly — a table can still be read stale in the window before its write is even detected, or after its TTL expires but before a slow replica has actually caught up. It shrinks the window where a stale read happens. It doesn’t close it.</p><h3>The idea worth keeping</h3><p>The patch that does all this took three and a half months and seven revisions of public review to land, and the version that merged is meaningfully different from the one first posted — different key, different lock, different failure handling, a lot less dead weight. That process is a separate story; what matters here is what it left behind.</p><p>Two ideas carry past this specific feature. First: when you need a time window for “how long should this data be considered possibly stale,” derive it from a real, measured number instead of guessing at a constant — a fixed TTL is either too short to matter or too long to be cheap, and the right answer changes as your infrastructure does. Second: anything that lets one session affect the correctness or performance of another session’s reads needs an explicit cap on how long or how far that effect can reach — a guardrail a purely local mechanism doesn’t need, because a purely local mechanism can only ever hurt the session that triggered it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=001f06dfaa98" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tailor-tech/v3-your-replica-doesnt-know-you-just-wrote-that-001f06dfaa98">V3: Your Replica Doesn’t Know You Just Wrote That</a> was originally published in <a href="https://medium.com/tailor-tech">Tailor Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Securing an Agent’s Write Actions]]></title>
            <link>https://medium.com/tailor-tech/securing-an-agents-write-actions-8fcc04021b01?source=rss----9820ba808869---4</link>
            <guid isPermaLink="false">https://medium.com/p/8fcc04021b01</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[agentic-ai-security]]></category>
            <dc:creator><![CDATA[Itamar Golan]]></dc:creator>
            <pubDate>Tue, 04 Aug 2026 14:01:13 GMT</pubDate>
            <atom:updated>2026-08-04T14:01:12.025Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Letting an agent create and commit real things safely: the model proposes, the code guarantees.</em></p><p><em>A 4-part series on building an AI agent from how LLMs behave: </em><a href="https://medium.com/tailor-tech/build-your-agent-around-how-llms-actually-behave-515e03272875"><em>Part 1</em></a><em>, </em><a href="https://medium.com/tailor-tech/architecting-a-multi-agent-assistant-44355cb29d25"><em>Part 2</em></a><em>, </em><a href="https://medium.com/tailor-tech/engineering-an-agents-context-6cf189f7968d"><em>Part 3</em></a><em>, Part 4 (you’re here).</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q7PbvjzJG9QRytJBd32VpQ.jpeg" /></figure><p>Part 1 made the case that LLMs are probabilistic, and that anything which has to be exact every single time belongs in code, not in the model. Nowhere does that principle matter more than here. The moment your agent stops answering questions and starts creating and committing real things, a product listing, an invoice, a filing, unreliability stops being an annoyance and starts being dangerous. A model that occasionally rounds a number or drops a field is a bad tool call. A model that occasionally does that to a real invoice is a bad afternoon for your finance team. The rule that makes it safe is simple to state and does almost all the work: <strong>the model proposes, the code guarantees.</strong></p><p>Everything below protects one invariant, and it has two halves. Say it up front, because every mechanism that follows exists to defend it: <strong>the model never authors the token that confirms a write, and it never authors what the user sees and approves.</strong> The confirmation token is minted, stored, and checked entirely server-side. It never reaches the model or the client, so the model can’t approve a write on its own, and can’t be tricked into replaying or forging one. And the values on the confirmation card, the exact thing the user says yes to and the code then commits, are built by code from validated state, not rendered by the model. The model is in the loop to propose the write (it generates the JSON that calls the tool), but the code captures that, validates it, and hands the client its own version, so what the user approves is always exactly what gets written. Hold both halves and the scary failure modes (a forged confirmation, a hallucinated approval, a value that drifts between what the user saw and what actually got committed) simply cannot happen, because the model is never in a position to produce the one or quietly reshape the other.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4CbifNQRq-uTTutn_d_5IA.png" /><figcaption><em>Every write runs preview, confirm, commit. The token stays server-side; the model never authors what the user approves.</em></figcaption></figure><h3>Two steps, one direction</h3><p>Every write action is split into two tool calls that share a base name: a preview and a confirm. create_product_preview and create_product_confirm, send_invoice_preview and send_invoice_confirm, and so on.</p><p>The <strong>preview</strong> step validates the inputs (is the price a positive number, is the required field actually present) and, if they check out, mints a one-time confirmation token. It mutates nothing. No product exists yet, no invoice has gone out. It is pure validation plus a token mint.</p><p>The <strong>confirm</strong> step is the only place a mutation happens, and it requires that token to run.</p><p>Here is the part that actually enforces the invariant: the code captures the token off the tool’s <strong>result</strong>, server-side, the moment the preview call returns. Not off anything the model writes afterward. The token is stored alongside the conversation state (which pending action is this, what values did the user agree to) and it is never handed to the model in a follow-up message and never sent to the client in any payload. The model gets back the values it previewed, so it can describe them to the user in plain language, but it never sees, holds, or repeats the token itself. There is no code path where the model needs to know the token to do its job, so there is no code path where it can leak it, guess it, or fabricate one that happens to work.</p><h3>Approve first, or nothing happens</h3><p>A real mutation only ever happens after the user has explicitly confirmed it, in a separate turn from the one where it was previewed. If the model tries to call preview and confirm back to back in the same turn, the runtime refuses the confirm outright. That is a fail-closed rule, not a bug we haven’t gotten around to relaxing: a preview and a confirm happening in the same turn is the model approving its own action, and that is never a real user confirmation, no matter how confident the model sounds about it. The user has to actually see the preview and actually say yes, whether that “yes” comes as a typed reply or a button press on a card. Nothing in the system trusts the model’s own judgment that the user would have said yes.</p><h3>The code builds the action, the model just points at it</h3><p>This is the piece that removes the most risk for the least effort, and it is worth walking through carefully.</p><p>The model’s job, once a preview succeeds, is to compose a good reply to the user and flip one small boolean: a hint that means, roughly, “show the confirmation card now.” That is the entire surface the model controls on the way out. It does not write the payload that goes into the card. It does not touch the token. It cannot decide what values appear in it.</p><p>The server intercepts that hint before the response reaches the client. It deletes the boolean the model set and injects, in its place, the real action payload: the actual previewed values, built server-side from the state it saved during the preview step, with the token scrubbed out entirely. What the frontend receives is a structured object naming which action this is and what stage it’s in (preview, or later, committed), carrying only the values the code itself validated. The model’s message and its suggested replies are still its own words; the actual action card is not. It is assembled by code, from code-held state, every time.</p><p>That swap is why the model cannot malform, fake, or smuggle anything into a real write. It doesn’t have write access to the thing that matters. It has a switch that says “show a card,” and the code decides what the card says.</p><p>These guardrails aren’t hypothetical. While building this, we watched the model do the exact things the design now rules out: it would try to confirm its own proposal in the same breath it made it, and it would “tidy up” a value on the way to the card, nudging an amount or a date away from what the tool had validated. Both are structurally impossible now, a same-turn confirm is refused, and the card is built by code from validated state. And once the user approves, the write itself is quick: in production <strong>the confirmed creation completes in under a second</strong>, because the model is out of the loop by then, the code just checks the token and writes. A single model driving the whole flow could never promise that.</p><h3>When the writing agent can’t talk to the user</h3><p>This one is specific to a multi-agent setup, so skip it if you run a single model. Say you have an orchestrator that talks to the user while a separate agent holds the write tool (the shape from Part 2: a lead out front, specialists behind it). Then you inherit a small problem. The specialist owns the write, so it is the one that knows the action still needs a billing cycle or a tax ID, but it is not the one that gets to talk to the user. The agent that knows what to ask is not the agent that can ask.</p><p>Closing the gap doesn’t take much, because the action already carries its own requirements. Every write action declares the fields it needs as part of its definition, and that full list is always surfaced to the lead, layered on top of whatever the specialist reports back. The specialist can say it doesn’t have enough to complete the write, but it never has to work out which fields are missing or spell them out; the required set is right there for the lead regardless. The lead holds the conversation, so it asks the user for exactly those fields, in its own voice, without the action’s requirements ever being copied into its prompt. The requirement rides with the action, and the lead is simply the one that can voice it.</p><p>Once the user answers, the lead passes the values back down, the specialist previews, and you are on the main path again. This is the piece that quietly makes the split work: the action carries its own required fields, the specialist owns the write, and the lead is the one that turns a missing field into a question the user actually sees.</p><h3>The frontend renders the action, not the prose</h3><p>The card the server built has to land somewhere that knows what to do with it. The frontend keeps a registry: every action key maps to a small set of views. When a message arrives carrying an action object, the frontend reads two things off it, which action this is and what stage it’s in, and renders the matching view. A preview stage draws the preview card for that action. Nothing here reads the model&#39;s words to decide what to show; the prose is just prose, and the structured object drives the UI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*ifX5SeQOXJNEixFV28DDoQ.png" /><figcaption><em>The confirmation card the user approves, built by code from validated state.</em></figcaption></figure><p>The preview card shows the values the code validated, plus one affordance: an <strong>Edit</strong> button. The model usually fills only the fields it needed to get the job done, so a preview is often partial. Edit opens the full form for that action, every field it supports, including the optional ones it left blank, so the user can fix a value or add something that was left out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*cV41IxzfIb8DLf9AybdRBg.png" /><figcaption><em>Edit opens the full form, including the optional fields the model left blank. Saving is itself the approval.</em></figcaption></figure><p>That edit path hides a useful shortcut. If the user just accepts the preview, it’s the ordinary confirm step. But if the user edits the form and submits, the payload that comes back is, by definition, the user’s own reviewed and approved values. There is nothing left for the model to propose, so the code doesn’t route it back through the model for a fresh preview. It runs the preview and confirm itself, server-side, back to back: validate the submitted values, mint the token, commit. The user hitting save is the approval, which is exactly why the same-turn rule that stops the model from confirming its own preview doesn’t apply here: a person editing a form and submitting it is the real confirmation that rule exists to protect.</p><h3>Exactly once, not “probably once”</h3><p>Writes need to survive retries, double-clicks, and flaky connections without creating two of something. Three mechanisms do that job:</p><ul><li>A durable <strong>idempotency key</strong> on the confirm step means a resubmission (the user’s client retries, the network hiccups and resends) replays the original result instead of creating a second entity.</li><li>A short-lived <strong>lock</strong> on the pending action serializes two near-simultaneous confirm attempts, so a double-click can’t race itself into two writes.</li><li>Success is grounded on an actual <strong>created</strong> result coming back from the write itself, never inferred from an HTTP 200. A 200 tells you the request was received. It doesn’t tell you the product exists. Only the write’s own confirmation does, and that’s the only thing the code treats as success.</li></ul><h3>Why the next write action is cheap</h3><p>None of this is bespoke per action, and that is deliberate. It falls out of a naming convention. Every write action is a pair of tools sharing a base name, and that shared base is the action’s key everywhere downstream: it’s what the runtime uses to derive the token, the idempotency behavior, and which card to render, with no per-action plumbing to write.</p><p>So shipping a new write action is small: write the tool pair (a preview and a confirm that share a base name), write a short playbook that teaches the model when and how to use them, and add one entry to the frontend’s component registry mapping that action key to its two views, a preview card and an edit form. That’s it. No new token handling, no new idempotency code, no new confirmation logic, because the runtime already derives all of that from the name.</p><h3>Where we drew the line, on purpose</h3><p>We put the guarantees in code on purpose, and just as deliberately kept the judgment out of code. Deciding what to create, how to phrase the confirmation, which optional fields to ask about, that all stays with the model, because that’s the part it’s actually good at. We didn’t try to script the conversation. We scripted the token.</p><blockquote><em>Safe agent writes are a code problem wearing an LLM costume.</em></blockquote><p>Draw the line at “anything that must be exact”: the token, the payload, the commit. Keep that on the code side, keep the language and the judgment on the model’s side, and every new capability you add afterward gets cheap, because the rails are already built.</p><p>That’s the whole series: don’t fight the model, and don’t over-trust it either. Part 1 named the behaviors. Part 2 showed how “one role per agent” becomes a real system. Part 3 showed how to engineer that system’s context. This part showed how to let it actually do things, without losing sleep over it.</p><p><strong>In this series:</strong></p><ol><li><a href="https://medium.com/tailor-tech/build-your-agent-around-how-llms-actually-behave-515e03272875">Build your agent around how LLMs actually behave</a></li><li><a href="https://medium.com/tailor-tech/architecting-a-multi-agent-assistant-44355cb29d25">Architecting a Multi-Agent Assistant</a></li><li><a href="https://medium.com/tailor-tech/engineering-an-agents-context-6cf189f7968d">Engineering an Agent’s Context</a></li><li><strong>Securing an Agent’s Write Actions</strong></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8fcc04021b01" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tailor-tech/securing-an-agents-write-actions-8fcc04021b01">Securing an Agent’s Write Actions</a> was originally published in <a href="https://medium.com/tailor-tech">Tailor Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Engineering an Agent’s Context]]></title>
            <link>https://medium.com/tailor-tech/engineering-an-agents-context-6cf189f7968d?source=rss----9820ba808869---4</link>
            <guid isPermaLink="false">https://medium.com/p/6cf189f7968d</guid>
            <category><![CDATA[context-engineering]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Itamar Golan]]></dc:creator>
            <pubDate>Tue, 04 Aug 2026 14:00:51 GMT</pubDate>
            <atom:updated>2026-08-04T14:00:50.001Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How to get the right knowledge into the model without bloating its prompt.</em></p><p><em>A 4-part series on building an AI agent from how LLMs behave: </em><a href="https://medium.com/tailor-tech/build-your-agent-around-how-llms-actually-behave-515e03272875"><em>Part 1</em></a><em>, </em><a href="https://medium.com/tailor-tech/architecting-a-multi-agent-assistant-44355cb29d25"><em>Part 2</em></a><em>, Part 3 (you’re here), </em><a href="https://medium.com/tailor-tech/securing-an-agents-write-actions-8fcc04021b01"><em>Part 4</em></a><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2e6BBZqZO_lqiUXXO6YGMw.jpeg" /></figure><p>Part 1 laid out the behaviors we design around, including this one: long prompts make a model worse, and without the user’s context it either gives a generic answer or stops to interrogate. Part 2 covered how to architect that team: a lead orchestrator with specialists behind it. This part is about what actually goes into each specialist’s head: how we keep the prompt small and still get an answer that’s informed and specific, not generic and not full of questions the user already answered once.</p><h3>Keep the system prompt to a job description</h3><p>Each specialist’s system prompt states three things: its role, its routing rules (what it should and shouldn’t handle, when to hand a question back), and its output contract (the shape of what it returns). That’s the whole prompt. No situational playbooks baked in, no growing list of “if the user says X, do Y” carve-outs bolted on every time an edge case bites you.</p><p>Write edge cases directly into the prompt and you’re back in the trap from part one: a wall of instructions the model holds in its head on every turn, whether or not this turn needs any of it. Most don’t.</p><p>Keeping the prompt lean isn’t only about the system prompt. The single-model version carried far more than its instructions on every turn: it pulled a slab of the knowledge base into the same call, so a typical turn ran on well over <strong>15K tokens</strong> of context whether the question needed it or not. The lead now runs on a lean prompt of about <strong>2K tokens</strong> and reaches for retrieval, through a specialist, only when the question calls for it. Context shows up when it earns its place, not by default.</p><h3>Skills: playbooks that load only when the situation calls for them</h3><p>So the detailed stuff lives somewhere else, reachable on demand instead of carried around all the time. We call that a <strong>skill</strong>: a playbook stored as data, not as prose baked into a prompt.</p><p>Alongside its domain tools, like a knowledge-base search, each agent gets one more: a “load a skill” tool. It’s declared the ordinary way, the same tools JSON you’d pass on any LLM call:</p><pre>tools = [<br>  {<br>    &quot;type&quot;: &quot;function&quot;,<br>    &quot;function&quot;: {<br>      &quot;name&quot;: &quot;load_skill&quot;,<br>      &quot;description&quot;: &quot;Load a playbook before acting on a known situation, then follow the returned steps. Use process_refund when the user wants money back on a completed order; cancel_subscription when they want to stop a recurring plan; escalate_to_human when the request needs a person (a legal threat, a complaint, anything out of scope).&quot;,<br>      &quot;parameters&quot;: {<br>        &quot;type&quot;: &quot;object&quot;,<br>        &quot;properties&quot;: {<br>          &quot;skill&quot;: { <br>            &quot;type&quot;: &quot;string&quot;, <br>            &quot;enum&quot;: [&quot;process_refund&quot;, &quot;cancel_subscription&quot;, &quot;escalate_to_human&quot;] <br>          }<br>        },<br>        &quot;required&quot;: [&quot;skill&quot;]<br>      }<br>    }<br>  }<br>]</pre><p>Its skill argument isn&#39;t free text, it&#39;s an <strong>enum of the exact skill names</strong>, so the model can&#39;t invent one that doesn&#39;t exist; it picks from what&#39;s there. The when-to-use line on each skill lives right in that description, which is all the model needs to route to the right playbook before it loads a single one.</p><p>Until the model calls it, the playbook costs zero tokens, because it isn’t in context at all. And loading it is cheap: the playbook lives in your own store, not behind a remote API, so pulling it in is a local lookup that takes milliseconds, not a network round-trip. The moment it loads, the full instructions for that situation drop into context, get followed, and mostly stop mattering once the turn is done. Editing a playbook (fixing a wrong step, adding a new case) is just a <strong>data change</strong>, no redeploy.</p><p>This also forces a distinction worth keeping clean: <strong>a skill is guidance the agent reads, a tool is something it calls.</strong> Loading a skill only drops instructions into the model’s context; it touches nothing outside the model. A tool reaches beyond the model: it might read something (look up an order, fetch a profile) or change something (create a record, send a request). Keep the two separate and the model’s job stays legible: pull in the guidance it needs, then decide which tools to call.</p><h3>Load what you already know before the model says a word</h3><p>The context problem from part one, where “how do I improve my ad conversion rate” needs a different answer for a wedding photographer than for a SaaS company, has a mostly mechanical fix: pull what you already know about the user (their business, their products, their current state) into the conversation before the model produces a single token.</p><p>The payoff is immediate. Ask that vague ad-conversion question and the model doesn’t hedge into a one-size-fits-all answer, and it doesn’t stop to ask what the business does, because it already knows. Both failure modes from part one disappear at once, and none of it required the model to reason its way there. It’s a lookup, run before the conversation starts.</p><h3>Cache what’s stable, read fresh what isn’t</h3><p>Not all of that context is equally volatile. Most of it (org details, the product catalog, longstanding preferences) barely changes from one turn to the next, so it gets cached and there’s no round trip paid on every message for data that never moves. But some of it changes mid-conversation in ways that actually matter: a filing gets approved, a status flips, while the user is mid-chat with you about exactly that thing. For that slice, we read fresh at the moment it’s needed instead of trusting a snapshot from ten minutes ago.</p><p>Get this split wrong and you either pay a tax every turn for facts that never change, or confidently tell someone their filing is still pending when it was approved five minutes earlier.</p><h3>Let the model write its own search</h3><p>Remember the knowledge-base search, one of those domain tools? It’s a tool the model calls on demand, whenever it decides it needs to look something up. The interesting part isn’t that it can call it, it’s what it puts in the query.</p><p>The naive way to fill that query is to pass the user&#39;s raw message straight through. Predictable, and weak, and it&#39;s worth being specific about why. A knowledge-base lookup is usually a vector search: it turns the query into an embedding and returns the chunks whose embeddings sit closest to it. A raw user message embeds badly for that. It&#39;s conversational, padded with filler, often carries a pronoun or two and more than one intent at once, and it rarely uses the words the knowledge base is actually written in. Its embedding lands in a vague spot, near nothing in particular, and you get weak matches back.</p><p>So we let the model write the query itself. It rewrites a messy question into a short, single-intent search phrased in the domain&#39;s own vocabulary, so the embedding lands right where the relevant chunks live. It splits one overloaded question into a few focused searches that each retrieve cleanly, and it folds in context the user never typed. &quot;Do I have anything I need to file to stay in good standing?&quot; becomes two sharp searches, one for a renewal and one for a license, with the user&#39;s location added because the model already knows it. <strong>That&#39;s the deliberate flip side of &quot;the model judges, the code guarantees&quot;: phrasing a search is judgment</strong>, exactly what a model is good at, and exactly the wrong thing to freeze into a template.</p><p>Splitting the assistant by domain pays off here too. Because the compliance specialist only ever handles compliance, its knowledge-base search can be scoped to just the compliance documents, and the finance specialist’s to just finance. The vector search then runs over a smaller, more relevant corpus, with fewer near-misses dragged in from an unrelated domain. A single generalist agent can’t narrow it that way: it might be asked about anything, so it has to search everything, every time.</p><p>Keep the prompt lean, load playbooks and the user’s context exactly when they’re needed, and let the model own how it phrases a search. None of this makes the model smarter. It makes sure the model is fed the right thing at the right moment, and in practice that matters more than being smarter.</p><p>Part 4 covers the other half of the system: once an agent knows all of this, how do you let it actually create and commit things on the user’s behalf without keeping you up at night.</p><p><strong>In this series:</strong></p><ol><li><a href="https://medium.com/tailor-tech/build-your-agent-around-how-llms-actually-behave-515e03272875">Build your agent around how LLMs actually behave</a></li><li><a href="https://medium.com/tailor-tech/architecting-a-multi-agent-assistant-44355cb29d25">Architecting a Multi-Agent Assistant</a></li><li><strong>Engineering an Agent’s Context</strong></li><li><a href="https://medium.com/tailor-tech/securing-an-agents-write-actions-8fcc04021b01">Securing an Agent’s Write Actions</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6cf189f7968d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tailor-tech/engineering-an-agents-context-6cf189f7968d">Engineering an Agent’s Context</a> was originally published in <a href="https://medium.com/tailor-tech">Tailor Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Make the MCP the only door — and every cluster touch becomes visible]]></title>
            <link>https://medium.com/tailor-tech/make-the-mcp-the-only-door-and-every-cluster-touch-becomes-visible-dd7b4ba0b80d?source=rss----9820ba808869---4</link>
            <guid isPermaLink="false">https://medium.com/p/dd7b4ba0b80d</guid>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[observability]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Evgeny Kharitonov]]></dc:creator>
            <pubDate>Tue, 04 Aug 2026 12:04:12 GMT</pubDate>
            <atom:updated>2026-08-04T12:04:10.124Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Part 2 of 2 — enforcing the gateway, and the observability that falls out of it.</em></p><p>Part 1 built a scoped gateway: a per-cluster <a href="https://github.com/containers/kubernetes-mcp-server">Kubernetes MCP server</a> sitting behind Cloudflare Access and Okta, read-only by default, write access only in dev, sessions that expire on their own. On paper, that’s a real guardrail — an agent talking to that MCP server can only do what the gateway lets it do.</p><p>The problem is the phrase “talking to.” Nothing stops an agent from <em>not</em> talking to it. If the same shell that runs the MCP client can also run kubectl or the cloud CLI directly, and there are usable credentials sitting in that shell&#39;s environment, the agent has a second, unscoped door standing right next to the scoped one. It doesn&#39;t matter how carefully you designed the gateway&#39;s RBAC if the agent can just step around it.</p><p>So this post is about two things: closing that second door so the gateway is the <em>only</em> path in — and the payoff that falls out once it is, which is that every cluster touch suddenly becomes something you can see.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*66kvYoh8uQLgg7Jg_hKmvA.jpeg" /></figure><h3>The MCP has to be the path of least resistance</h3><p>Scoped access only means something if the MCP is the path the agent actually takes — and left to itself, it isn’t always. An agent improvising its way through a task, or nudged by a prompt injection that suggests a shortcut, will use whatever tool gets the job done, including a raw CLI call. Telling it not to is a convention, and conventions don’t survive contact with an agent under pressure to finish.</p><p>The fix isn’t more policy documentation. It’s making the raw command fail.</p><h3>The mechanism: a pre-tool-use hook</h3><p>Coding agent runtimes commonly expose a hook that runs before any shell command executes, with the power to allow, ask, or deny it. That’s the natural interception point: before the agent’s shell command runs, inspect it, and if the command being executed is kubectl or the cloud CLI, deny it and tell the agent to use the MCP tool instead. The agent gets a clear redirect, not just a wall — &quot;use the cluster MCP tool for this,&quot; which it can act on immediately.</p><p>The naive way to decide whether a command is a cluster command is to look for the tool’s name in the text — and it’s wrong in both directions at once. It’s too eager: brew install kubectl, command -v kubectl, and a grep for the word all mention the tool without running it, and a guardrail that blocks those gets muted in its first week. It&#39;s also too lax: zsh -c &quot;kubectl get pods&quot; never presents the command at the top level at all — and neither does eval, ssh host &#39;…&#39;, a pipe into a shell, or an inline python3 -c script.</p><p>So we ended up writing a small purpose-built checker rather than relying on a pattern: something that understands just enough shell structure to work out what is <em>actually</em> being executed, including when it’s wrapped a layer or two deep. Less pattern-matching, more parsing — which turns out to be the shape of this problem generally, the moment your input is a shell string rather than a tool call.</p><p>It’s best-effort, and we treat it that way. A shell is expressive enough that no checker is ever complete, which is exactly why the real boundary lives elsewhere: in the gateway’s RBAC and in which credentials an agent session holds at all. The hook’s job is narrower — make the MCP the path of least resistance and the raw path fail. Alongside it, the agents’ own instructions point at the MCP for anything cluster-shaped. In practice that combination works well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tOFA_xkeWA7sgNqHSfW7LA.png" /></figure><h3>Elevated operations stay human-only</h3><p>Some operations aren’t things an agent should be able to do at all — assuming an elevated cloud role, decrypting a secret parameter. The hook blocks the agent from these by design, full stop: there’s no MCP tool for them, and a human runs them, in their own shell, under their own identity.</p><p>This is a deliberate line, not an oversight: agents don’t get elevated cloud power, ever, regardless of how the request is phrased or how legitimate the task sounds. The MCP’s scoped RBAC from Part 1 defines everything an agent <em>can</em> reach; this is the explicit statement of what it categorically cannot.</p><h3>The dividend: a door you control is a door you can measure</h3><p>Closing the raw path did something we didn’t fully appreciate until after it shipped: it turned the gateway into the single point every cluster interaction has to pass through — and a chokepoint you control is a chokepoint you can <em>measure</em>. Once every interaction is forced through one authenticated gateway, cluster access stops being invisible and becomes legible: you can log it, attribute it, and put it on a dashboard.</p><p>Human cluster access was already on a controlled path: just-in-time credentials, issued per person, expiring on their own. What that path doesn’t give you is a picture of <em>agent</em> behaviour. An agent working inside a developer’s shell inherits that developer’s credentials — so whatever it does arrives with no separate identity, no scope of its own, and no record that distinguishes it from the human. And because each CLI call goes straight from a laptop to the API server, there’s no aggregate view either: no way to ask which clusters agents are hitting, which operations they actually reach for, or whether one has started looping. Routing agents through their own gateway is what turns that from guesswork into a dashboard.</p><p>We didn’t set out to build an audit system. We built a chokepoint for security reasons, and the chokepoint turned out to double as a sensor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m5dLvwXs18M3D4ULH7M_Pw.png" /></figure><h3>Two signal sources, two different questions</h3><p>Two independent layers of the same design each answer a different question, and together they cover the ground raw kubectl never did.</p><p><strong>The front door: identity, via Cloudflare Access.</strong> Every connection to the MCP is an authenticated, per-user OIDC session — true by construction, because the block made it the only way in. Cloudflare Access logs each of those sessions natively: who authenticated, which cluster’s MCP endpoint they hit, and when. That gives the agent side its own record — <em>which identity opened a session against which cluster, and when</em> — tied to a real Okta identity instead of riding a developer’s credentials, and it lives in Cloudflare’s own Access logs, no export required.</p><p><strong>The door itself: usage, via MCP server metrics.</strong> The MCP server exposes Prometheus-style metrics, and Datadog’s OpenMetrics autodiscovery scrapes them per cluster, each cluster landing in its own metric namespace. That gives us request volume, a breakdown by which tool was actually called (list pods vs. exec vs. describe — the operations agents reach for in practice, not the ones we assumed they would), latency, and error rate. Rolled up across every cluster, it’s one “Kubernetes MCP fleet usage” dashboard instead of N clusters we’d otherwise check one at a time.</p><h3>What this actually buys you</h3><p>Concretely, questions that used to require guesswork now have answers sitting in a dashboard:</p><ul><li><strong>Which clusters are agents actually hitting, and to do what?</strong> Not which clusters they’re <em>authorized</em> to hit — which ones see real traffic, and which tools dominate it.</li><li><strong>Is an agent misbehaving?</strong> A request-volume spike on one cluster, or one tool suddenly dominating call volume, is a visible signal — the kind of thing that used to stay invisible until someone noticed a symptom downstream.</li><li><strong>Which operations do agents actually reach for?</strong> Not the policy on paper, but what they really do, cluster by cluster.</li><li><strong>A clean answer for an access review.</strong> “Here’s every agent session against production this quarter, by identity, and what it called” — the agent side of the house documented to the same standard as the human one.</li></ul><p>None of this comes out of a CLI-based path, however well governed: there’s no gateway in the middle to instrument.</p><h3>It closes the loop on the blast-radius model</h3><p>Part 1’s whole argument was about shrinking blast radius: production is read-only, sessions expire in minutes, and the scope of what any single session can do is deliberately small. Add this layer on top and the picture sharpens further — an agent touching production isn’t just constrained, it’s <strong>rare, short, attributable, and countable</strong>. The security posture and the observability posture reinforce each other: the smaller and more logged the blast radius, the less any single touch matters, and the easier it is to notice the one that does.</p><h3>What’s next: a full trace per tool call</h3><p>The two signals we have today answer different questions at different resolutions. Cloudflare Access tells us <em>who</em> opened a session against <em>which</em> cluster. The MCP server’s metrics tell us <em>what kind</em> of work happened there, in aggregate — call volume, which tools, latency, errors. What neither gives us is the middle: a per-call record tying one specific operation to the identity that asked for it.</p><p>The path to that is already in the building. We run an internal capability layer called Loom — one platform service hosting connectors to our enterprise systems behind the same Cloudflare Access edge, rather than a microservice per integration. We wrote about the thinking behind it in <a href="https://medium.com/tailor-tech/dont-build-the-integration-build-the-capability-bcae956a172d">Don’t Build the Integration, Build the Capability</a>. The relevant property here is that Loom already sits <em>in the request path</em>: authenticated requests pass through it on the way to the backing system.</p><p>Anything in the request path can be instrumented. Proxying the cluster MCPs through Loom would turn each tool call into a traced event — this identity, this cluster, this operation, this outcome — instead of a counter that went up. That’s the difference between “somebody authenticated to production this afternoon and there were forty MCP calls” and “this person listed pods in that namespace at 14:03.”</p><p>It isn’t built yet. But it’s the natural next step, and it follows from the same idea the whole series rests on: put a door where you can see it, and everything downstream gets easier — enforcement first, and then the trace.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd7b4ba0b80d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tailor-tech/make-the-mcp-the-only-door-and-every-cluster-touch-becomes-visible-dd7b4ba0b80d">Make the MCP the only door — and every cluster touch becomes visible</a> was originally published in <a href="https://medium.com/tailor-tech">Tailor Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Architecting a Multi-Agent Assistant]]></title>
            <link>https://medium.com/tailor-tech/architecting-a-multi-agent-assistant-44355cb29d25?source=rss----9820ba808869---4</link>
            <guid isPermaLink="false">https://medium.com/p/44355cb29d25</guid>
            <category><![CDATA[multi-agent-systems]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Itamar Golan]]></dc:creator>
            <pubDate>Mon, 03 Aug 2026 13:38:04 GMT</pubDate>
            <atom:updated>2026-08-03T13:38:02.937Z</atom:updated>
            <content:encoded><![CDATA[<p><em>One assistant on the surface, a team of agents behind it, and the tradeoffs of running them as one system.</em></p><p><em>A 4-part series on building an AI agent from how LLMs behave: </em><a href="https://medium.com/tailor-tech/build-your-agent-around-how-llms-actually-behave-515e03272875"><em>Part 1</em></a><em>, Part 2 (you’re here), </em><a href="https://medium.com/tailor-tech/engineering-an-agents-context-6cf189f7968d"><em>Part 3</em></a><em>, </em><a href="https://medium.com/tailor-tech/securing-an-agents-write-actions-8fcc04021b01"><em>Part 4</em></a><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u8G_-q5bQPXC-YFQMfSxQw.jpeg" /></figure><p>Part 1 made the argument: one model juggling every role in your product hedges and blurs. Ask it to do customer support, sales, and billing from the same prompt, and it waters all three down. The fix is to split the assistant into a team, one role each. This post is about what that actually looks like once you build it.</p><h3>The shape</h3><p>Navi (our AI assistant for entrepreneurs) is not one model with a long prompt. It is a lead orchestrator and a set of domain specialists behind it, each owning exactly one domain, things like compliance, bookkeeping, taxes, payments, banking, branding, or marketing. Add a domain and you add a specialist, you don’t bolt another paragraph onto an already strained prompt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OGwJQKOrf8qg_scq0AEYwA.png" /><figcaption><em>One assistant on the surface, a team of agents behind it. Only the lead talks to the user.</em></figcaption></figure><p>It is <strong>one system, deployed together</strong>, not a scatter of separate services calling each other over the network. The specialists run in the same process as the lead, as nodes in one graph, which is what makes delegation and parallel execution cheap instead of an infrastructure project.</p><p>To be honest about the tradeoff: this is the simpler choice for what we need today, not the one right answer. The rule of thumb we follow: as long as you do not need to expose an agent as a standalone service that other systems call on its own, keep them in-process. The moment you split them out, you take on agent-to-agent (A2A) communication, with all the networking, versioning, and partial-failure handling that comes with it. The day one of our agents needs to be reachable from outside, that math changes and we will pull it out. It has not yet, so we have not.</p><h3>One voice out</h3><p>Once you have a team, the next decision is who gets to talk to the user. We send everything through the lead: specialists report to it, and it composes the single message the user sees. There are two reasons, and the second one sneaks up on you.</p><p>The first is voice. The moment more than one model writes to the user directly, you lose control of tone, formatting, and the personality the product is supposed to have. One turn sounds like a careful assistant, the next like a terse API. Users notice.</p><p>The second is concurrency. Your specialists run at the same time, that is the whole point of a team, so you cannot let them all write to the user, or two of them race to answer the same turn. Something has to be the single writer, and making it the lead is the clean way to get there: the specialists produce in parallel, the lead decides what actually gets said. It also means the lead owns the conversation and the final voice, so the specialists never need the full transcript, only the brief the lead hands them (more on that next).</p><p>One voice is still a choice, not a law, and it is worth <strong>making on purpose</strong>. Sometimes you want a different voice for part of an answer: a sales-oriented assistant that gets a technical support question is often better off letting a support agent reply in its own register, a precise step-by-step, not the sales tone. That is fine. The rule is not “always one voice.” The rule is to pick your single writer per turn deliberately, and to know when you are enforcing one voice and when you are handing the turn to another agent on purpose, instead of letting it happen by accident.</p><h3>Specialists are one-off tasks, not mini chatbots</h3><p>The obvious way to build this would be to hand each specialist the whole conversation and let it figure out what’s relevant. We don’t. The lead does not forward the raw conversation. It hands over a brief: an objective, the specific context that objective needs, and any constraints. That’s it.</p><p>Each specialist gets its task, answers, and forgets. It carries no conversation history across turns, because the lead is the only agent that holds the full conversation.</p><p>This is a deliberate constraint, not a limitation we’re stuck with. A specialist that only ever sees one focused brief stays focused: it can’t get confused by six turns of unrelated small talk earlier in the conversation, because it never sees them. Its prompt stays small, which means less for the model to get wrong or lose track of, and a smaller prompt is also a cheaper, faster call. You are not paying to re-explain an entire conversation to a specialist that only needs to look up an LLC’s filing status.</p><h3>Because it’s a team, they run in parallel</h3><p>A team that only runs one member at a time is barely a team. When a turn needs two specialists, say a question that touches both compliance and commerce in one breath, both get dispatched at once, not one after the other.</p><p>This isn’t exotic to build. The agent runtimes people already reach for to build tool-calling loops run concurrent tool calls out of the box, each on its own thread; you don’t have to hand-write a scheduler. What you get for it is real: <strong>total latency for that turn is the slowest branch, not the sum of both.</strong> Run two specialists one after another and you waste the second one’s entire runtime as pure wait. Run them concurrently and that wait becomes essentially free.</p><h3>A model per agent</h3><p>Once you’ve separated the roles, an obvious question follows: does every agent need to run the same model? No, and forcing them to is wasteful in both directions.</p><p>The lead has the hardest job: it reasons over the whole conversation, reconciles what multiple specialists reported, and composes the structured output the user sees, under a strict output contract it cannot violate. That’s worth a stronger reasoning model with a bigger token budget, because it’s the one place quality is directly user-facing.</p><p>In our case, the specialists mostly run domain tools and hand back a short answer: no UI to compose, no long-range reasoning, just call the right tool and summarize the result. That is a job for a small, fast, cheap model, and running a heavyweight one there would mean paying reasoning-class prices for what is usually a lookup. Yours might not be: if a specialist has to do real reasoning of its own, give it a bigger model. The point is that you size each agent to its job, not that specialists are always the cheap ones.</p><p>One practical note: keep each agent’s model a config value, not a hardcoded choice. New models land constantly, and when the model behind an agent is config, adopting a better or cheaper one is an edit, not a release. The multi-agent shape helps here too: you can try a new model on a single agent first and judge it with a <strong>small blast radius</strong>, instead of swapping the whole system at once.</p><h3>The consequence you have to design for</h3><p>Here’s the trade-off you sign up for with one voice: a specialist’s answer can’t go straight to the user, it has to pass through the lead. The lead’s own answer still streams token by token, the same as any single-model chat. But it can’t start until the specialists it delegated to have reported back, so there’s a real gap, sometimes a few seconds, before the first word appears, while tools run and specialists get consulted. In a single-model system the model starts talking the instant it generates; here, nothing reaches the user until the lead has something to say. Do nothing about that gap and the product feels broken: a multi-second silence reads as a hang, not as work happening.</p><p>The fix is not to fight the architecture, it’s to fill that gap. While the specialists are working and the lead has nothing to stream yet, <strong>we stream progress:</strong> as each tool starts, a lightweight status update goes out, “checking your account,” “consulting the compliance specialist,” so the wait has visible motion in it. It’s ephemeral, cleared the moment the lead’s answer starts arriving. Cheap to build, and it turns “why is this stuck” into “oh, it’s working.”</p><h3>Cost, latency, and quality</h3><p>Every online agent lives inside the same trilemma: cost, latency, and quality, push on one and you usually pay on another. This design <strong>moved all three at once</strong>. Cost per turn dropped, since each agent runs a model sized to its job instead of one heavyweight doing everything. Latency now scales with the question: the simple asks the lead handles on its own come back roughly 60% faster, often more, than the single-model version, which paid the full prompt-and-retrieval cost on every turn. The complex, multi-domain questions take roughly 0.9x to 1.4x as long, the lead delegates, the specialists work in parallel, and the lead composes their answers into one, but the quality of that answer is something one model juggling everything could never reach.</p><p>Model your agents as one role each, behind a single orchestrator that owns the conversation and the voice. That structure buys you three things at once: focus, because no agent does two jobs; parallelism, because narrow specialists can work concurrently in ways one generalist model never can; and a model sized to the job, because the hardest reasoning and the simplest lookup no longer have to run on the same expensive model just because they live in the same system.</p><p>None of this is free. It costs a design constraint (only one agent speaks), an engineering habit (brief the specialist, don’t forward the conversation), and a UX problem to solve deliberately (fill the wait with progress until the lead can stream its answer). Still a better trade than a single model quietly hedging its way through every role you ask it to play.</p><p>The next post in this series goes one level deeper: how we keep every one of these prompts lean by loading playbooks just in time instead of writing them all into the system prompt up front.</p><p><strong>In this series:</strong></p><ol><li><a href="https://medium.com/tailor-tech/build-your-agent-around-how-llms-actually-behave-515e03272875">Build your agent around how LLMs actually behave</a></li><li><strong>Architecting a Multi-Agent Assistant</strong></li><li><a href="https://medium.com/tailor-tech/engineering-an-agents-context-6cf189f7968d">Engineering an Agent’s Context</a></li><li><a href="https://medium.com/tailor-tech/securing-an-agents-write-actions-8fcc04021b01">Securing an Agent’s Write Actions</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44355cb29d25" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tailor-tech/architecting-a-multi-agent-assistant-44355cb29d25">Architecting a Multi-Agent Assistant</a> was originally published in <a href="https://medium.com/tailor-tech">Tailor Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build your agent around how LLMs actually behave]]></title>
            <link>https://medium.com/tailor-tech/build-your-agent-around-how-llms-actually-behave-515e03272875?source=rss----9820ba808869---4</link>
            <guid isPermaLink="false">https://medium.com/p/515e03272875</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[prompt-engineering]]></category>
            <dc:creator><![CDATA[Itamar Golan]]></dc:creator>
            <pubDate>Mon, 03 Aug 2026 13:37:47 GMT</pubDate>
            <atom:updated>2026-08-03T13:37:45.413Z</atom:updated>
            <content:encoded><![CDATA[<p><em>The repeatable ways LLMs misbehave in production, and the design principle each one forces.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*32YFTW12KsvMd6ZwGDNAqA.png" /></figure><p>Most of the “agent” problems we run into aren’t model problems. They’re design problems. The model is usually fine. The way we wrapped it isn’t.</p><p>We’re building Navi, an assistant built into a platform that helps people start and run their business. The ambition is broad, an AI that supports the whole business rather than answering one-off questions, and that is exactly what makes it a hard engineering problem. Navi has to reason across very different domains (formation and compliance, bookkeeping and taxes, payroll, invoicing and payments, banking, branding, and marketing), draw on what it already knows about the user, and take real actions on their behalf instead of just describing them. That scope is what surfaced every behavior in this post.</p><p>Put an agent in front of real users and you learn quickly how these models actually behave. Not the marketing version. The annoying, repeatable ways they behave in production. Once you have seen it, you stop treating the LLM as a black box you can instruct your way out of, and start treating its quirks as fixed properties you design around, the same way you would design around latency or a rate limit. Almost every real architectural decision in Navi traces back to one of them.</p><p>This post is the map. Each behavior below comes with the principle it forced on us. The rest of the series goes deep on how we turned those principles into a product.</p><h3>1. LLMs are role-players</h3><p>These models do their best work when they know exactly who they are supposed to be. Give one a clear role and a tight scope, and it needs surprisingly little instruction to handle the common cases well. That keeps getting more true: as the models improve, they need less hand-holding, not more, as long as the role is unambiguous. A clear identity beats a long list of rules.</p><p>Overload that identity and it falls apart. Ask a single assistant to do customer support, sales, and billing from the same prompt, and it starts to hedge. It blends the three together and waters down its behavior on all of them, trying to be everything at once. You feel it the moment your assistant has to cover more than one job: the do-everything prompt that looked great in the demo gets vaguer with every responsibility you bolt on.</p><p><strong>Principle: one role per agent.</strong> A clearly scoped role beats a generalist steered by a growing pile of instructions, and it only gets stronger as the models do. Focus is a capability, not just tidiness.</p><h3>2. Long instructions make them worse</h3><p>Here is a pattern every one of us has lived. Your prompt starts lean. Then you find a bug, so you add an instruction. Another bug, another instruction. A few weeks in, the prompt is a wall of edge cases, half of them quietly contradict each other, and you are writing IMPORTANT and CRITICAL in caps hoping the model listens this time. Eventually everything is important, which means nothing is.</p><p>More rules do not buy you more control. A long prompt buries the signal. The model loses the thread, invents new mistakes, and slows down, and you pay for all of it on every single turn.</p><p><strong>Principle: keep the prompt lean, load the rest just in time.</strong> The edge case gets its playbook only when the edge case actually shows up.</p><h3>3. They will answer even when they don’t know you</h3><p>A lot of good answers depend on who is asking. “How do I improve my ad conversion rate?” has a different right answer for a wedding photographer than for a SaaS startup. Give a model that question with no context and one of two things happens. It produces a generic answer that fits everyone and helps no one. Or it stops and interrogates the user (“what does your business do? what are you selling?”) for things you already know.</p><p>Both are bad. The generic answer is forgettable. The interrogation is worse, because the user already told you all of this when they signed up.</p><p><strong>Principle: load what you already know about the user up front,</strong> before the model says a word. Start the conversation informed.</p><h3>4. They are not deterministic</h3><p>This is the one people keep learning the hard way. LLMs are probabilistic. Hand a model the exact JSON result of a tool call and ask it to pass that back to the frontend verbatim, and sooner or later it will “improve” a field, drop one, or round a number. Ask it to carry a one time token and it eventually mangles it. Ask it to guarantee a write happens exactly once and it simply can’t promise you that.</p><p><strong>Principle: the model judges, the code guarantees.</strong> Language, intent, and decisions belong to the model. Anything that has to be exact every single time (a token, an id, a serialized payload, a commit) belongs in code. This is the line that keeps an agent which takes real actions from being terrifying, and it is the whole subject of part four.</p><h3>5. But don’t code away what they are actually good at</h3><p>The trap on the other side is over-correcting. Once non-determinism burns you, it is tempting to script everything and leave the model as a thin narrator. Don’t. You will throw away the one thing it is genuinely great at: turning a vague, messy request into something precise.</p><p>Take retrieval. Our first version hard coded the knowledge base search to the user’s raw message. Predictable, and weak. Letting the model write the query instead, turning one vague question into a few sharp searches, works far better, because phrasing a good search is judgment, not a rule you can freeze. (Exactly why it helps is a story for the post on context.)</p><p><strong>Principle: put determinism where you need a guarantee, and nowhere else.</strong></p><h3>Where this goes</h3><p>Five behaviors gave us five principles, and the principles gave us an architecture. The next three posts show how, each one standing on its own:</p><ul><li><strong>Architecting a Multi-Agent Assistant:</strong> how “one role per agent” becomes a real system, with a single assistant the user talks to and a team of specialists working behind it.</li><li><strong>Engineering an Agent’s Context:</strong> lean prompts, playbooks loaded on demand, and the user’s context loaded up front.</li><li><strong>Securing an Agent’s Write Actions:</strong> the part that lets an agent create and commit real things without keeping you up at night.</li></ul><p>If there is one idea to take from all of it: don’t fight the model, and don’t over trust it either. Build for how it actually behaves, and most of the hard problems get a lot smaller.</p><p><strong>In this series:</strong></p><ol><li><strong>Build your agent around how LLMs actually behave</strong></li><li><a href="https://medium.com/tailor-tech/architecting-a-multi-agent-assistant-44355cb29d25">Architecting a Multi-Agent Assistant</a></li><li><a href="https://medium.com/tailor-tech/engineering-an-agents-context-6cf189f7968d">Engineering an Agent’s Context</a></li><li><a href="https://medium.com/tailor-tech/securing-an-agents-write-actions-8fcc04021b01">Securing an Agent’s Write Actions</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=515e03272875" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tailor-tech/build-your-agent-around-how-llms-actually-behave-515e03272875">Build your agent around how LLMs actually behave</a> was originally published in <a href="https://medium.com/tailor-tech">Tailor Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reading production safely — for humans and AI agents]]></title>
            <link>https://medium.com/tailor-tech/reading-production-safely-for-humans-and-ai-agents-b0a70b006de0?source=rss----9820ba808869---4</link>
            <guid isPermaLink="false">https://medium.com/p/b0a70b006de0</guid>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[data-masking]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[pii]]></category>
            <category><![CDATA[mcp-server]]></category>
            <dc:creator><![CDATA[Tal Tchernihovski]]></dc:creator>
            <pubDate>Tue, 21 Jul 2026 08:17:16 GMT</pubDate>
            <atom:updated>2026-07-21T08:17:14.912Z</atom:updated>
            <content:encoded><![CDATA[<h4>Read-only, least-privilege, just-in-time, audited access through a single MCP — with sensitive data masked by default.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OeVVvKIjbe-3-jiJ7wUN9A.jpeg" /></figure><p>Every so often an engineer needs to read production directly — chasing a customer bug, confirming a data shape, checking whether a backfill actually landed. Most of the time there are better-scoped ways in (internal APIs, dashboards), but every now and then you need the raw rows. Increasingly, AI coding agents need the same thing — they’re only as useful as the real state they can observe.</p><p>Giving out that access safely is more work than it looks. You have to control who can connect and what they’re allowed to do, keep production stable while someone pokes at it, keep an audit trail of what was read, and make sure customer data doesn’t walk out the door. Data masking tends to get the attention, but it’s one facet of a broader problem.</p><p>Here’s the shape of what we built.</p><h3>One seam: an MCP</h3><p>All production reads go through a single read-only <a href="https://modelcontextprotocol.io/">MCP</a> server over a production replica. Concentrating access in one place is what makes everything else tractable — it’s the single point where we can enforce least privilege, mask data, audit queries, and bound sessions. And the same interface serves a human in their editor and an autonomous agent, so there’s one path to secure and reason about, not two.</p><p><strong>Least privilege by construction.</strong> The connection is read-only, against a replica — no writes, no schema changes, no path to the primary. An investigator, human or agent, can read, only read, and only through this seam.</p><p><strong>Stability.</strong> The MCP reads from a dedicated replica we stood up for exactly this, separate from the writer and from the replicas that serve the application. On Aurora a reader instance shares the cluster’s storage but runs on its own compute, so a heavy ad-hoc query can’t affect production performance — investigation load and live traffic never contend for the same resources.</p><h3>Access is just-in-time and audited</h3><ul><li><strong>Just-in-time.</strong> There’s no standing connection sitting around. Access is granted per investigation, and each time, you state what you’re looking into and why — access is tied to an intent, not a permanent grant.</li><li><strong>Short sessions.</strong> Sessions expire after ten minutes, so nothing lingers as an idle privileged connection.</li><li><strong>Audit.</strong> pgaudit records every statement that runs through the path, so “who read what, and when” is always answerable.</li></ul><h3>Masking: allowlist, not blocklist</h3><p>Now the data-masking part. The decision that matters most here is choosing an allowlist over a blocklist.</p><p>A blocklist — “hide these known-sensitive columns” — only ever protects you from the columns you remembered. Add a tax_id column and forget to update the list, and it’s exposed. An allowlist flips the risk: every column comes back masked <em>unless</em> it’s on a short, reviewed list of columns we’re confident are safe — stable identifiers, timestamps, enums like status. Everything else — email, first_name, phone, ip_address — comes back as a masked token by default, whether or not anyone flagged it. A brand-new column is masked until someone reviews it onto the safe list. Safe is the default; exposing a column is the thing that takes a deliberate, reviewed step.</p><p>A few details that made it usable:</p><ul><li><strong>Stable tokens.</strong> A masked value is deterministic, not a random blob — you can still group by it or join on it, you just never see the underlying value.</li><li><strong>It follows the real column.</strong> Masking keys off the underlying table column, not the SQL you wrote. SELECT secret AS id still masks — you can’t launder a sensitive column through an alias.</li><li><strong>It happens at the source.</strong> Values are replaced inside the access path, before the response is assembled. For an AI agent that matters a lot: raw sensitive data never enters the model’s context, so it can’t leak into a prompt, a trace, or a log — it simply never arrives.</li></ul><h3>Catching it earlier</h3><p>Masking at read time is the backstop. We’d rather sensitive data never be stored in the clear to begin with, so the same notion of “what looks sensitive” that the masker uses also runs in code review: when a change adds a database column, the column is classified, and one that looks sensitive either blocks or routes to a human before it merges. When a column genuinely needs to hold sensitive data, the guidance is to encrypt it with KMS rather than store it raw.</p><h3>Why bother</h3><p>The goal was never to lock production down. It was to make reading production <em>safe to do</em> — so an engineer or an agent can get the answer they need, and the careful thing is simply what happens by default. Access is scoped, short-lived, and audited; sensitive data is masked unless it’s been proven safe; and every exception is a deliberate, reviewed step. Nobody has to remember to be careful.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0a70b006de0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tailor-tech/reading-production-safely-for-humans-and-ai-agents-b0a70b006de0">Reading production safely — for humans and AI agents</a> was originally published in <a href="https://medium.com/tailor-tech">Tailor Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Letting AI agents into our Kubernetes clusters-without handing over the keys]]></title>
            <link>https://medium.com/tailor-tech/letting-ai-agents-into-our-kubernetes-clusters-without-handing-over-the-keys-ea9cb7033c6e?source=rss----9820ba808869---4</link>
            <guid isPermaLink="false">https://medium.com/p/ea9cb7033c6e</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[cloudflare-zero-trust]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Evgeny Kharitonov]]></dc:creator>
            <pubDate>Thu, 16 Jul 2026 07:06:01 GMT</pubDate>
            <atom:updated>2026-07-16T07:06:01.509Z</atom:updated>
            <content:encoded><![CDATA[<p>Hand an autonomous agent an infrastructure incident to investigate, and most of what it needs it can already get without touching a cluster: logs, metrics, deployment status, error rates, and traces all live in your observability stack. Our agents reach that through a Datadog MCP, and they reach the cloud control plane through an AWS MCP. There’s no official AWS MCP, so we built a thin one ourselves — a read-only server backed by a dedicated IAM role scoped to exactly what the agents need, nothing more. For a large share of investigations, that combination is genuinely enough. We deliberately do <em>not</em> want agents leaning on raw cluster access for the things observability already answers better.</p><p>But some trails lead where observability doesn’t follow — a DNS resolution failure inside the cluster, a network policy silently dropping traffic, a CNI or service-mesh quirk, the live state of a resource nothing happens to be scraping. That’s when an agent needs to look at the cluster itself. So the interesting combination isn’t “give the agent a cluster” — it’s giving the agent AWS, Datadog, <em>and</em> the cluster, each through its own MCP, so it can line up what the cloud and the dashboards are saying against what the cluster is actually doing. An agent that can query all three is a genuinely strong first responder on an infra issue; one that’s blind to the cluster keeps handing the hard part back to a human.</p><p>The catch is <em>how</em> you give an agent that cluster access. The lazy answer is to hand it a kubeconfig — the same one on your laptop, with the same standing permissions, sitting in a file an agent (or a bug in the agent’s tool-use) can read at any time, valid until someone remembers to rotate it. That’s broad, long-lived, and unaudited: exactly the three properties you don’t want anywhere near something that writes its own commands.</p><p>The right answer isn’t “no access.” It’s <strong>access scaled to blast radius</strong> — how much damage a mistake in that specific environment can actually do. This post is the shape of that model: a gateway in front of every cluster, read-only everywhere by default, write access carved out in exactly one place on purpose. Part 2 covers how that gateway is actually enforced as the <em>only</em> door in. Part 3 covers what you get once every touch through it is a structured event: an audit trail for agent-driven infrastructure work that didn’t exist before.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*isTPPl0ZMWwcBKpi7lhFew.jpeg" /></figure><h3>The gateway: agents talk to an MCP, never to the API server</h3><p>The mechanism that makes any of this possible is the <strong>Model Context Protocol (MCP)</strong> — a standard way to expose tools and data to an AI agent as a discrete, named set of callable actions, instead of a general-purpose shell. An agent that has “an MCP tool called get_pod_logs&quot; can be scoped, logged, and rate-limited in a way that an agent with &quot;a shell and a kubeconfig&quot; cannot.</p><p>The design puts a <strong>Kubernetes MCP server</strong> — an <a href="https://github.com/containers/kubernetes-mcp-server">open-source project</a> built specifically to expose cluster operations (get, list, logs, describe, and optionally exec) as MCP tools — in front of <strong>each</strong> cluster individually. One instance per cluster, not one shared instance for the fleet. Agents talk to that MCP; they never see the cluster’s own API server endpoint or a credential that would let them reach it directly.</p><p>That’s the load-bearing structural decision: the MCP is not a convenience wrapper around kubectl, it&#39;s the entire boundary. Everything downstream — identity, RBAC, session length — is a policy applied at that one chokepoint, per cluster.</p><h3>Identity and time, not network reachability</h3><p>Each per-cluster MCP is published behind <strong>Cloudflare Access</strong> (Zero Trust), using <strong>Okta</strong> as the identity provider through managed OAuth. Practically, that means every connection to an MCP is an authenticated, per-user OIDC session — not a shared secret that, once leaked, works for anyone who has it until someone notices and rotates it.</p><p>This is the principle worth naming explicitly, because it’s easy to build the opposite by default: <strong>the control plane here is identity and time, not network reachability.</strong> It’s tempting to reach for network controls — this cluster’s API server is only reachable from this VPN, this bastion, this CI runner — because they’re familiar and easy to reason about topologically. But network reachability answers “where are you connecting from,” not “who are you and for how long.” A laptop on the right VPN with a stale kubeconfig is a bigger risk than a short-lived, per-user, RBAC-scoped session issued five minutes ago — even when the session is read-only. Identity-and-time as the primary gate, with network position as a secondary layer at most, is the harder default to build but the one that actually matches the threat: it’s not usually attackers on the wrong network, it’s standing credentials nobody remembers exist.</p><p>Concretely, each MCP instance runs under its own dedicated Kubernetes <strong>ServiceAccount</strong>, and that ServiceAccount’s <strong>RBAC</strong> is the actual enforcement of what an agent connected through it can do. One rule holds everywhere, no exceptions: a set of sensitive resource types is denied outright on every cluster- <strong>secrets among them</strong> - regardless of environment or session length.</p><h3>Blast radius sets the policy, not convenience</h3><p>With the chokepoint and the identity model in place, the interesting design question is: what should the RBAC on each cluster’s ServiceAccount actually allow? The answer is scaled directly to what a mistake in that cluster costs:</p><ul><li><strong>dev</strong> — read <strong>and write</strong>, but still bounded: create, update, delete, and exec, scoped to a single namespace and subject to the same denied-resource rules as every other cluster. This is the deliberate <strong>acceleration zone</strong>. <br>An agent here can restart a deployment, apply a fix, patch a config, and verify the result in the same loop, without a human relaying every command. That’s the entire point of giving an agent cluster access in the first place, and dev is where a wrong guess costs a kubectl rollout undo, not an incident.</li><li><strong>staging, production, ops, and data clusters</strong> — <strong>read-only</strong>: get, list, logs, top, describe. No writes, anywhere, no matter how confident the agent is. The blast radius of a mistake here is real users or real data, so the answer to “can the agent fix this itself” is no — it can <em>diagnose</em>, and a human (or a more constrained path — see Part 2) acts on the diagnosis.</li></ul><p>Session lifetime follows the same logic and is tuned per cluster: dev sessions run on the order of a day, since the whole value of the acceleration zone is not re-authenticating every few minutes. An internal ops cluster sits around an hour — enough for a focused debugging session, short enough to bound exposure. Production sessions are deliberately short — on the order of ten minutes — because even read access to production should not be a thing you forget you’re holding. Different clusters are also gated to different identity groups in Okta, so “who can even request a session here” is itself scoped before RBAC ever comes into play.</p><p>None of these numbers are load-bearing on their own — they’re design choices, tunable as the system matures. What’s load-bearing is the shape: <strong>the acceleration zone is exactly one environment wide, and every other environment defaults to read-only with a short leash.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xi7ZhannVWv6pWuKkCIEAw.png" /></figure><h3>Two identity planes, one deliberately narrower than the other</h3><p>There are two separate ways to reach a cluster, and keeping them separate is itself a design decision. Humans who still need raw kubectl — for the operations that genuinely require it — authenticate through a cloud IAM assume-role flow gated by TOTP: a real, if familiar, credential-issuance path with its own standing risk. Agents authenticate through the Cloudflare Access → Okta OAuth flow into the MCP, and that path never distributes a cluster credential of any kind to anything the agent can read or exfiltrate. An agent session and a human kubectl session don&#39;t share a mechanism, a credential format, or a blast radius — which means hardening one doesn&#39;t quietly weaken the other, and a compromise of the agent&#39;s tooling can&#39;t be laundered into raw cluster access.</p><h3>What’s still open</h3><p>Two honest gaps, both intentional rather than overlooked. Read-only outside dev means some real operational tasks — restarting a stuck pod in staging, clearing a bad cache entry in an ops cluster — currently have no path through the MCP at all. That’s not an oversight; it’s next in this series: Part 2 is about making the MCP the <em>only</em> door, including how the narrow, audited paths for the operations that do need to write outside dev get built without reopening the blast radius this whole model exists to contain.</p><p>The other gap: per-user attribution end-to-end — knowing precisely which identity, on which agent run, issued which specific call — is still maturing. Today you know who opened the session; tracing an individual tool call back through an agent’s own reasoning chain is a harder problem, and it’s the subject of Part 3, where every cluster touch becomes a structured, queryable event.</p><p>Access scoped to blast radius, gated by identity and time rather than network position, is the foundation everything else in this series builds on. It’s also, on its own, a stronger baseline than most humans get: a ten-minute, RBAC-scoped, per-user session to production beats a kubeconfig that’s been sitting in ~/.kube/config since a laptop was issued. Part 2 picks up from here — how that MCP boundary gets enforced as the <em>only</em> way in, for humans and agents alike.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea9cb7033c6e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tailor-tech/letting-ai-agents-into-our-kubernetes-clusters-without-handing-over-the-keys-ea9cb7033c6e">Letting AI agents into our Kubernetes clusters-without handing over the keys</a> was originally published in <a href="https://medium.com/tailor-tech">Tailor Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Don’t Build the Integration, Build the Capability]]></title>
            <link>https://medium.com/tailor-tech/dont-build-the-integration-build-the-capability-bcae956a172d?source=rss----9820ba808869---4</link>
            <guid isPermaLink="false">https://medium.com/p/bcae956a172d</guid>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[zero-trust]]></category>
            <dc:creator><![CDATA[Evgeny Kharitonov]]></dc:creator>
            <pubDate>Sun, 12 Jul 2026 07:47:29 GMT</pubDate>
            <atom:updated>2026-07-12T07:47:27.887Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A platform team’s job with AI isn’t to wire every agent into every system. It’s to make any team’s secure, agent-ready connection a same-day job. Here’s the design work that gets you there.</em></p><p>Every department wants agents. Marketing wants one wired into their campaign tools so it can draft and schedule sends without leaving the conversation. IT wants one connected to their device-management system so fleet questions answer themselves. Support wants theirs sitting on top of the ticketing platform. Data wants the warehouse accessible as naturally as a chat. And everybody wants to search the company knowledge base without switching tools.</p><p>That’s a lot of connectors — and if you build them one at a time, you’re in trouble before you’ve shipped the third one. You’ve got a scatter of half-maintained services, no coherent identity model, and a platform team that’s bottlenecked every time someone files a new “we want an agent” request. The problem isn’t any single integration. The problem is that one-at-a-time is the wrong unit of work.</p><p>Here at Tailor Brands, we ran into this early. So instead of building integrations, we built a capability — an internal platform we call <strong>Loom</strong>, designed so that any team can have a new secure, agent-ready connector in roughly a day. This post is about the design decisions that made that possible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9QqriSVTNCh2WXnFRojOFQ.png" /></figure><h3>The trap: one integration at a time</h3><p>The mechanics of connecting an agent to a single system are, by now, a solved problem — there’s a standard protocol for it (MCP), and the tutorials all walk the same happy path. The catch is the words <em>single system</em>: you stand up a connector for the marketing platform, another for the ticketing system, another for device management. When you do that at company scale you end up with something like:</p><ul><li>A new microservice per connector, each one owned (or forgotten) differently.</li><li>Auth solved independently on each one — some use API keys in the environment, some roll their own token check, none of them share a policy.</li><li>Observability bolted on differently if at all.</li><li>The platform team as the person who does this work every time a new request comes in.</li></ul><p><strong>The goal isn’t to build the integrations. It’s to build the capability to produce integrations quickly and safely.</strong> That reframe changes the design completely.</p><h3>Design decision 1 — one platform, many connectors</h3><p>The first decision: instead of one service per connector, Loom hosts all of them inside a single platform service.</p><p>Here’s why this works. When you actually sit down to build a connector, the unique work per connector is surprisingly small: talk to the upstream API, shape the results in a way that’s useful to an LLM, expose the right operations. That part varies by connector. But everything around it — identity verification, request routing, graceful shutdown, structured logging, health endpoints — is identical across all of them. Built once in a shared chassis, maintained once.</p><p><strong>The unique work per connector is small. The scaffolding is large. Build the scaffolding once.</strong></p><p>The trade-off is obvious and worth naming honestly: connectors deploy together. If you want to ship an update to the marketing connector, you redeploy the platform, which also redeploys the ticketing and device-management ones. For an internal platform — where you control the pipeline and the workloads — this is actually fine. One deployment pipeline, one reliability surface, one place to find logs. For a product you sell to external customers where each connector might have different SLAs, you’d think twice. For us, it’s strictly a feature.</p><p>Today Loom runs roughly seven connectors across departments: Marketing, IT, Support, Data, an org-wide knowledge base backed by vector search, a shared file store, and a connector for our internal deployment system — all built and hardened over a couple of months. That it didn’t take a big team is the whole point of this post: most of each connector is scaffolding we only had to write once.</p><h3>Design decision 2 — solve identity once, at the edge</h3><p>The second decision is where to enforce authentication — and the answer is: not inside the connectors.</p><p>Every Loom connector sits behind a zero-trust access layer. Traffic arrives at the edge — a Cloudflare Access layer in front of the platform — which verifies the request against our company SSO (Okta) before it ever reaches the application. The edge authenticates; the application trusts. When a request makes it through, a signed identity assertion is forwarded downstream. The connector decodes it to know who’s calling; it doesn’t re-verify, because the only way a request reaches it is through the edge.</p><blockquote><em>“A connector should assume it’s already behind a locked door — don’t build a second lock inside an already-locked room.”</em></blockquote><p>The consequences of this choice are significant:</p><ul><li><strong>Access policy becomes a per-connector dial, not per-connector code.</strong> Who can reach the device-management connector versus the marketing connector is a configuration entry in the edge layer, not a logic branch in application code.</li><li><strong>Security review has one address.</strong> When you want to audit how agents are authenticated against your systems, there’s one place to look.</li><li><strong>The OAuth machinery lives at the perimeter.</strong> Agent clients need to discover connectors and register against them dynamically — the protocol defines an OAuth discovery and dynamic client registration flow per resource. That flow belongs at the edge — it has to know about auth — not scattered inside six different application handlers.</li></ul><p>That last point is exactly why the next decision matters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UMMej4FXvf4aW6zTZPpfaw.png" /></figure><h3>Design decision 3 — a front door per connector</h3><p>We started Loom with path-based routing under a single host: one hostname, paths like /marketing, /support, /device-management. It seemed simpler. It wasn&#39;t.</p><p>The problem is that access control, OAuth discovery, and request routing all want to operate at the level of a connector, not at the level of a path suffix. Cloudflare Access policies are scoped to hosts. OAuth discovery endpoints live at /.well-known under the resource root — and &quot;the resource&quot; has to be a host, not a path prefix, or the client registration flows break. The routing layer wants to match by host.</p><p>When every layer independently wants host-level boundaries, path-based routing is fighting the grain of the stack. <strong>We switched to a dedicated subdomain per connector</strong> — marketing-mcp.example.internal, support-mcp.example.internal, and so on. It looks like more pieces, but it&#39;s actually simpler: one clean addressing scheme that the edge, the OAuth flows, and the routing layer all agree on. That alignment keeps everything else simple.</p><h3>Design decision 4 — design for scale-out from day one</h3><p>Agents generate bursty, concurrent load. A single conversation can spawn multiple parallel tool calls; a shared deployment tool or knowledge base sees that load multiplied across every employee using it. The only scalable answer is to run many interchangeable replicas behind a load balancer.</p><p>That only works if each request is self-contained. <strong>Statelessness is the constraint — but a narrower one than it first sounds.</strong> The rule isn’t <em>no state</em>; it’s <em>no state in the process</em>. If a connector holds session context in memory, or caches user data on one pod, then every request has to land on that same pod and you’ve given up horizontal scale. Shared state is fine, as long as it lives somewhere every replica can reach: auth arrives in the forwarded assertion, call context rides in the request, and anything that genuinely needs to persist goes to a backing store. One of our connectors does exactly this — it keeps per-user credentials for a task-management tool in Postgres, which keeps the pods interchangeable and, as a bonus, opens the door to richer stateful features later. The pods stay disposable; the state just doesn’t live inside them.</p><p>It’s less elegant in the small. There are moments when stateful shortcuts feel natural — holding onto a cursor, caching an auth token per user. We push back on all of them. <strong>Statelessness is less elegant in the small; far more robust in the large.</strong> An extra round-trip or a lookup in a fast shared store is almost always the right call over process-local state you have to maintain.</p><h3>The payoff — make the next connector cheap</h3><p>Once the pattern stabilized — shared chassis, edge auth, subdomain boundary, stateless design — adding a new connector became mechanical. Describe what system you’re connecting, what operations it exposes, and who should have access. Stand up the connector code (which is genuinely small once the scaffolding exists). Add an access policy entry at the edge. Add a routing entry for the new subdomain. That’s it.</p><p>Mechanical work should be automated. Once the pattern repeated often enough to be confident it was stable, we wrapped the entire rollout in a single command: describe the connector and it scaffolds the connector code, wires the access policy, wires the routing entry, and opens everything for review as a single coherent change. What used to be a multi-repo, multi-step process scattered across a few different systems is now a guided conversation.</p><p>The effect on how the platform team relates to the rest of the company is real. The answer to “can we get an agent connected to X?” went from “let’s scope a project” to “let’s do it this week.” <strong>The platform team becomes the on-ramp, not the gate.</strong> That’s the outcome the design was aimed at from the beginning.</p><p>There’s a second-order effect that’s easy to miss: when adding a connector is cheap, connectors become <strong>disposable</strong>. Where a solid official or community connector already exists, we just use it. Where one doesn’t — or where it exists but doesn’t match how our teams actually work — we build our own, tuned to exactly what we need. And because the investment in any single connector is small, we’re never precious about it: one that stops earning its keep gets thrown away and replaced, not maintained forever out of sunk cost. Being able to treat integrations as disposable — use, build, swap, or delete on demand — turns out to be a surprisingly powerful place to stand.</p><p>The automation didn’t come first, though — and that honesty matters. We built it only after the pattern had repeated enough times that we were confident it was stable and worth encoding. Automating an uncertain pattern just makes it faster to make the same mistake in more places. Get the pattern right first; automate second.</p><h3>What we’d carry forward</h3><p>If you’re building something similar, here’s what the design history argues for:</p><ol><li><strong>Build the capability, not the integrations.</strong> One shared chassis, maintained once.</li><li><strong>Push security to the edge.</strong> Auth solved in one layer, surfaced as policy, not code.</li><li><strong>Pick a boundary the whole stack agrees on.</strong> Subdomain-per-connector aligns routing, access control, and OAuth discovery — fighting that alignment is expensive.</li><li><strong>Design for many replicas early.</strong> Statelessness is a constraint, not a nice-to-have; retrofit is much harder than design.</li><li><strong>Automate the rollout only after the pattern is stable.</strong> Premature automation locks in early mistakes.</li></ol><p><em>Small tip from my perspective:</em> the departments asking for connectors don’t think about your routing layer or your trust model. They care that it showed up the same week they asked, and that they can trust it with their data. The platform abstractions exist to make that reliability and speed possible — not to be visible.</p><p>Agents are only as valuable as the systems you safely connect them to. An agent that can reason beautifully but can’t touch your CRM, your device management layer, or your company knowledge is a clever toy. A platform team’s job isn’t to build every flow — it’s to make every flow possible.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bcae956a172d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tailor-tech/dont-build-the-integration-build-the-capability-bcae956a172d">Don’t Build the Integration, Build the Capability</a> was originally published in <a href="https://medium.com/tailor-tech">Tailor Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How it shipped: MVP first, features as they were needed]]></title>
            <link>https://medium.com/tailor-tech/how-it-shipped-mvp-first-features-as-they-were-needed-ac6e0f13c2fa?source=rss----9820ba808869---4</link>
            <guid isPermaLink="false">https://medium.com/p/ac6e0f13c2fa</guid>
            <category><![CDATA[agentic-workflow]]></category>
            <category><![CDATA[vibe-coding]]></category>
            <category><![CDATA[agentic-coding]]></category>
            <category><![CDATA[mvp]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Nadav Shatz]]></dc:creator>
            <pubDate>Mon, 29 Jun 2026 09:15:19 GMT</pubDate>
            <atom:updated>2026-06-29T09:15:17.804Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Part 4 of 4 — the process lens. The first three posts described the system as it stands; this one is about how it got there.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0BpnlWvCKAxQhprwdFM2cQ.jpeg" /></figure><p>Part 1 made an argument — <em>the build is short, the hardening is long, so keep the thing you’re hardening small</em>. Parts 2 and 3 described the finished machine. This post is the honest part: the machine wasn’t designed finished. It was shipped as a deliberately tiny MVP and then grew one capability at a time, each one added because a <em>real app asked for it</em> — not because a roadmap predicted it.</p><p>That sequencing isn’t an accident of how we happened to work. It’s the same thesis from Part 1, applied to process: if generality is what makes a platform expensive, then the way to stay cheap is to refuse to build a capability until something concrete needs it. The git history is the proof, and it’s a tidy one — the whole arc below happened over about <strong>ten days in early June 2026</strong>.</p><blockquote>A note on sources. The platform’s code is spread across several repos, but the clearest signal of when a capability became real is when it was first documented and when the first app exercised it. So the timeline below is reconstructed from those two markers — a faithful proxy for “when it became real,” not a PR-by-PR changelog of the platform internals. Dates are approximate.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LIVd7bAG45T8f5jjMc05OQ.png" /></figure><h3>The shape of the process</h3><p>Three rules, stated plainly, describe almost every decision in the history:</p><ol><li><strong>Ship the smallest substrate that runs one real app.</strong> Not “a platform” — <em>one app, end to end</em>, with the narrowest possible runtime.</li><li><strong>Add a capability only when a real app needs it.</strong> No speculative features. The trigger for “support X” was always “someone is trying to ship an app that needs X,” usually a smoke-test app built for exactly that purpose.</li><li><strong>Harden what use surfaces, at the earliest gate that catches it.</strong> Every rough edge that bit someone became a check, a default, or a wall — ideally one that fails at PR time rather than at runtime.</li></ol><p>What follows is those rules playing out, in four phases.</p><h3>Phase 0 — the MVP substrate (~Jun 1–2)</h3><p>The repo bootstrapped on <strong>June 1</strong> (a Terraform-managed skeleton), and within a day there was a working end-to-end path: the architecture, the shared chart, the ApplicationSet, the build pipeline, and the deploy MCP — enough to take a single Next.js app from “describe it” to a live, SSO-gated URL. The very first real app, todos, was deployed and then <strong>scheduled for deletion on June 2</strong> — which means the <em>first</em> thing the platform proved end-to-end wasn’t just “deploy works” but “deploy <em>and the soft-delete lifecycle</em> work.” The MVP’s definition of done included being able to clean up after itself.</p><p>Crucially, the MVP already had teeth that are tempting to defer but expensive to retrofit:</p><ul><li>The <strong>SAST gate</strong> (validate-sast) and secret scanning were in from essentially the start — security gates are far cheaper to add before there are 50 apps than after.</li><li><strong>Egress hardening</strong> (default-deny posture, IMDS deny, opt-in restricted mode) and <strong>opt-in Redshift</strong> landed in the first wave too.</li></ul><p>This matters to the thesis: the MVP was narrow in <em>scope</em> (one runtime, one app shape) but not soft in <em>posture</em>. The walls came first; the features came later.</p><h3>Phase 1 — close the gaps the MVP exposed (~Jun 3–4)</h3><p>The first days of real use immediately surfaced gaps — not in features, but in <em>safety and ergonomics</em>:</p><ul><li><strong>Scoped reads + the secured-vault tier</strong> (June 3). The original cut let any employee read any app’s logs/status; first contact with reality made that obviously too loose, and the read path was tightened to mirror writes. The vault tier arrived in the same breath for apps that needed to be visible to <em>fewer</em> than all employees.</li><li><strong>app_requirements and </strong><strong>close_app_pr</strong> (June 3) — the agent kept needing “what exactly must an app satisfy?” and “this PR is wedged, let me start clean.” Both are tools that exist because the deploy <em>loop</em> hit friction, not because anyone designed them up front.</li><li><strong>Source-staging fixes</strong> (June 4) — the presigned-upload contract (no headers, 15-min TTL, 403 triage) got pinned down after a real “why won’t my upload work” misdiagnosis.</li></ul><p>Phase 1 is the unglamorous truth of MVPs: the first feature you build after launch is usually a fix for something launch taught you.</p><h3>Phase 2 — the feature wave, driven by dogfooding (~Jun 7–8)</h3><p>This is where the “as needed” rule is most visible, because each feature lands <em>next to the app that demanded it</em>:</p><ul><li><strong>A second framework, then a third.</strong> TanStack Start was documented on June 7 and React Router 7 on June 8 — and the git history shows tanstack-smoke and reactrouter-smoke apps scaffolded on June 8, the smoke tests that proved each framework actually built and booted under Paketo. Multi-framework support wasn’t a vision item; it was “someone wants to ship a TanStack app, does it work?” — and the answer required the devDependencies-pruning fix and the Procfile convention from Part 2. Because the substrate was a <em>runtime contract</em> (“a Node server on :3000”), adding frameworks needed zero chart and zero pipeline change — exactly the payoff Part 1 predicted.</li><li><strong>SSE realtime</strong> (June 8) — added when an app needed live updates, and deliberately scoped to the one transport that works uniformly across all three frameworks rather than the more general (and non-uniform) WebSockets.</li><li><strong>Object storage</strong> (June 8) — and with it, the <em>single</em> deliberate breach of the “pods have no AWS identity” rule. Note the discipline: the exception wasn’t designed into the MVP “in case someone needs files.” It appeared the day an app needed object storage, and it was scoped as tightly as possible (one shared role, self-gating via the ServiceAccount annotation, tokenless).</li><li><strong>App identity</strong> (June 8) — CF Access JWT verification, so apps could know their logged-in user without shipping a login. Again demand-shaped: it’s the feature that makes <em>migrating an existing app</em> onto vibe viable, by letting it drop its bundled auth.</li></ul><p>Four substantial capabilities in roughly two days — but none of them speculative. Each has a fingerprint in the apps directory or the migration story showing what pulled it into existence.</p><h3>Phase 3 — ergonomics and hardening from real use (~Jun 9–11)</h3><p>Once people were shipping apps with databases and identity, the rough edges moved up the stack — from “can I deploy at all” to “this failed in a confusing way”:</p><ul><li><strong>transfer_app_ownership</strong> (June 9) — apps outlive the person who first built them; handing one over needed to be a first-class, GitOps-native operation rather than a manual directory shuffle.</li><li><strong>The </strong><strong>node-pg-migrate-in-</strong><strong>dependencies pre-flight</strong> (June 9) and the <strong>migrations-require-</strong><strong>database.enabled</strong> coupling — both are <em>incident fixes</em> turned into PR-time walls. An app shipped migrations without a database and 500’d at runtime; an app put the migration tool in devDependencies and the migrator died on a pruned image. Both failures were pulled forward into checks that fail before merge. (Part 3 tells these as incidents; here they’re visible as the <em>process</em> of hardening-follows-use.)</li><li><strong>Failure-diagnosis tooling</strong> (June 9) — get_app_pr_status learning to return the failing <em>leaf</em> job, its log tail, and structured annotations, because an agent with no GitHub UI kept being stuck on “CI is red, but why?”</li><li><strong>Postgres extensions + </strong><strong>LISTEN/</strong><strong>NOTIFY, and URL overrides</strong> (June 10) — refinements landing alongside creatives-tracker, a real app on June 10 that used a database, identity, <em>and</em> LISTEN/NOTIFY fan-out. A genuine app exercising several young features at once is the strongest signal the platform had crossed from “demo” to “useful.”</li><li><strong>get_app_source</strong> (June 11) — the read/download counterpart to the source-upload flow, so an agent could pull an existing app’s committed tree back down and iterate on it without a local checkout. It’s the smallest possible feature with the clearest trigger: the moment people had apps worth <em>editing again later</em>, “read the source back” became the obviously-missing half of the loop — and, like every read tool, it inherited the per-owner scoping for free.</li></ul><h3>What the shape bought us</h3><p>Reading the arc back, a few things stand out as consequences of the demand-driven discipline — not happy accidents:</p><ul><li><strong>We never built the speculative generality that Part 1 warned about.</strong> WebSockets, per-app IAM roles, a third data store nobody asked for — none of it got built “to be safe.” The system has exactly the surface its apps forced it to have, which is the whole reason the hardening stayed tractable.</li><li><strong>Each addition could be hardened immediately, because it arrived alone.</strong> Adding object storage <em>by itself</em> meant we could reason about its one IRSA exception in isolation. A big-bang “v1 with everything” would have made every wall a multi-way interaction.</li><li><strong>The backlog stayed honest.</strong> Because features were pulled by need, the things <em>not</em> yet built (per-app IAM, durable audit log, PITR) are visibly “no app has needed this enough to justify the hardening yet” rather than “we forgot.” That’s a much healthier backlog than one full of half-built speculation.</li></ul><h3>The cost of doing it this way</h3><p>It would be dishonest to present this as free. Demand-driven evolution has real downsides, and we paid them:</p><ul><li><strong>Some things got reworked.</strong> Read-scoping tightening in Phase 1 was, in effect, fixing a Phase 0 decision that was too loose. Shipping narrow means occasionally shipping <em>wrong</em> and correcting in the open.</li><li><strong>Early adopters hit the sharp edges first.</strong> The people deploying on June 3–4 found the staging-upload and PR-wedge friction the hard way. An MVP externalizes some discovery cost onto its first users; that’s only acceptable because the users are internal colleagues, not customers.</li><li><strong>It requires the discipline to <em>not</em> build.</strong> The hardest part of “add features as needed” is saying no to features that aren’t needed yet but obviously will be. That only works if you trust the process enough to add them later, quickly — which in turn only works because the substrate is narrow.</li></ul><h3>The throughline</h3><p>Part 1 argued the <em>what</em>: build a narrow substrate instead of renting or over-building. This post is the <em>when</em>: ship the narrowest useful slice, then let real apps — not a roadmap — pull each capability into existence, hardening each as it arrives. The two are the same idea. “The build is short, the hardening is long” isn’t only a reason to scope the system small; it’s a reason to scope the <em>process</em> small too — to add surface area only when something real is standing there asking for it, so that every piece you harden is a piece you already know you need.</p><p>That closes the series: the <strong>why</strong> (Part 1), the <strong>how</strong> (Part 2), the <strong>guardrails</strong> (Part 3), and the <strong>process</strong> that connected them. Four posts, one throughline — build the narrowest thing that works, then let real use, not a roadmap, tell you what to harden next.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac6e0f13c2fa" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tailor-tech/how-it-shipped-mvp-first-features-as-they-were-needed-ac6e0f13c2fa">How it shipped: MVP first, features as they were needed</a> was originally published in <a href="https://medium.com/tailor-tech">Tailor Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>