<?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: Gabriele Pieretti</title>
    <description>The latest articles on DEV Community by Gabriele Pieretti (@gabbrowick).</description>
    <link>https://dev.to/gabbrowick</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%2F4081509%2F97ad5a9c-8094-4644-b924-bfeb72c87649.jpg</url>
      <title>DEV Community: Gabriele Pieretti</title>
      <link>https://dev.to/gabbrowick</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gabbrowick"/>
    <language>en</language>
    <item>
      <title>Critical Apache Flaw: Who Updates the Server Behind Your Website?</title>
      <dc:creator>Gabriele Pieretti</dc:creator>
      <pubDate>Fri, 13 Nov 2026 19:08:17 +0000</pubDate>
      <link>https://dev.to/gabbrowick/critical-apache-flaw-who-updates-the-server-behind-your-website-5526</link>
      <guid>https://dev.to/gabbrowick/critical-apache-flaw-who-updates-the-server-behind-your-website-5526</guid>
      <description>&lt;p&gt;On 11 November Apache released version 2.4.71 of its web server, one of the most widely used in the world. It fixes a critical flaw, CVE-2026-119618, that lets an attacker run their own code on the server without any password. It affects versions 2.4.55 to 2.4.70 with HTTP/2 enabled.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happened
&lt;/h2&gt;

&lt;p&gt;The bug sits in the &lt;code&gt;mod_http2&lt;/code&gt; module, in a function that handles request headers. Two parts of the server use it at the same time without coordinating, and with crafted requests an attacker can corrupt the process memory and get it to execute commands. Apache rates it critical, the top of its scale.&lt;/p&gt;

&lt;p&gt;It was reported twice. First on 26 October by Anthropic's automated scanner (Anthropic is the company behind Claude), an AI-based tool that reads the code of open source projects looking for bugs. Then on 3 November by two researchers at Google Cloud. The facts come from the &lt;a href="https://httpd.apache.org/security/vulnerabilities_24.html" rel="noopener noreferrer"&gt;official Apache 2.4 vulnerabilities page&lt;/a&gt;; there is also a summary in Italian on &lt;a href="https://www.hwupgrade.it/news/sicurezza-software/milioni-di-siti-a-rischio-hacking-apache-corre-a-tappare-una-falla-scoperta-per-caso-da-anthropic_162028.html" rel="noopener noreferrer"&gt;Hardware Upgrade&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why a small business should care
&lt;/h2&gt;

&lt;p&gt;According to Hardware Upgrade, Apache serves roughly one website in five worldwide. Plenty of them belong to small businesses: a brochure site on shared hosting, a WordPress built a few years ago, a management tool reachable from outside for staff on the road.&lt;/p&gt;

&lt;p&gt;The flaw only opens up with HTTP/2 enabled, an option that makes pages load faster. Apache ships with it off, but many hosting providers and many technicians turn it on for the speed. You cannot tell by looking whether your site is exposed: someone has to check, or you have to ask.&lt;/p&gt;

&lt;p&gt;Attackers do not pick targets by name. They run programs that sweep the internet for servers with the right version, and to those programs a small site is a target like any other. A compromised server can send spam, host scam pages or hand over whatever people typed into your contact forms.&lt;/p&gt;

&lt;p&gt;The fact that one report came from an AI tool matters to you too. Tools like that find bugs in years-old code quickly. Researchers use them and attackers can use them, so the gap between a flaw being announced and the first attacks gets shorter. Updating "when we get round to it" becomes a risk.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to check
&lt;/h2&gt;

&lt;p&gt;If you or your technician can log into the server, the version is one command away:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;httpd -v
apache2 -v
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first works on Red Hat, AlmaLinux and similar systems, the second on Debian and Ubuntu. The line that matters is &lt;code&gt;Server version: Apache/2.4.xx&lt;/code&gt;. To see whether HTTP/2 is on, look for the &lt;code&gt;Protocols&lt;/code&gt; directive with &lt;code&gt;h2&lt;/code&gt; in the Apache configuration files.&lt;/p&gt;

&lt;p&gt;On a Linux server, though, the number alone is not enough. Debian moved its packages to 2.4.71, while Ubuntu and Red Hat patch theirs without moving to that version, so you may see a lower number with the flaw already closed. Ubuntu also had to patch packages numbered below 2.4.55, which at first glance look out of range. If the server runs a Linux distribution, the distribution's security advisory is what counts, even when the number seems out of range. Whoever runs the server knows where to find it.&lt;/p&gt;

&lt;p&gt;On shared hosting you cannot run these commands, and you do not need to: updating is the provider's job. Write to them and ask for confirmation that their servers are on 2.4.71 or carry the fix. If your site runs on a different web server, such as nginx or LiteSpeed, this flaw does not affect it; the questions below are still worth asking for the next one.&lt;/p&gt;

&lt;p&gt;If updating straight away is not possible, the temporary measure reported by the sources is to switch HTTP/2 off. The site falls back to HTTP/1.1, a little slower but out of reach of this flaw. Decide that together with whoever runs the server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three questions for whoever runs your website
&lt;/h2&gt;

&lt;p&gt;Whether it is your hosting provider, the agency that built the site or a trusted technician, send them an email with these three questions.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Who updates the server?&lt;/strong&gt; Operating system, Apache, PHP: you want a name or a specific service. It happens that the host assumes the agency is doing it and the agency assumes the host is.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How fast after a critical advisory?&lt;/strong&gt; For a flaw like this one, the answer you want is a few days. Also ask whether security updates are installed automatically or by hand.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How will you tell us it is done?&lt;/strong&gt; An email with the date and the installed version is enough. If nothing arrives, you have no way of knowing the work was done.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If nobody can answer one of these, that is the problem to fix, even before this particular flaw.&lt;/p&gt;

&lt;h2&gt;
  
  
  If you want a second opinion
&lt;/h2&gt;

&lt;p&gt;If you do not know who runs your server, or the answer you got does not convince you, I can look at it with you: we check what the site reveals from the outside and I prepare the questions to send to your provider. For PHP sites there is also the &lt;a href="https://gabrielepieretti.dev/php-vulnerability-check/" rel="noopener noreferrer"&gt;free PHP version check&lt;/a&gt;, and on the same subject I wrote about the &lt;a href="https://gabrielepieretti.dev/blog-en/php-vulnerabilities-october-2026/" rel="noopener noreferrer"&gt;two critical PHP flaws in October&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://gabrielepieretti.dev/blog-en/apache-http2-vulnerability-november-2026/" rel="noopener noreferrer"&gt;gabrielepieretti.dev&lt;/a&gt;. I write about software, security and small businesses: &lt;a href="https://gabrielepieretti.dev/blog-en/" rel="noopener noreferrer"&gt;more here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>apache</category>
      <category>security</category>
      <category>webdev</category>
      <category>hosting</category>
    </item>
    <item>
      <title>A Free Audit Is a Server That Fetches Strangers' URLs: Building a Lead Magnet in Laravel</title>
      <dc:creator>Gabriele Pieretti</dc:creator>
      <pubDate>Thu, 12 Nov 2026 09:06:23 +0000</pubDate>
      <link>https://dev.to/gabbrowick/a-free-audit-is-a-server-that-fetches-strangers-urls-building-a-lead-magnet-in-laravel-3cpc</link>
      <guid>https://dev.to/gabbrowick/a-free-audit-is-a-server-that-fetches-strangers-urls-building-a-lead-magnet-in-laravel-3cpc</guid>
      <description>&lt;p&gt;For &lt;a href="https://localproai.it" rel="noopener noreferrer"&gt;LocalPro AI&lt;/a&gt;, the local marketing service I run for restaurants and pizzerias in Italy, I wanted the classic lead generation tool: type in your website address, get a score out of 100 and a list of things to fix in a few seconds, and leave your email to receive the full report. The visible part took an afternoon. The rest, meaning everything needed so that a public form that fetches URLs chosen by strangers does not become a liability, took much longer. This post is about that rest, because it applies to any lead magnet.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it measures, and what I chose not to measure
&lt;/h2&gt;

&lt;p&gt;The audit downloads the home page of the site you give it and runs nine checks, each with a fixed weight:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="no"&gt;WEIGHTS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s1"&gt;'reachable'&lt;/span&gt;       &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// the site opens&lt;/span&gt;
    &lt;span class="s1"&gt;'https'&lt;/span&gt;           &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s1"&gt;'speed'&lt;/span&gt;           &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// full marks within 1.5 s, half within 3 s&lt;/span&gt;
    &lt;span class="s1"&gt;'mobile'&lt;/span&gt;          &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// meta viewport with width=device-width&lt;/span&gt;
    &lt;span class="s1"&gt;'meta'&lt;/span&gt;            &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// title 10-70 characters, description 50-170&lt;/span&gt;
    &lt;span class="s1"&gt;'structured_data'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// JSON-LD or microdata of a LocalBusiness type&lt;/span&gt;
    &lt;span class="s1"&gt;'nap'&lt;/span&gt;             &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// name, address, phone readable on the page&lt;/span&gt;
    &lt;span class="s1"&gt;'maps'&lt;/span&gt;            &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;// link or map pointing to the Google listing&lt;/span&gt;
    &lt;span class="s1"&gt;'crawl'&lt;/span&gt;           &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;// robots.txt and sitemap&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The score is the sum, capped at 100. No mysterious weighted average: whoever reads the report should be able to work out on their own why they got 62.&lt;/p&gt;

&lt;p&gt;What it does not do is more interesting than what it does. It does not query Google: no Places API, no scraping of search results, which Google's terms forbid. As for the Google listing, I only check whether the site links to it. That is a deliberate limit: an audit that starts by breaking the terms of your customer's most important supplier is not a great business card.&lt;/p&gt;

&lt;p&gt;There is also a bit of AI, and it is off by default. When enabled it only rewrites the advice in the email into friendlier Italian, and the prompt contains the business type, the score and the advice: never the business name, the email or the URL. It has a cap of 100 calls a day on top of the general AI budget, and if it fails or hits the cap the static texts are used. The report works the same without it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The real problem: a server that fetches whatever you tell it
&lt;/h2&gt;

&lt;p&gt;A form that accepts a URL and goes to fetch it is, by definition, an HTTP request made by my server on behalf of anyone. If you are not careful, that anyone asks for &lt;code&gt;http://169.254.169.254/&lt;/code&gt; (the cloud metadata service), &lt;code&gt;http://localhost:6379&lt;/code&gt; or the database IP on the internal network. It is called SSRF, and a lead magnet is the perfect place to introduce it without noticing.&lt;/p&gt;

&lt;p&gt;The fetcher I wrote, &lt;code&gt;SafeHttpFetcher&lt;/code&gt;, does the following, in order:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;accepts only &lt;code&gt;http&lt;/code&gt; and &lt;code&gt;https&lt;/code&gt;, only ports 80 and 443, and no credentials in the URL;&lt;/li&gt;
&lt;li&gt;resolves the host itself and rejects the request if even one of the IPs is not public. The blocklist covers more than the usual &lt;code&gt;10.0.0.0/8&lt;/code&gt;: there is CGNAT &lt;code&gt;100.64.0.0/10&lt;/code&gt;, link-local, IPv4-mapped IPv6 addresses, NAT64, 6to4 and Teredo, which are all ways of writing an internal IP so that it looks like something else;&lt;/li&gt;
&lt;li&gt;forces curl onto the IP it just checked, so a second DNS lookup cannot take the connection elsewhere;&lt;/li&gt;
&lt;li&gt;follows redirects by hand, up to a small fixed number, and repeats the whole validation at every hop.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The core is the set of options passed to curl through Laravel's HTTP client:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nc"&gt;Http&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;withHeaders&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s1"&gt;'Accept-Encoding'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'identity'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;withOptions&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s1"&gt;'allow_redirects'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s1"&gt;'decode_content'&lt;/span&gt;  &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s1"&gt;'timeout'&lt;/span&gt;         &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$timeout&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s1"&gt;'curl'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="no"&gt;CURLOPT_RESOLVE&lt;/span&gt;   &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"{$host}:{$port}:{$pinned}"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="no"&gt;CURLOPT_PROTOCOLS&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;CURLPROTO_HTTP&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="no"&gt;CURLPROTO_HTTPS&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="no"&gt;CURLOPT_PROXY&lt;/span&gt;     &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="no"&gt;CURLOPT_MAXFILESIZE&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$maxBytes&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="no"&gt;CURLOPT_NOPROGRESS&lt;/span&gt;  &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="no"&gt;CURLOPT_PROGRESSFUNCTION&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
            &lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$ch&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$dlTotal&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$dlNow&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$dlNow&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$maxBytes&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$url&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;Three lines deserve a comment.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;CURLOPT_RESOLVE&lt;/code&gt; is the defence against DNS rebinding: the attacker's domain answers with a public IP when I check it and with &lt;code&gt;127.0.0.1&lt;/code&gt; half a second later, when curl connects. If I decide the IP, there is no second lookup.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;CURLOPT_PROXY =&amp;gt; ''&lt;/code&gt; looks pointless until you find out that curl honours the &lt;code&gt;HTTP_PROXY&lt;/code&gt; and &lt;code&gt;HTTPS_PROXY&lt;/code&gt; environment variables. With a proxy in the middle, the proxy resolves the host and the pin is gone. The empty string turns it off even if someone sets those variables in the container one day.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;decode_content =&amp;gt; false&lt;/code&gt; together with &lt;code&gt;Accept-Encoding: identity&lt;/code&gt;: otherwise Guzzle asks curl to decompress without limits, and a gzip response of a few KB can turn into a few GB in memory. I do the decompression myself, with the same size cap. The progress function aborts the download as soon as it goes over, even when the server does not send a &lt;code&gt;Content-Length&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;One last detail, found while writing the tests: the timeout applies to the whole redirect chain, not to each hop. Otherwise a slow site with three redirects keeps a worker busy for four times the expected time. On top of that there is a time budget for the entire audit, home page plus &lt;code&gt;robots.txt&lt;/code&gt; and sitemap.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rate limits: per IP, and per address
&lt;/h2&gt;

&lt;p&gt;Every analysis fetches a third-party site, and every report sends an email. Those are two different resources, with separate limits: analyses are limited per IP, per minute and per day; reports are limited per IP and per email address, and the address only enters the limiter key as a SHA-256 hash.&lt;/p&gt;

&lt;p&gt;The per-address limit is the one that matters: someone rotating IPs cannot use the form to flood another person's inbox. The address only reaches the rate limiter key as a hash, so Redis does not hold a plain list of emails. There is no captcha: for a form aimed at a pizza maker opening it on their phone between two services, I prefer a honeypot (a hidden field called &lt;code&gt;fax_aziendale&lt;/code&gt;, "company fax", that no human fills in) and tight limits.&lt;/p&gt;

&lt;h2&gt;
  
  
  A cached page cannot carry a CSRF token
&lt;/h2&gt;

&lt;p&gt;This is the trade-off I thought about the longest. The form page is served from the public cache, like the rest of the marketing site, because it has to be fast. But a cached page is the same for everyone, so it cannot contain a session CSRF token. The two audit &lt;code&gt;POST&lt;/code&gt; routes are therefore excluded from CSRF verification in &lt;code&gt;bootstrap/app.php&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I accepted the exclusion after looking at what a third-party site could do by making your browser submit that form: start an analysis (limited per IP) or have a report sent to an address (limited per address). Neither acts on an account, because there are no accounts. The limits do the job the token usually does. If one day the audit had to touch data of a logged-in user, that decision would have to be made again from scratch.&lt;/p&gt;

&lt;p&gt;The result pages, on the other hand, go out with &lt;code&gt;Cache-Control: no-store, private&lt;/code&gt; and &lt;code&gt;X-Robots-Tag: noindex, nofollow&lt;/code&gt;: someone's pizzeria score must not end up in a shared cache or on Google.&lt;/p&gt;

&lt;h2&gt;
  
  
  The lead only exists once there is consent
&lt;/h2&gt;

&lt;p&gt;The analysis creates nothing in the database. The result stays in the cache for 60 minutes under a random 40 character token, and the lead is written only when the person asks for the report, inside a transaction together with the consent records. Then the token is deleted: submitting the same form twice creates no duplicates and sends no second email.&lt;/p&gt;

&lt;p&gt;On consent:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;privacy is required, marketing is optional, and a refusal is recorded too;&lt;/li&gt;
&lt;li&gt;the marketing checkbox only records a request. Actual consent comes from the confirmation in the email, through a signed link valid for 7 days;&lt;/li&gt;
&lt;li&gt;the link opens a page with a button, and consent comes from the &lt;code&gt;POST&lt;/code&gt; of that button. Email security scanners open links on their own to check them, and consent given by a &lt;code&gt;GET&lt;/code&gt; would be consent given by the scanner;&lt;/li&gt;
&lt;li&gt;the &lt;code&gt;List-Unsubscribe&lt;/code&gt; header for one-click unsubscribe is only added once consent is confirmed;&lt;/li&gt;
&lt;li&gt;leads are deleted after 12 months, 24 with marketing consent.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The audit sits behind a switch, off by default: when off, the form and the analysis answer 404 and the page disappears from the sitemap and the privacy notice. The unsubscribe routes are deliberately left outside the switch. Anyone who received an email must be able to unsubscribe even on the day I decide to turn everything off.&lt;/p&gt;

&lt;h2&gt;
  
  
  The tests
&lt;/h2&gt;

&lt;p&gt;There are 73 Pest tests in seven files, and more than half are not about the score. They cover redirects to private IPs, hosts resolving to several IPs of which one is internal, compressed responses over the limit, slow redirect chains, the token expiring, the same form submitted twice, consent given by a &lt;code&gt;GET&lt;/code&gt; that must not count. Computing the score is the easy part to test and the one that breaks least.&lt;/p&gt;

&lt;h2&gt;
  
  
  The point, if you are building one
&lt;/h2&gt;

&lt;p&gt;A lead magnet looks like marketing, but from the server's side it is a public, anonymous endpoint that makes network requests and sends email to addresses supplied by anyone. Treating it as a side feature is the quickest way to have your first security incident on the very page meant to bring in customers. The rule I set myself: everything the form does on behalf of the visitor needs a limit, and every limit needs a test.&lt;/p&gt;

&lt;p&gt;If you need a tool like this for your product, or want someone to look at the one you already have, &lt;a href="https://gabrielepieretti.dev/consulting/" rel="noopener noreferrer"&gt;this is how I work&lt;/a&gt;. On Laravel security I have also written about &lt;a href="https://gabrielepieretti.dev/blog-en/laravel-storage-path-traversal/" rel="noopener noreferrer"&gt;path traversal in Storage::path()&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://gabrielepieretti.dev/blog-en/free-audit-lead-magnet-laravel/" rel="noopener noreferrer"&gt;gabrielepieretti.dev&lt;/a&gt;. I write about Laravel, privacy-by-design and building a vertical B2B SaaS solo, &lt;a href="https://gabrielepieretti.dev/blog-en/" rel="noopener noreferrer"&gt;more here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>security</category>
      <category>php</category>
      <category>saas</category>
    </item>
    <item>
      <title>Live Hair Colour Try-On, Entirely on the Phone: MediaPipe in a WebView Inside Flutter</title>
      <dc:creator>Gabriele Pieretti</dc:creator>
      <pubDate>Thu, 12 Nov 2026 09:06:22 +0000</pubDate>
      <link>https://dev.to/gabbrowick/live-hair-colour-try-on-entirely-on-the-phone-mediapipe-in-a-webview-inside-flutter-4jof</link>
      <guid>https://dev.to/gabbrowick/live-hair-colour-try-on-entirely-on-the-phone-mediapipe-in-a-webview-inside-flutter-4jof</guid>
      <description>&lt;p&gt;In the &lt;a href="https://play.google.com/store/apps/details?id=it.miraviso.colore" rel="noopener noreferrer"&gt;Miraviso Colore&lt;/a&gt; app you point the front camera at your face, tap a copper brown, and your hair turns copper brown while you move your head. No frame leaves the phone. Put like that it sounds like a filter app feature. Doing it properly, on an ordinary Android phone and with a privacy promise you can check by watching the network, took more rounds than I had planned for. This is the engine as it stands today, with the numbers I measured.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why there is a browser inside a Flutter app
&lt;/h2&gt;

&lt;p&gt;The first thing that surprises people who open the code: the try-on does not use &lt;code&gt;tflite_flutter&lt;/code&gt;, there is no Kotlin plugin and no Flutter shader. The screen is a &lt;code&gt;WebViewWidget&lt;/code&gt;, and inside it runs a page with &lt;a href="https://ai.google.dev/edge/mediapipe/solutions/vision/image_segmenter" rel="noopener noreferrer"&gt;MediaPipe Tasks Vision&lt;/a&gt; in WebAssembly and a WebGL2 fragment shader.&lt;/p&gt;

&lt;p&gt;The engine started life as a browser prototype and found its shape there. Porting it to Dart would have meant rewriting the segmentation, the shader and every fix described below, to end up with the same result. Today it lives in a package, &lt;code&gt;live_color&lt;/code&gt;, shared between the salon tablet app and the app for people who want to try a colour at home. Before that it was copied into both apps, and the copies had already drifted apart once: one engine, two presentations.&lt;/p&gt;

&lt;p&gt;You pay for that choice straight away. ES modules do not load from &lt;code&gt;file://&lt;/code&gt;, and &lt;code&gt;getUserMedia&lt;/code&gt; requires a secure context. The fix is a small HTTP server written in Dart that listens on &lt;code&gt;127.0.0.1&lt;/code&gt;, on a port picked by the OS, and serves the engine assets from the app bundle:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;server&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nc"&gt;HttpServer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;bind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;InternetAddress&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;loopbackIPv4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// the WebView opens http://127.0.0.1:&amp;lt;port&amp;gt;/index.html&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;localhost&lt;/code&gt; counts as a secure context, so the camera starts. In the Android manifest cleartext traffic is allowed only to &lt;code&gt;127.0.0.1&lt;/code&gt; and &lt;code&gt;localhost&lt;/code&gt;, and the camera permission requested by the WebView is granted on the Flutter side, after the user has given it to the app.&lt;/p&gt;

&lt;h2&gt;
  
  
  From camera to mask
&lt;/h2&gt;

&lt;p&gt;The front camera opens at 640×480 with an ideal 30 fps, and the working canvas has its long side at 480 pixels. More resolution does not help: a hair mask is soft by nature, and every extra pixel is paid for in every later step.&lt;/p&gt;

&lt;p&gt;The model is &lt;code&gt;hair_segmenter.tflite&lt;/code&gt;, the one from MediaPipe's old hair demo. Two classes, background and hair, 780 KB. Until mid-August I used &lt;code&gt;selfie_multiclass_256x256&lt;/code&gt;, which segments six classes (hair, skin, clothes...) of which I needed one. The switch had three measurable effects:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the model went from 16 MB to 780 KB, and the APK from 40.7 to 25.8 MB;&lt;/li&gt;
&lt;li&gt;on Google's official Pixel 6 numbers, CPU segmentation drops from 217 to 58 ms (GPU from 71 to 52);&lt;/li&gt;
&lt;li&gt;the CPU path, which is what phones with an uncooperative GPU end up on, became usable.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The segmenter runs in &lt;code&gt;VIDEO&lt;/code&gt; mode and returns only &lt;code&gt;confidenceMasks&lt;/code&gt;: a value between 0 and 1 per pixel instead of a binary mask. I try the GPU delegate first and fall back to CPU if creation fails. The detail that makes the difference is that the segmenter gets the same WebGL canvas I draw on: the mask arrives as a texture through &lt;code&gt;getAsWebGLTexture()&lt;/code&gt; and never goes back to JavaScript memory.&lt;/p&gt;

&lt;h2&gt;
  
  
  Colour: multiply to go darker, relight to go lighter
&lt;/h2&gt;

&lt;p&gt;Recolouring is a GLSL ES 3.0 fragment shader. The first version, in JavaScript over the canvas pixels, cost 66 ms per frame on its own, and no mirror survives that.&lt;/p&gt;

&lt;p&gt;The basic idea is simple: compute the hair's luminance (Rec.601 weights, 0.299, 0.587, 0.114) and multiply it by the tint. Shadows and highlights stay where they are, because they come from the real hair. It works beautifully when the tint is darker than the hair. When it is lighter it does not work at all: multiplying black by platinum gives a salt-and-pepper grey, because multiplication cannot lighten.&lt;/p&gt;

&lt;p&gt;For lighter tints the shader switches strategy, which I call "relight": it brings the hair's mean tone up to the tint's luminance and keeps only the relative shading around that mean. The numbers, picked by eye in front of the mirror and then kept:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;60% of the local texture is preserved;&lt;/li&gt;
&lt;li&gt;below a 0.12 gap between tint and hair the relight does not kick in, so browns and blacks stay on the multiplicative path;&lt;/li&gt;
&lt;li&gt;relative shading is clamped between 0.45 and 1.5, against black holes and burnt patches;&lt;/li&gt;
&lt;li&gt;if the result falls outside the gamut, the whole tint is scaled instead of clipping each channel, so a light blonde does not turn white.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The mask confidence acts as alpha: thin hair and edges are coloured in proportion, and below 0.10 nothing is touched. There is no blur or feathering on the mask, because confidence is already soft. The hair's mean luminance, which the relight uses as its reference, goes through an exponential moving average with weight 0.25 and resets if it jumps by more than 0.15, for example when you walk into a brighter room.&lt;/p&gt;

&lt;p&gt;The catalogue has 54 entries: 53 colours in 7 families (blondes, browns, reds, copper, cool, blacks, fashion) plus "Natural", which removes the tint. On top of solid colour there are techniques: balayage, ombré and sombré live, the brush on photos only.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three bugs that looked like something else
&lt;/h2&gt;

&lt;p&gt;The most useful fixes came from symptoms that did not point at their cause.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The colour flickered.&lt;/strong&gt; I was binding the mask texture returned by MediaPipe directly. But the library recycles that texture for the next frame, and now and then the shader read a mask that had already been overwritten. Now I copy it into a texture of my own with a shader pass and keep the last good one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The hair was always one step behind.&lt;/strong&gt; I segmented the video and then drew the video: by then the video had already moved on by a frame. Now the frame is frozen into a texture &lt;em&gt;before&lt;/em&gt; segmentation, so mask and image are the same snapshot by construction.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The mirror "breathed".&lt;/strong&gt; Once a second the image seemed to zoom slightly. It was a synchronous read of about 300 KB of pixels from the GPU to compute the hair's mean luminance: it stalled the pipeline just long enough to be visible. Now the GPU does the average, reducing the texture with mipmaps down to 1×1, and I read a single pixel asynchronously with a pixel buffer object and a fence, collecting the value on the next frame. Zero synchronous GPU→CPU reads in the loop.&lt;/p&gt;

&lt;p&gt;Then there is the worst case: the Galaxy A56 (Exynos 1580, Xclipse 540 GPU) returns empty masks on the GPU delegate without any error. No exception, no log, just a mirror that does not colour. The engine now notices and rebuilds the segmenter on CPU by itself. On CPU one segmentation took between 437 and 483 ms on that phone, so there the cadence is adaptive: segment every N frames, up to one in 20, with the colour pinned to the last mask. On GPU I never dilute the cadence: when you are tracking a turning head, staying locked on matters more than smoothness.&lt;/p&gt;

&lt;p&gt;Last lesson: an unhandled exception inside the draw loop killed &lt;code&gt;requestVideoFrameCallback&lt;/code&gt;, and the mirror froze on the first frame without a word. The loop now sits in a &lt;code&gt;try&lt;/code&gt; that writes the error to the status line.&lt;/p&gt;

&lt;h2&gt;
  
  
  How fast it really is
&lt;/h2&gt;

&lt;p&gt;In mid-August, with the engine's own work already under 25 ms per frame and the camera delivering 30, I measured three phones: 15 fps on the Pixel 8 Pro, 14 on the A56, 5 on a Galaxy S21. The next day, with the new model and the loop moved entirely onto the GPU, the Pixel 8 Pro went up to 22 fps, with 10 ms segmentation and a mask present on 398 frames out of 398.&lt;/p&gt;

&lt;p&gt;The ceiling, though, is no longer the engine: it is compositing the WebView inside Flutter. On the Galaxy S21 about 180 ms per frame remain that do not show up in any of my measurements. I tried and ruled out the rounded clipping of the mirror; the next suspect is the composition mode of &lt;code&gt;webview_flutter&lt;/code&gt; on Android. It is the cost of the architecture I picked at the start, and I would rather write it down than hide it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The telemetry I did not expect
&lt;/h2&gt;

&lt;p&gt;"No frame leaves the phone" has always been true: segmentation and colour run locally. In the early versions, though, MediaPipe, the model and the fonts were fetched from jsDelivr and Google on every launch; in August I bundled all of them into the app, about 39 MB more, and since then none of those files comes from outside. Then, watching the network from a headless Chromium, I found that MediaPipe's bundle, 60 seconds after the segmenter is created, sends a &lt;code&gt;POST&lt;/code&gt; to &lt;code&gt;odml.pa.googleapis.com/v1/log&lt;/code&gt; with an API key assembled at runtime. About 90 bytes of protobuf with version, delegate and counters, no image. It fires even if you never start the camera, and Google answers 200. Grepping the sources for it is pointless: the key never appears in plain text.&lt;/p&gt;

&lt;p&gt;I did not patch the minified bundle, because a surgical edit to third-party code disappears on the first update. I closed it with a &lt;code&gt;Content-Security-Policy&lt;/code&gt; served by the same loopback server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;connect-src 'self';
script-src 'self' 'wasm-unsafe-eval';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;connect-src 'self'&lt;/code&gt; takes away the engine's permission to talk to anything that is not the local server. &lt;code&gt;'wasm-unsafe-eval'&lt;/code&gt; is required, without it MediaPipe cannot compile its WASM; &lt;code&gt;'unsafe-eval'&lt;/code&gt; is not. Measured over 200 seconds, three flush windows: the request fires at +60 seconds, the browser blocks it, outbound connections stay at zero. Since a missing header breaks nothing you can see, there is a test (&lt;code&gt;csp_test.dart&lt;/code&gt;) that queries the real server and checks the response.&lt;/p&gt;

&lt;p&gt;For completeness: the app does have the &lt;code&gt;INTERNET&lt;/code&gt; permission, because the salon directory, the map and the demo request form need it. The promise is about the colour engine, and the engine has no way out.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I take away
&lt;/h2&gt;

&lt;p&gt;Two things. First, "on-device" is not a property of an architecture, it is a property you measure: I had a fully local engine and a library phoning home, and I only noticed by watching the traffic. Second, the worst bugs in a video engine are not the ones that break it but the ones that make it feel slightly off: a flicker, a lag, a breath. Each had a precise cause, and none was the one I would have guessed.&lt;/p&gt;

&lt;p&gt;If you run a salon and want to see how it works there, it is all on &lt;a href="https://miraviso.it" rel="noopener noreferrer"&gt;miraviso.it&lt;/a&gt;. If you have a product with this kind of problem (on-device vision, Flutter, data that must not leave) I am happy to talk: &lt;a href="https://gabrielepieretti.dev/consulting/" rel="noopener noreferrer"&gt;this is how I work&lt;/a&gt;, and here is the &lt;a href="https://gabrielepieretti.dev/consulting/cases/miraviso/" rel="noopener noreferrer"&gt;Miraviso case study&lt;/a&gt;. I also wrote about the same engine in &lt;a href="https://gabrielepieretti.dev/blog-en/when-you-dont-need-an-llm/" rel="noopener noreferrer"&gt;when you don't need an LLM&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://gabrielepieretti.dev/blog-en/live-hair-color-try-on-on-device/" rel="noopener noreferrer"&gt;gabrielepieretti.dev&lt;/a&gt;. I write about Laravel, privacy-by-design and building a vertical B2B SaaS solo, &lt;a href="https://gabrielepieretti.dev/blog-en/" rel="noopener noreferrer"&gt;more here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>android</category>
      <category>privacy</category>
      <category>webgl</category>
    </item>
    <item>
      <title>Google Reviews: One Link, a QR Code and an NFC Card at the Till</title>
      <dc:creator>Gabriele Pieretti</dc:creator>
      <pubDate>Wed, 11 Nov 2026 16:32:52 +0000</pubDate>
      <link>https://dev.to/gabbrowick/google-reviews-one-link-a-qr-code-and-an-nfc-card-at-the-till-47h9</link>
      <guid>https://dev.to/gabbrowick/google-reviews-one-link-a-qr-code-and-an-nfc-card-at-the-till-47h9</guid>
      <description>&lt;p&gt;A happy customer leaves and says "I'll write you a review". Then they get home, open Google, search for the business name, find three similar listings, can't work out where to write and give up. Every extra step costs you a review. In LocalProAI I built a page that removes almost all of those steps.&lt;/p&gt;

&lt;h2&gt;
  
  
  A link that opens the review window directly
&lt;/h2&gt;

&lt;p&gt;Google has an address that goes straight to the "Write a review" window of one specific listing. Whoever opens it sees the stars to tap and the box to write in. They don't have to search, and they can't pick the wrong business.&lt;/p&gt;

&lt;p&gt;To build it you need the code Google gives every listing, the Place ID. Owners usually don't know it exists, and they shouldn't have to. LocalProAI takes it from the connected Google Business Profile, or from the listing found when the business signed up. If it is missing, the panel says so plainly with a "Write to us" button, and we set it from the admin side.&lt;/p&gt;

&lt;p&gt;In the panel, under &lt;strong&gt;Reviews &amp;gt; Link, QR and NFC card&lt;/strong&gt;, the link is ready with two buttons: "Copy link" and "Try it". You can paste it in a booking confirmation, at the bottom of an email or in your signature.&lt;/p&gt;

&lt;h2&gt;
  
  
  The QR code to print
&lt;/h2&gt;

&lt;p&gt;The same page has the QR code for the link, generated by the LocalProAI server with no external service. You can download it as a 1000-pixel PNG, which is enough to print on an A5 sheet, or as an SVG if you are handing it to a print shop.&lt;/p&gt;

&lt;p&gt;There is also a card that is already laid out: press "Print" and only the card comes out of the printer, without menus or the rest of the page. It works on the counter, next to the card reader, on a table or in the window. The customer scans it with their phone while waiting for change or for their coffee.&lt;/p&gt;

&lt;h2&gt;
  
  
  The NFC card at the till
&lt;/h2&gt;

&lt;p&gt;A QR code asks the customer to open the camera and frame it. An NFC card is quicker still: they hold their phone against the card and the link opens. Blank NFC cards are cheap and you write them with your phone, once.&lt;/p&gt;

&lt;p&gt;The page has a step-by-step guide (the panel is in Italian, so the button names are too):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;install NFC Tools, a free app for iPhone and Android;&lt;/li&gt;
&lt;li&gt;open "Write", then "Add a record", choose "URL / URI" and paste the link copied from the panel;&lt;/li&gt;
&lt;li&gt;tap "Write" and hold the card against the back of the phone until the app confirms;&lt;/li&gt;
&lt;li&gt;test the card with an iPhone and with an Android phone;&lt;/li&gt;
&lt;li&gt;only after the test, under "Other", choose "Lock tag".&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That last step matters. An unlocked card can be rewritten by anyone with an NFC phone, even with an address that has nothing to do with you. Once it is locked, nobody can change the link. The lock can't be undone, though, so do it after checking that the card works.&lt;/p&gt;

&lt;h2&gt;
  
  
  Google's rules, written on the page
&lt;/h2&gt;

&lt;p&gt;Google forbids two things that many owners do in good faith, and I put both in a box on the page where you can't miss them.&lt;/p&gt;

&lt;p&gt;First: no rewards in exchange for a review. A discount, a free coffee, an entry into a prize draw. Even a small gift makes the review break the rules, and Google can remove it.&lt;/p&gt;

&lt;p&gt;Second: you ask everyone for a review, not only the happy customers. Asking only the person who has just paid you a compliment looks clever, but Google's rules forbid it. In practice the card on the counter and the NFC card at the till solve this on their own, because they are there for anyone.&lt;/p&gt;

&lt;p&gt;Once reviews come in, they need an answer, negative ones included. The LocalProAI site has a guide (in Italian) on &lt;a href="https://localproai.it/guide/come-ottenere-piu-recensioni-google" rel="noopener noreferrer"&gt;how to get more Google reviews&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Each business sees only its own link
&lt;/h2&gt;

&lt;p&gt;LocalProAI hosts many businesses on the same system. The link and the QR code are always worked out for the business the owner is logged in to, and there is no parameter in the address you could change to see someone else's. The QR code is also never cached in the browser, so an owner who runs two businesses from the same computer won't print the wrong one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I worked on this
&lt;/h2&gt;

&lt;p&gt;Reviews matter for how a business shows up on the Google map, and they can matter for what assistants like ChatGPT answer when someone asks for a recommendation. I wrote about that when I described &lt;a href="https://gabrielepieretti.dev/blog-en/ai-assistants-recommend-local-business/" rel="noopener noreferrer"&gt;how I check every week whether ChatGPT recommends a business&lt;/a&gt;. The most honest way to get more of them is to make them easy to leave, for every customer, while they are still there.&lt;/p&gt;

&lt;p&gt;If you run a small business and want more Google reviews without chasing customers, we can look together at your profile, the link to use and where to put the QR code and the card in your shop, on a &lt;a href="https://gabrielepieretti.dev/consulting/?da=google-review-link-qr-nfc-card&amp;amp;utm_source=devto&amp;amp;utm_medium=referral#call" rel="noopener noreferrer"&gt;free 30-minute call&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://gabrielepieretti.dev/blog-en/google-review-link-qr-nfc-card/" rel="noopener noreferrer"&gt;gabrielepieretti.dev&lt;/a&gt;. I write about software for small businesses, Laravel, FastAPI and privacy-by-design. &lt;a href="https://gabrielepieretti.dev/blog-en/" rel="noopener noreferrer"&gt;More here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>smallbusiness</category>
      <category>seo</category>
      <category>google</category>
      <category>laravel</category>
    </item>
    <item>
      <title>Your Client Brings a Haircut Photo: How I Try It on Her Own Face</title>
      <dc:creator>Gabriele Pieretti</dc:creator>
      <pubDate>Wed, 11 Nov 2026 16:32:48 +0000</pubDate>
      <link>https://dev.to/gabbrowick/your-client-brings-a-haircut-photo-how-i-try-it-on-her-own-face-3o89</link>
      <guid>https://dev.to/gabbrowick/your-client-brings-a-haircut-photo-how-i-try-it-on-her-own-face-3o89</guid>
      <description>&lt;p&gt;The client sits down, takes out her phone and shows a photo: "I'd like this." The photo shows someone else, with a different face, a different colour and often a different hair type. The stylist's job is to work out which parts of that photo can actually go on her. With Miraviso I wanted the tablet to reason the same way.&lt;/p&gt;

&lt;p&gt;In the &lt;a href="https://gabrielepieretti.dev/blog-en/hair-colour-consultation-tablet-preview/" rel="noopener noreferrer"&gt;colour consultation&lt;/a&gt; the look is built with a few taps, using the words of the trade. The inspiration photo is another way in: you load it on the tablet next to the client's photo and ask for a preview. It sounds simple. The hard part is deciding what to take from the photo and what to leave as it is.&lt;/p&gt;

&lt;h2&gt;
  
  
  From the photo you take the cut
&lt;/h2&gt;

&lt;p&gt;When a client shows a photo, she is nearly always talking about the cut: the length, the shape, the fringe, the layers. The model's colour is a detail she often hasn't even noticed, and sometimes it wouldn't suit her.&lt;/p&gt;

&lt;p&gt;So if the stylist doesn't pick a colour, Miraviso takes only the cut, length, shape and styling from the inspiration photo. The colour stays the one the client has now, including grey and white hair, roots and natural highlights, in the same amount and in the same places.&lt;/p&gt;

&lt;p&gt;I was strict about the grey hair. A woman who has it and wants to keep it needs to see herself with the new cut and with her own grey. If the preview takes ten years off her with an even brown, it stops being useful, because it is showing her someone else.&lt;/p&gt;

&lt;h2&gt;
  
  
  If you pick the colour, the colour is yours
&lt;/h2&gt;

&lt;p&gt;The opposite case happens too: the client wants the cut from the photo plus a new colour. The stylist picks the technique and the shade from the buttons, or frames the swatch from the colour chart with the camera. In that case the inspiration photo still provides only the cut, and the colour comes from the stylist's request or from the swatch.&lt;/p&gt;

&lt;p&gt;This rule came from the salon floor. In one session the client had picked a bright red, and the inspiration photo showed a blonde girl: the preview came out blonde. Now the two sources have separate jobs. The photo suggests the shape, and the colour is decided by the person who knows the hair in front of them.&lt;/p&gt;

&lt;h2&gt;
  
  
  The styling, with the same intensity
&lt;/h2&gt;

&lt;p&gt;Styling is the delicate part. If the model has wavy hair and the client's is straight, the preview should show her with waves, because that is often exactly what she liked in the photo. The risk is overdoing it: a soft wave turning into tight curls on someone who has never had them.&lt;/p&gt;

&lt;p&gt;The rule I wrote is this: follow the styling of the photo, with the same intensity. Soft waves stay soft waves. If the stylist wants something different, they ask for it with a styling button or by voice, and their request wins over the photo.&lt;/p&gt;

&lt;h2&gt;
  
  
  What about the beard?
&lt;/h2&gt;

&lt;p&gt;Not only women sit in the chair. In one session a man with salt-and-pepper hair had asked only for the cut from a photo. In the preview his hair had turned dark brown, and his beard darker, thicker and more even. For a haircut preview that was far too much.&lt;/p&gt;

&lt;p&gt;Now the app explicitly asks to leave beard and moustache as they are: same colour, grey included, same shape and length. A chosen colour goes to the hair only. With an inspiration photo alone, though, the beard still sometimes comes out a little darker. I'm working on it, and meanwhile the stylist looks at the preview before showing it to the client. If the client wants to try a different beard as well, you ask for it explicitly.&lt;/p&gt;

&lt;h2&gt;
  
  
  The model's face is never copied
&lt;/h2&gt;

&lt;p&gt;The inspiration photo shows a real person, and her face must not end up on the client. The preview uses that photo only as a reference for the hair. Features, make-up, expression, skin: all of it stays the client's. When she looks at the preview she should see herself with a new cut, not a resemblance to the model.&lt;/p&gt;

&lt;p&gt;Everything else follows the rules I already described for the consultation. Without the client's consent the preview does not start. To generate it, the photos go through Gemini on servers in Europe, stay in memory only for as long as needed and are never written to disk. Every image carries the label "AI-generated preview".&lt;/p&gt;

&lt;h2&gt;
  
  
  The history keeps the photo you used
&lt;/h2&gt;

&lt;p&gt;Every attempt goes into the consultation history together with its recipe, and now also with the inspiration photo that produced it. When the client says "I liked the one before", the stylist can see straight away which photo it started from and with which choices. You pick up from there without rebuilding it from memory.&lt;/p&gt;

&lt;h2&gt;
  
  
  What changes for the salon
&lt;/h2&gt;

&lt;p&gt;The photo a client brings is a great way to start the conversation and a poor contract. Showing her the cut on herself straight away, with her own colour and her own hair, makes it easier to say calmly what can be done and what can't. If the fringe in the photo doesn't suit her face, you both see it on the screen, and the stylist doesn't have to argue the point.&lt;/p&gt;

&lt;p&gt;If you work in a salon and want to handle this moment better, the Miraviso site has a practical guide (in Italian) on &lt;a href="https://miraviso.it/guide/mostrare-taglio-prima" rel="noopener noreferrer"&gt;how to show a cut before you do it&lt;/a&gt;, with or without a tablet.&lt;/p&gt;

&lt;p&gt;If your app or business software handles client photos or personal data and you want to check where those photos go, who sees them and how long they are kept, we can look at it together on a &lt;a href="https://gabrielepieretti.dev/consulting/?da=inspiration-photo-haircut-preview&amp;amp;utm_source=devto&amp;amp;utm_medium=referral#call" rel="noopener noreferrer"&gt;free 30-minute call&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://gabrielepieretti.dev/blog-en/inspiration-photo-haircut-preview/" rel="noopener noreferrer"&gt;gabrielepieretti.dev&lt;/a&gt;. I write about software for small businesses, Laravel, FastAPI and privacy-by-design. &lt;a href="https://gabrielepieretti.dev/blog-en/" rel="noopener noreferrer"&gt;More here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>privacy</category>
      <category>smallbusiness</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Hair Colour Consultation: the Client Sees the Result on the Tablet Before You Start</title>
      <dc:creator>Gabriele Pieretti</dc:creator>
      <pubDate>Wed, 04 Nov 2026 20:31:15 +0000</pubDate>
      <link>https://dev.to/gabbrowick/hair-colour-consultation-the-client-sees-the-result-on-the-tablet-before-you-start-243c</link>
      <guid>https://dev.to/gabbrowick/hair-colour-consultation-the-client-sees-the-result-on-the-tablet-before-you-start-243c</guid>
      <description>&lt;p&gt;"I'd like it a bit warmer, but not too much." Anyone who works in a salon knows what that sentence is worth: nothing. The client has one picture in her head, the stylist has another, and the gap only shows up afterwards, in the mirror. With &lt;a href="https://miraviso.it/" rel="noopener noreferrer"&gt;Miraviso&lt;/a&gt; I have been working to make that gap visible before you start, on a tablet, with the client still in the chair.&lt;/p&gt;

&lt;p&gt;In an earlier article I described the &lt;a href="https://gabrielepieretti.dev/blog-en/live-hair-color-try-on-on-device/" rel="noopener noreferrer"&gt;live hair colour try-on&lt;/a&gt;, which colours the hair in the camera view and runs entirely on the device. This is something else: a proper consultation, step by step, that starts from a photo of the client and builds the look using the words of the trade.&lt;/p&gt;

&lt;h2&gt;
  
  
  You talk like in the salon, not like to an app
&lt;/h2&gt;

&lt;p&gt;The tablet does not ask anyone to type. The stylist taps buttons grouped as &lt;strong&gt;Cut, Styling, Technique, Tone, Touch-ups&lt;/strong&gt; and, for those who use it, &lt;strong&gt;Colour analysis&lt;/strong&gt;. Inside are everyday words: balayage, shatush, babylights, airtouch for techniques; shades for colour; and touch-ups like "Warmer", "Cooler" or "Darker roots".&lt;/p&gt;

&lt;p&gt;The starting catalogue is already rich (techniques and tones alone add up to more than thirty entries), but every salon adapts it: it can switch off what it does not offer, rename entries to match what it calls them at the chair, and add its own. If your salon calls "honey blonde" something else, the tablet shows it under that name.&lt;/p&gt;

&lt;p&gt;There is also a button people really like: &lt;strong&gt;"Like the swatch"&lt;/strong&gt;. The stylist points the camera at the swatch from the colour chart that the client picked, and that colour goes into the preview. No trade names to interpret: it is the swatch the client actually touched.&lt;/p&gt;

&lt;h2&gt;
  
  
  All over or only the strands
&lt;/h2&gt;

&lt;p&gt;This part came from a real test. At the end of September a salon owner used the tablet with real clients and pointed out something I had missed as a developer: the same colour changes everything depending on where it goes. A warm brown all over and a warm brown only on the strands of a balayage are two different results.&lt;/p&gt;

&lt;p&gt;So now there is a simple switch, &lt;strong&gt;"The colour goes on"&lt;/strong&gt;, with two options: &lt;em&gt;all over&lt;/em&gt; or &lt;em&gt;strands only&lt;/em&gt;. When the stylist picks a technique that works on strands, the tablet switches to "strands only" by itself, because that is almost always what is needed. But if the stylist changes it by hand, the tablet respects that choice and does not quietly undo it. A small label on screen always shows what is being tried: "Base" or "Strands", with the colour name.&lt;/p&gt;

&lt;h2&gt;
  
  
  A history of previews, like at the chair
&lt;/h2&gt;

&lt;p&gt;Each preview takes about thirty seconds, and the tablet says so clearly while it works. The result is shown full screen; holding a finger down brings back the original, and letting go shows the preview again. It is the most natural way to compare.&lt;/p&gt;

&lt;p&gt;Previews line up in a &lt;strong&gt;history&lt;/strong&gt; that always starts with "Her now": the starting photo. From there you can move on in two ways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;start over&lt;/strong&gt;, applying the whole recipe again to the original photo (useful when several things change at once);&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;adjust this photo&lt;/strong&gt;, starting from the latest preview and changing a single detail, for example "a bit cooler".&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the client says "the one before was better", you tap the one before and continue from there: the history opens a new branch without losing the other previews. That is how people actually reason at the chair, trying and stepping back.&lt;/p&gt;

&lt;p&gt;For undecided clients there is the &lt;strong&gt;warm and cool&lt;/strong&gt; comparison: both versions start together and arrive side by side, again in about thirty seconds. The choice is often made right there, in a few moments, looking at the two images next to each other. The Miraviso site has a practical guide on exactly this situation, in Italian: &lt;a href="https://miraviso.it/guide/cliente-indecisa-colore" rel="noopener noreferrer"&gt;the client who can't decide on a colour&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;At the end, the before and after can be replayed with a wipe animation, built directly on the tablet.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part where I made no compromises
&lt;/h2&gt;

&lt;p&gt;This is a person's face, and it has to be treated accordingly. To generate the preview the photo goes through a Google model (Gemini) running on servers in Europe, not on the generic worldwide ones. I say it openly because it is different from the live try-on, which never leaves the device.&lt;/p&gt;

&lt;p&gt;The rules are these:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;without the client's consent the consultation does not start&lt;/strong&gt;: the server refuses the request, it is not just a notice on screen;&lt;/li&gt;
&lt;li&gt;on the server the photo &lt;strong&gt;stays only in memory&lt;/strong&gt; while the preview is generated, it is not written to disk;&lt;/li&gt;
&lt;li&gt;the preview history &lt;strong&gt;lives on the tablet&lt;/strong&gt;, not on the server; the look is saved to the client record only if the client has also agreed to photos being kept;&lt;/li&gt;
&lt;li&gt;every image carries the label &lt;strong&gt;"AI-generated preview"&lt;/strong&gt;, as required by the EU rules on artificial intelligence: the client must know it is a simulation, not a promise.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That last point matters for the salon too. A preview helps people understand each other, it does not guarantee the result: the starting base, the condition of the hair and the stylist's hand still decide, and the label says so without having to explain it every time.&lt;/p&gt;

&lt;h2&gt;
  
  
  What changes for the salon
&lt;/h2&gt;

&lt;p&gt;The value is not in the technology, it is in the conversation. A consultation where the client sees three or four variations and picks the one she likes is one where you understand each other earlier, and where suggesting an extra service gets easier, because she sees it on herself instead of imagining it.&lt;/p&gt;

&lt;p&gt;If you work in a salon and want to handle this moment better, even without a tablet, the Miraviso site has &lt;a href="https://miraviso.it/guide" rel="noopener noreferrer"&gt;practical guides&lt;/a&gt; (in Italian) written for the chair, starting with the &lt;a href="https://miraviso.it/guide/consulenza-colore-domande" rel="noopener noreferrer"&gt;questions to ask in a colour consultation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If your app or business software handles client photos or personal data and you want to check where that data goes and which consents you need, we can look at it together on a &lt;a href="https://gabrielepieretti.dev/consulting/?da=hair-colour-consultation-tablet-preview&amp;amp;utm_source=devto&amp;amp;utm_medium=referral#call" rel="noopener noreferrer"&gt;free 30-minute call&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://gabrielepieretti.dev/blog-en/hair-colour-consultation-tablet-preview/" rel="noopener noreferrer"&gt;gabrielepieretti.dev&lt;/a&gt;. I write about software for small businesses, Laravel, FastAPI and privacy-by-design. &lt;a href="https://gabrielepieretti.dev/blog-en/" rel="noopener noreferrer"&gt;More here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>privacy</category>
      <category>flutter</category>
      <category>smallbusiness</category>
    </item>
    <item>
      <title>Does ChatGPT Recommend Your Business? How I Check Every Week</title>
      <dc:creator>Gabriele Pieretti</dc:creator>
      <pubDate>Wed, 04 Nov 2026 20:31:15 +0000</pubDate>
      <link>https://dev.to/gabbrowick/does-chatgpt-recommend-your-business-how-i-check-every-week-38c1</link>
      <guid>https://dev.to/gabbrowick/does-chatgpt-recommend-your-business-how-i-check-every-week-38c1</guid>
      <description>&lt;p&gt;Someone arrives in a new town and, instead of opening Google Maps, asks ChatGPT: "Which body shop can I trust in Montecatini?". They get three or four names, each with a couple of lines of explanation. If your business is not on that list, for that customer it does not exist. And you never find out, because nobody sends you a notification.&lt;/p&gt;

&lt;p&gt;On Google you can at least search for yourself and see where you rank. With AI assistants it is harder: the answer changes from one day to the next, from one assistant to another, and with the way the question is phrased. That is why in &lt;a href="https://localproai.it/" rel="noopener noreferrer"&gt;LocalProAI&lt;/a&gt; I built a check that runs on its own every Monday morning. Here is how it works, because the choices behind it are useful even if you never use it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The right questions for each kind of business
&lt;/h2&gt;

&lt;p&gt;The first mistake would be asking everyone the same question. People looking for a dentist do not ask what people looking for a pizzeria ask. So the questions are written by hand, per type of business, in the words a customer would use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;pizzeria&lt;/strong&gt;: "What is the best pizzeria in Pistoia?", but also "Pizzeria open on Sunday evening in Pistoia?" and "Best pizzeria with home delivery in Pistoia?";&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;hair salon&lt;/strong&gt;: "How much does a blow-dry cost in Lucca?", "Where can I get a good hair colour in Lucca?";&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;garage and body shop&lt;/strong&gt;: "Who do I call for roadside assistance in Prato?", "Where can I get hail damage on my car repaired in Prato?";&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;dentist&lt;/strong&gt;: "Emergency dentist in Livorno: who do I call?".&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Today there are seven categories: pizzeria, restaurant, hair salon, gym, dentist, medical practice and garage. Each one has between four and eight questions. The questions include the town, the neighbourhood if the business has set one, the dish or service it is known for and, for medical practices, the specialty. If a piece of information is missing, the question that needs it is skipped instead of being asked halfway.&lt;/p&gt;

&lt;p&gt;For doctors and dentists there is a note I also wrote into the code: these are questions patients ask, not advertising for the practice. The rules on healthcare advertising apply to what the practice publishes, and in fact the texts the system prepares later (I will get there) follow different rules.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three assistants, not one
&lt;/h2&gt;

&lt;p&gt;Every question goes to three assistants with web search turned on: Perplexity, OpenAI (the company behind ChatGPT) and Google's Gemini. One alone would give a partial picture: it is common for a business to show up on one and not on the others.&lt;/p&gt;

&lt;p&gt;One thing needs saying clearly: this is not the ChatGPT app on your phone. It is the same providers queried automatically, with web search on. The answers can differ a little from what a customer sees, since they may have a chat history or phrase the question differently. The check is there to show the trend week after week, not to capture the exact answer every single person will get.&lt;/p&gt;

&lt;h2&gt;
  
  
  What gets recorded in each answer
&lt;/h2&gt;

&lt;p&gt;For every answer the system notes four things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;whether the business is mentioned&lt;/strong&gt;, looking for the name and its variants: "Pizzeria Da Mario" must be recognised even when the answer just says "Da Mario";&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;in which position&lt;/strong&gt;: first on the list or fourth makes a real difference;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;in what tone&lt;/strong&gt;: "renowned", "recommended" or "avoid", "overrated";&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;who else is named&lt;/strong&gt;, meaning the competitors the assistant suggests instead of you, and the sources it says it read.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I do not use another AI model to read the answers. These assistants almost always reply with numbered lists and names in bold, and a few handwritten rules are enough to pick them out. Having a second AI re-read every answer would triple the cost of the check with no real benefit. It is the same reasoning I described in &lt;a href="https://gabrielepieretti.dev/blog-en/when-you-dont-need-an-llm/" rel="noopener noreferrer"&gt;when you don't need an LLM&lt;/a&gt;: the big model goes where it is needed, not everywhere.&lt;/p&gt;

&lt;h2&gt;
  
  
  From numbers to action
&lt;/h2&gt;

&lt;p&gt;A chart going down without telling you what to do is not much use. So two and a half hours after the check, a second step looks at the last two weeks and searches for three situations:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;a question where the business &lt;strong&gt;never appears&lt;/strong&gt;, on any assistant;&lt;/li&gt;
&lt;li&gt;a question where it appears, but &lt;strong&gt;on average fourth or lower&lt;/strong&gt;;&lt;/li&gt;
&lt;li&gt;the &lt;strong&gt;same competitor&lt;/strong&gt; named in its place on at least three different questions.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For the most serious cases the system drafts an article for the business's website and a few FAQs, written to answer exactly that question, with the business name and a concrete fact at the start of each section. That is the kind of sentence assistants like to pick up.&lt;/p&gt;

&lt;p&gt;There are three brakes, on purpose:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;at most two actions a week&lt;/strong&gt; per business: a few good pieces beat a website full of similar texts;&lt;/li&gt;
&lt;li&gt;if a question was already worked on in the &lt;strong&gt;last 60 days&lt;/strong&gt;, the same article is not rewritten every Monday;&lt;/li&gt;
&lt;li&gt;the article stays &lt;strong&gt;in draft&lt;/strong&gt; until the owner reads it and approves it from the dashboard. It only goes out on its own if the owner chose automatic publishing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The owner gets a Telegram message explaining, in plain words, which question they were not being mentioned for and what has been prepared.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the owner sees
&lt;/h2&gt;

&lt;p&gt;The dashboard shows a summary of the last twelve weeks: how often the business was mentioned out of all questions, the average position, the week by week trend, the questions where it does best and worst, and the ten competitors named most often. For the most recent answers you can also see the sources the assistant used.&lt;/p&gt;

&lt;p&gt;The sources are often the most useful part. If assistants keep citing a local guide, a review site or a category directory where you are missing, you know where to work. And that work needs no technology: an up-to-date listing, consistent information everywhere, real reviews.&lt;/p&gt;

&lt;h2&gt;
  
  
  If you want to try it by hand
&lt;/h2&gt;

&lt;p&gt;Even without tools you can run a smaller version of this check:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;write five questions the way a customer would, with your town and your main service;&lt;/li&gt;
&lt;li&gt;ask them to ChatGPT, Perplexity and Gemini, in a private window or logged out;&lt;/li&gt;
&lt;li&gt;note whether you appear, in which position and who comes before you;&lt;/li&gt;
&lt;li&gt;look at the sources the assistant cites: those are the places where it pays to be present and accurate;&lt;/li&gt;
&lt;li&gt;repeat in a month with the same questions, worded the same way.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The last step is the one that matters. A single answer says little; the same question repeated over time tells you whether you are heading in the right direction.&lt;/p&gt;

&lt;p&gt;If you run a local business and want to know what ChatGPT, Perplexity and Gemini say when your customers ask about your kind of service, we can look at it together on a &lt;a href="https://gabrielepieretti.dev/consulting/?da=ai-assistants-recommend-local-business&amp;amp;utm_source=devto&amp;amp;utm_medium=referral#call" rel="noopener noreferrer"&gt;free 30-minute call&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://gabrielepieretti.dev/blog-en/ai-assistants-recommend-local-business/" rel="noopener noreferrer"&gt;gabrielepieretti.dev&lt;/a&gt;. I write about software for small businesses, Laravel, FastAPI and privacy-by-design. &lt;a href="https://gabrielepieretti.dev/blog-en/" rel="noopener noreferrer"&gt;More here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>seo</category>
      <category>smallbusiness</category>
      <category>localbusiness</category>
    </item>
    <item>
      <title>The Routine Update That Quietly Changes Your Software: Why You Need Tests That Notice</title>
      <dc:creator>Gabriele Pieretti</dc:creator>
      <pubDate>Mon, 02 Nov 2026 08:47:48 +0000</pubDate>
      <link>https://dev.to/gabbrowick/the-routine-update-that-quietly-changes-your-software-why-you-need-tests-that-notice-1dlc</link>
      <guid>https://dev.to/gabbrowick/the-routine-update-that-quietly-changes-your-software-why-you-need-tests-that-notice-1dlc</guid>
      <description>&lt;p&gt;Every piece of software your business runs on is built on dozens of parts written by other people. Now and then those parts need an update, usually to close a security hole. The program restarts, the pages open, nobody sees an error. And sometimes a rule that used to work has stopped working. Without telling anyone.&lt;/p&gt;

&lt;p&gt;It has happened to me more than once, on my own projects. Better that an automated test notices first, before an angry customer does. Here is what that means in plain words, and what to ask whoever builds your software.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why you can't stop updating
&lt;/h2&gt;

&lt;p&gt;A management system, a website with a customer area or a custom app is not only your supplier's code. It uses ready-made components: the one that reads uploaded files, the one that sends emails, the one that talks to the database. Think of them as spare parts in a car. The mechanic doesn't build the brakes, he fits them.&lt;/p&gt;

&lt;p&gt;When a hole is found in one of those parts, a fixed version comes out. Staying on the old one means leaving open a door everybody now knows about. So you update, and that's fine. The question is what happens next.&lt;/p&gt;

&lt;h2&gt;
  
  
  How an update changes the rules without an error
&lt;/h2&gt;

&lt;p&gt;Take a made-up but realistic example. An online shop gives a 10% discount only to newsletter subscribers. The rule lives in a setting of an external component, the one that handles the cart.&lt;/p&gt;

&lt;p&gt;A security update comes out and the supplier installs it. In the new version that setting has a different name. The shop's code still uses the old name, and the component simply ignores it. No error message, no blank page. The shop keeps selling.&lt;/p&gt;

&lt;p&gt;Except now everyone gets the discount. Or nobody does, and subscribers start writing to support. In the first case you find out when you look at the margins at the end of the month. In the second, when someone has already complained.&lt;/p&gt;

&lt;p&gt;In an app that handles photos or health data, the rule that stops working can be a data protection rule. Then it is no longer about margins. It is about what you promised your customers.&lt;/p&gt;

&lt;h2&gt;
  
  
  What an automated test is, without jargon
&lt;/h2&gt;

&lt;p&gt;An automated test is a check written once and repeated by the computer every time something changes. For the discount it would read roughly like this: "a customer who isn't subscribed puts a 100 euro product in the cart, the total must be 100; a subscribed customer does the same, the total must be 90".&lt;/p&gt;

&lt;p&gt;It takes a few seconds to run. The supplier runs it before every update. If the total is wrong, the test turns red and the update doesn't go live until someone understands why.&lt;/p&gt;

&lt;p&gt;That is where the value is. The test checks behaviour, meaning what the customer sees, and not the code. The code can look exactly as before and do something else.&lt;/p&gt;

&lt;h2&gt;
  
  
  The test that always says yes
&lt;/h2&gt;

&lt;p&gt;There is a little-known trap. A test can stop checking and still pass. Picture a check that must confirm every private page asks for a password. After an update, the check no longer finds any page to look at. Zero pages checked, zero problems found: green.&lt;/p&gt;

&lt;p&gt;That is why a good supplier also checks the opposite. They remove the rule on purpose and watch the test turn red. A test you have never seen fail is a test you can't trust.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to ask your supplier
&lt;/h2&gt;

&lt;p&gt;You don't need to code to ask these questions. They tell you whether the software you pay for is kept under control or whether everyone is hoping for the best.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Are there automated tests on the rules that involve money or data?&lt;/strong&gt; Prices, discounts, permissions, deadlines, privacy. Start with whatever is expensive when it breaks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Who watches the external components, and how often?&lt;/strong&gt; There are tools that flag known holes in the parts you use. Ask whether they run and who reads the warnings.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What happens after an update?&lt;/strong&gt; The right answer is "the tests run, and if one is red we don't release". The answer to dig into is "we click around a bit by hand".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Has a test ever stopped an update?&lt;/strong&gt; If yes, that's a good sign: the tests are actually checking something.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;If you change supplier, do the tests stay?&lt;/strong&gt; They are part of the project you pay for. They belong in your repository, next to the code.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Writing tests takes time, so money. You don't do it for everything. In an average management system the truly delicate rules are a few dozen. One test each takes a few hours, and then it works for free for years.&lt;/p&gt;

&lt;p&gt;The other side of the sum is what a wrong discount costs you for a month, a customer who can't log in, or a privacy promise that is no longer kept while nobody knows.&lt;/p&gt;

&lt;h2&gt;
  
  
  For the technical reader
&lt;/h2&gt;

&lt;p&gt;Both traps share a shape: the line of code is still there, and it no longer does anything. Nothing below is tied to one framework; I have seen it in Python, and the same holds in PHP or JavaScript.&lt;/p&gt;

&lt;h3&gt;
  
  
  A setting under a name nobody reads
&lt;/h3&gt;

&lt;p&gt;Many libraries are configured by assigning a class attribute at startup. If a new version renames that attribute, Python does not complain about the old name: assigning an attribute that does not exist on a class simply creates it.&lt;/p&gt;

&lt;p&gt;The app starts, every test that only checks "does it run" stays green, and the library quietly falls back to its default. The defence is a test that reads the value back under the current name and fails loudly if the name moves again.&lt;/p&gt;

&lt;p&gt;It looks redundant next to a behavioural test. It is not: when it fails it tells you exactly what broke, and if the attribute is renamed once more, the &lt;code&gt;AttributeError&lt;/code&gt; shows up in CI instead of in production. Keep a behavioural test as well, because the setting is only a means.&lt;/p&gt;

&lt;h3&gt;
  
  
  A loop over an empty list
&lt;/h3&gt;

&lt;p&gt;Tests that walk every route, file or table are handy: nobody has to remember the route added next week. But a framework release can change how mounted routers appear in the route list. After that, the filter finds zero items, the loop runs zero times, and the test is green.&lt;/p&gt;

&lt;p&gt;One check that the list is not empty, placed before the loop, turns a silent no-op into a red test.&lt;/p&gt;

&lt;h3&gt;
  
  
  Habits that catch both
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Run the dependency audit inside the test suite, so the warning lands next to the results and the upgrade starts from there.&lt;/li&gt;
&lt;li&gt;Before trusting a guard test, remove the guard and watch the test fail. A test you have never seen fail may be testing nothing.&lt;/li&gt;
&lt;li&gt;After a big version jump, read the release notes for renames, but don't rely on them: no changelog will tell you that your own test now loops over an empty list.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I have also written about security updates in the post on &lt;a href="https://gabrielepieretti.dev/blog-en/php-vulnerabilities-october-2026/" rel="noopener noreferrer"&gt;two critical PHP flaws in October&lt;/a&gt;, with the steps I followed on my own services. If you want to know how well the software you use is protected, or have one built with the right tests from day one, we can talk it through on a &lt;a href="https://gabrielepieretti.dev/consulting/?da=software-updates-need-tests&amp;amp;utm_source=devto&amp;amp;utm_medium=referral#call" rel="noopener noreferrer"&gt;free first call&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://gabrielepieretti.dev/blog-en/software-updates-need-tests/" rel="noopener noreferrer"&gt;gabrielepieretti.dev&lt;/a&gt;. I write about software for small businesses, Laravel, FastAPI and privacy-by-design. &lt;a href="https://gabrielepieretti.dev/blog-en/" rel="noopener noreferrer"&gt;More here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>testing</category>
      <category>python</category>
      <category>security</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Email Tracking Pixels in Italy: What to Do With Your Sending Tool After the Garante Guidelines</title>
      <dc:creator>Gabriele Pieretti</dc:creator>
      <pubDate>Fri, 30 Oct 2026 16:19:47 +0000</pubDate>
      <link>https://dev.to/gabbrowick/email-tracking-pixels-in-italy-what-to-do-with-your-sending-tool-after-the-garante-guidelines-2bn3</link>
      <guid>https://dev.to/gabbrowick/email-tracking-pixels-in-italy-what-to-do-with-your-sending-tool-after-the-garante-guidelines-2bn3</guid>
      <description>&lt;p&gt;In late October 2026, Italian banks, phone carriers and online platforms sent emails about "tracking pixels". The reason is a decision by the Garante, Italy's data protection authority, and the deadline to comply ran out on 29 October 2026. Almost none of those emails explain what the people who send email should do: a company with a newsletter, a CRM or business software that writes to customers.&lt;/p&gt;

&lt;p&gt;Here is the practical version, without the jargon. At the end there is a checklist to go through with your own sending tool.&lt;/p&gt;

&lt;h2&gt;
  
  
  What an email pixel is
&lt;/h2&gt;

&lt;p&gt;It is a tiny image, usually invisible, placed inside the email. When the recipient opens the message, their mail program downloads that image from the sender's server. At that moment the server learns that the email was opened, when, and often from which IP address and with which program or device.&lt;/p&gt;

&lt;p&gt;If every recipient gets a different pixel, the sender knows who opened, how many times and at what time. That is how open-rate statistics work in almost every newsletter tool. For many businesses it is just a number in the dashboard, and nobody ever decided to switch it on.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the Garante decided
&lt;/h2&gt;

&lt;p&gt;On 17 April 2026 the Garante adopted its &lt;a href="https://www.garanteprivacy.it/home/docweb/-/docweb-display/docweb/10241943" rel="noopener noreferrer"&gt;guidelines on the use of tracking pixels in email communications&lt;/a&gt; (doc. web no. 10241943, in Italian), published in the Italian Official Journal, General Series no. 98, on 29 April 2026. The deadline to comply was six months from publication: 29 October 2026. The Garante also has a &lt;a href="https://www.garanteprivacy.it/temi/tracking-pixel" rel="noopener noreferrer"&gt;summary page on the topic&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The legal basis is Article 122 of the Italian Privacy Code, the same rule that covers cookies (Article 5(3) of the ePrivacy Directive). The Garante also refers to the European Data Protection Board guidelines 2/2023. The principle is simple: reading or storing information on a person's device requires their consent, with a few exceptions. Without consent and without an exception, the pixel cannot be used.&lt;/p&gt;

&lt;p&gt;The rules apply to whoever sends the emails, and also to sending platforms and email service providers.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is allowed without consent
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Counting opens anonymously and in total.&lt;/strong&gt; Knowing how many emails in a campaign were opened overall, to check whether they land in the inbox or in spam. The pixel must be the same for the whole campaign, and the IP address and mail client must be anonymised. In practice: one number, not a list of people.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security tied to authentication.&lt;/strong&gt; Account activation emails, password changes, replies to requests about privacy rights.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mandatory service communications.&lt;/strong&gt; Contract changes, data breach notices, phishing warnings, deadlines.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What needs consent
&lt;/h3&gt;

&lt;p&gt;Measuring opens for each individual recipient to improve promotional campaigns, to decide how often to write to them, or to build a profile of them. In other words, the most common use of open statistics in commercial newsletters.&lt;/p&gt;

&lt;h3&gt;
  
  
  A privacy notice is always required
&lt;/h3&gt;

&lt;p&gt;This is the point many people miss. Any email that contains a pixel, including the ones allowed without consent, needs a privacy notice. It can be layered and it can also sit in the cookie policy. For mailings already under way, it is enough to give it in the first suitable message.&lt;/p&gt;

&lt;h3&gt;
  
  
  Consent for marketing
&lt;/h3&gt;

&lt;p&gt;For promotional emails, consent to the pixel can be part of the single marketing consent, as long as it is asked in a neutral way. But it must be possible to withdraw it on its own: every email needs a link or icon in the footer that leads to the recipient's preferences. People who refuse the pixel must not be penalised, for example they cannot lose the newsletter. And the choices must be recorded, so you can prove them.&lt;/p&gt;

&lt;p&gt;There is also a technical requirement: the pixel address must contain an identifier that is not readable and not sequential, never the recipient's email address.&lt;/p&gt;

&lt;h2&gt;
  
  
  The grey area: tracked links
&lt;/h2&gt;

&lt;p&gt;Besides the pixel, many tools rewrite every link in the email so it goes through their server first, which tells them who clicked what. The guidelines do not deal with click tracking explicitly. The mechanism is similar, though: an identifier per recipient that tells the sender what that person did. My own cautious view is to treat it with the same criteria as the pixel until there is more guidance. That is an opinion, not something the text says.&lt;/p&gt;

&lt;h2&gt;
  
  
  The checklist
&lt;/h2&gt;

&lt;p&gt;You do not need to know how to code. You need the dashboard of your sending tool, or half an hour with whoever runs it.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Find out whether open tracking is on.&lt;/strong&gt; In many tools it is a dashboard setting, sometimes in the options of each campaign, sometimes on by default. Check your CRM and business software too: if they send emails with open statistics, they use a pixel. If you cannot find the setting, ask the supplier in writing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;If you do not need it, switch it off.&lt;/strong&gt; If you only look at the total number of opens, ask whether the tool can give it to you in anonymous, aggregate form, or do without it. It is the simplest route.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;If you need it for marketing, sort out consent.&lt;/strong&gt; Consent asked in a neutral way, a notice that explains the pixel, a footer link in every email to change one's mind, no penalty for saying no, recorded choices. And check that the tool can exclude people who did not consent from tracking.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Transactional and service emails: privacy notice.&lt;/strong&gt; Order confirmations, reminders, invoices, password recovery. Even when the pixel is allowed without consent, the notice is required. Also ask yourself whether you really need the pixel in those emails.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check tracked links.&lt;/strong&gt; Look at a link in one of your emails: if it points to the sending tool's domain instead of your website, clicks are being tracked. Decide whether to keep it and on what basis.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Update your privacy notice and your record of processing.&lt;/strong&gt; The notice must say that you use the pixel, for what and on which basis. The record must list the processing, along with the sending platform provider. If a supplier adds the pixel, also check what your contract with them says.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If your tool builds the pixel address with the recipient's email inside it, pass that on to the supplier straight away: the guidelines ask for an identifier that means nothing to whoever reads it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it is worth doing
&lt;/h2&gt;

&lt;p&gt;It is not only about the rules. Per-recipient open statistics are already unreliable: several mail programs download images in advance or block them. Quite often you find out you were collecting personal data for a number nobody used to decide anything.&lt;/p&gt;

&lt;p&gt;I wrote about something similar, checking what the software you use actually does, in the post on &lt;a href="https://gabrielepieretti.dev/blog-en/software-updates-need-tests/" rel="noopener noreferrer"&gt;updates that quietly change your software&lt;/a&gt;. If you send newsletters or customer emails from your business software and want to understand what it tracks and what is worth changing, we can look at it together on a &lt;a href="https://gabrielepieretti.dev/consulting/?da=email-tracking-pixels-italy-garante&amp;amp;utm_source=devto&amp;amp;utm_medium=referral#call" rel="noopener noreferrer"&gt;free 30-minute call&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This post is a practical reading of the guidelines, not legal advice. For unclear cases, talk to your privacy advisor or DPO.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://gabrielepieretti.dev/blog-en/email-tracking-pixels-italy-garante/" rel="noopener noreferrer"&gt;gabrielepieretti.dev&lt;/a&gt;. I write about software for small businesses, Laravel, FastAPI and privacy-by-design. &lt;a href="https://gabrielepieretti.dev/blog-en/" rel="noopener noreferrer"&gt;More here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>privacy</category>
      <category>gdpr</category>
      <category>email</category>
      <category>smallbusiness</category>
    </item>
    <item>
      <title>A Free-Trial Rule Written Wrong in the Software: What to Check Before It Costs You Customers</title>
      <dc:creator>Gabriele Pieretti</dc:creator>
      <pubDate>Thu, 29 Oct 2026 18:47:49 +0000</pubDate>
      <link>https://dev.to/gabbrowick/a-free-trial-rule-written-wrong-in-the-software-what-to-check-before-it-costs-you-customers-ac3</link>
      <guid>https://dev.to/gabbrowick/a-free-trial-rule-written-wrong-in-the-software-what-to-check-before-it-costs-you-customers-ac3</guid>
      <description>&lt;p&gt;If you sell a subscription with a free trial, somewhere in the software there is a rule that decides how much a trial user can do. It looks like a trivial line. In my case that line was written with paying customers in mind, and a trial that spanned two months was worth double.&lt;/p&gt;

&lt;p&gt;I'm telling the story because the same mistake, turned the other way, blocks a customer halfway through the trial. And a blocked trial user doesn't call support. They close the tab and try your competitor.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happened
&lt;/h2&gt;

&lt;p&gt;Miraviso, the app I built for hair salons, had a 14-day free trial. Since 3 November 2026 the trial lasts 30 days, but the problem I describe does not depend on its length. During the trial there is a cap on haircut previews, because every preview has a cost that I pay.&lt;/p&gt;

&lt;p&gt;For subscribed salons the counter goes back to zero on the first of every month. That makes sense: they pay every month, every month they get their allowance. The problem was that the trial used the same rule. A salon that started its trial on 25 October finished it on 8 November. On 1 November the counter reset, and that salon got two full allowances instead of one.&lt;/p&gt;

&lt;p&gt;No customer was ever going to report it, of course. And no check was looking for it, because for subscribers the rule was right.&lt;/p&gt;

&lt;h2&gt;
  
  
  The same mistake, the other way round
&lt;/h2&gt;

&lt;p&gt;For me it cost a bit of margin. But a badly written trial rule can do worse damage, and I came close to doing some myself while fixing it.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The customer blocked on day five.&lt;/strong&gt; The cap is counted on the wrong basis, for example it adds usage from an earlier period. The customer is trying the product seriously, which makes them the best lead you have, and the software tells them they're done.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The demo account blocked forever.&lt;/strong&gt; I had a few trial salons with no end date, the ones I use for demos. With a single cap for the whole trial, sooner or later they would have stopped and never started again. I would have found out during a demo, in front of a salon owner.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The fix that slams the door.&lt;/strong&gt; On the day you correct the rule, there are people halfway through their trial. If the count changes overnight, someone finds themselves blocked without doing anything different from the day before.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The right number with the wrong label.&lt;/strong&gt; The salon dashboard said "previews this month" even for trial users. A customer who reads "month" and gets stopped after ten days thinks the software is broken.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why nobody notices
&lt;/h2&gt;

&lt;p&gt;Business rules in software are written once, at the start, when there is only one kind of customer. Then come the trial, the launch discount, the demo account, the yearly plan. Each needs a slightly different rule, and often each inherits the one already there.&lt;/p&gt;

&lt;p&gt;The whole problem sits in one word that seems obvious. For me it was "the period". For a subscriber it meant the billing month. For a trial user it should have meant the 14 days of the trial. The software used the same word for two different things.&lt;/p&gt;

&lt;p&gt;These mistakes only show on specific days: at the end of the month, in February, when a customer moves from trial to subscription. If nobody tests exactly those days, they sit there for months.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to check in your software
&lt;/h2&gt;

&lt;p&gt;You don't need to read the code. Sit down for half an hour with whoever wrote it and run these checks together.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Write the rule in one sentence.&lt;/strong&gt; "A trial user can do at most so many things in 14 days, counted from the day they signed up." If your supplier tells it differently, you have already found something.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Try the awkward dates.&lt;/strong&gt; A trial that starts on the 25th, on 28 February, on 31 December. Ask your supplier to simulate them: with an automated test it takes minutes, with no need to wait for the end of the month.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;List your kinds of customer.&lt;/strong&gt; On trial, subscribed, demo account, moving from trial to paid mid-month, cancelling and coming back. For each: which rule applies?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Look at what the customer reads.&lt;/strong&gt; The number on their dashboard and the words next to it. They must say the same thing the rule says.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ask what happens when you fix it.&lt;/strong&gt; Do people already on trial keep the usage they have? Are they blocked overnight, or do they reach the end normally?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Two people at the same moment.&lt;/strong&gt; Two employees of the same customer using the service in the same second must not be able to go over the limit together.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How I fixed it
&lt;/h2&gt;

&lt;p&gt;Before touching the rule I wrote an automated test that reproduced the problem: a trial started at the end of October, a few previews, then the calendar moved to early November. The counter had to stay where it was. Right after, I wrote another one for subscribers saying the opposite: on the first of the month you start again. That way I couldn't fix the trial by breaking the subscription.&lt;/p&gt;

&lt;p&gt;Then I changed the rule: for trial users the count runs from the first day to the last, with no reset. Usage already recorded by salons halfway through the trial stayed in the count, so nobody saw their number change overnight. Demo accounts kept the monthly count, on purpose. And the dashboard now says "in your trial" instead of "this month" for trial users.&lt;/p&gt;

&lt;p&gt;An internal statistic that only I use still counts by month. It decides nothing for customers, and I noted it in the project notes. I preferred to leave it that way rather than widen the change.&lt;/p&gt;

&lt;h2&gt;
  
  
  For the technical reader
&lt;/h2&gt;

&lt;p&gt;The fix had three constraints that are worth more than the bug itself. No real numbers below; the pattern is what matters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The period is a function of the customer state.&lt;/strong&gt; The old helper returned "the billing period if there is a subscription, otherwise the first of the current month". That definition was written for one kind of customer and then used for two. Now the helper takes the customer: trials with an end date count on a single bucket for the whole trial; subscribers and open-ended demo accounts keep the monthly bucket.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage already recorded must keep counting.&lt;/strong&gt; On release day some trials already had a row for October and one for November. Changing only the key would have dropped November's usage and widened the cap for someone halfway through. So the trial counts on the bucket of the month it started in (the row the old code already wrote) plus any later rows that existed before the release.&lt;/p&gt;

&lt;p&gt;For subscribers this changes nothing, because there are no rows in the future.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The reservation must stay atomic.&lt;/strong&gt; Two devices of the same customer can ask at the same instant. If both read "one left", both pass. The check and the increment have to live in one statement, so the sum of later rows goes inside it, not in a read before it.&lt;/p&gt;

&lt;p&gt;The database locks the row, checks and increments in one step; no row back means the cap is reached.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tests first.&lt;/strong&gt; The first commit was only a failing test: a trial started late in October, some usage, the clock moved to early November, the counter must not reset. Next to it, the opposite test for subscribers, so the fix could not break billing. The "today" function is injected, so nobody waits for the end of the month. If you run a SaaS with trials, start a fake one on the 25th and move the clock a week: about ten lines of test.&lt;/p&gt;

&lt;p&gt;If you want to see how Miraviso is built as a whole, there is the &lt;a href="https://gabrielepieretti.dev/consulting/cases/miraviso/" rel="noopener noreferrer"&gt;project page&lt;/a&gt;. If you sell subscriptions or services with a trial and want to check that the rules in your software say what you decided, that is work we can do together, starting with a &lt;a href="https://gabrielepieretti.dev/consulting/?da=free-trial-rule-written-wrong&amp;amp;utm_source=devto&amp;amp;utm_medium=referral#call" rel="noopener noreferrer"&gt;free 30-minute call&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://gabrielepieretti.dev/blog-en/free-trial-rule-written-wrong/" rel="noopener noreferrer"&gt;gabrielepieretti.dev&lt;/a&gt;. I write about software for small businesses, Laravel, FastAPI and privacy-by-design. &lt;a href="https://gabrielepieretti.dev/blog-en/" rel="noopener noreferrer"&gt;More here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>saas</category>
      <category>postgres</category>
      <category>testing</category>
      <category>startup</category>
    </item>
    <item>
      <title>Claude Duet Asks Before It Acts: What to Check Before You Hand Work to an Agent</title>
      <dc:creator>Gabriele Pieretti</dc:creator>
      <pubDate>Fri, 23 Oct 2026 17:21:59 +0000</pubDate>
      <link>https://dev.to/gabbrowick/claude-duet-asks-before-it-acts-what-to-check-before-you-hand-work-to-an-agent-4iih</link>
      <guid>https://dev.to/gabbrowick/claude-duet-asks-before-it-acts-what-to-check-before-you-hand-work-to-an-agent-4iih</guid>
      <description>&lt;p&gt;On October 21 Anthropic opened a research preview of &lt;a href="https://claude.com/resources/articles/claude-duet" rel="noopener noreferrer"&gt;Claude Duet&lt;/a&gt;, an app where Claude works as a proactive agent: it brings you what needs your attention, completes the tasks you give it, keeps working when you step away and checks with you before it acts on your behalf. It is aimed at professionals and small business owners. The useful question for a business owner is not whether Duet is nice. It is what to check before you let an agent, this one or any other, do things on your behalf. Read carefully, the announcement answers a good part of that question.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the announcement says
&lt;/h2&gt;

&lt;p&gt;Only what is written on the &lt;a href="https://claude.com/resources/articles/claude-duet" rel="noopener noreferrer"&gt;official page&lt;/a&gt; of October 21, 2026:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;it is an app for iOS and Android, and it is also on claude.ai; for now access is through a waitlist, for Pro and Max subscribers in the US only;&lt;/li&gt;
&lt;li&gt;every morning it sends a short brief on the important items in your connected apps, then checks your accounts every few hours and messages you only when something needs you;&lt;/li&gt;
&lt;li&gt;it has a virtual machine with its own browser, so it works with your phone and laptop off;&lt;/li&gt;
&lt;li&gt;it reads, drafts and prepares work on its own, but before it sends a message, makes a payment, signs a document or deletes anything it shows you what it is about to do and waits for your approval;&lt;/li&gt;
&lt;li&gt;some things are off-limits even with your approval, such as trading securities or moving money between accounts;&lt;/li&gt;
&lt;li&gt;credentials follow the design of Claude Managed Agents: it never directly sees your passwords or sign-in tokens.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Anthropic itself says this is an early version that may misread a thread or miscalibrate what is urgent, and that it cannot yet show you its browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  The right line: what can be undone
&lt;/h2&gt;

&lt;p&gt;Look at the list of actions where Duet stops: send, pay, sign, delete. They are not the "important" actions. They are the ones you cannot undo. A bad draft goes in the bin, a sent email does not; a sloppy quote can be fixed, a wire transfer cannot be called back.&lt;/p&gt;

&lt;p&gt;That is the right criterion, and it applies to any agent, bought or built. If a vendor pitches you an AI automation, the first question to ask is: which actions does it take on its own, and which ones stop and wait for me? If the answer is vague, the model is not the problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three Duet choices to demand everywhere
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Credentials never reach the agent.&lt;/strong&gt; In Duet the agent never sees passwords or tokens. A rule like "do not reveal the password" is something the model has to follow; an architecture where the password never reaches the model does not depend on the model at all. The second is sturdier.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Some things are simply forbidden.&lt;/strong&gt; Duet has actions it will not take even with your yes. It sounds excessive until you think about how approvals happen in real life: quickly, at the tenth notification of the day, maybe away from the office. For actions where a mistake costs too much, it is better if the button does not exist.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A check on sensitive data going out.&lt;/strong&gt; Duet ships with a dedicated classifier that checks each message: it refuses to share card numbers and government ID, and lets health or financial information through only when you have explicitly told it to. An agent that reads your mail and writes on your behalf is constantly deciding where information goes, and that is exactly where this check belongs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two things the announcement does not make clear
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Who writes the summary you approve.&lt;/strong&gt; An agent that has read an email with hidden instructions could describe a harmful action in harmless words. So it matters whether the confirmation screen is written by the agent in its own words or by the system from the real data of the action. The announcement says Duet shows you exactly what it is about to do, but not how; Anthropic promises more details on safety in the coming days. Before connecting my accounting to it, I would wait for them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where the data goes.&lt;/strong&gt; The agent runs on an Anthropic virtual machine, on the apps you connect. For a business in the EU, the question of where mail and invoices pass through, and in what data protection role for the vendor, is the first one to ask, not the last. The announcement does not answer it, and I am not going to guess.&lt;/p&gt;

&lt;h2&gt;
  
  
  Proactivity has a cost
&lt;/h2&gt;

&lt;p&gt;An honest detail in the announcement: Duet checks your accounts every few hours instead of nonstop, because checking nonstop would use up the plan's limits much faster. Background checks count toward those limits, and larger tasks, like a financial model or a deck, use more. An agent that keeps an eye on things costs something even when it finds nothing: pick a few things to watch, and watch them well.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;How I set up mine.&lt;/strong&gt; I use an assistant built on Claude Code every day, and its principles are very close to Duet's. It runs in an isolated sandbox. Actions that cannot be undone (merging to the main branch, deploys, messages to third parties, payments) go through a separate approver, which sends me a summary on Telegram with two buttons, Approve and Reject. It keeps a git-based memory that is consolidated every night and that I approve. Credentials never pass through the chat, and it treats emails and web pages as data, never as instructions. On its own it runs scheduled jobs: audits of my sites and a morning check. It is not infallible: now and then it misreads a request or sticks to the wrong approach and needs correcting. That is exactly why the confirmation button sits where it does.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  When you need it and when you do not
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Duet makes sense&lt;/strong&gt; if your day is mail, calendar, invoices and widely used SaaS tools, and you are fine with the agent running on a managed service. Two practical limits, though. The examples in the announcement are mostly US tools (QuickBooks, Gusto, Docusign, HubSpot): whether there are connectors for your own management software or e-invoicing has to be checked one by one in the marketplace. And for now you cannot try it outside the US.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A custom agent makes sense&lt;/strong&gt; when it has to work on your servers, your code or your business software, when the approval rules have to be yours, or when you need to know exactly where the data goes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You need neither&lt;/strong&gt; if the process is not defined yet. An agent that automates a mess produces the mess faster, and asks you to confirm it every time.&lt;/p&gt;

&lt;p&gt;I also wrote about the line between approving an action and protecting data in the context of the &lt;a href="https://gabrielepieretti.dev/blog-en/laravel-ai-sdk-tool-approvals/" rel="noopener noreferrer"&gt;Laravel AI SDK&lt;/a&gt;. If you want to figure out which steps in your business can be handed to an agent, and where the confirmation button belongs, that is what I do in my &lt;a href="https://gabrielepieretti.dev/consulting/" rel="noopener noreferrer"&gt;AI automation consulting&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://gabrielepieretti.dev/blog-en/claude-duet-proactive-agent/" rel="noopener noreferrer"&gt;gabrielepieretti.dev&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>claude</category>
      <category>automation</category>
      <category>security</category>
    </item>
    <item>
      <title>When You Don't Need an LLM: Splitting Work Between Device, Classifier and Big Model</title>
      <dc:creator>Gabriele Pieretti</dc:creator>
      <pubDate>Thu, 22 Oct 2026 09:26:15 +0000</pubDate>
      <link>https://dev.to/gabbrowick/when-you-dont-need-an-llm-splitting-work-between-device-classifier-and-big-model-cmn</link>
      <guid>https://dev.to/gabbrowick/when-you-dont-need-an-llm-splitting-work-between-device-classifier-and-big-model-cmn</guid>
      <description>&lt;p&gt;In version 1.0 of the &lt;a href="https://laravel.com/blog/introducing-laravel-ai-sdk-v1" rel="noopener noreferrer"&gt;Laravel AI SDK&lt;/a&gt;, classification becomes a capability of its own, alongside text, images, audio and embeddings. That is not a catalogue detail: it is the framework saying out loud something anyone running an AI product has already paid to learn — that "answer a closed question" and "generate something" are two different jobs, with different costs and different risk profiles. In Miraviso that split was not an optimisation that arrived later. It is the reason the product can claim that hair colour never leaves the device.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it looks like in the SDK
&lt;/h2&gt;

&lt;p&gt;The API is deliberately narrow. You ask a set of typed questions and get typed answers back:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Laravel\Ai\Classification&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Laravel\Ai\Classification\Boolean&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Laravel\Ai\Classification\Choice&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nv"&gt;$response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Classification&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;of&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$ticket&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;questions&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
    &lt;span class="s1"&gt;'is_urgent'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Boolean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Does this message convey urgency?'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="s1"&gt;'department'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Choice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Which team should handle this?'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="s1"&gt;'billing'&lt;/span&gt;   &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'Payments, invoicing, refunds'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'technical'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'Bugs, outages, integrations'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'sales'&lt;/span&gt;     &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'Pricing, plans, upgrades'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;]),&lt;/span&gt;
&lt;span class="p"&gt;])&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;classify&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There is a &lt;code&gt;Score&lt;/code&gt; type returning 0.0 to 1.0, and a &lt;code&gt;Str::decide&lt;/code&gt; macro for a single yes/no question with a certainty threshold. It runs on TypeSafe's Jev models and on OpenRouter; the announcement promises answers "in milliseconds at a fraction of the price" of a traditional LLM. I take that for what it is — a vendor claim, to be measured against your own workload — but the shape of the API interests me regardless of the benchmark.&lt;/p&gt;

&lt;p&gt;The point is that the return type is closed. &lt;code&gt;$response['department']-&amp;gt;choice&lt;/code&gt; is one of the three values you declared, or it is nothing. No JSON to repair, no prompt politely begging for a one-word answer, no retry for when the model felt like explaining itself. Anyone who has shipped an LLM as a router knows how much defensive code disappears when the contract looks like this.&lt;/p&gt;

&lt;h2&gt;
  
  
  The three tiers I sort work into
&lt;/h2&gt;

&lt;p&gt;In &lt;a href="https://miraviso.it" rel="noopener noreferrer"&gt;Miraviso&lt;/a&gt; — the virtual mirror for hair salons — every piece of work lands in one of three tiers, and the tier is decided before any code is written.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;On the device.&lt;/strong&gt; Everything that is geometry and segmentation. The colour try-on runs entirely on the tablet with MediaPipe on-device: the model finds the hair in the frame, the colour is composited locally, no frame leaves the hardware. This is not a cost decision, it is a product decision: it is a sentence I can say to a salon owner without an asterisk, and it is verifiable by watching the network.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Closed decisions.&lt;/strong&gt; Questions with a finite set of answers — the ones that now have a dedicated capability in Laravel's SDK. In my case almost all of them sit on the back-office side and never touch an image: routing an incoming request, deciding whether a salon's note contains something to be treated as sensitive, deciding whether a piece of text should be shown to an operator. A generative model answers these perfectly well, and is the most expensive, slowest and hardest-to-test instrument I could possibly pick for them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Actual generation.&lt;/strong&gt; Exactly one thing: the haircut preview, which requires producing new, plausible pixels. It runs on Gemini via Vertex AI in an EU region, requires explicit consent, and is never written to disk. It is the only part of the pipeline that needs a large model — and also the only one that carries a privacy story I have to explain in full to the end user. As I wrote about &lt;a href="https://gabrielepieretti.dev/blog-en/laravel-ai-sdk-tool-approvals/" rel="noopener noreferrer"&gt;tool approvals in the SDK&lt;/a&gt;, the boundary that matters sits before the model, not inside the agent.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the tier has to be decided up front
&lt;/h2&gt;

&lt;p&gt;The temptation, once you have a working generative integration, is to use it for everything: the client is already there, the error handling is already there, one more question costs five minutes. That is precisely how a product accumulates generative calls nobody designed.&lt;/p&gt;

&lt;p&gt;Three consequences I have watched happen in my own code, in order of how much they annoyed me:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The data perimeter widens quietly.&lt;/strong&gt; Every question handed to a remote model is one more piece of data leaving. If a classifier or a plain rule could have answered it, you widened the perimeter for nothing — and the perimeter is the thing you eventually have to describe in a privacy notice.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tests stop being tests.&lt;/strong&gt; A closed question has a set of acceptable answers and you assert on it. A natural-language answer gets checked by another model, or by eye, and at that point the suite no longer tells you whether you broke something.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deprecations hurt more.&lt;/strong&gt; I &lt;a href="https://gabrielepieretti.dev/blog-en/ai-model-deprecations-saas/" rel="noopener noreferrer"&gt;wrote about this already&lt;/a&gt;: when an endpoint is retired, the migration hurts in proportion to how many decisions you leaned on that model for. Closed decisions can be re-measured in half a day. Generation cannot.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The craft has not changed
&lt;/h2&gt;

&lt;p&gt;Said without reverence for the historical moment: this is the same question we have been asking for twenty years in front of a slow query. Do I really need to call the service, or can I compute the answer here? The difference is that this time the call does not only cost latency — it costs money per request and it moves data across a boundary you promised to hold.&lt;/p&gt;

&lt;p&gt;It is also why I keep hand-writing &lt;a href="https://gabrielepieretti.dev/games/" rel="noopener noreferrer"&gt;the logic games on this site&lt;/a&gt; with no libraries: when the minesweeper solver has to guarantee that a grid never forces a guess, that guarantee comes from a proof, not an estimate. Not every hard problem is a model problem — and telling which ones are not has become, over the last two years, one of the few skills that actually moves the cost of a product.&lt;/p&gt;

&lt;p&gt;Which is the good news here: having classification as a separate capability makes that choice explicit in the code, instead of leaving it implicit in a prompt. A framework that forces you to declare what kind of work you are asking for is a framework that helps you not ask for the wrong one.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://gabrielepieretti.dev/blog-en/when-you-dont-need-an-llm/" rel="noopener noreferrer"&gt;gabrielepieretti.dev&lt;/a&gt;. I write about Laravel, privacy-by-design and building a vertical B2B SaaS solo — &lt;a href="https://gabrielepieretti.dev/blog-en/" rel="noopener noreferrer"&gt;more here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>laravel</category>
      <category>architecture</category>
      <category>saas</category>
    </item>
  </channel>
</rss>
