<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kiell Tampubolon</title>
    <description>The latest articles on DEV Community by Kiell Tampubolon (@kielltampubolon).</description>
    <link>https://dev.to/kielltampubolon</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3890870%2Ff4c1760b-670f-4d29-b0a8-29dc39842afa.jpg</url>
      <title>DEV Community: Kiell Tampubolon</title>
      <link>https://dev.to/kielltampubolon</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kielltampubolon"/>
    <language>en</language>
    <item>
      <title>Microsoft 365 Went Down Overnight. 17.6% of Indonesian co.id Domains Get Their Mail Through It</title>
      <dc:creator>Kiell Tampubolon</dc:creator>
      <pubDate>Fri, 13 Nov 2026 02:31:00 +0000</pubDate>
      <link>https://dev.to/kielltampubolon/microsoft-365-went-down-overnight-176-of-indonesian-coid-domains-get-their-mail-through-it-a59</link>
      <guid>https://dev.to/kielltampubolon/microsoft-365-went-down-overnight-176-of-indonesian-coid-domains-get-their-mail-through-it-a59</guid>
      <description>&lt;p&gt;&lt;em&gt;Last updated 13 Nov 2026, 09:30 WIB. The incident is still open. I will update this post when Microsoft closes it and publishes a post-incident report.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In Indonesia this Microsoft 365 outage started at 23:17 WIB on Thursday 12 November and was still open when offices opened on Friday. Outlook, Exchange Online and the Microsoft 365 features that depend on Exchange were affected. I wanted to answer two questions: what Microsoft has actually said so far, and how many Indonesian organisations receive their email through Exchange Online. For the second one I checked the MX records of the same 4,573 .id domains I used in my &lt;a href="https://www.kielltampubolon.id/writing/i-checked-dmarc-on-4437-indonesian-id-domains/" rel="noopener noreferrer"&gt;DMARC study&lt;/a&gt; last month.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;The outage began at 23:17 WIB on Thursday. At 09:14 WIB on Friday Microsoft was still restoring capacity region by region.&lt;/li&gt;
&lt;li&gt;Microsoft says some of its servers stopped responding and dropped out, and the rest could not carry the extra load. It has not published a root cause and has reported no sign of an attack.&lt;/li&gt;
&lt;li&gt;About 1 in 11 popular .id domains that receive email use Microsoft 365 for it. Among company domains (co.id) it is about 1 in 6. Government domains (go.id) mostly run their own mail servers.&lt;/li&gt;
&lt;li&gt;Mail sent to an affected organisation is normally queued and retried by the sender's server, so it arrives late rather than disappearing. For anything urgent, call.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What Microsoft has said, in WIB
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbe51fcj1xny5y8xe7bj7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbe51fcj1xny5y8xe7bj7.png" alt="Microsoft's public Service Health Status page on 13 November 2026 showing &amp;quot;Service degradation&amp;quot; for Microsoft 365 (Business or Enterprise) and the incident &amp;quot;Users may be unable to connect to multiple Microsoft 365 services&amp;quot;, with the list of affected Exchange Online features." width="800" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Microsoft tracks the outage as two incidents: EX1550543 for Exchange Online and MO1550821 for the wider Microsoft 365 impact. Because admins may not be able to open the admin center, Microsoft also posts it on the public &lt;a href="https://status.cloud.microsoft/" rel="noopener noreferrer"&gt;status.cloud.microsoft&lt;/a&gt; page shown above. The timeline below comes from those posts, as collected by &lt;a href="https://statusstack.com/blog/microsoft-365-exchange-online-outage-november-12-2026" rel="noopener noreferrer"&gt;StatusStack&lt;/a&gt; and read from the status page itself.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fllxc9sc9t6pyjezf5twt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fllxc9sc9t6pyjezf5twt.png" alt="Timeline in WIB: 23:17 Thu EX1550543 opens; 01:07 may affect any region; 01:26 MO1550821 multiple services; 02:06 deployments paused; 02:43 servers failing health checks; 05:00 no relief; 05:57 some servers back; 06:59 returned servers fail again under traffic; 08:50 secure-connection process overwhelmed and rollback of a network change begun; 09:14 adding capacity for regions coming back online." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;WIB&lt;/th&gt;
&lt;th&gt;UTC&lt;/th&gt;
&lt;th&gt;What Microsoft said&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Thu 23:17&lt;/td&gt;
&lt;td&gt;16:17&lt;/td&gt;
&lt;td&gt;EX1550543 opens: possible mailbox access issue&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Thu 23:55&lt;/td&gt;
&lt;td&gt;16:55&lt;/td&gt;
&lt;td&gt;Affected: Outlook on the web, MAPI, Exchange ActiveSync, REST&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fri 01:07&lt;/td&gt;
&lt;td&gt;18:07&lt;/td&gt;
&lt;td&gt;The issue may affect users in any region, not only the Americas&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fri 01:26&lt;/td&gt;
&lt;td&gt;18:26&lt;/td&gt;
&lt;td&gt;MO1550821 opens: users may be unable to connect to multiple Microsoft 365 services&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fri 02:06&lt;/td&gt;
&lt;td&gt;19:06&lt;/td&gt;
&lt;td&gt;All deployments and configuration changes paused&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fri 02:18&lt;/td&gt;
&lt;td&gt;19:18&lt;/td&gt;
&lt;td&gt;The load comes from a "large number of servers being unexpectedly unavailable", not from more traffic&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fri 02:43&lt;/td&gt;
&lt;td&gt;19:43&lt;/td&gt;
&lt;td&gt;Affected servers are failing automated health checks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fri 05:00&lt;/td&gt;
&lt;td&gt;22:00&lt;/td&gt;
&lt;td&gt;Actions so far "have not provided the anticipated relief"; a core process is overwhelmed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fri 05:57&lt;/td&gt;
&lt;td&gt;22:57&lt;/td&gt;
&lt;td&gt;Some servers back in service and stable; limited recovery in some regions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fri 06:59&lt;/td&gt;
&lt;td&gt;23:59&lt;/td&gt;
&lt;td&gt;Returned servers can become unresponsive again once they receive traffic; some traffic types limited&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fri 08:50&lt;/td&gt;
&lt;td&gt;01:50&lt;/td&gt;
&lt;td&gt;A process that establishes secure connections is overwhelmed; a recent network change is being rolled back&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fri 09:14&lt;/td&gt;
&lt;td&gt;02:14&lt;/td&gt;
&lt;td&gt;Capacity being added to support traffic in regions coming back online&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The most specific explanation so far is in the 08:50 WIB post: "a process on the affected servers responsible for establishing secure connections becomes overwhelmed, causing the servers to stop processing requests." The same post says Microsoft has "begun reverting a recent network configuration change that correlates with the start of impact" and is watching whether that helps. At 02:57 WIB it had said it had "not identified any recent changes that correlate with start of impact", so the explanation is still changing. &lt;a href="https://www.securityweek.com/microsoft-365-outage-disrupts-outlook-exchange-online-and-teams/" rel="noopener noreferrer"&gt;SecurityWeek&lt;/a&gt; notes that Microsoft has disclosed no evidence of a cyberattack. &lt;a href="https://abcnews.com/US/outlook-down-microsoft-outage-reported-mail/story?id=138088203" rel="noopener noreferrer"&gt;ABC News&lt;/a&gt; reports that New York City's emergency management office warned residents that email to city agencies could be delayed.&lt;/p&gt;

&lt;p&gt;The list of affected products is long because many of them read mail, calendar or contacts from Exchange: Teams calendar and meeting scheduling, Copilot access to work data, Defender for Office 365 Safe Links, Graph API calls for mail and calendar, Purview, Planner, To Do, Intune and Universal Print. Microsoft says core Teams chat and meetings "remain largely functional", and files stored directly in SharePoint stay reachable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why restarting the servers did not end it
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F16plzcn9xo6j3nvle9tx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F16plzcn9xo6j3nvle9tx.png" alt="A loop of four boxes: a process that sets up secure connections gets overwhelmed; servers stop processing requests and fail health checks; those servers drop out so the remaining ones take their share; elevated load although overall traffic had not increased; back to the first box." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Read in order, Microsoft's posts describe a feedback loop. Servers fail a health check and are taken out of rotation. Their traffic moves to the servers that are left, which then do more work each, so more of them fail the same check. A restarted server rejoins a pool that is still overloaded and falls over again "once they receive traffic". Google's SRE book describes this pattern in &lt;a href="https://sre.google/sre-book/addressing-cascading-failures/" rel="noopener noreferrer"&gt;Addressing Cascading Failures&lt;/a&gt;, and Microsoft's response follows the same steps: stop changes, limit some kinds of traffic, bring capacity back gradually, and roll back recent changes.&lt;/p&gt;

&lt;p&gt;I don't know how Exchange Online balances load internally, and Microsoft has not said what triggered the first failures. The loop itself is something you can guard against in your own systems, and common load balancers already have settings for it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Limit how much capacity health checks can remove. Envoy's outlier detection ejects failing hosts but by default never more than &lt;a href="https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/outlier_detection.proto" rel="noopener noreferrer"&gt;10% of a cluster&lt;/a&gt; (&lt;code&gt;max_ejection_percent&lt;/code&gt;). If health checks mark too many hosts unhealthy anyway, Envoy's &lt;a href="https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/load_balancing/panic_threshold" rel="noopener noreferrer"&gt;panic threshold&lt;/a&gt; (50% by default) sends traffic to all hosts again.&lt;/li&gt;
&lt;li&gt;Fail open when the whole fleet looks unhealthy. An AWS Application Load Balancer routes to all targets when a target group has &lt;a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/application/target-group-health-checks.html" rel="noopener noreferrer"&gt;only unhealthy targets&lt;/a&gt;. A check that says every server is down is usually wrong about at least some of them.&lt;/li&gt;
&lt;li&gt;Bring hosts back slowly. A restarted host has cold caches and no open connections, so it should not take a full share of traffic in its first seconds. Envoy calls this &lt;a href="https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/load_balancing/slow_start" rel="noopener noreferrer"&gt;slow start&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Shed load before the expensive step. Here the overloaded part sets up secure connections. A TLS handshake costs much more CPU than a request on an open connection, and when a fleet has to reconnect every client at once it pays that cost all together. Turning some new connections away early costs less than letting every server stall on them.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How many .id domains receive mail through Microsoft 365
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzh0jqoquegno9gthptox.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzh0jqoquegno9gthptox.png" alt="Stacked bars of the first MX provider per .id group. Microsoft 365 share: co.id 18%, ac.id 5%, go.id 3%, sch.id 5%, plain .id 7%, all 9%. Google Workspace: co.id 20%, ac.id 57%, sch.id 41%, plain .id 27%, all 30%." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I used the same domain set as the DMARC study: the 4,573 domains under go.id, ac.id, co.id, or.id, sch.id, web.id, my.id, biz.id and plain .id in the Tranco GQ32K list. A Python script (dnspython) asked 1.1.1.1 and 8.8.8.8 for each domain's MX record, alternating between them, with up to 4 attempts and a cap of 45 queries per second. It ran on 13 November from 09:04 to 09:06 WIB. 84 domains do not exist, 50 failed every attempt, and 3,499 have a working MX. Each domain is classified by its lowest-preference MX host, where mail goes first: &lt;code&gt;*.mail.protection.outlook.com&lt;/code&gt; is Microsoft 365, &lt;code&gt;*.google.com&lt;/code&gt; and &lt;code&gt;googlemail.com&lt;/code&gt; are Google Workspace. The last column reuses the 25 October scan and counts domains whose SPF record includes &lt;code&gt;spf.protection.outlook.com&lt;/code&gt;, meaning they send mail through Microsoft 365.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Group&lt;/th&gt;
&lt;th&gt;With MX&lt;/th&gt;
&lt;th&gt;Microsoft 365&lt;/th&gt;
&lt;th&gt;Google Workspace&lt;/th&gt;
&lt;th&gt;Own server or hosting&lt;/th&gt;
&lt;th&gt;Other&lt;/th&gt;
&lt;th&gt;SPF allows M365&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;go.id&lt;/td&gt;
&lt;td&gt;452&lt;/td&gt;
&lt;td&gt;15 (3.3%)&lt;/td&gt;
&lt;td&gt;20 (4.4%)&lt;/td&gt;
&lt;td&gt;404 (89.4%)&lt;/td&gt;
&lt;td&gt;13 (2.9%)&lt;/td&gt;
&lt;td&gt;24 (5.3%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ac.id&lt;/td&gt;
&lt;td&gt;932&lt;/td&gt;
&lt;td&gt;50 (5.4%)&lt;/td&gt;
&lt;td&gt;535 (57.4%)&lt;/td&gt;
&lt;td&gt;109 (11.7%)&lt;/td&gt;
&lt;td&gt;238 (25.5%)&lt;/td&gt;
&lt;td&gt;75 (8.0%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;co.id&lt;/td&gt;
&lt;td&gt;892&lt;/td&gt;
&lt;td&gt;157 (17.6%)&lt;/td&gt;
&lt;td&gt;178 (20.0%)&lt;/td&gt;
&lt;td&gt;467 (52.4%)&lt;/td&gt;
&lt;td&gt;90 (10.1%)&lt;/td&gt;
&lt;td&gt;199 (22.3%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;or.id&lt;/td&gt;
&lt;td&gt;43&lt;/td&gt;
&lt;td&gt;5 (11.6%)&lt;/td&gt;
&lt;td&gt;16 (37.2%)&lt;/td&gt;
&lt;td&gt;21 (48.8%)&lt;/td&gt;
&lt;td&gt;1 (2.3%)&lt;/td&gt;
&lt;td&gt;6 (14.0%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;sch.id&lt;/td&gt;
&lt;td&gt;111&lt;/td&gt;
&lt;td&gt;5 (4.5%)&lt;/td&gt;
&lt;td&gt;46 (41.4%)&lt;/td&gt;
&lt;td&gt;58 (52.3%)&lt;/td&gt;
&lt;td&gt;2 (1.8%)&lt;/td&gt;
&lt;td&gt;6 (5.4%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;.id (plain)&lt;/td&gt;
&lt;td&gt;979&lt;/td&gt;
&lt;td&gt;73 (7.5%)&lt;/td&gt;
&lt;td&gt;266 (27.2%)&lt;/td&gt;
&lt;td&gt;511 (52.2%)&lt;/td&gt;
&lt;td&gt;129 (13.2%)&lt;/td&gt;
&lt;td&gt;97 (9.9%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;All 9 groups&lt;/td&gt;
&lt;td&gt;3,499&lt;/td&gt;
&lt;td&gt;305 (8.7%)&lt;/td&gt;
&lt;td&gt;1,063 (30.4%)&lt;/td&gt;
&lt;td&gt;1,646 (47.0%)&lt;/td&gt;
&lt;td&gt;485 (13.9%)&lt;/td&gt;
&lt;td&gt;407 (11.6%)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The "All" row also includes web.id, my.id and biz.id (90 domains with MX, none on Microsoft 365).&lt;/p&gt;

&lt;p&gt;Google receives mail for about 3.5 times as many of these domains as Microsoft does (1,063 against 305). In ac.id the gap is wider, 57.4% against 5.4%, possibly because Google Workspace for Education Fundamentals is free for qualifying schools and universities.&lt;/p&gt;

&lt;p&gt;co.id is where Microsoft 365 matters most. 157 company domains point their MX straight at Exchange Online, and 199 authorise Microsoft 365 to send for them. The two groups overlap but are not identical, since some companies receive mail elsewhere and send through Microsoft, or the other way round.&lt;/p&gt;

&lt;p&gt;go.id barely depends on it. 89.4% of go.id domains run their own mail server or a shared one, and 67 of them use the shared government mail service at &lt;code&gt;mail.go.id&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Some Microsoft 365 users are hidden behind filtering gateways such as Proofpoint, Mimecast or Trend Micro. 51 domains route inbound mail through one, and 19 of those also authorise Microsoft 365 in SPF, so their mailboxes are probably in Exchange Online. That makes 305 a lower bound. One more oddity: 236 ac.id domains use Cloudflare Email Routing, but nearly all of them belong to a single university group that registers a domain per faculty and unit, so that column says little about Indonesian universities in general.&lt;/p&gt;

&lt;p&gt;There are limits to what MX shows. It only tells you where inbound mail lands. An organisation can receive mail through Google and still run Teams, SharePoint and Copilot on Microsoft 365, and those users were affected too. Tranco ranks popular domains, so this is a sample of visible organisations and not all of Indonesia. And DNS is a snapshot from one morning.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happens to mail sent to an affected domain
&lt;/h2&gt;

&lt;p&gt;Most reports were about people reaching their mailboxes through Outlook on the web, Outlook desktop and phones. Microsoft also says "email delivery may be delayed". When a receiving server does not accept a message, the sending server keeps it in a queue and retries. &lt;a href="https://www.rfc-editor.org/rfc/rfc5321#section-4.5.4.1" rel="noopener noreferrer"&gt;RFC 5321&lt;/a&gt; says the give-up time "generally needs to be at least 4-5 days", and most mail servers use something close to that. A message sent to a co.id company on Exchange Online last night is most likely waiting in a queue and will arrive late. I would not promise that nothing is lost, though. Some senders give up sooner, and many send a "delivery delayed" warning after a few hours that people read as a failure. If something was urgent, check for bounces once service is back and resend.&lt;/p&gt;

&lt;h2&gt;
  
  
  What admins can do while it is still open
&lt;/h2&gt;

&lt;p&gt;You can follow the incident without the admin center. The status page reads a JSON endpoint that works without signing in. It is undocumented and may change, but it worked this morning:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;urllib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;

&lt;span class="no"&gt;URL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"https://status.cloud.microsoft/api/posts/mac"&lt;/span&gt;
&lt;span class="n"&gt;post&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;urllib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;urlopen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;URL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sub&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;[^&amp;gt;]+&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;" "&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;unescape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Message"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"LastUpdatedTime"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"|"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Title"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Current status"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;600&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run it from cron and post to your team chat when &lt;code&gt;LastUpdatedTime&lt;/code&gt; changes. The supported route is the Microsoft Graph &lt;a href="https://learn.microsoft.com/en-us/graph/api/serviceannouncement-list-issues" rel="noopener noreferrer"&gt;service health API&lt;/a&gt;, which needs an app registration with &lt;code&gt;ServiceHealth.Read.All&lt;/code&gt; and depends on Graph staying up.&lt;/p&gt;

&lt;p&gt;Leave your MX records alone. A new mail provider needs mailboxes, routing and expired DNS TTLs before it helps, and you would have to move back afterwards. Senders already queue and retry.&lt;/p&gt;

&lt;p&gt;Tell people another way to reach you. NYC Emergency Management did this on social media and pointed residents to 311 and 911. For a company it could be a WhatsApp broadcast or a short notice on the website with a phone number. It is also worth checking whether your incident contact list exists anywhere other than Outlook.&lt;/p&gt;

</description>
      <category>microsoft</category>
      <category>devops</category>
      <category>sre</category>
      <category>email</category>
    </item>
    <item>
      <title>I Pointed 3 Static Scanners at an MCP Server That Fails 8 Auth Tests. They Found 0, Including Mine</title>
      <dc:creator>Kiell Tampubolon</dc:creator>
      <pubDate>Thu, 12 Nov 2026 14:00:00 +0000</pubDate>
      <link>https://dev.to/kielltampubolon/i-pointed-3-static-scanners-at-an-mcp-server-that-fails-8-auth-tests-they-found-0-including-mine-2fha</link>
      <guid>https://dev.to/kielltampubolon/i-pointed-3-static-scanners-at-an-mcp-server-that-fails-8-auth-tests-they-found-0-including-mine-2fha</guid>
      <description>&lt;p&gt;In &lt;a href="https://www.kielltampubolon.id/writing/i-wrote-an-mcp-server-auth-test-harness-for-the-2026-07-28-spec-here-is-what-broke-first/" rel="noopener noreferrer"&gt;the previous post in this series&lt;/a&gt; I built a 10-test harness for the MCP 2026-07-28 authorization rules. A quickstart-style server passed 2 of them. A hardened version passed all 10.&lt;/p&gt;

&lt;p&gt;That left an uncomfortable follow-up question. I maintain an MCP security scanner, &lt;a href="https://github.com/glatinone/mcpscan" rel="noopener noreferrer"&gt;mcpscan&lt;/a&gt;. If the naive server had shipped, would my scanner have stopped it? Would anyone's?&lt;/p&gt;

&lt;p&gt;So I ran three static scanners against both servers. They produced the same report for the broken one and the fixed one.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;I scanned an MCP server that fails 8 authorization tests with three static analysis tools: &lt;strong&gt;mcpscan&lt;/strong&gt; (my own, 23 rules in v0.20), &lt;strong&gt;Semgrep&lt;/strong&gt; (200 rules from the &lt;code&gt;p/python&lt;/code&gt;, &lt;code&gt;p/jwt&lt;/code&gt; and &lt;code&gt;p/security-audit&lt;/code&gt; packs) and &lt;strong&gt;Bandit&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;All three found 0 of the 8 auth bugs.&lt;/strong&gt; They reported identical findings for the naive and the hardened server, so their output couldn't tell the two apart.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Five custom Semgrep rules, about 40 lines of YAML, caught 3 of 8&lt;/strong&gt; (no audience check, no issuer check, token read from the query string) with zero hits on the hardened server.&lt;/li&gt;
&lt;li&gt;The other five (missing discovery headers and metadata, missing scope checks, anonymous &lt;code&gt;tools/list&lt;/code&gt;, token passthrough) only showed up when a test talked to a running server.&lt;/li&gt;
&lt;li&gt;Static scanners aren't wrong here. They're looking for a different class of bug. Auth for MCP servers needs runtime tests in CI, with a few static rules as a cheap early warning.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;

&lt;p&gt;Both servers come from the auth harness. To keep the comparison clean, I split the original two-mode file into two single-mode copies, &lt;code&gt;naive/server.py&lt;/code&gt; and &lt;code&gt;hardened/server.py&lt;/code&gt;, so a scanner only ever sees one version. Then I re-ran the harness against each copy to make sure the split didn't change behaviour: still 8 failed and 3 passed for naive, 11 passed for hardened (10 tests plus a control).&lt;/p&gt;

&lt;p&gt;The eight failures the scanners had to find:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;#&lt;/th&gt;
&lt;th&gt;Failure in the naive server&lt;/th&gt;
&lt;th&gt;Spec level&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;01&lt;/td&gt;
&lt;td&gt;401 without &lt;code&gt;WWW-Authenticate&lt;/code&gt; / &lt;code&gt;resource_metadata&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;MUST (header or well-known URI)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;02&lt;/td&gt;
&lt;td&gt;No Protected Resource Metadata endpoint&lt;/td&gt;
&lt;td&gt;MUST&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;04&lt;/td&gt;
&lt;td&gt;No audience validation&lt;/td&gt;
&lt;td&gt;MUST&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;05&lt;/td&gt;
&lt;td&gt;No issuer validation&lt;/td&gt;
&lt;td&gt;MUST (via OAuth 2.1)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;07&lt;/td&gt;
&lt;td&gt;No per-tool scope check&lt;/td&gt;
&lt;td&gt;SHOULD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;08&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;tools/list&lt;/code&gt; open to anonymous callers&lt;/td&gt;
&lt;td&gt;SHOULD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;09&lt;/td&gt;
&lt;td&gt;Client token forwarded to the downstream API&lt;/td&gt;
&lt;td&gt;MUST NOT&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;td&gt;Token accepted from &lt;code&gt;?access_token=&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;MUST NOT (client rule)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Some of these are as obvious in the source as a bug can be. The decode call literally says:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;claims&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;jwt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;signing_key&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;algorithms&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;RS256&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
                    &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;verify_aud&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The results
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Felb2bifbcf89ktoh7xsk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Felb2bifbcf89ktoh7xsk.png" alt="Matrix of the 8 auth failures against four scanners: mcpscan, Semgrep with 200 rules and Bandit each caught 0 of 8; five custom Semgrep rules caught 3 of 8." width="800" height="547"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What each tool did report, for &lt;strong&gt;both&lt;/strong&gt; servers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;mcpscan:&lt;/strong&gt; nothing. "Clean, no issues found."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Semgrep (200 rules run):&lt;/strong&gt; one finding, &lt;code&gt;dynamic-urllib-use-detected&lt;/code&gt; on the downstream call, because &lt;code&gt;urllib&lt;/code&gt; supports &lt;code&gt;file://&lt;/code&gt; URLs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bandit:&lt;/strong&gt; two findings: B310 on the same &lt;code&gt;urllib&lt;/code&gt; call, and B105 "possible hardcoded password" on an empty string default.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of those are about authorization, and all of them appear in the hardened server too. The &lt;code&gt;verify_aud: False&lt;/code&gt; line above went unflagged by all three.&lt;/p&gt;

&lt;p&gt;My own scanner deserves the most direct explanation. mcpscan's auth-adjacent rule, MCP012, checks client configuration: a remote MCP server entry with no auth header, or a hardcoded bearer token. It looks at how you &lt;em&gt;connect to&lt;/em&gt; a server, not at how a server &lt;em&gt;validates&lt;/em&gt; tokens. That's a real gap, and I'd rather find it with a harness than have someone find it in production.&lt;/p&gt;

&lt;h2&gt;
  
  
  Five rules that catch three bugs
&lt;/h2&gt;

&lt;p&gt;Semgrep makes it cheap to encode a specific "never do this". These two rules did most of the work:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;rules&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;jwt-audience-check-disabled&lt;/span&gt;
    &lt;span class="na"&gt;languages&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;python&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;severity&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ERROR&lt;/span&gt;
    &lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Audience validation disabled. MCP 2026-07-28 says servers MUST validate the token audience (RFC 8707).&lt;/span&gt;
    &lt;span class="na"&gt;pattern&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;jwt.decode(...,&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;options={...,&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;"verify_aud":&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;False,&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;...},&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;...)'&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;jwt-decode-without-audience&lt;/span&gt;
    &lt;span class="na"&gt;languages&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;python&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;severity&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ERROR&lt;/span&gt;
    &lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;jwt.decode() without audience= accepts tokens minted for other services.&lt;/span&gt;
    &lt;span class="na"&gt;patterns&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;pattern&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;jwt.decode(...)&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;pattern-not&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;jwt.decode(..., audience=$A, ...)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the same shape for &lt;code&gt;issuer=&lt;/code&gt;, and one rule for &lt;code&gt;$Q.get("access_token", ...)&lt;/code&gt;, and you get this against the naive server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;access-token-from-query-string   line 73
jwt-audience-check-disabled      line 77
jwt-decode-without-audience      line 77
jwt-decode-without-issuer        line 77
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Against the hardened server: zero findings. Four hits on the naive server cover three distinct bugs (04, 05 and 10).&lt;/p&gt;

&lt;p&gt;The fifth rule was the one I most wanted to work: a taint rule from &lt;code&gt;headers.get("Authorization")&lt;/code&gt; to a downstream &lt;code&gt;add_header("Authorization", ...)&lt;/code&gt;, which would catch token passthrough (09). It found nothing. In this server the token is read in one function, returned, and handed to a second function that makes the downstream call. My best guess is that this cross-function flow is beyond what the rule can follow in Semgrep's open-source engine; I didn't dig further. The runtime test caught it in one assertion.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the other five can't be seen statically
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3c28t274evxnejbxvnoc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3c28t274evxnejbxvnoc.png" alt="Three layers: static rules caught 3 of 8, runtime tests 8 of 8, generic SAST and config scanners 0 of 8." width="800" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Look at what the remaining failures have in common:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;01 and 02&lt;/strong&gt; are about something &lt;em&gt;missing&lt;/em&gt;: a header that's never set, an endpoint that doesn't exist. Static rules find bad code much more easily than absent code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;07 and 08&lt;/strong&gt; depend on a mapping between tools and scopes, and on which methods your policy says are public. That's business logic a generic rule can't know.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;09&lt;/strong&gt; is a data flow across functions, which is hard for pattern-based tools by design.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A runtime test doesn't care how the code is written. It sends a request and checks the response, or checks what the fake downstream received. That's why the harness caught 8 of 8 and the scanners caught 0.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd put in CI
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The runtime harness&lt;/strong&gt;, on every pull request that touches the server. Ten tests ran in about 3 seconds here.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A handful of custom static rules&lt;/strong&gt; for the patterns you never want to see: &lt;code&gt;verify_aud: False&lt;/code&gt;, &lt;code&gt;decode()&lt;/code&gt; without &lt;code&gt;audience=&lt;/code&gt;, tokens from query strings. They fail fast, before anything starts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Your general scanners as well.&lt;/strong&gt; Semgrep and Bandit flagged a real hardening point (the &lt;code&gt;urllib&lt;/code&gt; scheme), and mcpscan covers configuration and supply-chain risks the harness doesn't. They just aren't an auth test.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And on my side: mcpscan needs server-side auth rules. The two Semgrep patterns above are the obvious starting point.&lt;/p&gt;

&lt;h2&gt;
  
  
  Caveats
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One server, written by me.&lt;/strong&gt; The naive baseline is deliberately typical, not a sample of real-world servers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Three scanners, default or common rule packs, in Python.&lt;/strong&gt; Commercial SAST tools, Semgrep Pro's cross-file analysis, or other languages may do better, especially on the passthrough case.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;mcpscan is my project&lt;/strong&gt;, so treat my explanation of its scope as the author's view. The scan output itself is unedited.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Update: I fixed mine
&lt;/h2&gt;

&lt;p&gt;A scanner that misses all eight is a roadmap, so I wrote the rules. mcpscan now ships seven server-side authorization rules, MCP024 to MCP030, built on the Python AST rather than regex. Same naive server, same command:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;#&lt;/th&gt;
&lt;th&gt;Failure&lt;/th&gt;
&lt;th&gt;Before&lt;/th&gt;
&lt;th&gt;After&lt;/th&gt;
&lt;th&gt;Rule&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;01&lt;/td&gt;
&lt;td&gt;401 without &lt;code&gt;resource_metadata&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;MCP027&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;02&lt;/td&gt;
&lt;td&gt;No Protected Resource Metadata endpoint&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;MCP028&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;04&lt;/td&gt;
&lt;td&gt;No audience check&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;MCP025&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;05&lt;/td&gt;
&lt;td&gt;No issuer check&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;MCP026&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;07&lt;/td&gt;
&lt;td&gt;No per-tool scope check&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;runtime only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;08&lt;/td&gt;
&lt;td&gt;Anonymous &lt;code&gt;tools/list&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;runtime only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;09&lt;/td&gt;
&lt;td&gt;Token passthrough&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;MCP029&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;td&gt;Token from &lt;code&gt;?access_token=&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;MCP030&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;0 of 8 became 6 of 8, with 0 findings on the hardened server.&lt;/strong&gt; MCP024 also flags &lt;code&gt;jwt.decode&lt;/code&gt; with signature verification turned off. I ran the new rules over fastmcp, the official &lt;code&gt;mcp&lt;/code&gt; SDK, LiteLLM and seven other MCP projects to hunt for false positives; the two causes I found are fixed and covered by tests. Scope checks and anonymous listing stay runtime-only for the reasons above, so the harness still earns its place in CI.&lt;/p&gt;

&lt;p&gt;The rules are on the &lt;a href="https://github.com/glatinone/mcpscan" rel="noopener noreferrer"&gt;mcpscan main branch&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The takeaway
&lt;/h2&gt;

&lt;p&gt;A clean scanner report means the scanner found nothing in its own rule set. These three tools ran hundreds of rules and gave the same verdict on a server that fails eight authorization tests and on one that passes them all. Test MCP auth the way an attacker would hit it, against a running server, and add static rules for the mistakes you never want to see.&lt;/p&gt;

&lt;p&gt;Has your scanner ever given a clean report on a bug you later found by hand?&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>security</category>
      <category>python</category>
      <category>testing</category>
    </item>
    <item>
      <title>I Wrote an MCP Server Auth Test Harness for the 2026-07-28 Spec. Here Is What Broke First</title>
      <dc:creator>Kiell Tampubolon</dc:creator>
      <pubDate>Tue, 10 Nov 2026 14:00:00 +0000</pubDate>
      <link>https://dev.to/kielltampubolon/i-wrote-an-mcp-server-auth-test-harness-for-the-2026-07-28-spec-here-is-what-broke-first-21pm</link>
      <guid>https://dev.to/kielltampubolon/i-wrote-an-mcp-server-auth-test-harness-for-the-2026-07-28-spec-here-is-what-broke-first-21pm</guid>
      <description>&lt;p&gt;The MCP 2026-07-28 revision makes authorization for HTTP servers look a lot like ordinary OAuth: the server is a resource server, it publishes metadata, it validates audience, and it never forwards the client's token. That's good news, because "ordinary OAuth" is something we already know how to test.&lt;/p&gt;

&lt;p&gt;So I wrote the tests. Ten of them, each tied to a specific MUST or SHOULD in the spec, run against two versions of the same small MCP server. The quickstart-style version passed 2. The hardened version passed 10. The interesting part is &lt;em&gt;which&lt;/em&gt; two passed, and why.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;MCP servers that use HTTP now have clear authorization rules in the 2026-07-28 spec. They match standard OAuth 2.1 resource-server behaviour, so they can be tested automatically.&lt;/li&gt;
&lt;li&gt;I wrote a 10-test harness (pytest, ~100 lines) and ran it against a deliberately typical "it works" server and a hardened one. &lt;strong&gt;Naive: 2/10. Hardened: 10/10.&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;The naive server's two passes came for free from library defaults: PyJWT checks expiry by default, and pinning &lt;code&gt;algorithms=["RS256"]&lt;/code&gt; blocks forged and &lt;code&gt;alg: none&lt;/code&gt; tokens.&lt;/li&gt;
&lt;li&gt;The worst failure was two tests combined: a token minted for a &lt;em&gt;different&lt;/em&gt; service was accepted (no audience check), and the server forwarded it downstream. That's the confused-deputy pattern the spec explicitly forbids.&lt;/li&gt;
&lt;li&gt;Four fixes close six of the eight failures: validate audience and issuer, return discovery metadata on every 401, check scope per tool, and use the server's own credential downstream. Two policy changes (no anonymous &lt;code&gt;tools/list&lt;/code&gt;, no query-string tokens) close the rest.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What the spec actually requires
&lt;/h2&gt;

&lt;p&gt;I tested against the authorization pages of the &lt;a href="https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization" rel="noopener noreferrer"&gt;2026-07-28 revision&lt;/a&gt;. These are the lines that turned into tests, quoted as written:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"MCP servers &lt;strong&gt;MUST&lt;/strong&gt; validate that access tokens were issued specifically for them as the intended audience, according to RFC 8707 Section 2."&lt;/li&gt;
&lt;li&gt;"Invalid or expired tokens &lt;strong&gt;MUST&lt;/strong&gt; receive a HTTP 401 response."&lt;/li&gt;
&lt;li&gt;"MCP servers &lt;strong&gt;MUST&lt;/strong&gt; implement OAuth 2.0 Protected Resource Metadata (RFC9728)", and the server MUST implement a discovery mechanism, either the &lt;code&gt;resource_metadata&lt;/code&gt; parameter in &lt;code&gt;WWW-Authenticate&lt;/code&gt; on 401 or the well-known URI (&lt;a href="https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization/authorization-server-discovery" rel="noopener noreferrer"&gt;discovery page&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;"The MCP server &lt;strong&gt;MUST NOT&lt;/strong&gt; pass through the token it received from the MCP client." (&lt;a href="https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization/security-considerations" rel="noopener noreferrer"&gt;security considerations&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;"Access tokens &lt;strong&gt;MUST NOT&lt;/strong&gt; be included in the URI query string."&lt;/li&gt;
&lt;li&gt;For insufficient scope, the server &lt;strong&gt;SHOULD&lt;/strong&gt; answer &lt;code&gt;403&lt;/code&gt; with &lt;code&gt;error="insufficient_scope"&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One more change matters for anyone writing tests: the 2026-07-28 Streamable HTTP transport removed protocol-level sessions and the &lt;code&gt;initialize&lt;/code&gt; handshake. Every request carries its own &lt;code&gt;MCP-Protocol-Version&lt;/code&gt; and &lt;code&gt;Mcp-Method&lt;/code&gt; headers (&lt;a href="https://modelcontextprotocol.io/specification/2026-07-28/basic/transports/streamable-http" rel="noopener noreferrer"&gt;transport page&lt;/a&gt;). So the harness doesn't do a handshake. It sends one self-contained request per test, which makes the tests short and independent.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;

&lt;p&gt;Everything runs on &lt;code&gt;127.0.0.1&lt;/code&gt;, and the full harness is on GitHub: &lt;a href="https://github.com/glatinone/mcp-auth-harness" rel="noopener noreferrer"&gt;glatinone/mcp-auth-harness&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A stub authorization server&lt;/strong&gt; that mints RS256 JWTs with whatever &lt;code&gt;aud&lt;/code&gt;, &lt;code&gt;iss&lt;/code&gt;, &lt;code&gt;scope&lt;/code&gt; and &lt;code&gt;exp&lt;/code&gt; a test asks for, and serves a JWKS.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A small MCP server&lt;/strong&gt; with two tools: &lt;code&gt;read_notes&lt;/code&gt; (needs &lt;code&gt;notes:read&lt;/code&gt;) and &lt;code&gt;delete_note&lt;/code&gt; (needs &lt;code&gt;notes:write&lt;/code&gt;). Both call a fake downstream API that records every &lt;code&gt;Authorization&lt;/code&gt; header it receives.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Two modes of that server.&lt;/strong&gt; &lt;code&gt;naive&lt;/code&gt; is my attempt at the typical "make it work" version: it verifies the signature and nothing else, lets &lt;code&gt;tools/list&lt;/code&gt; through without a token, accepts &lt;code&gt;?access_token=&lt;/code&gt; as a fallback, returns a bare 401, and forwards the caller's token downstream. &lt;code&gt;hardened&lt;/code&gt; fixes each of those.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To be clear about the limits: I wrote the naive server, so the scoreboard measures the gap between two implementations of mine, not any real product. It shows which mistakes a test suite catches and how cheap the fixes are.&lt;/p&gt;

&lt;h2&gt;
  
  
  The scoreboard
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftyw58jel1iofr53yb60n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftyw58jel1iofr53yb60n.png" alt="Scoreboard of 10 tests: the naive server fails 8 and passes only expired-token and forged-signature checks; the hardened server passes all 10." width="800" height="547"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Both servers also pass a control test: a valid token with the right scope gets a 200. Without that, a server that rejects everything would score 10/10.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What broke first:&lt;/strong&gt; test 01. With no token, the naive server returns a bare &lt;code&gt;401&lt;/code&gt; with no &lt;code&gt;WWW-Authenticate&lt;/code&gt; header. Test 02 then shows the fallback is missing too: the Protected Resource Metadata endpoint is a 404. The spec requires &lt;em&gt;one of&lt;/em&gt; those two discovery mechanisms; the naive server has neither, so a spec-following client has no way to find the authorization server and can't even start the flow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The two passes were free.&lt;/strong&gt; Expired tokens are rejected because PyJWT validates &lt;code&gt;exp&lt;/code&gt; by default. Forged signatures and &lt;code&gt;alg: none&lt;/code&gt; are rejected because the decode call pins &lt;code&gt;algorithms=["RS256"]&lt;/code&gt;. Neither was a decision anyone made about MCP. Switch to a library with different defaults and both could flip without anyone noticing, which is exactly why they belong in a test suite.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The worst result needed two tests together.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fub395azzw8dynu19arb0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fub395azzw8dynu19arb0.png" alt="Diagram: a client holding a token minted for another service calls the naive MCP server, which skips the audience check, returns 200 and forwards the same token to the downstream API." width="799" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Test 04 sent a token whose audience was a different service. The naive server returned &lt;code&gt;200&lt;/code&gt;. Test 09 showed that the naive server forwards the caller's token to the downstream API as-is. Put together, a token issued for something else is accepted and then replayed with the MCP server's position in the network behind it. That's the confused-deputy chain the "MUST NOT pass through" rule exists to prevent.&lt;/p&gt;

&lt;p&gt;Here's the passthrough test. It's short because the fake downstream does the work:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;test_09_no_token_passthrough&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;R9: &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;The MCP server MUST NOT pass through the token it received from the MCP client.&lt;/span&gt;&lt;span class="sh"&gt;'"""&lt;/span&gt;
    &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;tok&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ds&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;seen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;clear&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;rpc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;tools/call&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;read_notes&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;arguments&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{}},&lt;/span&gt; &lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;
    &lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ds&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;seen&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;downstream was not called&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Bearer &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ds&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;seen&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ds&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;seen&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The fixes
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhnckqm07zb1gd2j8f0ic.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhnckqm07zb1gd2j8f0ic.png" alt="Four fixes: validate audience, issuer and algorithm; return resource_metadata on every 401; check scope per tool; call downstream with the server's own credential." width="800" height="507"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Audience, issuer and algorithm in one call.&lt;/strong&gt; This single change fixed tests 04 and 05:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;claims&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;jwt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;signing_key&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;algorithms&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;RS256&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;                      &lt;span class="c1"&gt;# never trust the header's alg; rejects "none"
&lt;/span&gt;    &lt;span class="n"&gt;audience&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;resource&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;                     &lt;span class="c1"&gt;# MUST validate audience (RFC 8707)
&lt;/span&gt;    &lt;span class="n"&gt;issuer&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;as_url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;                         &lt;span class="c1"&gt;# token must come from our AS
&lt;/span&gt;    &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;require&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;exp&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;iss&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;aud&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]},&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;require&lt;/code&gt; option makes the rule explicit: a token that simply &lt;em&gt;omits&lt;/em&gt; &lt;code&gt;aud&lt;/code&gt;, &lt;code&gt;iss&lt;/code&gt; or &lt;code&gt;exp&lt;/code&gt; is rejected by policy, not by whatever your JWT library happens to do by default.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Discovery on every 401.&lt;/strong&gt; Serve the metadata document and point to it from the challenge (abridged):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;www_authenticate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;scope&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;desc&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;parts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;resource_metadata=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;prm_url&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;scope&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;scope=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;scope&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;error=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Bearer &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;, &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The metadata at &lt;code&gt;/.well-known/oauth-protected-resource/mcp&lt;/code&gt; lists the &lt;code&gt;resource&lt;/code&gt;, at least one entry in &lt;code&gt;authorization_servers&lt;/code&gt; (the spec requires it), and the supported scopes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Scope per tool, not per server.&lt;/strong&gt; A token that can read notes shouldn't be able to delete them (abridged):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;method&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;tools/call&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;need&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;TOOL_SCOPE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tool&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;have&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;claims&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;scope&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;need&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;need&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;have&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;AuthError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;403&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;insufficient_scope&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;scope&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;need&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4. No passthrough.&lt;/strong&gt; The server calls downstream with its own credential. In the harness that's a one-line difference:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;ds_auth&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Bearer &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mode&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;naive&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Bearer &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;cfg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;downstream_token&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In production, "its own credential" means a separate token the MCP server gets from the upstream authorization server, which is what the security considerations page describes.&lt;/p&gt;

&lt;p&gt;The hardened server also requires a token for &lt;code&gt;tools/list&lt;/code&gt; and rejects &lt;code&gt;?access_token=&lt;/code&gt; outright. Those two are policy choices more than hard spec requirements; see the caveats below.&lt;/p&gt;

&lt;h2&gt;
  
  
  Run it against your own server
&lt;/h2&gt;

&lt;p&gt;The harness starts the stub authorization server, the fake downstream and the MCP server itself, then runs the tests. To point it at your own server, change the server launch and URLs in &lt;code&gt;tests/conftest.py&lt;/code&gt;, and configure your server to trust the stub's JWKS in a test environment. Keep the stub: several tests need tokens a real authorization server won't mint on purpose (wrong issuer, forged key, &lt;code&gt;alg: none&lt;/code&gt;). The code is on GitHub at &lt;a href="https://github.com/glatinone/mcp-auth-harness" rel="noopener noreferrer"&gt;glatinone/mcp-auth-harness&lt;/a&gt; (MIT). It needs Python 3.12+ and &lt;code&gt;uv&lt;/code&gt;; in bash:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/glatinone/mcp-auth-harness &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd &lt;/span&gt;mcp-auth-harness
&lt;span class="nv"&gt;MCP_MODE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;naive    uv run pytest tests &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; results-naive.txt
&lt;span class="nv"&gt;MCP_MODE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;hardened uv run pytest tests &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; results-hardened.txt
uv run python make_results.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you only have ten minutes, run tests 01, 04 and 09 by hand with &lt;code&gt;curl&lt;/code&gt;: no token, a token for another audience, and a valid token while you watch what your downstream receives. Those three cover the failures with the biggest blast radius.&lt;/p&gt;

&lt;h2&gt;
  
  
  Caveats
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The baseline is mine.&lt;/strong&gt; It's a plausible quickstart, not a measured sample of real servers. Don't read 2/10 as a statistic about the ecosystem.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Some tests are stricter than the spec.&lt;/strong&gt; Test 08 (anonymous &lt;code&gt;tools/list&lt;/code&gt;) encodes "servers SHOULD implement proper authentication for all connections", not a MUST; some servers legitimately expose discovery publicly. Test 10 (query-string token) applies a client-side MUST NOT on the server side.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Issuer and &lt;code&gt;alg&lt;/code&gt; checks are my reading of standard JWT validation.&lt;/strong&gt; The MCP spec says to validate tokens "as described in OAuth 2.1 Section 5.2" without listing these checks itself.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test 01 is stricter than the spec.&lt;/strong&gt; The spec requires either the &lt;code&gt;WWW-Authenticate&lt;/code&gt; mechanism or the well-known URI; I test both because clients rely on the header in practice.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test 10 is weak for the hardened server.&lt;/strong&gt; The request carries no &lt;code&gt;Authorization&lt;/code&gt; header, so the hardened server would return 401 even without its explicit query-string check.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not covered:&lt;/strong&gt; &lt;code&gt;Origin&lt;/code&gt; header validation (a Streamable HTTP MUST), and client-side rules like sending the RFC 8707 &lt;code&gt;resource&lt;/code&gt; parameter. Those need a different harness.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The authorization server is a stub.&lt;/strong&gt; No real OAuth flows, consent or token exchange.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The takeaway
&lt;/h2&gt;

&lt;p&gt;Most of what the 2026-07-28 spec asks of an MCP server is a handful of lines in the token-validation path. The cost of getting it wrong isn't one bug; it's the combination, where a token for something else gets accepted and then forwarded. A ten-test suite that runs in under five seconds is a cheap way to make sure that combination can't ship.&lt;/p&gt;

&lt;p&gt;Which of these ten would your MCP server fail today? My guess is test 01, because it's the one nobody notices until a spec-following client tries to connect.&lt;/p&gt;

&lt;p&gt;Follow-up: &lt;a href="https://www.kielltampubolon.id/writing/i-pointed-3-static-scanners-at-an-mcp-server-that-fails-8-auth-tests-they-found-0/" rel="noopener noreferrer"&gt;I pointed 3 static scanners at an MCP server that fails 8 auth tests, and they found 0&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>security</category>
      <category>oauth</category>
      <category>python</category>
    </item>
    <item>
      <title>I Read the CI of 300 Popular Repos. 145 Still Run Third-Party Actions by Tag or Branch</title>
      <dc:creator>Kiell Tampubolon</dc:creator>
      <pubDate>Mon, 09 Nov 2026 14:00:00 +0000</pubDate>
      <link>https://dev.to/kielltampubolon/i-read-the-ci-of-300-popular-repos-145-still-run-third-party-actions-by-tag-or-branch-37co</link>
      <guid>https://dev.to/kielltampubolon/i-read-the-ci-of-300-popular-repos-145-still-run-third-party-actions-by-tag-or-branch-37co</guid>
      <description>&lt;p&gt;On 25 October 2026 I downloaded every workflow file from 300 popular open-source repos, half of them AI, LLM and MCP projects, and parsed 4,750 workflows. 265 of the 300 use at least one third-party action. 145 of those 265 (54.7%) still reference at least one of them by a tag or a branch, which is a pointer that whoever controls that action can move. In the AI half it is 88 of 135 (65.2%).&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR (for non-technical readers)
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Most open-source projects use small add-ons ("actions") written by other people to build and release their software. You can point to an add-on by a version name, which its owner can quietly change, or by a fixed fingerprint, which cannot change.&lt;/li&gt;
&lt;li&gt;I checked 300 popular projects. Of the 265 that use outside add-ons, 145 still use at least one by its changeable name. In AI projects it is about 2 in 3.&lt;/li&gt;
&lt;li&gt;This exact weakness was abused at least three times in the past 19 months: in March 2025, March 2026 and June 2026. Projects that used the fixed fingerprint were not affected.&lt;/li&gt;
&lt;li&gt;The fix is cheap: use the fingerprint, let a bot keep it updated, and give the build robot only the permissions it needs.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Why now
&lt;/h2&gt;

&lt;p&gt;Three incidents, all the same shape:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;tj-actions/changed-files, March 2025.&lt;/strong&gt; The &lt;a href="https://github.com/advisories/GHSA-mrrh-fwg8-r2c3" rel="noopener noreferrer"&gt;GitHub advisory for CVE-2025-30066&lt;/a&gt; says attackers retroactively pointed version tags at a malicious commit that printed CI secrets into public logs, impacting "over 23,000 repositories" between 14 and 15 March 2025.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;aquasecurity/trivy-action, March 2026.&lt;/strong&gt; According to &lt;a href="https://snyk.io/articles/trivy-github-actions-supply-chain-compromise/" rel="noopener noreferrer"&gt;Snyk's write-up&lt;/a&gt;, attackers force-pushed malicious code to 75 of 76 version tags, exposed for about 12 hours on 19 and 20 March 2026.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;codfish/semantic-release-action, June 2026.&lt;/strong&gt; &lt;a href="https://www.stepsecurity.io/blog/supply-chain-compromise-codfish-semantic-release-action" rel="noopener noreferrer"&gt;StepSecurity&lt;/a&gt; reports a malicious commit force-pushed on 24 June 2026 and version tags repointed to it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In all three, users who pinned a full commit SHA were not affected. GitHub's own &lt;a href="https://docs.github.com/en/actions/reference/security/secure-use" rel="noopener noreferrer"&gt;secure use reference&lt;/a&gt; says to "Pin references to actions to a commit SHA in your workflow files". Since &lt;a href="https://github.blog/changelog/2025-08-15-github-actions-policy-now-supports-blocking-and-sha-pinning-actions/" rel="noopener noreferrer"&gt;15 August 2025&lt;/a&gt;, administrators can enforce that with a checkbox in the allowed actions policy at enterprise, organization or repository level, and block specific actions with a &lt;code&gt;!&lt;/code&gt; prefix. And on &lt;a href="https://github.blog/changelog/2026-10-14-github-actions-workflow-lockfiles-in-public-preview/" rel="noopener noreferrer"&gt;14 October 2026&lt;/a&gt;, GitHub put workflow lockfiles (&lt;code&gt;.github/workflows/actions.lock&lt;/code&gt;, generated by &lt;code&gt;gh actions-lock&lt;/code&gt;) into public preview. So: how far along are popular repos?&lt;/p&gt;

&lt;h2&gt;
  
  
  Method
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Repo list.&lt;/strong&gt; GitHub search sorted by stars, non-archived, non-fork, pushed since 25 April 2026. AI queries: &lt;code&gt;topic:llm&lt;/code&gt;, &lt;code&gt;topic:mcp&lt;/code&gt;, &lt;code&gt;topic:model-context-protocol&lt;/code&gt;, &lt;code&gt;topic:ai-agents&lt;/code&gt;, &lt;code&gt;topic:large-language-models&lt;/code&gt;, &lt;code&gt;topic:agents&lt;/code&gt;, &lt;code&gt;topic:rag&lt;/code&gt;, &lt;code&gt;topic:mcp-server&lt;/code&gt;. General: &lt;code&gt;language:python&lt;/code&gt;, &lt;code&gt;language:typescript&lt;/code&gt;, &lt;code&gt;language:javascript&lt;/code&gt;, with any repo carrying an AI or ML topic moved to the AI group. From 1,921 candidates I walked down by stars, skipped 11 awesome-lists and 25 repos without workflows, and stopped at 150 per group. The smallest repo has 38,791 stars and the median 65,347.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fetch.&lt;/strong&gt; The contents API listed &lt;code&gt;.github/workflows&lt;/code&gt;, and every &lt;code&gt;.yml&lt;/code&gt;/&lt;code&gt;.yaml&lt;/code&gt; was downloaded and cached. Read-only &lt;code&gt;gh&lt;/code&gt; token, GET requests only.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Classify.&lt;/strong&gt; Each &lt;code&gt;uses:&lt;/code&gt; is local (&lt;code&gt;./&lt;/code&gt;), &lt;code&gt;docker://&lt;/code&gt;, first-party (&lt;code&gt;actions/*&lt;/code&gt;, &lt;code&gt;github/*&lt;/code&gt;), same-owner (the repo's own org) or third-party. Refs are a 40-hex SHA, a version tag, or a branch. Refs that were neither, like &lt;code&gt;release/v1&lt;/code&gt; or &lt;code&gt;stable&lt;/code&gt;, I resolved through the API.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Risky patterns.&lt;/strong&gt; Top-level &lt;code&gt;permissions:&lt;/code&gt;, &lt;code&gt;pull_request_target&lt;/code&gt; combined with a checkout of the PR head, and attacker-controlled contexts (&lt;code&gt;github.event.issue.title&lt;/code&gt;, &lt;code&gt;pull_request.title&lt;/code&gt;, &lt;code&gt;head_ref&lt;/code&gt;, &lt;code&gt;comment.body&lt;/code&gt; and the rest of GitHub's list) written straight into a &lt;code&gt;run:&lt;/code&gt; step.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The core of the classifier:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;SHA40&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;compile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;^[0-9a-f]{40}$&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;VER&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;compile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;^v?(\d+)(\.\d+)?(\.\d+)?([-+.].*)?$&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ref&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;uses&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;partition&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;@&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;owner&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;kind&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;first_party&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;owner&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;actions&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;github&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;third_party&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;ref_class&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sha&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;SHA40&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ref&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;tag&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;VER&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ref&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;branch&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The fetch finished at 12:41 WIB (05:41 UTC): 29,330 &lt;code&gt;uses:&lt;/code&gt; references, 5,640 of them to 472 distinct third-party actions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj7b32wlev5q9esm7lbe9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj7b32wlev5q9esm7lbe9.png" alt="Third-party refs by pin type for all, AI and general repos, and the share of repos with at least one unpinned third-party action: 55%, 65% and 44%." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;All&lt;/th&gt;
&lt;th&gt;AI/LLM/MCP&lt;/th&gt;
&lt;th&gt;General&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Third-party refs&lt;/td&gt;
&lt;td&gt;5,640&lt;/td&gt;
&lt;td&gt;3,438&lt;/td&gt;
&lt;td&gt;2,202&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pinned to full SHA&lt;/td&gt;
&lt;td&gt;64.1%&lt;/td&gt;
&lt;td&gt;55.0%&lt;/td&gt;
&lt;td&gt;78.3%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;By tag&lt;/td&gt;
&lt;td&gt;32.3%&lt;/td&gt;
&lt;td&gt;39.8%&lt;/td&gt;
&lt;td&gt;20.6%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;By branch&lt;/td&gt;
&lt;td&gt;3.6%&lt;/td&gt;
&lt;td&gt;5.2%&lt;/td&gt;
&lt;td&gt;1.1%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Repos using third-party actions&lt;/td&gt;
&lt;td&gt;265&lt;/td&gt;
&lt;td&gt;135&lt;/td&gt;
&lt;td&gt;130&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;...with at least one unpinned ref&lt;/td&gt;
&lt;td&gt;145 (54.7%)&lt;/td&gt;
&lt;td&gt;88 (65.2%)&lt;/td&gt;
&lt;td&gt;57 (43.8%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;...fully SHA-pinned&lt;/td&gt;
&lt;td&gt;120 (45.3%)&lt;/td&gt;
&lt;td&gt;47 (34.8%)&lt;/td&gt;
&lt;td&gt;73 (56.2%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;...with zero SHA pins&lt;/td&gt;
&lt;td&gt;93 (35.1%)&lt;/td&gt;
&lt;td&gt;55 (40.7%)&lt;/td&gt;
&lt;td&gt;38 (29.2%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Median repo's SHA share&lt;/td&gt;
&lt;td&gt;75%&lt;/td&gt;
&lt;td&gt;23%&lt;/td&gt;
&lt;td&gt;100%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Of the 1,822 tag references, 1,525 are major-only like &lt;code&gt;@v4&lt;/code&gt;, the kind of tag that is designed to move. When people do pin, they mostly do it well: 2,579 of 3,614 SHA references (71.4%) carry a version comment.&lt;/p&gt;

&lt;p&gt;The most-used third-party actions, plus anthropics/claude-code-action (rank 16) because it is so common in AI repos:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhg8ag8phe6pwcml6ob4v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhg8ag8phe6pwcml6ob4v.png" alt="SHA share for the 12 most-used third-party actions, from 71% for codecov/codecov-action down to 31% for pypa/gh-action-pypi-publish." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Action&lt;/th&gt;
&lt;th&gt;Repos&lt;/th&gt;
&lt;th&gt;Refs&lt;/th&gt;
&lt;th&gt;SHA share&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;docker/login-action&lt;/td&gt;
&lt;td&gt;95&lt;/td&gt;
&lt;td&gt;369&lt;/td&gt;
&lt;td&gt;61%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;docker/setup-buildx-action&lt;/td&gt;
&lt;td&gt;89&lt;/td&gt;
&lt;td&gt;278&lt;/td&gt;
&lt;td&gt;61%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;docker/build-push-action&lt;/td&gt;
&lt;td&gt;79&lt;/td&gt;
&lt;td&gt;226&lt;/td&gt;
&lt;td&gt;57%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;astral-sh/setup-uv&lt;/td&gt;
&lt;td&gt;62&lt;/td&gt;
&lt;td&gt;470&lt;/td&gt;
&lt;td&gt;43%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pnpm/action-setup&lt;/td&gt;
&lt;td&gt;55&lt;/td&gt;
&lt;td&gt;533&lt;/td&gt;
&lt;td&gt;49%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;pypa/gh-action-pypi-publish&lt;/td&gt;
&lt;td&gt;48&lt;/td&gt;
&lt;td&gt;123&lt;/td&gt;
&lt;td&gt;31%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;oven-sh/setup-bun&lt;/td&gt;
&lt;td&gt;47&lt;/td&gt;
&lt;td&gt;300&lt;/td&gt;
&lt;td&gt;66%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;softprops/action-gh-release&lt;/td&gt;
&lt;td&gt;46&lt;/td&gt;
&lt;td&gt;71&lt;/td&gt;
&lt;td&gt;41%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;anthropics/claude-code-action&lt;/td&gt;
&lt;td&gt;21&lt;/td&gt;
&lt;td&gt;41&lt;/td&gt;
&lt;td&gt;61%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;pypa/gh-action-pypi-publish stands out: 83 of its 123 references use the &lt;code&gt;release/v1&lt;/code&gt; branch, which is what the project's own README uses in its examples. That action handles PyPI publishing credentials, so it is the one I would pin first. tj-actions/changed-files, 19 months after its compromise, is still in 11 repos, and 8 of its 23 references are tags.&lt;/p&gt;

&lt;p&gt;Permissions and the risky patterns:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;All&lt;/th&gt;
&lt;th&gt;AI/LLM/MCP&lt;/th&gt;
&lt;th&gt;General&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Workflows with top-level &lt;code&gt;permissions:&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;70.3%&lt;/td&gt;
&lt;td&gt;67.6%&lt;/td&gt;
&lt;td&gt;74.3%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Workflows with no &lt;code&gt;permissions:&lt;/code&gt; at any level&lt;/td&gt;
&lt;td&gt;878 (18.5%)&lt;/td&gt;
&lt;td&gt;579 (20.4%)&lt;/td&gt;
&lt;td&gt;299 (15.6%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Repos where every workflow sets it&lt;/td&gt;
&lt;td&gt;84 (28.0%)&lt;/td&gt;
&lt;td&gt;29 (19.3%)&lt;/td&gt;
&lt;td&gt;55 (36.7%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Repos with a &lt;code&gt;pull_request_target&lt;/code&gt; workflow&lt;/td&gt;
&lt;td&gt;122&lt;/td&gt;
&lt;td&gt;64&lt;/td&gt;
&lt;td&gt;58&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;...checking out the PR head&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Repos with untrusted context in &lt;code&gt;run:&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Repos with &lt;code&gt;.github/workflows/actions.lock&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Three findings
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. The median AI repo pins less than a quarter of its third-party actions.&lt;/strong&gt; The median general repo pins all of them: 23% against 100%. Counted per reference, it is 55.0% against 78.3%. AI projects are younger and move fast, and their CI shows it. That is uncomfortable, because their workflows can hold model API keys, PyPI and npm tokens and registry credentials.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Having a bot for updates goes hand in hand with pinning.&lt;/strong&gt; 145 of the 300 repos (48.3%) configure Dependabot for &lt;code&gt;github-actions&lt;/code&gt; or Renovate. In those repos, 77.0% of third-party references are SHA-pinned, and 91 of 139 are fully pinned. Without an updater, it is 37.2%, and 29 of 126.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbz7jcslekns5z5q5ax2m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbz7jcslekns5z5q5ax2m.png" alt="SHA share with and without Dependabot or Renovate: 77% vs 37% overall, 66% vs 33% in AI repos, 93% vs 45% in general repos." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is a correlation, not proof. My reading: pinning once is easy, and keeping dozens of SHAs current by hand is the part that hurts, so repos that pin tend to be the ones that automated the updates.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. The scary patterns are rare, and mostly gated.&lt;/strong&gt; 122 repos (40.7%) have a &lt;code&gt;pull_request_target&lt;/code&gt; workflow, but only 5 check out the PR's code in it. Two of those put the job behind a GitHub environment used as a manual approval gate. The other 3 deserve a closer look, and I am handling them privately. 7 repos write an attacker-influenced value straight into &lt;code&gt;run:&lt;/code&gt;. On reading them, every one was on an unprivileged trigger, gated by an &lt;code&gt;if:&lt;/code&gt; such as "same-repo branch" or "author is a member", or behind a trust-check job. None looked exploitable from outside, but each is one edited &lt;code&gt;if:&lt;/code&gt; away from being exploitable. I am not naming any of these repos.&lt;/p&gt;

&lt;p&gt;And the newest control has not landed yet: 11 days after the public preview, none of the 300 repos has an &lt;code&gt;actions.lock&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix checklist
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Pin with a SHA plus a version comment.&lt;/strong&gt; Resolve the tag to a commit, and check that it comes from the action's own repo, not a fork:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gh api repos/OWNER/ACTION/commits/v1.2.3 &lt;span class="nt"&gt;--jq&lt;/span&gt; .sha
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;OWNER/ACTION@&amp;lt;full 40-character sha&amp;gt;&lt;/span&gt; &lt;span class="c1"&gt;# v1.2.3&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Let a bot keep the pins current.&lt;/strong&gt; Dependabot, in &lt;code&gt;.github/dependabot.yml&lt;/code&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;
&lt;span class="na"&gt;updates&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;package-ecosystem&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;github-actions"&lt;/span&gt;
    &lt;span class="na"&gt;directory&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/"&lt;/span&gt;
    &lt;span class="na"&gt;schedule&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;interval&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;weekly"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;GitHub's docs say Dependabot updates &lt;code&gt;actions/checkout@&amp;lt;commit&amp;gt;&lt;/code&gt; references, and updates the version comment "when the comment is on the same line". One catch from the same docs: Dependabot alerts are only raised for actions referenced by semantic version, not for SHA pins. On Renovate, add the &lt;code&gt;helpers:pinGitHubActionDigests&lt;/code&gt; preset to &lt;code&gt;extends&lt;/code&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Enforce it.&lt;/strong&gt; The allowed actions policy in your repository, organization or enterprise Actions settings has a checkbox to require full-length SHA pinning; unpinned workflows then fail. For transitive pins, try the &lt;code&gt;gh actions-lock&lt;/code&gt; lockfile preview.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Start every workflow with minimal permissions&lt;/strong&gt; and raise them per job:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;permissions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;contents&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;read&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;release&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;permissions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;contents&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;write&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Never put untrusted input inside &lt;code&gt;run:&lt;/code&gt;.&lt;/strong&gt; Pass it through &lt;code&gt;env:&lt;/code&gt;. Adapted from GitHub's docs:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Check PR title&lt;/span&gt;
  &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;TITLE&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ github.event.pull_request.title }}&lt;/span&gt;
  &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
    &lt;span class="s"&gt;if [[ "$TITLE" =~ ^octocat ]]; then&lt;/span&gt;
      &lt;span class="s"&gt;echo "PR title starts with 'octocat'"&lt;/span&gt;
    &lt;span class="s"&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Do not check out PR code in &lt;code&gt;pull_request_target&lt;/code&gt;.&lt;/strong&gt; If you must, put the job behind an environment with required reviewers. Since 8 December 2025 &lt;a href="https://github.blog/changelog/2025-11-07-actions-pull_request_target-and-environment-branch-protections-changes/" rel="noopener noreferrer"&gt;GitHub always takes the workflow file from the default branch&lt;/a&gt; for this trigger, but that does not make an explicit checkout of the PR head safe.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Caveats
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Static analysis only.&lt;/strong&gt; I read YAML. I did not run anything, and composite actions inside the repos (&lt;code&gt;.github/actions/*&lt;/code&gt;) and transitive actions were not scanned.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A SHA pin is not a full fix.&lt;/strong&gt; A pinned action that downloads a script or uses &lt;code&gt;@main&lt;/code&gt; internally still moves.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Settings are invisible.&lt;/strong&gt; A repo can set the default &lt;code&gt;GITHUB_TOKEN&lt;/code&gt; to read-only or enforce SHA pinning in its settings, and neither shows up in YAML. "No &lt;code&gt;permissions:&lt;/code&gt; block" is not proof of a write token.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Classification limits.&lt;/strong&gt; Version-like refs were counted as tags without checking the API, and a few could be branches. Same-org actions (for example a project's own reusable workflows) were left out of third-party counts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sample.&lt;/strong&gt; 300 repos by stars and topics, one day, default branch only. The AI split follows self-chosen GitHub topics.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I am publishing aggregates only.&lt;/p&gt;

&lt;h2&gt;
  
  
  Closing
&lt;/h2&gt;

&lt;p&gt;Pinning is not exotic anymore: 120 of 265 repos pin every third-party action, and GitHub now lets you enforce it with a checkbox. The gap is in fast-moving AI repos, and in workflows nobody has touched since they were copied from a README.&lt;/p&gt;

&lt;p&gt;If you maintain a popular repo that still uses &lt;code&gt;@v4&lt;/code&gt;: what is actually stopping you, the review noise from update PRs, or something else?&lt;/p&gt;

&lt;p&gt;Related: &lt;a href="https://www.kielltampubolon.id/writing/a-1-day-cooldown-would-have-blocked-70-of-2026s-hijacked-npm-releases/" rel="noopener noreferrer"&gt;a 1-day cooldown would have blocked 70% of 2026's hijacked npm releases&lt;/a&gt; and &lt;a href="https://www.kielltampubolon.id/writing/the-litellm-supply-chain-backdoor-what-3-hours-means-for-your-ai-agent-gateway/" rel="noopener noreferrer"&gt;the LiteLLM supply chain backdoor&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>security</category>
      <category>github</category>
      <category>devops</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Saya Cek DMARC 4.437 Domain .id. 47% Domain go.id Masih Bisa Dipalsukan</title>
      <dc:creator>Kiell Tampubolon</dc:creator>
      <pubDate>Fri, 06 Nov 2026 01:00:00 +0000</pubDate>
      <link>https://dev.to/kielltampubolon/saya-cek-dmarc-4437-domain-id-47-domain-goid-masih-bisa-dipalsukan-2o9e</link>
      <guid>https://dev.to/kielltampubolon/saya-cek-dmarc-4437-domain-id-47-domain-goid-masih-bisa-dipalsukan-2o9e</guid>
      <description>&lt;p&gt;&lt;em&gt;Versi bahasa Inggris dengan metodologi lengkap: &lt;a href="https://www.kielltampubolon.id/writing/i-checked-dmarc-on-4437-indonesian-id-domains/" rel="noopener noreferrer"&gt;https://www.kielltampubolon.id/writing/i-checked-dmarc-on-4437-indonesian-id-domains/&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Di setiap pelatihan phishing, selalu ada yang bertanya: "Bagaimana membedakan email asli dari instansi dengan yang palsu?" Jawaban jujurnya: tergantung domainnya. Kalau pemilik domain sudah memasang DMARC dengan kebijakan reject, email palsu yang memakai nama domain itu persis di kolom From biasanya tidak akan sampai ke inbox. Kalau belum, email palsu itu bisa lolos.&lt;/p&gt;

&lt;p&gt;Pada 25 Oktober 2026 saya mengecek 4.437 domain .id populer. Dari 469 domain go.id, 222 (47,3%) belum punya DMARC atau masih memakai &lt;code&gt;p=none&lt;/code&gt;. Artinya, nama instansi tersebut masih bisa dipakai di email palsu, dan server penerima tidak diminta untuk memblokirnya.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ringkasan untuk pimpinan
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;DMARC adalah satu record DNS yang memberi tahu Gmail, Outlook dan lainnya apa yang harus dilakukan terhadap email palsu atas nama domain Anda. Tanpa DMARC, atau dengan &lt;code&gt;p=none&lt;/code&gt;, tidak ada yang diblokir.&lt;/li&gt;
&lt;li&gt;Dari 4.437 domain .id, 3.301 (74,4%) masih bisa dipalsukan dengan cara ini.&lt;/li&gt;
&lt;li&gt;go.id paling baik, tetapi tetap 47,3%. Kampus (ac.id) 84,2%, sekolah (sch.id) 91,7%.&lt;/li&gt;
&lt;li&gt;Domain yang tidak dipakai untuk email juga perlu dilindungi. Dari 929 domain tanpa server email, hanya 40 yang sudah dikunci.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Kenapa ini penting
&lt;/h2&gt;

&lt;p&gt;Phishing di Indonesia sering menumpang nama instansi resmi. Pada April 2024, Kemenkes &lt;a href="https://kemkes.go.id/eng/%20waspada-email-phishing-mengatasnamakan-satusehat" rel="noopener noreferrer"&gt;memperingatkan&lt;/a&gt; email phishing yang mengatasnamakan SATUSEHAT. Pada 9 Juli 2026, DJP &lt;a href="https://investortrust.id/macro/109022/waspada-penipuan-djp-tegaskan-email-pengingat-tunggakan-pajak-hanya-pakai-domain-resmi" rel="noopener noreferrer"&gt;menegaskan&lt;/a&gt; bahwa email pengingatnya hanya dikirim dari @pajak.go.id. Imbauan "cek domain pengirim" hanya berguna kalau domain itu sendiri tidak bisa dipalsukan.&lt;/p&gt;

&lt;p&gt;Google &lt;a href="https://support.google.com/a/answer/81126" rel="noopener noreferrer"&gt;mewajibkan&lt;/a&gt; DMARC sejak 1 Februari 2024 untuk pengirim lebih dari 5.000 email per hari ke akun Gmail, dan &lt;a href="https://senders.yahooinc.com/best-practices/" rel="noopener noreferrer"&gt;Yahoo&lt;/a&gt; memberlakukan aturan serupa. Tetapi keduanya cukup dengan &lt;code&gt;p=none&lt;/code&gt;. Jadi aturan itu menjaga email Anda tetap terkirim, bukan melindungi nama Anda dari pemalsuan.&lt;/p&gt;

&lt;p&gt;Saya juga mencari panduan dari BSSN dan PANDI. Peraturan BSSN Nomor 4 Tahun 2021 tentang keamanan SPBE tidak menyebut SPF, DKIM, maupun DMARC, dan saya tidak menemukan dokumen BSSN atau PANDI lain yang membahasnya. Kalau ada, saya senang sekali kalau dikabari.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cara pengukuran (singkat)
&lt;/h2&gt;

&lt;p&gt;Sumbernya daftar Tranco GQ32K yang berisi 4.814 domain .id. Saya ambil semua domain go.id, ac.id, co.id, or.id, sch.id, web.id, my.id, biz.id dan .id langsung: 4.573 domain. Sebanyak 91 domain sudah tidak ada (NXDOMAIN) dan 45 gagal di DNS (SERVFAIL), jadi yang dianalisis 4.437 domain.&lt;/p&gt;

&lt;p&gt;Skrip Python hanya mengirim query DNS ke 1.1.1.1 dan 8.8.8.8, maksimal 45 query per detik. Tidak ada koneksi langsung ke server domain yang dicek. Total 33.336 query dalam 813 detik.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bisa dipalsukan&lt;/strong&gt; berarti: tidak ada DMARC yang valid, atau &lt;code&gt;p=none&lt;/code&gt;. &lt;code&gt;p=none&lt;/code&gt; hanya meminta laporan, tidak meminta tindakan. SPF dengan &lt;code&gt;~all&lt;/code&gt; juga tidak cukup, karena SPF mengecek alamat pengirim tersembunyi (envelope), bukan alamat From yang dilihat orang, dan RFC 7208 menyatakan softfail sebaiknya tidak menjadi satu-satunya alasan penolakan.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hasil per kategori
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft809wgnpdtrnip3yze37.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft809wgnpdtrnip3yze37.png" alt="Grafik batang DMARC per kategori .id: go.id 47% bisa dipalsukan, co.id 59%, or.id 74%, .id 82%, ac.id 84%, sch.id 92%, biz.id 96%, web.id 97%, my.id 97%." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Kategori&lt;/th&gt;
&lt;th&gt;Dianalisis&lt;/th&gt;
&lt;th&gt;Tanpa DMARC&lt;/th&gt;
&lt;th&gt;p=none&lt;/th&gt;
&lt;th&gt;quarantine&lt;/th&gt;
&lt;th&gt;reject&lt;/th&gt;
&lt;th&gt;Bisa dipalsukan&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;go.id&lt;/td&gt;
&lt;td&gt;469&lt;/td&gt;
&lt;td&gt;87&lt;/td&gt;
&lt;td&gt;135&lt;/td&gt;
&lt;td&gt;156&lt;/td&gt;
&lt;td&gt;91&lt;/td&gt;
&lt;td&gt;222 (47,3%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;co.id&lt;/td&gt;
&lt;td&gt;1.029&lt;/td&gt;
&lt;td&gt;341&lt;/td&gt;
&lt;td&gt;271&lt;/td&gt;
&lt;td&gt;217&lt;/td&gt;
&lt;td&gt;200&lt;/td&gt;
&lt;td&gt;612 (59,5%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;or.id&lt;/td&gt;
&lt;td&gt;50&lt;/td&gt;
&lt;td&gt;25&lt;/td&gt;
&lt;td&gt;12&lt;/td&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;37 (74,0%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;.id&lt;/td&gt;
&lt;td&gt;1.607&lt;/td&gt;
&lt;td&gt;957&lt;/td&gt;
&lt;td&gt;357&lt;/td&gt;
&lt;td&gt;169&lt;/td&gt;
&lt;td&gt;124&lt;/td&gt;
&lt;td&gt;1.314 (81,8%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ac.id&lt;/td&gt;
&lt;td&gt;942&lt;/td&gt;
&lt;td&gt;318&lt;/td&gt;
&lt;td&gt;475&lt;/td&gt;
&lt;td&gt;97&lt;/td&gt;
&lt;td&gt;52&lt;/td&gt;
&lt;td&gt;793 (84,2%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;sch.id&lt;/td&gt;
&lt;td&gt;133&lt;/td&gt;
&lt;td&gt;83&lt;/td&gt;
&lt;td&gt;39&lt;/td&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;122 (91,7%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;biz.id&lt;/td&gt;
&lt;td&gt;23&lt;/td&gt;
&lt;td&gt;16&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;22 (95,7%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;web.id&lt;/td&gt;
&lt;td&gt;70&lt;/td&gt;
&lt;td&gt;57&lt;/td&gt;
&lt;td&gt;11&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;68 (97,1%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;my.id&lt;/td&gt;
&lt;td&gt;114&lt;/td&gt;
&lt;td&gt;88&lt;/td&gt;
&lt;td&gt;23&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;111 (97,4%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Total&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;4.437&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1.972&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1.329&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;656&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;480&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;3.301 (74,4%)&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Tiga temuan
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. go.id sudah setengah jalan, lalu berhenti.&lt;/strong&gt; 247 domain go.id (52,7%) sudah quarantine atau reject, terbaik di antara semua kategori. Tetapi 135 masih &lt;code&gt;p=none&lt;/code&gt;, dan 97 di antaranya sudah menerima laporan &lt;code&gt;rua&lt;/code&gt;. Laporan masuk, tetapi kebijakannya tidak pernah dinaikkan.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Kampus dan sekolah paling terbuka.&lt;/strong&gt; ac.id punya 475 domain di &lt;code&gt;p=none&lt;/code&gt;, separuh dari semua domain kampus yang dianalisis, dan 367 di antaranya sudah mengumpulkan laporan. Di sch.id, 83 dari 133 domain sekolah belum punya DMARC sama sekali.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Domain tanpa email paling mudah diperbaiki, tetapi paling jarang dikunci.&lt;/strong&gt; Ada 929 domain tanpa MX. Hanya 40 (4,3%) yang memasang SPF &lt;code&gt;-all&lt;/code&gt; dan DMARC &lt;code&gt;p=reject&lt;/code&gt; sesuai praktik &lt;a href="https://m3aawg.org/M3AAWG-Protecting-Parked-Domains-BCP-update-2022-06" rel="noopener noreferrer"&gt;M3AAWG&lt;/a&gt;. Sebanyak 786 tidak punya SPF maupun DMARC. Di go.id ada 19 domain tanpa MX, dan tidak satu pun yang dikunci.&lt;/p&gt;

&lt;p&gt;Kontrol lain masih langka: MTA-STS 35 domain (0,8%), TLS-RPT 35 (0,8%), DNSSEC 190 (4,3%).&lt;/p&gt;

&lt;h2&gt;
  
  
  Langkah perbaikan
&lt;/h2&gt;

&lt;p&gt;Ganti &lt;code&gt;contoh.go.id&lt;/code&gt; dengan domain Anda.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Mulai dengan monitoring dan laporan.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;_dmarc.contoh.go.id.  TXT  "v=DMARC1; p=none; rua=mailto:laporan-dmarc@contoh.go.id"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Baca laporannya selama 2 sampai 4 minggu. Pastikan semua pengirim resmi lolos SPF atau DKIM: email dinas, SIAKAD, aplikasi layanan, LMS, aplikasi buletin. Perbaiki yang belum.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Naik ke quarantine.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;_dmarc.contoh.go.id.  TXT  "v=DMARC1; p=quarantine; rua=mailto:laporan-dmarc@contoh.go.id"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tag &lt;code&gt;pct&lt;/code&gt; sudah dihapus di RFC 9989 (pengganti RFC 7489), jadi jangan mengandalkannya.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Reject.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;_dmarc.contoh.go.id.  TXT  "v=DMARC1; p=reject; sp=reject; rua=mailto:laporan-dmarc@contoh.go.id"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pastikan juga hanya ada satu record SPF, maksimal 10 lookup, dan diakhiri &lt;code&gt;-all&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Domain yang tidak dipakai untuk email&lt;/strong&gt; (domain aplikasi, domain event, domain lama):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;contoh.go.id.         MX   0 .
contoh.go.id.         TXT  "v=spf1 -all"
_dmarc.contoh.go.id.  TXT  "v=DMARC1; p=reject; rua=mailto:laporan-dmarc@contoh.go.id"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ini cukup lima menit dan tidak perlu uji coba, karena memang tidak ada email resmi yang bisa rusak.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. MTA-STS dan TLS-RPT&lt;/strong&gt; untuk email masuk:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;_mta-sts.contoh.go.id.    TXT  "v=STSv1; id=20261025T000000"
_smtp._tls.contoh.go.id.  TXT  "v=TLSRPTv1; rua=mailto:laporan-tls@contoh.go.id"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lalu sajikan file &lt;code&gt;https://mta-sts.contoh.go.id/.well-known/mta-sts.txt&lt;/code&gt; berisi &lt;code&gt;version: STSv1&lt;/code&gt;, &lt;code&gt;mode: testing&lt;/code&gt;, &lt;code&gt;mx: mail.contoh.go.id&lt;/code&gt;, &lt;code&gt;max_age: 86400&lt;/code&gt;. Ubah ke &lt;code&gt;enforce&lt;/code&gt; setelah laporan TLS bersih.&lt;/p&gt;

&lt;h2&gt;
  
  
  Batasan
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Sampelnya domain .id paling populer menurut Tranco, jadi condong ke organisasi besar.&lt;/li&gt;
&lt;li&gt;Yang dicek hanya domain utama, bukan subdomain. DKIM tidak diukur.&lt;/li&gt;
&lt;li&gt;"Bisa dipalsukan" berarti pemilik domain belum meminta pemblokiran. Sebagian penerima tetap menyaring email palsu dengan filter mereka sendiri.&lt;/li&gt;
&lt;li&gt;DMARC tidak mencegah domain tiruan (seperti kasus SATUSEHAT) atau akun email yang dibobol.&lt;/li&gt;
&lt;li&gt;Satu waktu pengukuran: 25 Oktober 2026, dari Batam.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Saya hanya menerbitkan angka agregat, tidak ada hasil per domain.&lt;/p&gt;

&lt;h2&gt;
  
  
  Penutup
&lt;/h2&gt;

&lt;p&gt;Perbaikannya hanya beberapa record TXT, bukan proyek besar. Untuk rekan-rekan admin di pemda, kampus dan sekolah: apa yang membuat domain Anda masih di &lt;code&gt;p=none&lt;/code&gt;? Takut sistem lama rusak, tidak ada yang membaca laporan, atau tidak jelas siapa yang memegang DNS?&lt;/p&gt;

&lt;p&gt;Baca juga: &lt;a href="https://www.kielltampubolon.id/writing/lets-encrypt-pindah-ke-64-hari-saya-cek-520-situs-id/" rel="noopener noreferrer"&gt;Let's Encrypt Pindah ke 64 Hari. Saya Cek 520 Situs .id&lt;/a&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>email</category>
      <category>dns</category>
      <category>indonesia</category>
    </item>
    <item>
      <title>I Checked DMARC on 4,437 Indonesian .id Domains. 47% of go.id Can Still Be Spoofed</title>
      <dc:creator>Kiell Tampubolon</dc:creator>
      <pubDate>Thu, 05 Nov 2026 14:00:00 +0000</pubDate>
      <link>https://dev.to/kielltampubolon/i-checked-dmarc-on-4437-indonesian-id-domains-47-of-goid-can-still-be-spoofed-1hja</link>
      <guid>https://dev.to/kielltampubolon/i-checked-dmarc-on-4437-indonesian-id-domains-47-of-goid-can-still-be-spoofed-1hja</guid>
      <description>&lt;p&gt;When someone asks me during &lt;a href="https://www.kielltampubolon.id/speaking/" rel="noopener noreferrer"&gt;phishing training&lt;/a&gt; how to spot a fake email from a government office, the honest answer depends on the domain. If the domain owner has published a DMARC policy that tells receivers to reject forged mail, a message with that exact domain in the From line will usually never reach the inbox. If not, it can. So on 25 October 2026 I checked 4,437 Indonesian .id domains. Of the 469 go.id domains, 222 (47.3%) either have no DMARC record or have one set to &lt;code&gt;p=none&lt;/code&gt;. Their name can still be put on a fake email, and receivers have not been asked to stop it.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR (for non-technical readers)
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;DMARC is a DNS record that tells Gmail, Outlook and others what to do with email that falsely claims to come from your domain. Without it, or with it set to "none", nothing is blocked on your behalf.&lt;/li&gt;
&lt;li&gt;I checked 4,437 popular .id domains on 25 October 2026. 3,301 of them (74.4%) can still be spoofed this way.&lt;/li&gt;
&lt;li&gt;Government domains (go.id) do best, and still 47.3% are spoofable. Universities (ac.id) are at 84.2%, schools (sch.id) at 91.7%.&lt;/li&gt;
&lt;li&gt;Domains that never send email need protection too. Of 929 domains without a mail server, only 40 have the records that say "nothing legitimate ever comes from here".&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Why this matters
&lt;/h2&gt;

&lt;p&gt;Phishing in Indonesia leans on trust in official names. In April 2024 the Ministry of Health &lt;a href="https://kemkes.go.id/eng/%20waspada-email-phishing-mengatasnamakan-satusehat" rel="noopener noreferrer"&gt;warned&lt;/a&gt; about phishing emails impersonating SATUSEHAT, sent from non-official domains. On 9 July 2026, the tax directorate (DJP) &lt;a href="https://investortrust.id/macro/109022/waspada-penipuan-djp-tegaskan-email-pengingat-tunggakan-pajak-hanya-pakai-domain-resmi" rel="noopener noreferrer"&gt;reminded&lt;/a&gt; taxpayers that its reminder emails come only from @pajak.go.id. Advice like "check the sender's domain" is only as good as the domain's protection against exact-domain forgery. That protection is DMARC.&lt;/p&gt;

&lt;p&gt;The big mailbox providers already expect it. Since 1 February 2024, &lt;a href="https://support.google.com/a/answer/81126" rel="noopener noreferrer"&gt;Google requires&lt;/a&gt; senders of more than 5,000 messages a day to Gmail accounts to set up DMARC, though the policy "can be set to none". &lt;a href="https://senders.yahooinc.com/best-practices/" rel="noopener noreferrer"&gt;Yahoo&lt;/a&gt; asks bulk senders for "a valid DMARC policy with at least p=none". Both rules are about deliverability. Neither forces anyone to block forgeries, and that gap is what this scan measures.&lt;/p&gt;

&lt;p&gt;I looked for Indonesian guidance. BSSN Regulation No. 4 of 2021, the SPBE security standard, does not mention SPF, DKIM or DMARC anywhere in its text, and I could not find a BSSN or PANDI document that does. If one exists, I would like to read it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Method
&lt;/h2&gt;

&lt;p&gt;The Tranco list GQ32K (generated 24 October 2026) contains 4,814 .id domains. I kept every domain under go.id, ac.id, co.id, or.id, sch.id, web.id, my.id, biz.id and plain .id: 4,573 domains. 91 returned NXDOMAIN and 45 failed with SERVFAIL or timeouts on every attempt (30 of them ac.id), so 4,437 domains are analysed.&lt;/p&gt;

&lt;p&gt;A Python script (dnspython, run with uv) sent only DNS queries, to 1.1.1.1 and 8.8.8.8 alternately, with up to 4 attempts and a global cap of 45 queries per second. For each domain it asked for MX, apex TXT (SPF), &lt;code&gt;_dmarc&lt;/code&gt; TXT, &lt;code&gt;_mta-sts&lt;/code&gt; TXT, &lt;code&gt;_smtp._tls&lt;/code&gt; TXT, &lt;code&gt;default._bimi&lt;/code&gt; TXT and DS. It followed SPF &lt;code&gt;include:&lt;/code&gt; and &lt;code&gt;redirect=&lt;/code&gt; to count DNS-querying terms against the limit of 10 in RFC 7208. The run started at 11:17 WIB and took 813 seconds and 33,336 queries.&lt;/p&gt;

&lt;p&gt;DMARC records were parsed per &lt;a href="https://www.rfc-editor.org/rfc/rfc7489" rel="noopener noreferrer"&gt;RFC 7489&lt;/a&gt;: exactly one &lt;code&gt;v=DMARC1&lt;/code&gt; record with a usable &lt;code&gt;p=&lt;/code&gt;. Two records means no policy. RFC 7489 is now obsoleted by &lt;a href="https://www.rfc-editor.org/rfc/rfc9989" rel="noopener noreferrer"&gt;RFC 9989&lt;/a&gt; (2026), which keeps none, quarantine and reject but drops &lt;code&gt;pct&lt;/code&gt; in favour of a &lt;code&gt;t=&lt;/code&gt; testing flag.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Spoofable&lt;/strong&gt; here means no valid DMARC record, or &lt;code&gt;p=none&lt;/code&gt;. Why count &lt;code&gt;p=none&lt;/code&gt;? RFC 9989 says a &lt;code&gt;p=none&lt;/code&gt; policy "MUST NOT modify existing mail handling". The domain only asks for reports. SPF alone does not fill the gap: it checks the hidden envelope sender, not the From address people read, and RFC 7208 says a &lt;code&gt;~all&lt;/code&gt; softfail "SHOULD NOT" be the sole reason to reject. So &lt;code&gt;p=none&lt;/code&gt; plus &lt;code&gt;~all&lt;/code&gt; leaves forgery of the exact domain unblocked at most receivers, unless their own spam filters catch it. 1,104 of the 1,329 &lt;code&gt;p=none&lt;/code&gt; domains pair it with &lt;code&gt;~all&lt;/code&gt;, &lt;code&gt;?all&lt;/code&gt;, &lt;code&gt;+all&lt;/code&gt; or no SPF at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8f61x9wxq42d6ftaoov6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8f61x9wxq42d6ftaoov6.png" alt="Stacked bars per .id second level showing no DMARC, p=none, p=quarantine and p=reject. Spoofable share: go.id 47%, co.id 59%, or.id 74%, plain .id 82%, ac.id 84%, sch.id 92%, biz.id 96%, web.id 97%, my.id 97%." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Group&lt;/th&gt;
&lt;th&gt;Analysed&lt;/th&gt;
&lt;th&gt;No DMARC&lt;/th&gt;
&lt;th&gt;p=none&lt;/th&gt;
&lt;th&gt;p=quarantine&lt;/th&gt;
&lt;th&gt;p=reject&lt;/th&gt;
&lt;th&gt;Spoofable&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;go.id&lt;/td&gt;
&lt;td&gt;469&lt;/td&gt;
&lt;td&gt;87&lt;/td&gt;
&lt;td&gt;135&lt;/td&gt;
&lt;td&gt;156&lt;/td&gt;
&lt;td&gt;91&lt;/td&gt;
&lt;td&gt;222 (47.3%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;co.id&lt;/td&gt;
&lt;td&gt;1,029&lt;/td&gt;
&lt;td&gt;341&lt;/td&gt;
&lt;td&gt;271&lt;/td&gt;
&lt;td&gt;217&lt;/td&gt;
&lt;td&gt;200&lt;/td&gt;
&lt;td&gt;612 (59.5%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;or.id&lt;/td&gt;
&lt;td&gt;50&lt;/td&gt;
&lt;td&gt;25&lt;/td&gt;
&lt;td&gt;12&lt;/td&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;37 (74.0%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;.id&lt;/td&gt;
&lt;td&gt;1,607&lt;/td&gt;
&lt;td&gt;957&lt;/td&gt;
&lt;td&gt;357&lt;/td&gt;
&lt;td&gt;169&lt;/td&gt;
&lt;td&gt;124&lt;/td&gt;
&lt;td&gt;1,314 (81.8%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ac.id&lt;/td&gt;
&lt;td&gt;942&lt;/td&gt;
&lt;td&gt;318&lt;/td&gt;
&lt;td&gt;475&lt;/td&gt;
&lt;td&gt;97&lt;/td&gt;
&lt;td&gt;52&lt;/td&gt;
&lt;td&gt;793 (84.2%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;sch.id&lt;/td&gt;
&lt;td&gt;133&lt;/td&gt;
&lt;td&gt;83&lt;/td&gt;
&lt;td&gt;39&lt;/td&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;122 (91.7%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;biz.id&lt;/td&gt;
&lt;td&gt;23&lt;/td&gt;
&lt;td&gt;16&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;22 (95.7%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;web.id&lt;/td&gt;
&lt;td&gt;70&lt;/td&gt;
&lt;td&gt;57&lt;/td&gt;
&lt;td&gt;11&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;68 (97.1%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;my.id&lt;/td&gt;
&lt;td&gt;114&lt;/td&gt;
&lt;td&gt;88&lt;/td&gt;
&lt;td&gt;23&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;111 (97.4%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;All&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;4,437&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1,972&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1,329&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;656&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;480&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;3,301 (74.4%)&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;70.9% of domains publish one SPF record, and 113 publish two or more, which is a permanent error. Of the single SPF records, 71.1% end in &lt;code&gt;~all&lt;/code&gt; and 26.9% in &lt;code&gt;-all&lt;/code&gt;. 84 of them (2.7%) exceed 10 DNS lookups, so they fail at receivers that enforce the limit.&lt;/p&gt;

&lt;p&gt;The newer controls are rare. MTA-STS: 35 domains (0.8%). TLS-RPT: 35 (0.8%). BIMI: 38 (0.9%). DNSSEC, measured as a DS record at the parent: 190 (4.3%), led by go.id at 74 (15.8%).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgn2fccz45k2wstf9kbj7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgn2fccz45k2wstf9kbj7.png" alt="Bars showing the share of 4,437 domains with each control: one SPF record 70.9%, valid DMARC 55.6%, DMARC with rua 39.5%, enforced 25.6%, reject at pct=100 with SPF -all 5.3%, DNSSEC 4.3%, BIMI 0.9%, MTA-STS 0.8%, TLS-RPT 0.8%." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Three findings
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. go.id is ahead, and stuck halfway.&lt;/strong&gt; 247 go.id domains (52.7%) enforce quarantine or reject, the best of any group. But 135 sit at &lt;code&gt;p=none&lt;/code&gt;, and 97 of those (71.9%) already send aggregate reports to an &lt;code&gt;rua&lt;/code&gt; address. Somebody turned on monitoring and never finished the rollout. Only 54 go.id domains (11.5%) have the strict combination: &lt;code&gt;p=reject&lt;/code&gt; at 100% plus SPF &lt;code&gt;-all&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Campuses and schools are wide open.&lt;/strong&gt; ac.id has the most &lt;code&gt;p=none&lt;/code&gt; records of any group: 475, half of all analysed university domains. 86.1% of ac.id SPF records end in &lt;code&gt;~all&lt;/code&gt;. Universities send mail from many places (the academic system, LMS, newsletters, helpdesk), which makes reject feel risky, and that is exactly the case &lt;code&gt;rua&lt;/code&gt; reports are built for: 367 of those 475 already collect them. sch.id is worse at 91.7% spoofable, and 83 of 133 school domains have no DMARC at all.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Domains that send no mail are the easiest target and the easiest fix.&lt;/strong&gt; 929 domains have no MX record. Only 40 of them (4.3%) publish both SPF &lt;code&gt;-all&lt;/code&gt; and DMARC &lt;code&gt;p=reject&lt;/code&gt;, the lockdown the &lt;a href="https://m3aawg.org/M3AAWG-Protecting-Parked-Domains-BCP-update-2022-06" rel="noopener noreferrer"&gt;M3AAWG parked-domain practice&lt;/a&gt; recommends. 786 publish neither SPF nor valid DMARC. In go.id, 19 domains have no MX and none of them is locked down. Domains with mail servers fare better but not well: 2,440 of 3,508 (69.6%) are spoofable.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Faa5cmfqoqac2dpzn2tte.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Faa5cmfqoqac2dpzn2tte.png" alt="Two stacked bars: domains with MX, 70% spoofable of 3,508; domains without MX, 93% spoofable of 929. Callouts: 786 no-MX domains publish neither SPF nor DMARC; 40 are locked down with v=spf1 -all and p=reject." width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix checklist
&lt;/h2&gt;

&lt;p&gt;Replace &lt;code&gt;example.go.id&lt;/code&gt; and the report addresses with your own.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Start DMARC in monitoring mode, with reports.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;_dmarc.example.go.id.  TXT  "v=DMARC1; p=none; rua=mailto:dmarc-reports@example.go.id"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read the aggregate reports for two to four weeks. Every legitimate sender (your mail platform, the academic system, the bulk mail tool, the ticketing system) must pass SPF or DKIM with an aligned domain. Fix the ones that do not. If the &lt;code&gt;rua&lt;/code&gt; address is on another domain, that domain must publish an authorization record for you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Move to quarantine.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;_dmarc.example.go.id.  TXT  "v=DMARC1; p=quarantine; rua=mailto:dmarc-reports@example.go.id"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;RFC 7489 allowed &lt;code&gt;pct=25&lt;/code&gt; for a partial rollout. 66 domains in this scan enforce with &lt;code&gt;pct&lt;/code&gt; below 100. RFC 9989 removes &lt;code&gt;pct&lt;/code&gt;, so do not plan around it. Move the whole domain once the reports are clean.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Reject.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;_dmarc.example.go.id.  TXT  "v=DMARC1; p=reject; sp=reject; rua=mailto:dmarc-reports@example.go.id"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keep reading reports afterwards. Also check SPF: one record only, at most 10 lookups, ending in &lt;code&gt;-all&lt;/code&gt; once you know your senders.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Domains that never send mail.&lt;/strong&gt; Per M3AAWG, plus a null MX (RFC 7505):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;example.go.id.         MX   0 .
example.go.id.         TXT  "v=spf1 -all"
_dmarc.example.go.id.  TXT  "v=DMARC1; p=reject; rua=mailto:dmarc-reports@example.go.id"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This takes five minutes and needs no testing, because there is no legitimate mail to break.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. MTA-STS and TLS-RPT for inbound mail.&lt;/strong&gt; These protect mail coming to you against downgrade attacks, not spoofing, but the work is small:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;_mta-sts.example.go.id.    TXT  "v=STSv1; id=20261025T000000"
_smtp._tls.example.go.id.  TXT  "v=TLSRPTv1; rua=mailto:tls-reports@example.go.id"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then serve &lt;code&gt;https://mta-sts.example.go.id/.well-known/mta-sts.txt&lt;/code&gt; with a valid certificate:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;version: STSv1
mode: testing
mx: mail.example.go.id
max_age: 86400
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Switch &lt;code&gt;mode&lt;/code&gt; to &lt;code&gt;enforce&lt;/code&gt; and raise &lt;code&gt;max_age&lt;/code&gt; once the TLS reports are clean, and change &lt;code&gt;id&lt;/code&gt; whenever the policy changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Caveats
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Sample.&lt;/strong&gt; These are the most popular .id domains in Tranco, so they skew towards bigger organisations. biz.id has only 23 analysed domains.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Apex only.&lt;/strong&gt; I checked the registered domain, not subdomains. &lt;code&gt;sp=&lt;/code&gt; and the parent policy cover subdomains, and I did not measure them separately.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No DKIM.&lt;/strong&gt; DKIM keys live under selectors that DNS cannot list, so I did not measure DKIM.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;"Spoofable" is about the policy, not the outcome.&lt;/strong&gt; Many receivers run their own filters and will catch some forged mail even at &lt;code&gt;p=none&lt;/code&gt;. The point is that the domain owner has not asked them to.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MTA-STS was checked by TXT record only.&lt;/strong&gt; Fetching the policy file would mean contacting the domains, and this scan sends DNS queries only.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DMARC does not stop look-alike domains or stolen accounts.&lt;/strong&gt; The SATUSEHAT campaign used other domains. In April 2022, &lt;a href="https://nasional.kompas.com/read/2022/04/25/12590051/asn-diminta-cermat-menjaga-keamanan-e-mail-hindari-kebocoran-akun?page=all" rel="noopener noreferrer"&gt;Kompas reported&lt;/a&gt; leaked email credentials across 28 government domains and subdomains. Mail sent from a real hacked account passes DMARC.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One point in time, one place.&lt;/strong&gt; 25 October 2026, from Batam, through two public resolvers. 45 domains with failing DNS were excluded.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I am publishing aggregates only, not per-domain results.&lt;/p&gt;

&lt;h2&gt;
  
  
  Closing
&lt;/h2&gt;

&lt;p&gt;The fix here is a few TXT records, not a project. go.id has shown it can move: more than half of its domains enforce DMARC. The rest are mostly stuck at &lt;code&gt;p=none&lt;/code&gt;, often with reports already arriving in someone's inbox.&lt;/p&gt;

&lt;p&gt;If you run mail for a pemda, a campus or a school: what keeps your domain at &lt;code&gt;p=none&lt;/code&gt;? Is it fear of breaking a legacy system, nobody reading the reports, or nobody owning DNS?&lt;/p&gt;

&lt;p&gt;Versi bahasa Indonesia: &lt;a href="https://www.kielltampubolon.id/writing/saya-cek-dmarc-4437-domain-id-go-id-masih-bisa-dipalsukan/" rel="noopener noreferrer"&gt;https://www.kielltampubolon.id/writing/saya-cek-dmarc-4437-domain-id-go-id-masih-bisa-dipalsukan/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Related: &lt;a href="https://www.kielltampubolon.id/writing/lets-encrypt-is-going-to-64-days-i-checked-520-id-sites/" rel="noopener noreferrer"&gt;Let's Encrypt Is Going to 64 Days. I Checked 520 .id Sites&lt;/a&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>email</category>
      <category>dns</category>
      <category>indonesia</category>
    </item>
    <item>
      <title>I drew a circuit on paper and Gemma 4 made it run: Sketch2Sim at MLH Hack Day Batam</title>
      <dc:creator>Kiell Tampubolon</dc:creator>
      <pubDate>Wed, 04 Nov 2026 15:43:44 +0000</pubDate>
      <link>https://dev.to/kielltampubolon/i-drew-a-circuit-on-paper-and-gemma-4-made-it-run-sketch2sim-at-mlh-hack-day-batam-132e</link>
      <guid>https://dev.to/kielltampubolon/i-drew-a-circuit-on-paper-and-gemma-4-made-it-run-sketch2sim-at-mlh-hack-day-batam-132e</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/mlh-hackathon"&gt;MLH x DEV Writing Challenge&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;Every hardware idea I have ever seen starts the same way: boxes and lines on paper. "UNO" in one box, "LED" in another, a line between them. Turning that drawing into something that runs is the slow part. You pick pins, remember the resistor, write the firmware, and then lose twenty minutes to one jumper you put in backwards.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sketch2Sim&lt;/strong&gt; removes that gap. You take a photo of a circuit sketch (or draw one in the app), Gemma 4 reads it, and you get two files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;diagram.json&lt;/code&gt;: the circuit in Wokwi's format (parts, positions, wires)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;sketch.ino&lt;/code&gt;: Arduino firmware that does what your handwritten note says&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Paste both into &lt;a href="https://wokwi.com" rel="noopener noreferrer"&gt;Wokwi&lt;/a&gt;, press play, and the circuit runs. No hardware, no breadboard, no guessing which leg of the LED is which.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F97ux0vx44zs2zehnjd3z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F97ux0vx44zs2zehnjd3z.png" alt="Hand-drawn traffic light sketch on notebook paper next to the same circuit running in the Wokwi simulator" width="799" height="364"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My handwritten note said &lt;em&gt;"red &amp;gt; green &amp;gt; yellow, button = pedestrian crossing"&lt;/em&gt;. What came out was a working traffic light: an Uno, three LEDs, three 220 Ω resistors, a button, and firmware that cycles the lights when you press it.&lt;/p&gt;

&lt;h3&gt;
  
  
  The idea that makes it work
&lt;/h3&gt;

&lt;p&gt;The interesting part is not "AI reads a picture". It is the split of responsibilities:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;A vision model reads intent from a picture. Deterministic code turns that intent into something a simulator is guaranteed to accept.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr0xonmd0b8vf4g0uyacb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr0xonmd0b8vf4g0uyacb.png" alt="Pipeline: Sketch, then Gemma 4, then the validator, then Wokwi, plus examples of what the validator repairs" width="800" height="338"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Gemma 4 understands.&lt;/strong&gt; It gets the image, a catalog of nine real Wokwi parts with their exact pin names, a few wiring rules and one worked example. It answers with JSON: parts, wires with a one-line reason for every pin, and the firmware.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A validator guarantees.&lt;/strong&gt; Plain TypeScript, no AI. It maps invented part types onto real ones, normalizes pin names (&lt;code&gt;D13&lt;/code&gt; becomes &lt;code&gt;13&lt;/code&gt;), inserts the 220 Ω resistor the model forgot, moves servos onto PWM pins, adds missing GND and 5V wires, and flips parts wired with reversed polarity. Every repair is shown in the UI, so you see exactly where the model was corrected.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Wokwi runs it.&lt;/strong&gt; The output is a normal Wokwi project. Nothing about it is locked to my app.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  What I learned
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb9qud2fi9q2qeizt6iqr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb9qud2fi9q2qeizt6iqr.png" alt="The hack day in numbers: 6 of 6 sketches valid, 5 of 5 run in Wokwi, compile time 104 to 30 seconds, 20 validator repairs, 2 reversed buzzers caught, 0 merge conflicts" width="799" height="444"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Gemma 4 vision is great at topology and weak at electrical details.&lt;/strong&gt; All six sketches I tested came back with the right parts and connections, including the behavior notes, which ended up correctly in the firmware. Pin names and polarity are where it slips: it wired a buzzer backwards twice. Prompting harder did not fix that. A small set of deterministic rules did.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Latency was thinking, and the API knobs did not help.&lt;/strong&gt; My first compiles took 45 to 104 seconds. One slow run had 3,209 thought tokens against 1,637 answer tokens. Gemma 4 on the Gemini API rejected both &lt;code&gt;thinkingBudget&lt;/code&gt; and &lt;code&gt;thinkingLevel&lt;/code&gt;. Two lines in the prompt asking for a brief answer took thought tokens to zero and compiles to 26 to 34 seconds, with the same quality.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Planning beats speed when you work with AI agents.&lt;/strong&gt; I built this solo with two Claude Code sessions running in parallel, one on the engine and one on the app, in the same folder, with zero merge conflicts. The trick was half a page written before any code: one owner per file, one frozen contract, and one status file per session.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0v5i9cmt1mgj07zqqnj3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0v5i9cmt1mgj07zqqnj3.png" alt="Two Claude Code sessions coordinating through one frozen contract file and separate status files" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;Two-minute demo video (the hackathon name is in the first frame, as the rules ask):&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/bYefFiPMhnQ" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Try it yourself:&lt;/strong&gt; &lt;a href="https://glatinone.github.io/sketch2sim/" rel="noopener noreferrer"&gt;glatinone.github.io/sketch2sim&lt;/a&gt;. The presets work without any key (they are labeled &lt;strong&gt;CACHED&lt;/strong&gt; because they replay a saved, real Gemma 4 run). To compile your own sketch, paste a free Gemini API key from AI Studio. It stays in your browser.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/glatinone" rel="noopener noreferrer"&gt;
        glatinone
      &lt;/a&gt; / &lt;a href="https://github.com/glatinone/sketch2sim" rel="noopener noreferrer"&gt;
        sketch2sim
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Draw a napkin circuit, Gemma 4 reads it, a validator repairs it, and it runs in Wokwi. MLH Hacktoberfest Hack Day Batam 2026.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Sketch2Sim&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;From a paper sketch to a running circuit.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Sketch2Sim turns a rough hand-drawn circuit (drawn in the app, or a photo of paper) into a ready-to-paste
Wokwi &lt;code&gt;diagram.json&lt;/code&gt; + Arduino &lt;code&gt;sketch.ino&lt;/code&gt;. &lt;strong&gt;Gemma 4&lt;/strong&gt; reads the image; a &lt;strong&gt;deterministic validator&lt;/strong&gt;
repairs whatever the model gets wrong, so the output is a circuit the real
&lt;a href="https://wokwi.com" rel="nofollow noopener noreferrer"&gt;Wokwi&lt;/a&gt; simulator accepts. Paste both files, press ▶, press the button, the LED lights.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Try it:&lt;/strong&gt; &lt;a href="https://glatinone.github.io/sketch2sim/" rel="nofollow noopener noreferrer"&gt;https://glatinone.github.io/sketch2sim/&lt;/a&gt; (bring your own free Gemini API key; presets work without one and are labeled CACHED).&lt;/p&gt;
&lt;p&gt;Built in one afternoon at &lt;strong&gt;MLH Hacktoberfest Hack Day Batam&lt;/strong&gt; (31 Oct 2026) for the
&lt;em&gt;Best Use of Gemma 4&lt;/em&gt; and &lt;em&gt;Best Open-Source AI Project&lt;/em&gt; challenges.&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/glatinone/sketch2sim/docs/screenshot-live-result.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fglatinone%2Fsketch2sim%2FHEAD%2Fdocs%2Fscreenshot-live-result.png" alt="Sketch2Sim: a hand-drawn UNO + BUTTON + LED sketch compiled live by Gemma 4 into a wiring table, diagram.json and sketch.ino"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Real screenshot of a live compile (gemma-4-26b-a4b-it, no mock).&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;How it works&lt;/h2&gt;
&lt;/div&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;
&lt;pre class="notranslate"&gt;&lt;code&gt; sketch / photo ──► Gemma 4 (multimodal) ──► validator + repair ──► diagram.json + sketch.ino ──► Wokwi ▶
   canvas, upload,     reads boxes, labels,     catalog-locked parts,&lt;/code&gt;&lt;/pre&gt;…&lt;/div&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/glatinone/sketch2sim" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;This is what you see after a compile: the parts, a wiring table with a reason for every pin, and both files ready to copy.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Faf8zy4u88mh3bfke7sq5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Faf8zy4u88mh3bfke7sq5.png" alt="Sketch2Sim result view with parts, wiring table with reasons, and generated files" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And this is the validator catching Gemma wiring a buzzer backwards on my "air piano" sketch (an ultrasonic sensor that plays notes based on hand distance):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Feyuke0igie17q7wjdatj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Feyuke0igie17q7wjdatj.png" alt="The validator flagging and fixing a reversed buzzer on the air piano sketch" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The most natural input is a photo of paper, so the phone is the main device. The mobile layout opens straight on the camera and keeps one big Compile button under your thumb. A live compile from a phone took 17.9 seconds in testing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frryuacegu1fqfbx5m93o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frryuacegu1fqfbx5m93o.png" alt="Sketch2Sim on a phone: snap the paper, compile with Gemma 4, read the wires with reasons" width="800" height="578"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And here it is in the room, in front of the judges:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fi6vsdnemhsakmo0972a3.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fi6vsdnemhsakmo0972a3.jpg" alt="Demo time at Politeknik Negeri Batam: presenting the problem slide and the four-step flow to the judges" width="800" height="569"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Partner Technologies
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzyqw2tta6ib9nokc7a2k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzyqw2tta6ib9nokc7a2k.png" alt="Partner technologies and who does what: Gemma 4 understands, the validator guarantees, Wokwi runs, GitHub ships" width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Gemma 4 (Best Use of Gemma 4 track)
&lt;/h3&gt;

&lt;p&gt;Gemma 4 is the brain of Sketch2Sim. I used &lt;code&gt;gemma-4-26b-a4b-it&lt;/code&gt; through the Gemini API, called with plain &lt;code&gt;fetch&lt;/code&gt; from the browser so there is no backend to host. The image goes in as inline data next to the prompt, and JSON mode keeps the answer structured:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;body&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;contents&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt; &lt;span class="na"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;user&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;inline_data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;mime_type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;mimeType&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;base64&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;prompt&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}],&lt;/span&gt;
  &lt;span class="na"&gt;generationConfig&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;temperature&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;maxOutputTokens&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;8192&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;thinkingConfig&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;includeThoughts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="c1"&gt;// budget/level are rejected for Gemma 4&lt;/span&gt;
    &lt;span class="na"&gt;responseMimeType&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="c1"&gt;// AI Studio's new "AQ." keys are only accepted as ?key=, not via the x-goog-api-key header&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;API_BASE&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;model&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;:generateContent?key=&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;apiKey&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Things I learned the hard way, in case they save you an hour:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;New AI Studio keys (starting with &lt;code&gt;AQ.&lt;/code&gt;) only worked as a &lt;code&gt;?key=&lt;/code&gt; query parameter.&lt;/strong&gt; The same key was rejected in the &lt;code&gt;x-goog-api-key&lt;/code&gt; header.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bigger was not better on the day.&lt;/strong&gt; On the free tier, &lt;code&gt;gemma-4-31b-it&lt;/code&gt; succeeded on 3 of 8 calls (the rest were 500 or 503) and took about 60 seconds when it worked. The 26B model went 8 for 8. If you pick 31B anyway, a 500 or 503 falls back to 26B automatically.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Latency has a long tail, so I race it.&lt;/strong&gt; The engine fires two identical requests and keeps whichever returns valid JSON first:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Gemma 4 latency has a long tail, so fire two identical requests&lt;/span&gt;
&lt;span class="c1"&gt;// and keep whichever returns parseable JSON first.&lt;/span&gt;
&lt;span class="nx"&gt;winner&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;any&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="nf"&gt;attempt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nf"&gt;attempt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;)]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Gemma sometimes puts raw line breaks inside JSON strings&lt;/strong&gt; (the Arduino code), so the parser escapes them before &lt;code&gt;JSON.parse&lt;/code&gt;. If both answers are still broken, one retry tells the model exactly what was wrong.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prompt for brevity, not for intelligence.&lt;/strong&gt; The single biggest speedup was asking for short rationales and no code comments. Thought tokens dropped to zero.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fh7fd75sjf1q9c0a184kk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fh7fd75sjf1q9c0a184kk.png" alt="Bar chart: 104 seconds before prompt tuning, 35 seconds after, with zero thinking tokens" width="800" height="320"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My honest verdict: Gemma 4 is a very good &lt;em&gt;reader&lt;/em&gt; of messy, handwritten, real-world images. It understood boxes, wobbly lines and handwritten notes in the margin. Treat it as the part that understands intent, and put a small deterministic layer behind it for anything that must be exactly right.&lt;/p&gt;

&lt;h3&gt;
  
  
  Wokwi
&lt;/h3&gt;

&lt;p&gt;Wokwi was listed as an event resource, and it changed my plan. My first spec had me writing my own circuit simulator in SVG. Throwing that out and targeting the real Wokwi simulator meant every result could be verified by pressing play, by me or by a judge. The validator only allows parts from a fixed catalog of real Wokwi parts (&lt;code&gt;wokwi-arduino-uno&lt;/code&gt;, &lt;code&gt;wokwi-led&lt;/code&gt;, &lt;code&gt;wokwi-pushbutton&lt;/code&gt;, &lt;code&gt;wokwi-servo&lt;/code&gt;, &lt;code&gt;wokwi-hc-sr04&lt;/code&gt;, and so on), with pin names taken from Wokwi's own docs. That is why 5 of 5 tested circuits ran on first paste. One gotcha: circuits with a servo need the Servo library added in Wokwi's Library Manager, so the app tells you when that applies.&lt;/p&gt;

&lt;h3&gt;
  
  
  GitHub
&lt;/h3&gt;

&lt;p&gt;The repo went public at 13:02, about thirty minutes into the build, under the MIT license. A GitHub Actions workflow deploys the app to GitHub Pages on every push, so anyone can open the live app on their own phone. The repo has five &lt;a href="https://github.com/glatinone/sketch2sim/labels/good%20first%20issue" rel="noopener noreferrer"&gt;good first issues&lt;/a&gt;: an ESP32 target, more parts, an Arduino UNO Q export, a Bahasa Indonesia UI, and more.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AI tools disclosure:&lt;/strong&gt; the code was written with &lt;strong&gt;Claude Code&lt;/strong&gt; (Anthropic), two sessions in parallel. Gemma 4 is the model the app itself uses at runtime. I planned, reviewed, tested and demoed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hackathon Experience
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fc9eswxch8r11fghyrqi5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fc9eswxch8r11fghyrqi5.png" alt="Hack Day at a glance, with my certificate of attendance from Hacktoberfest Hack Day Kota Batam x Batam Innovation Center" width="800" height="462"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I attended &lt;strong&gt;Hacktoberfest Hack Day Kota Batam x Batam Innovation Center&lt;/strong&gt;, in person, on 31 October 2026 at Politeknik Negeri Batam. It was a one-day event: about two and a half hours of building, then live demos in front of a judging table.&lt;/p&gt;

&lt;p&gt;Two rules shaped everything I did. First, judging weighed &lt;strong&gt;Technology, Design, Completion and Learning&lt;/strong&gt; equally, and the idea or pitch itself was not scored. Second, the demo had to be live. That pushed me away from big, impressive ideas toward something small that would provably work on stage. I had six candidates on my list, and Sketch2Sim was the only one that used every resource on the event page: Gemma 4, Wokwi and Arduino.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnxcrlx3906v2ikcnwe6o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnxcrlx3906v2ikcnwe6o.png" alt="2.5 hours, minute by minute: from plan at 12:31 to submission at 14:50" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I came solo, so my "team" was two Claude Code sessions on one laptop, plus a lot of tab switching. The atmosphere was what I love about local hack days: a campus room, a big screen, judges in MLH shirts, snacks on the table, and every team showing something real. Watching the other demos was a highlight in itself. One team mapped forest fires and the haze they cause across the region, which is a very real problem where I live.&lt;/p&gt;

&lt;p&gt;What I will remember most:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The first notebook sketch that turned into a traffic light changing colours in Wokwi.&lt;/strong&gt; That was the moment the whole idea stopped being a slide.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Session B finding a bug in Session A's code&lt;/strong&gt; and, instead of touching it, writing the cause and a one-line fix into its own status file. A picked it up and fixed it minutes later. Two agents, one folder, and they behaved like polite teammates.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The last twenty minutes.&lt;/strong&gt; The submission form tab vanished once and had to be filled again, and Wokwi slowed to 3 to 10 percent simulation speed because my laptop was rendering the demo video at the same time. Hack days are never smooth, and that is part of the fun.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sketch2Sim is small on purpose: one board, nine parts, one simulator. The pattern underneath is not. Swap the catalog and the output format and the same pipeline can target ESP32 and Pi Pico, SPICE netlists, PLC ladder logic, or, eventually, digital twins of real lab benches and production lines. Batam is an industrial city with a big vocational campus, so training technicians on a simulated copy of real equipment is a very concrete next step here.&lt;/p&gt;

&lt;p&gt;If you have ever lost an afternoon to a backwards LED, I would love to hear what you would want Sketch2Sim to simulate next. Leave a comment, try the &lt;a href="https://glatinone.github.io/sketch2sim/" rel="noopener noreferrer"&gt;live app&lt;/a&gt;, or grab a &lt;a href="https://github.com/glatinone/sketch2sim/labels/good%20first%20issue" rel="noopener noreferrer"&gt;good first issue&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Links&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Live app: &lt;a href="https://glatinone.github.io/sketch2sim/" rel="noopener noreferrer"&gt;glatinone.github.io/sketch2sim&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Code (MIT): &lt;a href="https://github.com/glatinone/sketch2sim" rel="noopener noreferrer"&gt;github.com/glatinone/sketch2sim&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;How the engine works: &lt;a href="https://github.com/glatinone/sketch2sim/blob/main/src/engine/ENGINE.md" rel="noopener noreferrer"&gt;ENGINE.md&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Slide deck: &lt;a href="https://glatinone.github.io/sketch2sim/Sketch2Sim-deck.pdf" rel="noopener noreferrer"&gt;Sketch2Sim deck (PDF)&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Deep dives: &lt;a href="https://dev.to/kielltampubolon/from-a-paper-sketch-to-a-running-circuit-building-sketch2sim-with-gemma-4-in-one-hack-day-2ndm"&gt;building it in one hack day&lt;/a&gt;, &lt;a href="https://dev.to/kielltampubolon/two-claude-code-sessions-one-folder-no-merge-conflicts-how-i-split-a-hackathon-build-between-ai-3d5n"&gt;two Claude Code sessions, no merge conflicts&lt;/a&gt;, &lt;a href="https://dev.to/kielltampubolon/what-gemma-4-vision-gets-right-about-circuit-sketches-and-the-validator-that-fixes-the-rest-g18"&gt;what Gemma 4 vision gets right&lt;/a&gt;, &lt;a href="https://dev.to/kielltampubolon/from-arduino-sketches-to-digital-twins-where-sketch2sim-goes-next-and-how-to-get-involved-2bcb"&gt;where it goes next&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>mlhacks</category>
      <category>devchallenge</category>
      <category>hackathon</category>
      <category>ai</category>
    </item>
    <item>
      <title>Cooldown 1 Hari Memblokir 70% Rilis npm yang Dibajak di 2026. Untuk Typosquat, 7 Hari Masih Meloloskan 45%</title>
      <dc:creator>Kiell Tampubolon</dc:creator>
      <pubDate>Wed, 04 Nov 2026 01:00:00 +0000</pubDate>
      <link>https://dev.to/kielltampubolon/cooldown-1-hari-memblokir-70-rilis-npm-yang-dibajak-di-2026-untuk-typosquat-7-hari-masih-1adn</link>
      <guid>https://dev.to/kielltampubolon/cooldown-1-hari-memblokir-70-rilis-npm-yang-dibajak-di-2026-untuk-typosquat-7-hari-masih-1adn</guid>
      <description>&lt;p&gt;&lt;em&gt;Versi bahasa Inggris dengan metodologi lengkap: &lt;a href="https://www.kielltampubolon.id/writing/a-1-day-cooldown-would-have-blocked-70-of-2026s-hijacked-npm-releases/" rel="noopener noreferrer"&gt;A 1-Day Cooldown Would Have Blocked 70% of 2026's Hijacked npm Releases&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Pada 8 Oktober, seseorang mem-push &lt;code&gt;tensorlake@0.5.144&lt;/code&gt; ke npm dengan worm pencuri kredensial di hook preinstall. Socket menandainya 11 menit kemudian. Advisory OSV muncul 1,7 jam setelah publish, dan npm menggantinya dengan placeholder keamanan 3,1 jam setelah publish. Kalau installer Anda menolak rilis yang umurnya kurang dari sehari, versi itu tidak pernah sampai ke mesin Anda.&lt;/p&gt;

&lt;p&gt;Saya mengambil semua advisory paket berbahaya OSV untuk npm dan PyPI dari 1 Januari sampai 24 Oktober 2026, lalu bertanya untuk tiap paket: apakah cooldown 1, 3, atau 7 hari akan menahannya?&lt;/p&gt;

&lt;p&gt;Untuk rilis hasil pembajakan paket npm asli, cooldown 1 hari memblokir &lt;strong&gt;70,4%&lt;/strong&gt;. Untuk paket yang berbahaya sejak hari pertama, cooldown 7 hari masih meloloskan &lt;strong&gt;45%&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Ringkasan untuk pembaca non-teknis&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Cooldown" membuat installer mengabaikan rilis yang lebih baru dari N hari. Banyak malware tertangkap sebelum sempat setua itu.&lt;/li&gt;
&lt;li&gt;Kalau penyerang membajak paket asli yang tepercaya, versi jahatnya cepat ditandai: median 4,9 jam. Menunggu 1 hari akan memblokir 70,4% dari semuanya di 2026, menunggu 3 hari 81,3%.&lt;/li&gt;
&lt;li&gt;Paket yang palsu sejak awal, misalnya nama mirip, bertahan jauh lebih lama. Menunggu 7 hari pun meloloskan 45% dari mereka. Melawannya butuh pengecekan nama, bukan menunggu.&lt;/li&gt;
&lt;li&gt;Biayanya: dengan cooldown 3 hari, 22,7% perbaikan keamanan baru sampai ke Anda setelah kerentanannya publik, kecuali update keamanan dikecualikan. Renovate dan Dependabot melakukannya otomatis. pnpm, npm, dan uv memungkinkan pengecualian manual per paket.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Kenapa sekarang
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ChainDrop, 4 Agustus.&lt;/strong&gt; Microsoft menjelaskan varian Mini Shai-Hulud yang menyebar sendiri dan menyerang "lebih dari 400 paket npm", termasuk ekosistem &lt;code&gt;keyv&lt;/code&gt;, &lt;code&gt;flat-cache&lt;/code&gt;, dan &lt;code&gt;cache-manager&lt;/code&gt;. Worm ini mencuri token publish, menaikkan versi patch, lalu merilis ulang (&lt;a href="https://www.microsoft.com/en-us/security/blog/2026/08/04/chaindrop-supply-chain-compromise-anatomy-self-propagating-worm/" rel="noopener noreferrer"&gt;Microsoft Security Blog&lt;/a&gt;). Di data saya, &lt;code&gt;flat-cache@6.1.24&lt;/code&gt; dapat advisory OSV 0,5 jam setelah publish, &lt;code&gt;cache-manager@7.2.10&lt;/code&gt; 1,0 jam, &lt;code&gt;keyv@6.0.0&lt;/code&gt; 1,7 jam.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tensorlake, 8 Oktober.&lt;/strong&gt; Keluarga worm yang sama. Versi jahat dipublikasikan pukul 01:12:07 UTC dan terdeteksi pukul 01:23:10 UTC (&lt;a href="https://socket.dev/blog/tensorlake-compromise" rel="noopener noreferrer"&gt;Socket&lt;/a&gt;, &lt;a href="https://thehackernews.com/2026/10/tensorlake-npm-package-compromised-to.html" rel="noopener noreferrer"&gt;The Hacker News&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MALFEX, Oktober.&lt;/strong&gt; Kebalikannya. Delapan paket npm berbahaya, 40.767 unduhan, dengan &lt;code&gt;function-flag&lt;/code&gt; saja 37.419 unduhan dan pertama kali terbit pada Juli 2024 (&lt;a href="https://thehackernews.com/2026/10/eight-malicious-npm-packages-downloaded.html" rel="noopener noreferrer"&gt;The Hacker News&lt;/a&gt;). Versi 1.7.3 miliknya tayang 429 hari sebelum advisory OSV muncul. Cooldown tidak menolong di sini.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tooling sudah menyusul. npm merilis &lt;code&gt;min-release-age&lt;/code&gt; di 11.10.0, pip merilis &lt;code&gt;--uploaded-prior-to&lt;/code&gt; di 26.0, dan pnpm 11 menyalakan cooldown 1 hari secara default. Dokumentasi pnpm membenarkannya begini: "In most cases, malicious releases are discovered and removed from the registry within an hour." Saya ingin menguji kalimat itu.&lt;/p&gt;

&lt;h2&gt;
  
  
  Metode
&lt;/h2&gt;

&lt;p&gt;Semuanya dijalankan pada 25 Oktober 2026 dari laptop Windows.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Advisory.&lt;/strong&gt; Saya mengunduh ekspor massal OSV untuk npm dan PyPI, menyimpan entri &lt;code&gt;MAL-*&lt;/code&gt; yang terbit 2026-01-01 sampai 2026-10-24, dan membuang yang ditarik. Tersisa 12.820 advisory npm dan 1.545 PyPI.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Waktu publish.&lt;/strong&gt; Untuk npm saya membaca field &lt;code&gt;time&lt;/code&gt; di tiap packument. npm menyimpan timestamp versi yang dihapus dan waktu placeholder &lt;code&gt;0.0.1-security&lt;/code&gt; menggantikan paket. Untuk PyPI saya memakai &lt;code&gt;upload_time&lt;/code&gt; dari JSON API.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Jendela waktu.&lt;/strong&gt; Untuk tiap paket: &lt;code&gt;published&lt;/code&gt; di OSV dikurangi waktu publish versi jahat &lt;strong&gt;pertama&lt;/strong&gt;. Hanya versi pertama yang dihitung, karena cooldown tetap menginstal versi lama.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Terblokir.&lt;/strong&gt; Cooldown D hari memblokir paket jika jendelanya lebih pendek dari D.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dibajak vs jahat sejak lahir.&lt;/strong&gt; "Dibajak" berarti paket npm asli dengan rilis bersih sebelum versi jahat dan masih hidup sampai sekarang. Sisanya (typosquat, dependency confusion, spam) masuk "jahat sejak lahir". Ini heuristik.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Biaya.&lt;/strong&gt; Saya mengambil 200 paket npm teratas (npm-high-impact) dan 200 paket PyPI teratas (daftar hugovk), memeriksa setiap rilis stabil dari 28 April sampai 25 Oktober, lalu mengukur seberapa sering cooldown menahan "latest". Rilis juga saya cocokkan dengan versi &lt;code&gt;fixed&lt;/code&gt; di OSV untuk menemukan perbaikan keamanan.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Timestamp OSV adalah batas atas deteksi: tensorlake ditandai Socket 91 menit sebelum OSV punya entri.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hasil: apa yang diblokir cooldown
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fo3zd9qzbbojsvizff0ua.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fo3zd9qzbbojsvizff0ua.png" alt="Histogram 11.556 paket berbahaya menurut waktu sampai advisory OSV" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Dari 11.556 paket dengan timestamp yang bisa dipakai, median jendelanya 72,4 jam, hampir persis 3 hari. Lalu ekornya mengambil alih: p75 adalah 28,9 hari dan p90 103,0 hari.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Populasi (per paket)&lt;/th&gt;
&lt;th&gt;n&lt;/th&gt;
&lt;th&gt;Median jendela&lt;/th&gt;
&lt;th&gt;Cooldown 1 hari&lt;/th&gt;
&lt;th&gt;3 hari&lt;/th&gt;
&lt;th&gt;7 hari&lt;/th&gt;
&lt;th&gt;14 hari&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Paket npm dibajak&lt;/td&gt;
&lt;td&gt;1.336&lt;/td&gt;
&lt;td&gt;4,9 jam&lt;/td&gt;
&lt;td&gt;70,4%&lt;/td&gt;
&lt;td&gt;81,3%&lt;/td&gt;
&lt;td&gt;85,1%&lt;/td&gt;
&lt;td&gt;87,4%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Semua npm + PyPI&lt;/td&gt;
&lt;td&gt;11.556&lt;/td&gt;
&lt;td&gt;72,4 jam&lt;/td&gt;
&lt;td&gt;37,7%&lt;/td&gt;
&lt;td&gt;49,9%&lt;/td&gt;
&lt;td&gt;58,4%&lt;/td&gt;
&lt;td&gt;65,1%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;npm jahat sejak lahir&lt;/td&gt;
&lt;td&gt;10.160&lt;/td&gt;
&lt;td&gt;100,5 jam&lt;/td&gt;
&lt;td&gt;33,5%&lt;/td&gt;
&lt;td&gt;45,8%&lt;/td&gt;
&lt;td&gt;55,0%&lt;/td&gt;
&lt;td&gt;62,3%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;npm, jam takedown registry&lt;/td&gt;
&lt;td&gt;9.923&lt;/td&gt;
&lt;td&gt;130,9 jam&lt;/td&gt;
&lt;td&gt;33,1%&lt;/td&gt;
&lt;td&gt;43,8%&lt;/td&gt;
&lt;td&gt;52,4%&lt;/td&gt;
&lt;td&gt;58,9%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuqjale2rai894mlg353t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuqjale2rai894mlg353t.png" alt="Grafik batang paket berbahaya yang diblokir cooldown 1, 3, 7, dan 14 hari" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kalimat di dokumentasi pnpm itu terlalu optimis.&lt;/strong&gt; Hanya 13,1% paket yang mendapat advisory dalam satu jam sejak versi jahat pertama. Bahkan untuk pembajakan, kasus tercepat, angkanya 10,0% dalam satu jam dan 59,7% dalam enam jam.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cooldown adalah pertahanan terhadap pembajakan.&lt;/strong&gt; Worm dan rilis dari token curian menyerang paket populer, jadi scanner mengerubunginya, dan menunggu sehari terbayar. Typosquat menunggu salah ketik atau nama halusinasi asisten AI. Tidak ada yang mengawasi, jadi mereka hidup berminggu-minggu.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Penghapusan di registry tertinggal dari advisory di bagian ekor.&lt;/strong&gt; Di mana npm memasang placeholder, itu datang sebelum advisory OSV untuk 60,6% paket, tetapi yang lambat jauh lebih lambat, sehingga median jendela takedown 5,5 hari.&lt;/p&gt;

&lt;p&gt;PyPI menghapus proyek berbahaya sepenuhnya, jadi hanya 60 paket PyPI yang timestamp-nya bisa dipakai. Saya tidak menarik kesimpulan PyPI dari situ.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hasil: berapa biaya cooldown
&lt;/h2&gt;

&lt;p&gt;Selama 180 hari, 239 dari 400 paket teratas memindahkan versi terbarunya minimal sekali. Untuk paket-paket itu, inilah seberapa sering cooldown menjauhkan Anda dari rilis terbaru:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Cooldown&lt;/th&gt;
&lt;th&gt;Tertahan (npm + PyPI, aktif)&lt;/th&gt;
&lt;th&gt;Rilis npm tak pernah terinstal&lt;/th&gt;
&lt;th&gt;Rilis PyPI tak pernah terinstal&lt;/th&gt;
&lt;th&gt;Perbaikan keamanan tiba setelah disclosure (dari 141)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1 hari&lt;/td&gt;
&lt;td&gt;3,94% waktu&lt;/td&gt;
&lt;td&gt;17,8%&lt;/td&gt;
&lt;td&gt;24,4%&lt;/td&gt;
&lt;td&gt;21 (14,9%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3 hari&lt;/td&gt;
&lt;td&gt;9,71%&lt;/td&gt;
&lt;td&gt;30,1%&lt;/td&gt;
&lt;td&gt;43,2%&lt;/td&gt;
&lt;td&gt;32 (22,7%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;7 hari&lt;/td&gt;
&lt;td&gt;18,53%&lt;/td&gt;
&lt;td&gt;44,4%&lt;/td&gt;
&lt;td&gt;57,5%&lt;/td&gt;
&lt;td&gt;65 (46,1%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;14 hari&lt;/td&gt;
&lt;td&gt;29,48%&lt;/td&gt;
&lt;td&gt;55,2%&lt;/td&gt;
&lt;td&gt;68,7%&lt;/td&gt;
&lt;td&gt;86 (61,0%)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Saat tertahan, Anda biasanya hanya tertinggal 1,1 sampai 1,7 versi untuk cooldown 1 sampai 7 hari.&lt;/p&gt;

&lt;p&gt;Kolom keamanan adalah biaya sebenarnya. Saya menghitung perbaikan sebagai terlambat jika Anda masih di versi rentan setelah advisory-nya publik. Disclosure biasanya datang jauh setelah perbaikan: median selisihnya 12,8 hari di npm dan 7,9 hari di PyPI. Itu sebabnya cooldown 1 hari murah. Pada 7 hari, hampir separuh perbaikan baru tiba setelah advisory publik.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fi9w370f3fm88jgsjn3qj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fi9w370f3fm88jgsjn3qj.png" alt="Grafik garis manfaat dan biaya cooldown 1 sampai 14 hari" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Naik dari 3 ke 7 hari menambah 8,5 poin pemblokiran malware dan 23,4 poin perbaikan keamanan yang terlambat. Pada 14 hari, kedua kurva hampir bertemu.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pengaturan untuk stack Anda
&lt;/h2&gt;

&lt;p&gt;Setiap opsi di bawah sudah saya cek ke dokumentasi resmi pada 25 Oktober 2026.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;pnpm&lt;/strong&gt; (&lt;code&gt;pnpm-workspace.yaml&lt;/code&gt;, dalam menit; default 1440 sejak v11):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;minimumReleaseAge&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;4320&lt;/span&gt;   &lt;span class="c1"&gt;# 3 days&lt;/span&gt;
&lt;span class="na"&gt;minimumReleaseAgeExclude&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;@myorg/*'&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;nx@21.6.5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;npm&lt;/strong&gt; (11.10.0 ke atas, dalam hari; &lt;code&gt;min-release-age-exclude&lt;/code&gt; butuh 11.17.0):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="c"&gt;# .npmrc
&lt;/span&gt;&lt;span class="py"&gt;min-release-age&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;3&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--min-release-age-exclude&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'@myorg/*'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;uv&lt;/strong&gt; (menerima durasi sederhana, durasi ISO 8601 seperti &lt;code&gt;P3D&lt;/code&gt;, atau timestamp):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="k"&gt;[&lt;/span&gt;&lt;span class="n"&gt;tool&lt;/span&gt;&lt;span class="k"&gt;.&lt;/span&gt;&lt;span class="n"&gt;uv&lt;/span&gt;&lt;span class="k"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;exclude-newer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"3 days"&lt;/span&gt;
&lt;span class="n"&gt;exclude-newer-package&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;cryptography&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;pip&lt;/strong&gt; (26.1 ke atas untuk durasi; index harus menampilkan waktu upload):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--uploaded-prior-to&lt;/span&gt; P3D &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt
&lt;span class="c"&gt;# or: PIP_UPLOADED_PRIOR_TO=P3D&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Renovate&lt;/strong&gt; (&lt;code&gt;security:minimumReleaseAgeNpm&lt;/code&gt; dan &lt;code&gt;security:minimumReleaseAgePypi&lt;/code&gt; masing-masing menetapkan 3 hari):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"extends"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"security:minimumReleaseAgeNpm"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"security:minimumReleaseAgePypi"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Dependabot&lt;/strong&gt; (update versi sudah default cooldown 3 hari; ini membuatnya eksplisit):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;
&lt;span class="na"&gt;updates&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;package-ecosystem&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;npm"&lt;/span&gt;
    &lt;span class="na"&gt;directory&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/"&lt;/span&gt;
    &lt;span class="na"&gt;schedule&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;interval&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;weekly"&lt;/span&gt;
    &lt;span class="na"&gt;cooldown&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;default-days&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;
      &lt;span class="na"&gt;exclude&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;@myorg/*"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Kapan cooldown merugikan
&lt;/h2&gt;

&lt;p&gt;Bot sudah menangani masalah perbaikan keamanan. Dokumentasi Renovate menyebut "Security updates bypass any &lt;code&gt;minimumReleaseAge&lt;/code&gt; checks", dan dokumentasi Dependabot menyebut "The &lt;code&gt;cooldown&lt;/code&gt; option is only available for &lt;em&gt;version&lt;/em&gt; updates, not &lt;em&gt;security&lt;/em&gt; updates." Kalau PR upgrade Anda dibuka oleh bot, angka 22,7% saya sebagian besar tidak berlaku.&lt;/p&gt;

&lt;p&gt;Cooldown di level installer tidak tahu mana perbaikan keamanan. Di npm, jika &lt;code&gt;min-release-age&lt;/code&gt; memblokir versi yang sudah ditambal, &lt;code&gt;npm audit fix&lt;/code&gt; membiarkan Anda di versi rentan, memberi peringatan, dan keluar dengan kode non-nol. Mode gagal yang benar, tetapi Anda butuh playbook:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CVE mendesak di satu paket:&lt;/strong&gt; tambahkan ke daftar exclude (&lt;code&gt;minimumReleaseAgeExclude&lt;/code&gt;, &lt;code&gt;min-release-age-exclude&lt;/code&gt;, &lt;code&gt;exclude-newer-package = { pkg = false }&lt;/code&gt;), instal, lalu hapus entrinya. pnpm 11.22 bisa memangkas entri basi dengan &lt;code&gt;minimumReleaseAgeExcludePrune&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Paket milik sendiri:&lt;/strong&gt; kecualikan scope organisasi Anda secara permanen.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pin dengan versi persis, bukan nama,&lt;/strong&gt; bila bisa. pnpm menerima &lt;code&gt;nx@21.6.5&lt;/code&gt; agar pengecualian tidak diam-diam mencakup rilis berikutnya.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Catatan batasan
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;published&lt;/code&gt; di OSV adalah saat entri masuk OSV, bukan saat seseorang pertama kali menyadari. Deteksi nyata sering lebih awal, jadi angka saya konservatif.&lt;/li&gt;
&lt;li&gt;Label "dibajak" adalah heuristik.&lt;/li&gt;
&lt;li&gt;Timestamp PyPI hanya bertahan untuk paket yang tidak dihapus, jadi 60 paket adalah sampel yang bias.&lt;/li&gt;
&lt;li&gt;Model biaya mengasumsikan Anda selalu ingin versi stabil terbaru, dan 141 perbaikan adalah sampel kecil.&lt;/li&gt;
&lt;li&gt;Cooldown tidak berguna melawan paket yang jahat sejak hari pertama dan sengaja Anda instal. &lt;code&gt;function-flag&lt;/code&gt; milik MALFEX bertengger di npm selama 429 hari.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Pengaturan saya setelah semua ini: 3 hari untuk npm dan PyPI, pengecualian untuk scope sendiri, dan update keamanan lewat Renovate agar lolos antrean. Jika diputar ulang terhadap 2026, itu memblokir 81,3% pembajakan dengan harga 9,71% waktu tertahan.&lt;/p&gt;

&lt;p&gt;Cooldown apa yang Anda pakai, dan pernahkah Anda butuh pintu darurat untuk CVE sungguhan?&lt;/p&gt;

&lt;p&gt;Terkait: &lt;a href="https://www.kielltampubolon.id/writing/the-litellm-supply-chain-backdoor-what-3-hours-means-for-your-ai-agent-gateway/" rel="noopener noreferrer"&gt;backdoor supply chain LiteLLM&lt;/a&gt; dan &lt;a href="https://www.kielltampubolon.id/writing/the-fake-browser-extension-playbook-is-back-this-time-it-ships-as-agent-skills/" rel="noopener noreferrer"&gt;playbook ekstensi browser palsu, kini hadir sebagai agent skills&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>security</category>
      <category>npm</category>
      <category>python</category>
      <category>indonesia</category>
    </item>
    <item>
      <title>A 1-Day Cooldown Would Have Blocked 70% of 2026's Hijacked npm Releases. Against Typosquats, 7 Days Still Misses 45%</title>
      <dc:creator>Kiell Tampubolon</dc:creator>
      <pubDate>Tue, 03 Nov 2026 14:00:00 +0000</pubDate>
      <link>https://dev.to/kielltampubolon/a-1-day-cooldown-would-have-blocked-70-of-2026s-hijacked-npm-releases-against-typosquats-7-days-20l8</link>
      <guid>https://dev.to/kielltampubolon/a-1-day-cooldown-would-have-blocked-70-of-2026s-hijacked-npm-releases-against-typosquats-7-days-20l8</guid>
      <description>&lt;p&gt;On October 8, someone pushed &lt;code&gt;tensorlake@0.5.144&lt;/code&gt; to npm with a credential-stealing worm in its preinstall hook. Socket flagged it 11 minutes later. The OSV advisory landed 1.7 hours after publish, and npm swapped in a security placeholder 3.1 hours after publish. If your installer refused anything younger than one day, you never saw it.&lt;/p&gt;

&lt;p&gt;So I took every malicious-package advisory OSV published for npm and PyPI between January 1 and October 24, 2026, and asked one question about each package: would a cooldown of 1, 3 or 7 days have kept it off your machine?&lt;/p&gt;

&lt;p&gt;For hijacked releases of real npm packages, a 1-day cooldown blocks &lt;strong&gt;70.4%&lt;/strong&gt;. For packages that were malicious from day one, a 7-day cooldown still lets &lt;strong&gt;45%&lt;/strong&gt; through.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR (for non-technical readers)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A "cooldown" tells your package installer to ignore any release newer than N days. A lot of malware is caught before it gets that old.&lt;/li&gt;
&lt;li&gt;When attackers hijack a real, trusted package, the bad version gets flagged fast: median 4.9 hours. A 1-day wait would have blocked 70.4% of them in 2026; a 3-day wait, 81.3%.&lt;/li&gt;
&lt;li&gt;Packages that are fake from day one, like look-alike names, live much longer. Even a 7-day wait would have missed 45% of them. Defending against those means checking names, not waiting.&lt;/li&gt;
&lt;li&gt;The bill: with a 3-day wait, 22.7% of security fixes reach you after the vulnerability is already public, unless you exempt security updates. Renovate and Dependabot do that automatically; pnpm, npm and uv let you exempt a package by hand.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Why now
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ChainDrop, August 4.&lt;/strong&gt; Microsoft described a self-propagating Mini Shai-Hulud variant that hit "over 400 npm packages", including the &lt;code&gt;keyv&lt;/code&gt;, &lt;code&gt;flat-cache&lt;/code&gt; and &lt;code&gt;cache-manager&lt;/code&gt; ecosystems. It steals a publish token, bumps the patch version and republishes (&lt;a href="https://www.microsoft.com/en-us/security/blog/2026/08/04/chaindrop-supply-chain-compromise-anatomy-self-propagating-worm/" rel="noopener noreferrer"&gt;Microsoft Security Blog&lt;/a&gt;). In my data, &lt;code&gt;flat-cache@6.1.24&lt;/code&gt; got its OSV advisory 0.5 hours after publish, &lt;code&gt;cache-manager@7.2.10&lt;/code&gt; after 1.0 hour and &lt;code&gt;keyv@6.0.0&lt;/code&gt; after 1.7 hours.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tensorlake, October 8.&lt;/strong&gt; Same worm family. The malicious version was published at 01:12:07 UTC and detected at 01:23:10 UTC (&lt;a href="https://socket.dev/blog/tensorlake-compromise" rel="noopener noreferrer"&gt;Socket&lt;/a&gt;, &lt;a href="https://thehackernews.com/2026/10/tensorlake-npm-package-compromised-to.html" rel="noopener noreferrer"&gt;The Hacker News&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MALFEX, October.&lt;/strong&gt; The opposite shape. Eight malicious npm packages, 40,767 downloads, with &lt;code&gt;function-flag&lt;/code&gt; alone at 37,419 and first published in July 2024 (&lt;a href="https://thehackernews.com/2026/10/eight-malicious-npm-packages-downloaded.html" rel="noopener noreferrer"&gt;The Hacker News&lt;/a&gt;). Its version 1.7.3 was online for 429 days before its OSV advisory. No cooldown helps there.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Meanwhile the tools caught up. npm shipped &lt;code&gt;min-release-age&lt;/code&gt; in 11.10.0, pip shipped &lt;code&gt;--uploaded-prior-to&lt;/code&gt; in 26.0, and pnpm 11 turned a 1-day cooldown on by default. The pnpm docs justify it like this: "In most cases, malicious releases are discovered and removed from the registry within an hour." I wanted to test that sentence.&lt;/p&gt;

&lt;h2&gt;
  
  
  Method
&lt;/h2&gt;

&lt;p&gt;Everything ran on October 25, 2026, from a Windows laptop with Python, uv and about 15,000 cached registry lookups.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Advisories.&lt;/strong&gt; I downloaded the OSV bulk exports for npm and PyPI and kept &lt;code&gt;MAL-*&lt;/code&gt; entries published from 2026-01-01 to 2026-10-24, dropping withdrawn ones. That left 12,820 npm and 1,545 PyPI advisories.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Publish times.&lt;/strong&gt; For npm I read each packument's &lt;code&gt;time&lt;/code&gt; field. npm keeps the timestamps of removed versions and records when the &lt;code&gt;0.0.1-security&lt;/code&gt; placeholder replaced the package, which gives me a takedown time for free. For PyPI I used &lt;code&gt;upload_time&lt;/code&gt; from the JSON API.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Window.&lt;/strong&gt; For each package: OSV &lt;code&gt;published&lt;/code&gt; minus the publish time of its &lt;strong&gt;first&lt;/strong&gt; malicious version. If a typosquat shipped ten bad versions, a cooldown still installs the older ones, so only the first one counts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Blocked.&lt;/strong&gt; A cooldown of D days blocks the package if the window is shorter than D.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hijacked vs born-malicious.&lt;/strong&gt; "Hijacked" means a real npm package with clean releases before the bad one, still live today. Everything else (typosquats, dependency confusion, spam) is "born-malicious". It's a heuristic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost.&lt;/strong&gt; I took the top 200 npm packages (npm-high-impact) and the top 200 PyPI packages (hugovk's list), looked at every stable release from April 28 to October 25, and measured how often a cooldown holds back "latest". I also matched each release against OSV &lt;code&gt;fixed&lt;/code&gt; versions to find security fixes.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The OSV timestamp is an upper bound on detection: tensorlake was flagged by Socket 91 minutes before OSV had an entry. Registry removal is a different clock again, and I report it separately.&lt;/p&gt;

&lt;h2&gt;
  
  
  Results: what a cooldown blocks
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fo3zd9qzbbojsvizff0ua.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fo3zd9qzbbojsvizff0ua.png" alt="Histogram of 11,556 malicious npm and PyPI packages by time from first malicious version to OSV advisory: 4,361 within a day, 2,390 between one and seven days, 4,805 over a week" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Across all 11,556 packages with usable timestamps, the median window was 72.4 hours, almost exactly 3 days. Then the tail takes over: p75 is 28.9 days and p90 is 103.0 days.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Population (per package)&lt;/th&gt;
&lt;th&gt;n&lt;/th&gt;
&lt;th&gt;Median window&lt;/th&gt;
&lt;th&gt;1-day cooldown&lt;/th&gt;
&lt;th&gt;3-day&lt;/th&gt;
&lt;th&gt;7-day&lt;/th&gt;
&lt;th&gt;14-day&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Hijacked npm packages&lt;/td&gt;
&lt;td&gt;1,336&lt;/td&gt;
&lt;td&gt;4.9 h&lt;/td&gt;
&lt;td&gt;70.4%&lt;/td&gt;
&lt;td&gt;81.3%&lt;/td&gt;
&lt;td&gt;85.1%&lt;/td&gt;
&lt;td&gt;87.4%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;All npm + PyPI&lt;/td&gt;
&lt;td&gt;11,556&lt;/td&gt;
&lt;td&gt;72.4 h&lt;/td&gt;
&lt;td&gt;37.7%&lt;/td&gt;
&lt;td&gt;49.9%&lt;/td&gt;
&lt;td&gt;58.4%&lt;/td&gt;
&lt;td&gt;65.1%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Born-malicious npm&lt;/td&gt;
&lt;td&gt;10,160&lt;/td&gt;
&lt;td&gt;100.5 h&lt;/td&gt;
&lt;td&gt;33.5%&lt;/td&gt;
&lt;td&gt;45.8%&lt;/td&gt;
&lt;td&gt;55.0%&lt;/td&gt;
&lt;td&gt;62.3%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;npm, registry takedown clock&lt;/td&gt;
&lt;td&gt;9,923&lt;/td&gt;
&lt;td&gt;130.9 h&lt;/td&gt;
&lt;td&gt;33.1%&lt;/td&gt;
&lt;td&gt;43.8%&lt;/td&gt;
&lt;td&gt;52.4%&lt;/td&gt;
&lt;td&gt;58.9%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuqjale2rai894mlg353t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuqjale2rai894mlg353t.png" alt="Grouped bar chart of the share of malicious packages blocked by 1, 3, 7 and 14-day cooldowns: hijacked npm packages 70, 81, 85 and 87 percent; all packages 38, 50, 58 and 65 percent; born-malicious npm 34, 46, 55 and 62 percent" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The pnpm sentence is optimistic.&lt;/strong&gt; Only 13.1% of packages had an advisory within an hour of the first bad version. Even for hijacks, the fast case, it was 10.0% within an hour and 59.7% within six hours.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A cooldown is a hijack defense.&lt;/strong&gt; Worms and stolen-token releases hit popular packages, so scanners swarm them, and waiting a day pays off. Typosquats wait quietly for a typo or a hallucinated name from an AI assistant. Nobody is looking, so they live for weeks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Registry removal lags the advisory in the tail.&lt;/strong&gt; Where npm put up a placeholder, it came before the OSV advisory for 60.6% of packages, but the slow ones were slower, so the median takedown window was 5.5 days. If you run a cooldown with no scanner in front of it, the takedown row is your realistic number.&lt;/p&gt;

&lt;p&gt;PyPI deletes malicious projects outright, so only 60 PyPI packages kept usable timestamps. I don't draw PyPI conclusions from them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Results: what a cooldown costs
&lt;/h2&gt;

&lt;p&gt;Over 180 days, 239 of the 400 top packages moved their latest version at least once. For those, here is how often a cooldown kept you off the newest release:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Cooldown&lt;/th&gt;
&lt;th&gt;Held back (npm + PyPI, active)&lt;/th&gt;
&lt;th&gt;npm releases never installed&lt;/th&gt;
&lt;th&gt;PyPI releases never installed&lt;/th&gt;
&lt;th&gt;Security fixes reaching you after disclosure (of 141)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1 day&lt;/td&gt;
&lt;td&gt;3.94% of the time&lt;/td&gt;
&lt;td&gt;17.8%&lt;/td&gt;
&lt;td&gt;24.4%&lt;/td&gt;
&lt;td&gt;21 (14.9%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3 days&lt;/td&gt;
&lt;td&gt;9.71%&lt;/td&gt;
&lt;td&gt;30.1%&lt;/td&gt;
&lt;td&gt;43.2%&lt;/td&gt;
&lt;td&gt;32 (22.7%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;7 days&lt;/td&gt;
&lt;td&gt;18.53%&lt;/td&gt;
&lt;td&gt;44.4%&lt;/td&gt;
&lt;td&gt;57.5%&lt;/td&gt;
&lt;td&gt;65 (46.1%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;14 days&lt;/td&gt;
&lt;td&gt;29.48%&lt;/td&gt;
&lt;td&gt;55.2%&lt;/td&gt;
&lt;td&gt;68.7%&lt;/td&gt;
&lt;td&gt;86 (61.0%)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;When you are held back, you're usually one version behind: 1.1 to 1.7 on average for 1 to 7-day cooldowns. The "never installed" column is mostly a feature: releases replaced within D days, often by a hotfix for the one you skipped.&lt;/p&gt;

&lt;p&gt;The security column is the real cost. I counted a fix as late if you would still be on the vulnerable version after its advisory was public. Disclosure usually comes well after the fix: the median gap was 12.8 days on npm and 7.9 days on PyPI. That's why a 1-day cooldown costs so little. At 7 days, though, almost half the fixes land after the advisory is public.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fi9w370f3fm88jgsjn3qj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fi9w370f3fm88jgsjn3qj.png" alt="Line chart across 1, 3, 7 and 14-day cooldowns: malicious packages blocked rises 37.7 to 65.1 percent, security fixes reaching you after disclosure rises 14.9 to 61.0 percent, and time held back rises 3.9 to 29.5 percent" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Going from 3 to 7 days buys 8.5 more points of malware blocking and costs 23.4 more points of late security fixes. By 14 days the two curves nearly meet.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setting for your stack
&lt;/h2&gt;

&lt;p&gt;Every option below was checked against the official docs on October 25, 2026.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;pnpm&lt;/strong&gt; (&lt;code&gt;pnpm-workspace.yaml&lt;/code&gt;, in minutes; default 1440 since v11):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;minimumReleaseAge&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;4320&lt;/span&gt;   &lt;span class="c1"&gt;# 3 days&lt;/span&gt;
&lt;span class="na"&gt;minimumReleaseAgeExclude&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;@myorg/*'&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;nx@21.6.5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;npm&lt;/strong&gt; (11.10.0 or later, in days; &lt;code&gt;min-release-age-exclude&lt;/code&gt; needs 11.17.0):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="c"&gt;# .npmrc
&lt;/span&gt;&lt;span class="py"&gt;min-release-age&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;3&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--min-release-age-exclude&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'@myorg/*'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;uv&lt;/strong&gt; (accepts friendly durations, ISO 8601 durations like &lt;code&gt;P3D&lt;/code&gt;, or timestamps):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="k"&gt;[&lt;/span&gt;&lt;span class="n"&gt;tool&lt;/span&gt;&lt;span class="k"&gt;.&lt;/span&gt;&lt;span class="n"&gt;uv&lt;/span&gt;&lt;span class="k"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;exclude-newer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"3 days"&lt;/span&gt;
&lt;span class="n"&gt;exclude-newer-package&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;cryptography&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;pip&lt;/strong&gt; (26.1 or later for durations; index must expose upload time):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--uploaded-prior-to&lt;/span&gt; P3D &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt
&lt;span class="c"&gt;# or: PIP_UPLOADED_PRIOR_TO=P3D&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Renovate&lt;/strong&gt; (&lt;code&gt;security:minimumReleaseAgeNpm&lt;/code&gt; and &lt;code&gt;security:minimumReleaseAgePypi&lt;/code&gt; each set 3 days):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"extends"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"security:minimumReleaseAgeNpm"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"security:minimumReleaseAgePypi"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Dependabot&lt;/strong&gt; (version updates already default to a 3-day cooldown; this makes it explicit):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;
&lt;span class="na"&gt;updates&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;package-ecosystem&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;npm"&lt;/span&gt;
    &lt;span class="na"&gt;directory&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/"&lt;/span&gt;
    &lt;span class="na"&gt;schedule&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;interval&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;weekly"&lt;/span&gt;
    &lt;span class="na"&gt;cooldown&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;default-days&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;
      &lt;span class="na"&gt;exclude&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;@myorg/*"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  When a cooldown hurts
&lt;/h2&gt;

&lt;p&gt;The bots already handle the security-fix problem. Renovate's docs say "Security updates bypass any &lt;code&gt;minimumReleaseAge&lt;/code&gt; checks", and Dependabot's docs say "The &lt;code&gt;cooldown&lt;/code&gt; option is only available for &lt;em&gt;version&lt;/em&gt; updates, not &lt;em&gt;security&lt;/em&gt; updates." If a bot opens your upgrade PRs, my 22.7% figure mostly doesn't apply to you.&lt;/p&gt;

&lt;p&gt;Installer-level cooldowns don't know what a security fix is. On npm, if &lt;code&gt;min-release-age&lt;/code&gt; blocks the patched version, &lt;code&gt;npm audit fix&lt;/code&gt; keeps you on the vulnerable version, warns and exits non-zero. Right failure mode, but you need a playbook:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Urgent CVE in one package:&lt;/strong&gt; add it to the exclude list (&lt;code&gt;minimumReleaseAgeExclude&lt;/code&gt;, &lt;code&gt;min-release-age-exclude&lt;/code&gt;, &lt;code&gt;exclude-newer-package = { pkg = false }&lt;/code&gt;), install, then remove the entry. pnpm 11.22 can prune stale entries for you with &lt;code&gt;minimumReleaseAgeExcludePrune&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Your own packages:&lt;/strong&gt; exclude your org scope permanently.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pin by exact version, not by name,&lt;/strong&gt; when you can. pnpm accepts &lt;code&gt;nx@21.6.5&lt;/code&gt; so the exception doesn't silently cover the next release too.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Caveats
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;OSV &lt;code&gt;published&lt;/code&gt; is when the entry landed in OSV, not when someone first noticed. Real detection is often earlier, so my blocking numbers are conservative as a detection measure.&lt;/li&gt;
&lt;li&gt;The hijacked label is a heuristic: listed versions, clean history before them, package still live.&lt;/li&gt;
&lt;li&gt;PyPI timestamps survive only for packages that weren't deleted, so 60 packages is a biased sample.&lt;/li&gt;
&lt;li&gt;The cost model assumes you always want the newest stable version. Backport lines and pinned majors are ignored, and 141 fixes is a modest sample.&lt;/li&gt;
&lt;li&gt;A cooldown does nothing against a package that was malicious from day one and that you install on purpose. MALFEX's &lt;code&gt;function-flag&lt;/code&gt; sat on npm for 429 days.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My setting after all this: 3 days for npm and PyPI, an exclude for my own scope, and security updates through Renovate so they skip the line. Replayed against 2026, that blocks 81.3% of hijacks for 9.71% of the time held back.&lt;/p&gt;

&lt;p&gt;What cooldown are you running, and have you ever needed the escape hatch for a real CVE?&lt;/p&gt;

&lt;p&gt;Related: &lt;a href="https://www.kielltampubolon.id/writing/the-litellm-supply-chain-backdoor-what-3-hours-means-for-your-ai-agent-gateway/" rel="noopener noreferrer"&gt;the LiteLLM supply chain backdoor&lt;/a&gt; and &lt;a href="https://www.kielltampubolon.id/writing/the-fake-browser-extension-playbook-is-back-this-time-it-ships-as-agent-skills/" rel="noopener noreferrer"&gt;the fake browser extension playbook, now shipping as agent skills&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>security</category>
      <category>npm</category>
      <category>python</category>
      <category>devops</category>
    </item>
    <item>
      <title>From Arduino sketches to digital twins: where Sketch2Sim goes next, and how to get involved</title>
      <dc:creator>Kiell Tampubolon</dc:creator>
      <pubDate>Sat, 31 Oct 2026 08:03:01 +0000</pubDate>
      <link>https://dev.to/kielltampubolon/from-arduino-sketches-to-digital-twins-where-sketch2sim-goes-next-and-how-to-get-involved-2bcb</link>
      <guid>https://dev.to/kielltampubolon/from-arduino-sketches-to-digital-twins-where-sketch2sim-goes-next-and-how-to-get-involved-2bcb</guid>
      <description>&lt;p&gt;&lt;em&gt;Hackathon log, part 4. Parts 1 to 3 cover what Sketch2Sim is, how two AI coding sessions built it in one hack day, and how the Gemma 4 engine works. This last part looks forward.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Sketch2Sim does one narrow thing today. You photograph a circuit sketch, Gemma 4 reads it, a validator makes the result correct, and you get a project that runs in the Wokwi Arduino simulator. One board, nine parts, one simulator, built in about two and a half hours.&lt;/p&gt;

&lt;p&gt;I think the narrow version hides a general pattern, and this post is about that pattern: where it could go, what's realistic, and where I'd like help.&lt;/p&gt;

&lt;h2&gt;
  
  
  The pattern underneath
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;A vision model reads intent from a picture. Deterministic code turns that intent into something a simulator is guaranteed to accept.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The model is good at understanding a messy drawing. It's unreliable on exact details like pin names and polarity. The validator is the opposite: it understands nothing, but it never lets an invalid circuit through. Every repair it makes is shown to the user, so trust is earned instead of assumed.&lt;/p&gt;

&lt;p&gt;None of that is specific to Arduino. Here is what changes and what stays when you point the pipeline at a different simulator:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhftsohftwc01iigjfpgk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhftsohftwc01iigjfpgk.png" alt="Diagram: what stays the same (input, Gemma 4 call, parsing, fixes shown, phone UI) and what is swapped per target (catalog, rules, builder, prompt)" width="800" height="382"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the code that's four files: &lt;code&gt;catalog.ts&lt;/code&gt; (parts and exact pin names), &lt;code&gt;validate.ts&lt;/code&gt; (target-specific repairs), &lt;code&gt;wokwi.ts&lt;/code&gt; (the output format) and &lt;code&gt;prompt.ts&lt;/code&gt; (the catalog table plus one example). Today each of those has exactly one implementation.&lt;/p&gt;

&lt;h2&gt;
  
  
  The roadmap
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhqnx6bpwepsxlz6l970a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhqnx6bpwepsxlz6l970a.png" alt="Roadmap: today Arduino Uno in Wokwi; next ESP32, Pi Pico and Arduino UNO Q; later SPICE, PLC and MQTT simulators; vision: digital twins" width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Next: same simulator, more hardware
&lt;/h3&gt;

&lt;p&gt;These are small, well-defined pieces of work, and most are already open as &lt;a href="https://github.com/glatinone/sketch2sim/labels/good%20first%20issue" rel="noopener noreferrer"&gt;good first issues&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ESP32 and Raspberry Pi Pico.&lt;/strong&gt; Both are supported in Wokwi. Each needs a board entry in the catalog with its real pin names, plus validator rules for which pins can do PWM, analog input or I2C.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Arduino UNO Q.&lt;/strong&gt; It was one of the hack day's featured resources: a board that pairs a Linux processor with a microcontroller. Supporting it means generating two programs (a Python app and a sketch) instead of one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;More parts.&lt;/strong&gt; Displays, relays, more sensors. Each part is a catalog entry and, sometimes, one validator rule.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Classroom mode.&lt;/strong&gt; A teacher shares a target behavior, students photograph their own sketches, and the validator's list of fixes becomes feedback: "your LED had no resistor" is a repair and a lesson at the same time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A Bahasa Indonesia interface,&lt;/strong&gt; because the first users I have in mind are students at vocational campuses like the one that hosted the hack day.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Later: other simulators
&lt;/h3&gt;

&lt;p&gt;The same split should work for any simulator with a strict input format:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Analog circuits.&lt;/strong&gt; A sketch of a filter or an amplifier becomes a SPICE netlist. The validator checks that every node connects and every component has a value.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PLC ladder logic.&lt;/strong&gt; A sketch of a conveyor with sensors and a motor becomes ladder logic for an open-source PLC runtime.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pneumatics and IoT flows.&lt;/strong&gt; Valve and cylinder diagrams, or sensor-to-dashboard message flows over MQTT.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I haven't built any of these yet. They're where I think the pattern fits, based on what worked for Arduino.&lt;/p&gt;

&lt;h3&gt;
  
  
  The long-term vision: digital twins
&lt;/h3&gt;

&lt;p&gt;A digital twin is a simulated copy of a real system that you can test changes on before touching the real thing. Building one is usually slow, specialist work.&lt;/p&gt;

&lt;p&gt;The piece Sketch2Sim could contribute is the first step: &lt;strong&gt;from a picture of the real setup to a valid simulated model&lt;/strong&gt;. Photograph a control panel, a production line segment or a lab bench, and get a model that runs, which an engineer then refines. Live sensor data and syncing a model with a running machine are separate, much bigger problems, and I don't claim to solve them.&lt;/p&gt;

&lt;p&gt;This matters to me because of where the project started. Batam is an industrial city with a large vocational campus. Training a new technician on a simulated copy of the exact equipment they'll maintain, before they touch a live panel, is a very concrete use case here.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where this honestly stands
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;It's a one-day hackathon prototype.&lt;/li&gt;
&lt;li&gt;It was tested on six sketches and verified in Wokwi on five circuits.&lt;/li&gt;
&lt;li&gt;It depends on a hosted model (Gemma 4 through the Gemini API). Gemma is open-weights, so a self-hosted version for schools or factories without reliable internet is possible, but I haven't done it.&lt;/li&gt;
&lt;li&gt;Nothing on the roadmap past "Next" is started.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How you can get involved
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;If you write code:&lt;/strong&gt; the repo has five &lt;a href="https://github.com/glatinone/sketch2sim/labels/good%20first%20issue" rel="noopener noreferrer"&gt;good first issues&lt;/a&gt; (ESP32 target, more parts, Arduino UNO Q export, Bahasa Indonesia UI, one-click Wokwi). The engine is a few small TypeScript files with no dependencies beyond &lt;code&gt;fetch&lt;/code&gt;, and a new board is mostly a catalog entry plus a few rules. Start with &lt;a href="https://github.com/glatinone/sketch2sim/blob/main/CONTRIBUTING.md" rel="noopener noreferrer"&gt;CONTRIBUTING.md&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you teach:&lt;/strong&gt; try it with students and send me the sketches it got wrong. Real classroom drawings are the best test data I could ask for.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you build simulators or work on industrial training:&lt;/strong&gt; I'd like to hear which target you would want first, and what format your simulator accepts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you'd like to sponsor the next stage:&lt;/strong&gt; the useful things are concrete. API credits for a classroom pilot, a few ESP32 and UNO Q boards to test generated firmware on real hardware, and time to build the classroom mode with a partner school or a training center. Open an issue on the repo or message me here on dev.to.&lt;/p&gt;

&lt;p&gt;Links:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Try it: &lt;a href="https://glatinone.github.io/sketch2sim/" rel="noopener noreferrer"&gt;glatinone.github.io/sketch2sim&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Code (MIT): &lt;a href="https://github.com/glatinone/sketch2sim" rel="noopener noreferrer"&gt;github.com/glatinone/sketch2sim&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Demo video: &lt;a href="https://youtu.be/bYefFiPMhnQ" rel="noopener noreferrer"&gt;youtu.be/bYefFiPMhnQ&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Slide deck: &lt;a href="https://glatinone.github.io/sketch2sim/Sketch2Sim-deck.pdf" rel="noopener noreferrer"&gt;Sketch2Sim deck (PDF)&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you read all four parts: thank you. Tell me in the comments which simulator you'd point this at first. The most requested one goes to the top of the list.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Hackathon log: building Sketch2Sim&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://dev.to/kielltampubolon/from-a-paper-sketch-to-a-running-circuit-building-sketch2sim-with-gemma-4-in-one-hack-day-2ndm"&gt;From a paper sketch to a running circuit: building Sketch2Sim with Gemma 4 in one hack day&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/kielltampubolon/two-claude-code-sessions-one-folder-no-merge-conflicts-how-i-split-a-hackathon-build-between-ai-3d5n"&gt;Two Claude Code sessions, one folder, no merge conflicts: how I split a hackathon build between AI agents&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/kielltampubolon/what-gemma-4-vision-gets-right-about-circuit-sketches-and-the-validator-that-fixes-the-rest-g18"&gt;What Gemma 4 vision gets right about circuit sketches, and the validator that fixes the rest&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/kielltampubolon/from-arduino-sketches-to-digital-twins-where-sketch2sim-goes-next-and-how-to-get-involved-2bcb"&gt;From Arduino sketches to digital twins: where Sketch2Sim goes next, and how to get involved&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>opensource</category>
      <category>ai</category>
      <category>iot</category>
      <category>showdev</category>
    </item>
    <item>
      <title>What Gemma 4 vision gets right about circuit sketches, and the validator that fixes the rest</title>
      <dc:creator>Kiell Tampubolon</dc:creator>
      <pubDate>Sat, 31 Oct 2026 08:02:22 +0000</pubDate>
      <link>https://dev.to/kielltampubolon/what-gemma-4-vision-gets-right-about-circuit-sketches-and-the-validator-that-fixes-the-rest-g18</link>
      <guid>https://dev.to/kielltampubolon/what-gemma-4-vision-gets-right-about-circuit-sketches-and-the-validator-that-fixes-the-rest-g18</guid>
      <description>&lt;p&gt;&lt;em&gt;Hackathon log, part 3. Sketch2Sim turns a photo of a hand-drawn circuit into a Wokwi project that runs. Part 1 is the overview, part 2 is how two AI coding sessions built it. This part is the engine.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I gave Gemma 4 six hand-drawn circuit sketches during a hack day. It got the parts and connections right on all six, and it wired a buzzer backwards on two of them. That split, good at meaning and shaky on electrical detail, decided how the whole engine is built.&lt;/p&gt;

&lt;p&gt;Below: the request that works, the prompt, the validator code, the latency problem and how prompt wording fixed it, and the Gemini API quirks that cost me time. The code is from the &lt;a href="https://github.com/glatinone/sketch2sim" rel="noopener noreferrer"&gt;Sketch2Sim repo&lt;/a&gt; (MIT).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr0xonmd0b8vf4g0uyacb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr0xonmd0b8vf4g0uyacb.png" alt="Pipeline: Sketch, then Gemma 4, then the validator, then Wokwi, plus six kinds of repairs"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The request that works
&lt;/h2&gt;

&lt;p&gt;The Gemini API exposes two Gemma 4 models. A probe at the start of the day found &lt;code&gt;gemma-4-31b-it&lt;/code&gt; and &lt;code&gt;gemma-4-26b-a4b-it&lt;/code&gt;, both with a 262,144 token input limit. Image input, JSON mode and system instructions all work on 26B:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"systemInstruction"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"parts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;catalog + rules + example&amp;gt;"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"contents"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"role"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"user"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"parts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"inline_data"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"mime_type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"image/jpeg"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"data"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;base64&amp;gt;"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Target board: Arduino Uno. Read the attached sketch and compile it into the JSON object described above."&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]}],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"generationConfig"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"temperature"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"responseMimeType"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"application/json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"thinkingConfig"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"includeThoughts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An image costs 258 prompt tokens. The model always "thinks" first, and the response can include parts marked &lt;code&gt;thought: true&lt;/code&gt;, so the client keeps only the others:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;candidates&lt;/span&gt;&lt;span class="p"&gt;?.[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]?.&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;parts&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="p"&gt;[])&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;thought&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The prompt: a catalog, rules and one example
&lt;/h2&gt;

&lt;p&gt;The prompt doesn't ask the model to know Wokwi. It hands over a catalog of nine parts with their exact pin names, generated from the same code the validator uses:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- wokwi-arduino-uno (Arduino Uno): pins digital 2-13 (PWM: 3,5,6,9,10,11), analog A0-A5, 5V, GND.1, GND.2, GND.3
- wokwi-led (LED): pins A, C attrs e.g. {"color": "red"}
- wokwi-pushbutton (Push button): pins 1.l, 1.r, 2.l, 2.r
- wokwi-servo (Servo): pins GND, V+, PWM
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then a few wiring rules (every LED goes through a 220 Ω resistor, buttons use &lt;code&gt;INPUT_PULLUP&lt;/code&gt; to GND, servos on PWM pins, never pins 0 and 1) and one complete worked example for a button and an LED. The example did more for output consistency than any rule.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it reads well
&lt;/h2&gt;

&lt;p&gt;All six sketches came back with the right parts and the right connections:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Sketch&lt;/th&gt;
&lt;th&gt;Parts&lt;/th&gt;
&lt;th&gt;Wires&lt;/th&gt;
&lt;th&gt;Validator fixes&lt;/th&gt;
&lt;th&gt;Time&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Button and LED&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;45.2 s*&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Potentiometer and servo&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;51.7 s*&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Parking sensor&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;td&gt;1 (reversed buzzer)&lt;/td&gt;
&lt;td&gt;92.3 s*&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Traffic light&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;11&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;33.6 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Parking gate&lt;/td&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;11&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;31.7 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Air piano&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;td&gt;1 (reversed buzzer)&lt;/td&gt;
&lt;td&gt;26.4 s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;* before the prompt change described below.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It also reads handwriting. On the traffic light sketch I wrote "red &amp;gt; green &amp;gt; yellow, button = pedestrian crossing" under the drawing, and that exact sequence showed up in the firmware, with sensible delays.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where it slips, and the validator
&lt;/h2&gt;

&lt;p&gt;The mistakes were all electrical details: invented part types (&lt;code&gt;"led red"&lt;/code&gt;), pin names that don't exist in Wokwi (&lt;code&gt;D13&lt;/code&gt;, plain &lt;code&gt;GND&lt;/code&gt;), and polarity. On the parking sensor and the air piano it wired the buzzer's signal to the negative leg.&lt;/p&gt;

&lt;p&gt;So the model's JSON never goes straight to the user. A deterministic validator, plain TypeScript, repairs it against the catalog and records every change in &lt;code&gt;fixes[]&lt;/code&gt;, which the UI shows. Here is the polarity check:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// polarised two-pin parts wired backwards (signal on the - leg, GND on the + leg) -&amp;gt; swap legs&lt;/span&gt;
&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;wokwi-buzzer&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;wokwi-led&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pins&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;entries&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;catOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)?.&lt;/span&gt;&lt;span class="nx"&gt;pins&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="p"&gt;{});&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;neg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;pins&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(([,&lt;/span&gt; &lt;span class="nx"&gt;role&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;role&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;GND&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)?.[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pos&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;pins&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(([,&lt;/span&gt; &lt;span class="nx"&gt;role&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;role&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;SIGNAL&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)?.[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;neg&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;negWire&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;touching&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;neg&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;find&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;w&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nf"&gt;isGndEnd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;other&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;neg&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;)));&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;posWire&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;touching&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;find&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;w&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;isGndEnd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;other&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;)));&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;negWire&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;posWire&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c1"&gt;// ...swap the two legs and record the fix&lt;/span&gt;
  &lt;span class="nf"&gt;fix&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Fixed reversed polarity&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;: signal on &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;neg&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;, GND on &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`signal on &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;, GND on &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;neg&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Feyuke0igie17q7wjdatj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Feyuke0igie17q7wjdatj.png" alt="The validator flagging and fixing a reversed buzzer on the air piano sketch"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The other repairs work the same way: map the part type onto the catalog, resolve pin aliases (&lt;code&gt;D13&lt;/code&gt; to &lt;code&gt;13&lt;/code&gt;, &lt;code&gt;anode&lt;/code&gt; to &lt;code&gt;A&lt;/code&gt;), insert a resistor before any LED driven straight from a pin, move a servo off a non-PWM pin and patch the pin number in the firmware, wire forgotten GND and 5V pins, and drop anything that still can't be resolved. Before I had an API key, I tested it on a deliberately broken answer: 20 repairs, valid circuit.&lt;/p&gt;

&lt;p&gt;The point of the split: Gemma decides what the sketch &lt;em&gt;means&lt;/em&gt;. Code guarantees the result is &lt;em&gt;valid&lt;/em&gt;. Neither does the other's job.&lt;/p&gt;

&lt;h2&gt;
  
  
  Latency: 104 seconds to about 30
&lt;/h2&gt;

&lt;p&gt;My first compiles took 45 to 104 seconds. I logged the usage of one slow run on the traffic light sketch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"usageMetadata"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"promptTokenCount"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1454&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"candidatesTokenCount"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1637&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"thoughtsTokenCount"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3209&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two thirds of the output was thinking, at roughly 47 tokens per second. The obvious knobs don't work for Gemma 4 on this API: &lt;code&gt;thinkingBudget&lt;/code&gt; returns "Thinking budget is not supported for this model" and &lt;code&gt;thinkingLevel&lt;/code&gt; returns "Thinking level is not supported for this model".&lt;/p&gt;

&lt;p&gt;What worked was two sentences in the system prompt:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Be fast and brief: decide quickly, do not deliberate or double-check at length. Keep the answer compact:
rationale max 10 words, summary 1 sentence, at most 2 notes, NO comments inside the code, no Serial prints unless needed.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The next run on the same sketch reported no thought tokens at all and took 34.6 seconds. The three sketches I compiled after the change came out as accurate as the three before it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fh7fd75sjf1q9c0a184kk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fh7fd75sjf1q9c0a184kk.png" alt="Bar chart: 104 seconds before prompt tuning, 35 seconds after, with zero thinking tokens"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Two more things helped with the long tail. The engine sends &lt;strong&gt;two identical requests and keeps whichever returns parseable JSON first&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;attempt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;callWithFallback&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;base&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;prompt&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;raw&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;asCircuit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;extractJson&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="nx"&gt;winner&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;any&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="nf"&gt;attempt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;userPrompt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;board&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt; &lt;span class="nf"&gt;attempt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;userPrompt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;board&lt;/span&gt;&lt;span class="p"&gt;))]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And it uses the smaller model. On the free tier during the event, &lt;code&gt;gemma-4-31b-it&lt;/code&gt; succeeded on 3 of 8 calls (500 "Internal error" or 503 "high demand" otherwise) and took 54 to 61 seconds when it worked. &lt;code&gt;gemma-4-26b-a4b-it&lt;/code&gt; succeeded on 8 of 8.&lt;/p&gt;

&lt;h2&gt;
  
  
  Gemini API gotchas
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;New keys and headers.&lt;/strong&gt; The new AI Studio keys (prefix &lt;code&gt;AQ.&lt;/code&gt;) worked as a &lt;code&gt;?key=&lt;/code&gt; query parameter but were rejected in the &lt;code&gt;x-goog-api-key&lt;/code&gt; header.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A stale environment variable.&lt;/strong&gt; My laptop had an unrelated proxy key in &lt;code&gt;GEMINI_API_KEY&lt;/code&gt;, so every call failed with "API key not valid" while the new key was fine. The CLI now reads the key from a local &lt;code&gt;.env&lt;/code&gt; first.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;JSON mode isn't a schema.&lt;/strong&gt; Once, 26B returned a top-level array instead of the object I asked for. The engine accepts the first object inside an array.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Raw newlines in strings.&lt;/strong&gt; Gemma sometimes puts literal line breaks inside JSON strings (the Arduino code). The parser walks the text, escapes newlines inside strings, and drops trailing commas before &lt;code&gt;JSON.parse&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Wokwi gotchas
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;diagram.json&lt;/code&gt; connections are &lt;code&gt;[from, to, color, route]&lt;/code&gt;, and an empty route &lt;code&gt;[]&lt;/code&gt; is valid.&lt;/li&gt;
&lt;li&gt;Uno ground pins are &lt;code&gt;GND.1&lt;/code&gt; (top header) and &lt;code&gt;GND.2&lt;/code&gt; / &lt;code&gt;GND.3&lt;/code&gt; (bottom). Routing each part to the nearest one keeps wires from crossing the chip.&lt;/li&gt;
&lt;li&gt;Sketches with &lt;code&gt;#include &amp;lt;Servo.h&amp;gt;&lt;/code&gt; fail on the first build with "Servo.h: No such file or directory"; Wokwi offers a one-click "Install Servo library" button.&lt;/li&gt;
&lt;li&gt;Simulation speed dropped to 3 to 10 percent while my CPU was busy with other tabs and a video render. Close everything before a live demo.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All five circuits I verified ran correctly in Wokwi. The full engine notes are in &lt;a href="https://github.com/glatinone/sketch2sim/blob/main/src/engine/ENGINE.md" rel="noopener noreferrer"&gt;ENGINE.md&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Next in the series: part 4, where this pattern could go after Arduino, from other simulators to digital twins, and how to get involved.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Hackathon log: building Sketch2Sim&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://dev.to/kielltampubolon/from-a-paper-sketch-to-a-running-circuit-building-sketch2sim-with-gemma-4-in-one-hack-day-2ndm"&gt;From a paper sketch to a running circuit: building Sketch2Sim with Gemma 4 in one hack day&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/kielltampubolon/two-claude-code-sessions-one-folder-no-merge-conflicts-how-i-split-a-hackathon-build-between-ai-3d5n"&gt;Two Claude Code sessions, one folder, no merge conflicts: how I split a hackathon build between AI agents&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/kielltampubolon/what-gemma-4-vision-gets-right-about-circuit-sketches-and-the-validator-that-fixes-the-rest-g18"&gt;What Gemma 4 vision gets right about circuit sketches, and the validator that fixes the rest&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/kielltampubolon/from-arduino-sketches-to-digital-twins-where-sketch2sim-goes-next-and-how-to-get-involved-2bcb"&gt;From Arduino sketches to digital twins: where Sketch2Sim goes next, and how to get involved&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>ai</category>
      <category>gemini</category>
      <category>arduino</category>
      <category>typescript</category>
    </item>
    <item>
      <title>Two Claude Code sessions, one folder, no merge conflicts: how I split a hackathon build between AI agents</title>
      <dc:creator>Kiell Tampubolon</dc:creator>
      <pubDate>Sat, 31 Oct 2026 08:02:15 +0000</pubDate>
      <link>https://dev.to/kielltampubolon/two-claude-code-sessions-one-folder-no-merge-conflicts-how-i-split-a-hackathon-build-between-ai-3d5n</link>
      <guid>https://dev.to/kielltampubolon/two-claude-code-sessions-one-folder-no-merge-conflicts-how-i-split-a-hackathon-build-between-ai-3d5n</guid>
      <description>&lt;p&gt;&lt;em&gt;Hackathon log, part 2. &lt;a href="https://dev.to/kielltampubolon/from-a-paper-sketch-to-a-running-circuit-building-sketch2sim-with-gemma-4-in-one-hack-day-2ndm"&gt;Part 1&lt;/a&gt; covers what Sketch2Sim is: a photo of a circuit sketch goes in, a Wokwi project that runs comes out. This part is about how it got built.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I entered the MLH Hacktoberfest Hack Day in Batam alone, with about two and a half hours of build time. Instead of one AI coding session doing everything in sequence, I ran two Claude Code sessions at the same time, in the same folder, on the same laptop. They built one app together and never had a merge conflict.&lt;/p&gt;

&lt;p&gt;This post is the setup I used, the timeline it produced, and the four things that broke. Everything below comes from the status files the sessions wrote during the day.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fh1nfhcem1mld45690rua.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fh1nfhcem1mld45690rua.png" alt="Gantt chart of the build day: me, Session A, Session B and subagents, from 12:30 to 15:00"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup: written before any code
&lt;/h2&gt;

&lt;p&gt;I spent the first seven minutes writing a plan, not code. Three pieces made parallel work possible.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. One owner per file
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sketch2sim/
├── src/contract/types.ts   ← frozen; changing it needs a note in both status files
├── src/engine/**           ← Session A only
├── scripts/run-engine.ts   ← Session A only
├── package.json, configs   ← Session B only (the only one allowed to npm install)
└── everything else in src/ ← Session B only
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both sessions shared one working tree with no branches and no worktrees. Git was just the record. The ownership table did the conflict prevention.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. A frozen contract
&lt;/h3&gt;

&lt;p&gt;One TypeScript file defined everything the two halves needed to agree on:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;CompileInput&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;imageBase64&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;mimeType&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;image/png&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;image/jpeg&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;board&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Board&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;apiKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;modelId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;CompileSketch&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;CompileInput&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CompileResult&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Session B (the app) built the whole UI against a mock that returned a realistic fake &lt;code&gt;CompileResult&lt;/code&gt; after 1.5 seconds. It never waited for the engine. When Session A posted "engine ready", B flipped one constant in &lt;code&gt;compileClient.ts&lt;/code&gt; and the app was talking to Gemma 4.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Two status files as a message bus
&lt;/h3&gt;

&lt;p&gt;Each session wrote only to its own file, &lt;code&gt;status/A.md&lt;/code&gt; or &lt;code&gt;status/B.md&lt;/code&gt;, and read the other one before starting each task. Every entry was one line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[12:52 WIB] A5 DONE — ENGINE READY. Live compile of a hand-drawn UNO+BUTTON+LED sketch: valid circuit, 0 fixes needed.
[12:56 WIB] SYNC1 DONE — INTEGRATED: USE_MOCK off. Live compile of presets/blink-button.png through the UI: OK.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Anything one session needed from the other went under a "Requests to other session" heading in its &lt;em&gt;own&lt;/em&gt; file. Neither session ever edited the other's status file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0v5i9cmt1mgj07zqqnj3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0v5i9cmt1mgj07zqqnj3.png" alt="Two Claude Code sessions coordinating through a frozen contract and separate status files"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What it produced
&lt;/h2&gt;

&lt;p&gt;From the logs:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Time (WIB)&lt;/th&gt;
&lt;th&gt;Event&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;12:31&lt;/td&gt;
&lt;td&gt;Plan, contract and both briefs written&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;12:39&lt;/td&gt;
&lt;td&gt;Session B: scaffold ready, build passes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;12:52&lt;/td&gt;
&lt;td&gt;Session A: engine ready, first live compile works&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;12:56&lt;/td&gt;
&lt;td&gt;Session B: UI switched from mock to the real engine&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;13:02&lt;/td&gt;
&lt;td&gt;Session B: README, contributing guide, public repo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;13:08&lt;/td&gt;
&lt;td&gt;Session A: three presets plus cached fallbacks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;13:35&lt;/td&gt;
&lt;td&gt;Five generated circuits verified running in Wokwi&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;14:22&lt;/td&gt;
&lt;td&gt;Session B: slide deck and demo video done&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The engine was ready about 50 minutes ahead of the schedule I'd written in the plan. That buffer paid for everything that went wrong later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Subagents for the slow side quests
&lt;/h2&gt;

&lt;p&gt;Session A kept writing engine code while it handed slow, self-contained jobs to subagents that ran in the background:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Getting an API key.&lt;/strong&gt; One subagent drove my logged-in browser to Google AI Studio, created a free Gemini API key, saved it to a local &lt;code&gt;.env&lt;/code&gt;, and then probed Gemma 4: which model IDs exist, whether image input works, whether JSON mode and system instructions are accepted, and how long each call takes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Research.&lt;/strong&gt; Another checked every Wokwi pin name against the official docs and the &lt;code&gt;wokwi-cli&lt;/code&gt; diagram linter, so the part catalog wasn't built from memory.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Verification.&lt;/strong&gt; Later ones pasted generated projects into the real Wokwi editor, pressed play, held the virtual button, and saved screenshots as proof.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;End-to-end and mobile QA.&lt;/strong&gt; One ran the full flow on the deployed app; another emulated an iPhone and measured horizontal overflow on every screen.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The rule I'd keep: subagents do jobs whose answer fits in a short report. The main session never reads their transcripts, only their conclusions.&lt;/p&gt;

&lt;h2&gt;
  
  
  What broke (and what I'd do differently)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Cleanup collisions.&lt;/strong&gt; Session B tidied its temp files and also deleted Session A's temporary browser profiles and killed browser processes that matched a name pattern. It owned up to it in its status file, which is the only reason A knew. Lesson: cleanup must be scoped to things &lt;em&gt;you&lt;/em&gt; created, by exact path or ID, never by pattern.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Unsaved state in an agent-owned browser window is fragile.&lt;/strong&gt; A subagent filled in the MLH submission form and left it open for my review. Later, another agent ended its own browser session, the window holding the form closed, and the whole fill was gone. Nothing had been saved, because I'd asked for review before submit. It took one more subagent run to fill it again. Lesson: if a human needs to review something, put it somewhere that survives (a saved draft, or the text in a file) instead of an open tab.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. I let an agent get too close to submitting.&lt;/strong&gt; I asked a subagent to fill the submission form and submit it. Halfway through, I decided I wanted to review first and stopped it. The stop message only reaches a running subagent at its next step, so for a moment I couldn't be sure what it had clicked. It hadn't submitted anything. Lesson: for anything public or irreversible, agents prepare and a human presses the button. Write that into the brief from the start.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Trust, then verify.&lt;/strong&gt; Subagent reports were mostly accurate, but I checked the ones that mattered myself. For example, I confirmed the YouTube title through YouTube's public oEmbed endpoint instead of trusting "title set correctly". It was right. One time a report noted that a checkbox hadn't stuck on the first click, and that was true too.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ownership can move, if you announce it
&lt;/h2&gt;

&lt;p&gt;Late in the day, Session B was busy rendering the demo video and the app needed a proper phone layout. Session A took over every UI file with one line in its status file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[14:04 WIB] OWNERSHIP CHANGE — A now owns ALL app UI files for a mobile overhaul … B: please don't edit these until A posts MOBILE DONE.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A finished the mobile layout, posted &lt;code&gt;MOBILE DONE&lt;/code&gt;, and handed the files back. The same protocol that prevented conflicts also made the handover cheap.&lt;/p&gt;

&lt;h2&gt;
  
  
  A template you can copy
&lt;/h2&gt;

&lt;p&gt;If you want to try this on your next hackathon or side project:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Write the ownership table before any code. Every path gets exactly one owner.&lt;/li&gt;
&lt;li&gt;Freeze one contract file. Give the UI side a mock that satisfies it.&lt;/li&gt;
&lt;li&gt;One status file per session, one line per update, requests in your own file.&lt;/li&gt;
&lt;li&gt;Only one session installs dependencies and pushes.&lt;/li&gt;
&lt;li&gt;Agents prepare outward-facing actions (posts, submissions, uploads); a human confirms them.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Total cost of the setup: about seven minutes and half a page of Markdown. For me it was the best seven minutes of the day.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Next in the series: part 3 goes inside the engine: what Gemma 4 vision reads well, where it slips, and the validator that fixes it.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Hackathon log: building Sketch2Sim&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://dev.to/kielltampubolon/from-a-paper-sketch-to-a-running-circuit-building-sketch2sim-with-gemma-4-in-one-hack-day-2ndm"&gt;From a paper sketch to a running circuit: building Sketch2Sim with Gemma 4 in one hack day&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/kielltampubolon/two-claude-code-sessions-one-folder-no-merge-conflicts-how-i-split-a-hackathon-build-between-ai-3d5n"&gt;Two Claude Code sessions, one folder, no merge conflicts: how I split a hackathon build between AI agents&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/kielltampubolon/what-gemma-4-vision-gets-right-about-circuit-sketches-and-the-validator-that-fixes-the-rest-g18"&gt;What Gemma 4 vision gets right about circuit sketches, and the validator that fixes the rest&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/kielltampubolon/from-arduino-sketches-to-digital-twins-where-sketch2sim-goes-next-and-how-to-get-involved-2bcb"&gt;From Arduino sketches to digital twins: where Sketch2Sim goes next, and how to get involved&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>hackathon</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
