< Back to Logs
Published on 23 July 2026 • Written by MarckDWN • Privacy Case Study

When AI Agents Leak Your Bank Links: A Case Study in Agentic Privacy & Local-First Execution

Imagine a deceptively simple user request: "Please sort my bookmarks from bookmarks.html alphabetically."

In standard AI agent frameworks (AutoGPT, CrewAI, or typical workspace tool wrappers), the agent fulfills this by invoking a sequence of tool calls:

  1. READ_FILE bookmarks.html
  2. Loads the full 800-line HTML file (~85KB) into its prompt context.
  3. Transmits the entire raw file over the network to cloud LLM API endpoints (Gemini, OpenAI, or Claude).

⚠️ The Hidden Privacy Leak

An HTML export of user bookmarks is rarely just a list of website titles. In our real-world case study, the user's bookmarks.html file contained:

  • 🔴 Home banking & admin login portals: Bank portals (cedacri.it, cariparma.it), domain registrar dashboards (admin.aruba.it).
  • 🔴 Personal contact info: Direct phone numbers and email addresses embedded in whatsapp: and mailto: links.
  • 🔴 Internal network infrastructure: Private IP addresses and router/PBX management endpoints (151.100.100.105:8080/admin).
  • 🔴 Cloud OAuth tokens & session URLs: Azure dashboard endpoints containing authentication state strings.

The Engineering Paradox: To sort a simple list of text strings on the user's hard drive, a standard agent transmitted their entire digital footprint to a remote cloud server.

Five Technical Hurdles in Agentic Execution

During our architectural overhaul to solve this privacy leak, we identified five critical technical traps common in desktop agent runners:

1. HTML Tag Destruction in cmd.exe
When agents attempt inline string manipulation using python -c "import re; ... <DT><A>..." on Windows, cmd.exe interprets < and > as shell redirection operators before passing them to Python, returning Exit Code 255: < was unexpected at this time. We resolved this by switching execution to native powershell.exe using ProcessStartInfo.ArgumentList to bypass shell parameter escaping entirely.

2. Security Blacklist False Positives
Overly broad regex filters intended to block dangerous shell commands (like base64-encoded PowerShell strings -enc) matched innocent UTF-8 bookmark strings or base64 favicon blobs. We rewritten the blacklist matching with strict word-boundary constraints (\b(-EncodedCommand|-enc)\s+[A-Za-z0-9+/]{40,}).

3. Silent Output Hallucinations
When a CLI tool completed with Exit Code 0 without printing stdout, agents frequently misinterpreted the silent output as success and hallucinated results. The DWN.BRIDGE runner now returns an explicit status: [Output]: (no output produced).

4. The File Name "Magic String" Fallacy
Filtering files based on names like bookmarks.html fails completely in production. If a user names their export links.html or my_data.txt, filename-based rules collapse.

5. The Code vs. Data Dilemma
If you block reading .html files to protect privacy, your agent can no longer inspect source code web pages (like index.html) for web development tasks. If you allow reading .html files, bookmark exports leak to the cloud.

The DWN.BRIDGE Architectural Solution

To resolve the tension between data privacy and code editing freedom, we designed a three-layer local architecture:

graph TD
    User[User Request: Sort Bookmarks] -->|Trigger READ_FILE| Classifier[FileNatureClassifier in C#]
    Classifier -->|Inspect First 4KB on Disk| Analysis{Content Signature?}
    
    Analysis -->|UserDataExport Signature| Block[Shield Privacy: Block LLM Read]
    Analysis -->|SourceCode Signature| Allow[Allow LLM Read for Dev/Refactoring]
    
    Block -->|Return Guidance| LocalScript[Agent Writes Local Script: sort.py]
    LocalScript -->|Execute via RUN_COMMAND| Exec[Local Execution on Disk]
    Exec -->|Result| Done[Bookmarks Sorted: 0 Bytes Uploaded]
    
    style User fill:#3B82F6,stroke:#1E3A8A,color:#fff
    style Classifier fill:#8B5CF6,stroke:#5B21B6,color:#fff
    style Block fill:#EF4444,stroke:#991B1B,color:#fff
    style Allow fill:#10B981,stroke:#047857,color:#fff
    style Exec fill:#10B981,stroke:#047857,color:#fff
            

Component 1: `FileNatureClassifier` (C# Application Layer)

A low-level local module in C# that reads the first 4KB of a file from disk before any content is passed to the LLM or network:

Component 2: Zero-Knowledge Local-First Pattern

When user data exports are detected:

  1. The client blocks transmitting raw data to the LLM context.
  2. The agent writes a local processing script using WRITE_FILE (e.g., sort.py).
  3. The agent executes the script locally via RUN_COMMAND (python sort.py).
  4. All data processing occurs 100% on the local disk. Zero bytes of sensitive personal data reach cloud LLM servers.

Component 3: 100% Precision Acceptance Suite

We implemented an automated test suite (FileNatureClassifierTests.cs) generating test samples across 35 distinct file extensions and signatures (.cs, .py, .js, web .html, bookmark .html, .csv, .sql, .json). The classifier achieved 35/35 Passed (100% accuracy).

Conclusion: Local-First Agentic Philosophy

The lesson for AI developers is clear: Agents should write code to manipulate local data, rather than loading raw data into LLM prompt contexts.

By shifting from prompt-heavy data transfers to local script generation and execution, we preserve user privacy without sacrificing autonomous capabilities.

Keep your local data private

DWN.BRIDGE is fully open-source and free. Inspect the code, download the desktop client, or join our community.

Get Client Discord