DEV Community

Pascal Matthiesen
Pascal Matthiesen

Posted on • Edited on

Clickjitsu: The Art of Delegating Browser Tasks to AI Minions ๐Ÿค–

Hey tech adventurers! ๐Ÿ‘‹ Ready to turn the mundane world of browser automation into something that would make science fiction jealous? Let's dive into Clickjitsu - a project that proves sometimes the best ideas come from the most questionable engineering decisions! ๐Ÿš€

The Abstract Vision ๐Ÿ”ฎ

Challenge ๐Ÿค”: You need to automate web tasks, but traditional browser automation is about as secure as leaving your front door open with a "Free Stuff Inside" sign.

Solution ๐Ÿ’ก: Spawn completely fresh, isolated browser environments in Kubernetes, hand control to AI agents, and watch the digital magic unfold with military-grade security.

Why You'll Love This:

  • Watch AI work in real-time via WebRTC streaming ๐Ÿ“บ
  • Zero security contamination between sessions ๐Ÿ›ก๏ธ
  • Scalable cloud-native architecture that handles enterprise workloads ๐Ÿ“ˆ
  • Fresh browser instances for every single task ๐Ÿงน

Imagine saying "go buy me those fancy headphones" and watching a completely isolated browser environment materialize in the cloud, execute your mission, and vanish without a trace. That's Clickjitsu โ€“ where browser automation meets paranoid-level security! ๐Ÿ•ต๏ธโ€โ™‚๏ธ

The Security-First Philosophy ๐Ÿ›ก๏ธ

Here's where things get seriously smart: Every single session creates a brand new browser instance from scratch. No cookies, no history, no digital fingerprints from previous adventures. It's like having a perfectly clean rental car for every trip, except the car also self-destructs when you're done! ๐Ÿš—๐Ÿ’ฅ

Why This Security Model Is Genius:

  • Zero Cross-Contamination: Your Amazon shopping spree can't accidentally leak into your banking session ๐Ÿฆ
  • Fresh Identity Every Time: Each AI agent starts with a completely blank slate ๐Ÿงน
  • Isolated Kubernetes Namespaces: Every browser session lives in its own fortress ๐Ÿฐ
  • Ephemeral by Design: When the task ends, everything vanishes like it never existed ๐Ÿ’จ
  • Observable Operations: Real-time streaming means you can supervise your AI minions ๐Ÿ‘๏ธ

The Technical Magic Behind the Curtain ๐ŸŽญ

Architecture That Actually Makes Sense ๐Ÿ—๏ธ

Fresh Browser Request โ†’ Isolated K8s Namespace โ†’ Virgin Browser + AI Agent
                              โ†“
                    Live Stream โ† WebRTC โ† Secure Monitoring  
                              โ†“
                         Results + Cleanup + Self-Destruct
Enter fullscreen mode Exit fullscreen mode

Each session is like hiring a digital temp worker who:

  1. Gets a completely clean computer ๐Ÿ’ป
  2. Follows your exact instructions ๐Ÿ“‹
  3. Reports back with results ๐Ÿ“Š
  4. Shreds everything when done ๐Ÿ—‚๏ธ

The Tech Stack That Makes It Possible โœจ

  • ๐ŸŽฌ browser-use: The AI agent doing all the clicking wizardry
  • ๐Ÿ“บ neko: Streams the browser chaos via WebRTC so you can watch the show
  • โ˜ธ๏ธ Kubernetes: Because why make things simple when you can make them distributed and bulletproof?
  • ๐Ÿน Go: The glue holding this beautiful controlled chaos together
  • ๐Ÿง  OpenAI: Powers the AI that (hopefully) won't accidentally order 500 rubber ducks
  • ๐Ÿ—„๏ธ Redis: Session state management that doesn't judge your automation choices

Code That Makes You Go "Wow" โš™๏ธ

The session manager is where the real magic happens. Check out this beautiful orchestration:

func (m *Manager) CreateSession(ctx context.Context, req *models.CreateSessionRequest) (*models.Session, error) {
    sessionID := uuid.New().String()
    namespace := fmt.Sprintf("browser-session-%s", sessionID)

    session := &models.Session{
        ID:          sessionID,
        ExternalURL: fmt.Sprintf("https://%s.%s?usr=neko&pwd=neko&embed=1&volume=1", 
                                sessionID, m.config.BrowserDomain),
        Status:      models.StatusCreating,
        Prompt:      req.Prompt,
        ExpiresAt:   time.Now().Add(m.config.BrowserSessionTTL),
    }

    go m.createSessionResources(context.Background(), session)
    return session, nil
}
Enter fullscreen mode Exit fullscreen mode

Each session gets its own Kubernetes namespace โ€“ talk about resource isolation! It's like giving every AI agent their own private mansion that gets demolished after the party ๐Ÿฐ

The AI Runner: Where Dreams Meet Reality ๐Ÿค–

The Python runner executing inside each pod is delightfully elegant:

agent = Agent(
    task=os.environ["PROMPT"],
    llm=ChatOpenAI(model="o4-mini", temperature=1.0),
    browser_session=browser_session,
)
history = await agent.run()
result = history.final_result()
Enter fullscreen mode Exit fullscreen mode

It's literally: "Hey AI, here's a pristine browser and a task. Go nuts, but do it securely!" ๐Ÿฅœ

Real-World Applications (That Actually Matter) ๐ŸŒ

Enterprise Use Cases That'll Impress Your Boss:

  • Automated Testing: Fresh browsers for every test run, eliminating flaky tests caused by session contamination ๐Ÿงช
  • Market Research: Clean environments for competitive analysis without revealing your digital fingerprints ๐Ÿ”
  • Compliance Checking: Isolated sessions for regulatory verification with complete audit trails โœ…
  • Data Gathering: Secure web scraping without contamination or detection ๐Ÿ•ท๏ธ
  • Form Automation: Fill repetitive enterprise forms without data leakage ๐Ÿ“

Personal Use Cases That'll Change Your Life:

  • Price Monitoring: AI checks deals without accumulating tracking cookies ๐Ÿ’ฐ
  • Research Tasks: Clean browsing for sensitive investigations ๐Ÿ”ฌ
  • E-commerce Automation: Let AI handle your shopping without compromising your privacy ๐Ÿ›’
  • Social Media Management: Automate posts and interactions with complete isolation ๐Ÿ“ฑ

The "What Could Go Right" Scenarios ๐ŸŽฏ

Unlike traditional browser automation that accumulates digital baggage like a hoarder's basement, Clickjitsu's ephemeral approach means:

  • No Session Hijacking: Fresh browser = fresh start every time ๐Ÿ”„
  • No Data Persistence: Sensitive info never lingers around like a bad smell ๐Ÿšซ
  • No Cross-Task Interference: Yesterday's shopping can't affect today's banking ๐Ÿชโžก๏ธ๐Ÿฆ
  • Perfect Audit Trail: Every session is logged, isolated, and traceable ๐Ÿ“Š
  • Scalable Security: Want 100 AI agents? Just scale the pods without security concerns! ๐Ÿ“ˆ

Security Wins That Actually Matter ๐Ÿ†

Container-Level Fort Knox ๐Ÿฐ

  • Network Segmentation: Kubernetes networking keeps sessions separated like VIP sections at a concert ๐Ÿ•ธ๏ธ
  • Resource Limits: AI can't consume infinite resources or accidentally bankrupt you ๐Ÿ’ธ
  • Clean Slate Guarantee: Every session starts with zero previous context, like digital amnesia ๐Ÿงผ
  • Real-Time Monitoring: Watch exactly what your AI agent is doing, no surprises! ๐Ÿ‘๏ธ

Taking Security to Ludicrous Speed ๐Ÿš€

For Production Environments, you could take this paranoia to the next level with some seriously hardcore isolation:

  • gVisor: Run containers in a user-space kernel for that extra "nope, you're not touching my host OS" feeling ๐Ÿ›ก๏ธ
  • Kata Containers: Each container gets its own lightweight VM because why trust anything? ๐Ÿฐ
  • Firecracker MicroVMs: AWS-style microVMs that boot faster than your morning coffee โ˜•
# Because regular containers are for peasants
kubectl apply -f - <<EOF
apiVersion: v1
kind: Pod
spec:
  runtimeClassName: kata-containers  # Or gvisor, or firecracker
  containers:
  - name: paranoid-browser
    image: clickjitsu/browser:latest
EOF
Enter fullscreen mode Exit fullscreen mode

Why Go Full Paranoid? ๐Ÿ•ต๏ธโ€โ™‚๏ธ

  • Kernel-Level Isolation: AI agent escapes? Still trapped in VM-land!
  • Hardware-Assisted Security: CPU features working overtime to keep you safe
  • Compliance Gold Star: Auditors will weep tears of joy at your isolation levels โญ
  • Sleep Better at Night: Because knowing your AI can't accidentally root your cluster is priceless ๐Ÿ˜ด

Infrastructure Patterns That Impress ๐ŸŽฏ

# Each session gets its own isolated environment
apiVersion: v1
kind: Namespace
metadata:
  name: browser-session-uuid-here
---
# Browser container with Chrome DevTools + MicroVM isolation
# AI runner container with browser-use + gVisor sandboxing
# All ephemeral, all secure, all magnificently over-engineered
Enter fullscreen mode Exit fullscreen mode

The Infrastructure Wins That Matter ๐Ÿš€

Despite being born from "questionable life choices," Clickjitsu showcases serious cloud-native patterns:

  • Ephemeral Workloads: Each session is completely isolated and self-cleaning ๐Ÿงน
  • Horizontal Scalability: Want 100 AI shoppers? Just scale the pods! ๐Ÿ“ˆ
  • Resource Management: Proper CPU/memory limits prevent AI shopping sprees from breaking your cluster ๐Ÿ’ณ
  • WebRTC Streaming: Real-time browser viewing because watching AI click buttons is surprisingly addictive ๐Ÿ‘๏ธ
  • GitOps Ready: Infrastructure as code that would make your DevOps team weep with joy ๐Ÿ˜ญ

Warning Labels and Disclaimers โš ๏ธ

This is a one-day hack that turned into something surprisingly robust โ€“ use responsibly! Side effects may include:

  • Mysterious charges on your credit card (set those spending limits!) ๐Ÿ’ณ
  • AI developing sentience and judging your browsing habits ๐Ÿ‘จโ€โš–๏ธ
  • Kubernetes bills that make you question life choices ๐Ÿ’ธ
  • Your browser automation having better security than most enterprise systems ๐Ÿข
  • Colleagues asking "how the hell did you build that?" ๐Ÿคฏ

The Future of Secure Automation ๐Ÿ”ฎ

This isn't just about letting AI click buttons โ€“ it's about creating a paradigm where automation meets paranoid-level security. Imagine:

  • Corporate AI Assistants: Safely handling sensitive business processes without data leakage ๐Ÿ’ผ
  • Personal Digital Butlers: Managing your online life without privacy nightmares ๐Ÿ 
  • Research Automation: Gathering competitive intelligence without leaving digital footprints ๐Ÿ•ต๏ธ
  • Compliance Automation: Meeting regulations with verifiable isolation and audit trails โœ…
  • Zero-Trust Browsing: Every web interaction happens in a disposable, monitored environment ๐Ÿ—‘๏ธ

Try It Yourself (If You Dare) ๐ŸŽฎ

Want to watch AI navigate the web while you sip coffee in your security-hardened ivory tower? The project is open source and ready for your own questionable experiments!

Getting Started:

# Clone the madness
git clone https://github.com/pmdroid/clickjitsu

# Deploy to your K8s cluster
# Watch AI do your bidding
# Profit (securely)
Enter fullscreen mode Exit fullscreen mode

Just remember: with great AI power comes great responsibility (and the need for really good monitoring) ๐Ÿ•ท๏ธ

Key Takeaways That'll Stick ๐ŸŽฏ

  • Security Through Isolation: Fresh environments eliminate contamination risks better than hand sanitizer ๐Ÿ›ก๏ธ
  • Observable AI: Real-time streaming lets you supervise your digital minions like a benevolent overlord ๐Ÿ‘€
  • Scalable Architecture: Cloud-native design handles enterprise workloads without breaking a sweat ๐Ÿ“ˆ
  • Zero Persistence: What happens in the container, stays in the container (and then gets obliterated) ๐Ÿ”’
  • Infrastructure as Entertainment: Who knew watching AI browse the web could be this addictive? ๐Ÿฟ

The Bottom Line ๐Ÿ’ฐ

Clickjitsu proves that sometimes the most useful innovations come from solving problems you didn't know you had. It's browser automation for the age of zero-trust architecture, where every click is monitored, every session is isolated, and every result is achieved without compromising your digital soul.

Ready to delegate your browser tasks to AI agents while keeping everything locked down tighter than Fort Knox? Your secure automation journey starts here! ๐Ÿš€


Built with โค๏ธ and questionable engineering decisions that somehow resulted in enterprise-grade security. Because in 2025, even our browser automation needs better security than most banks ๐Ÿ˜…๐Ÿฆ

P.S. - Yes, it actually works. No, we can't be held responsible for what your AI decides to buy. Please set spending limits. I'm not kidding about this one! ๐Ÿ’ธ

Top comments (0)