What I learned by putting GitHub Copilot behind a MitM proxy
TL;DR Highlight
Routing Copilot through mitmproxy exposed its context injection and session store.
Who Should Read
A developer who wants to know what context AI coding tools actually send to their servers.
Core Mechanics
- Fast-draining credits started it
- The author noticed Copilot credits running out earlier each month.
- That led them to pick VS Code and Copilot as the test subject.
- Traffic first, source second
- Source shows what an app can do but not what it actually does at runtime.
- The author watched requests and responses first, then checked the source.
- Electron apps share a similar structure
- Electron bundles Node.js with web tech and renders it via Chromium.
- Requests can go through Chromium's network stack or Node's http/https/fetch, which affects interception.
- mitmproxy splits the TLS connection in two
- Trusting mitmproxy's local CA creates one TLS connection to the app and another to the server.
- That lets it decrypt and inspect requests.
- The public part ends at setup
- The detailed findings on traffic, harness and memory sit behind the paywall.
- It is part 1 of 2, and part 2 is about changing one HTTP header so billing stopped.
Community Reactions
- The author's own summary comment
- Model and capability discovery and routing were visible in real time.
- Recent edits can pull in context from other files, including .env.
- A SQLite session store behind Chronicle holds past prompts and responses, and the model queries it via tool calls.
- Experience that eBPF makes this easier
- It captures plaintext right before encryption and after decryption, so certificate pinning and mTLS don't matter.
- The commenter says it shows telemetry to prompts, including much collection unrelated to the user's request.
- Tip about a built-in debug log
- A commenter says the ... menu's "show agent debug logs" shows tool calls, prompts, model selection and token use.
- They add that VS Code can now connect your own otel service.
- Opinion: handle .env exposure with sandboxes
- Some were surprised there is no .env rule.
- Others suggested sandboxes without env access, and one team uses per-run, spend-capped keys deleted at teardown.
How to Apply
- Open agent debug logs in VS Code
- Today, open the ... menu in a Copilot chat and click "show agent debug logs".
- Check tool calls, prompts and token use to see where credits go.
- Separate .env from agent workspaces
- Remove real-secret .env files from directories where agents run.
- If needed, issue per-run spend-capped keys and delete them at teardown.
- Audit internal AI tool traffic with mitmproxy
- Install mitmproxy, trust its local CA, and point the tool's proxy setting at it.
- Check which file contents appear in requests and add exclusion rules for sensitive files.
Try It
# Paste into Claude or ChatGPT (simplified version of the article's idea)
Below is content I copied from an AI coding tool's request log (mitmproxy or agent debug logs).
{{request log}}
Summarize it in a table:
1. Types of context included (current file, recently edited files, history, system prompt, etc.)
2. Files or data that look unrelated to the current task
3. Strings that may be sensitive such as .env, keys, tokens (mask values, show location only)
Next: suggest which settings I should change to exclude the sensitive items.Terminology
Related Papers
Frostbite: A new CPU architecture discovered, designed and verified by AI
AI agents designed a CPU from scratch, claiming 4.59x perf/W over a traditional core
Restricting AI agents in mobile operating systems platforms from capturing data
Signal now blocks OS-level AI agents from reading its screen on iOS 27 and Android
Actions Speak Louder than Words: Stateful Privacy Sniffing of LLM Agents via Behavioral Covert Channels in Web Interactions
Agents' link choices alone let attackers rebuild user queries at F1 0.89; SOR cuts it to 0.39.
Tracking and Limiting Unsupported Claim Propagation in Multi-Agent LLM Systems: A Provenance-Aware Framework
Passing claims with source, evidence and history kept equivalence at 5 agent stages at 96% versus 31%.
LLM assisted reverse engineering
Pointing an agent at binaries with skills and MD notes made years-long hacks feasible
Metrics-in-the-Loop: Complexity Feedback Reshapes Agent-Written Code
Injecting per-turn complexity reports into coding agents cut code erosion without changing correctness
Why is Gemini 4 Carbon taking so long?
Carbon took nearly an hour on bug fixes that Astra and Opus finished in minutes, mostly from extra unrequested work.
Weight-Space Programming builds neural networks like a 1990s researcher
LLM hand-wrote MNIST weights to 91.3%, using 1990s-style techniques