GitHub Copilot Traffic Analysis via MITM Proxy Exposes Prompt Context Handling and Local SQLite Session Storage

A detailed reverse-engineering study placed GitHub Copilot behind an mitmproxy instance to inspect all network requests made by Visual Studio Code. The analysis revealed that Copilot performs OAuth token exchange, model availability checks, and intent classification before any user input occurs. Prompts sent to the model include context from recently edited files, even when inline suggestions are disabled for sensitive extensions such as .env. Copilot maintains a local SQLite database named session-store.db that records every user prompt, LLM response, repository, and branch worked on. The extension also exposes a session_store_sql tool allowing the model to run read-only SQL queries against this history using the Copilot Chronicle skill. These findings highlight how AI coding assistants manage context, authentication, and persistent local state.

HabrTranslated from Russian

Read at source

A security researcher conducted an in-depth analysis of GitHub Copilot by routing all network traffic from Visual Studio Code through an mitmproxy instance configured as a man-in-the-middle proxy.

The study began with the observation that Copilot rapidly consumes monthly request quotas, prompting an investigation into its internal communication patterns. Because Visual Studio Code and Copilot are built on Electron, the researcher first mapped the application’s network architecture, distinguishing between Chromium-based renderer processes and Node.js HTTP requests.

Proxy Setup and Traffic Interception

After installing mitmproxy via Homebrew and configuring VS Code proxy settings (Http Proxy, Strict SSL disabled, Proxy Support set to override), the researcher launched mitmweb to capture live requests. Additional steps included restarting the Extension Host process to ensure fresh connections were routed through the proxy.

Traffic analysis showed multiple request categories even before any code was typed: authentication and session management via OAuth, configuration and policy retrieval, MCP registry access, repository and session context, model discovery, and recent repository listings.

Model Intent Routing and Prompt Construction

In Auto mode, Copilot sends each prompt to the /models/session/intent endpoint for classification into categories such as code-gen, debugging, or tool-use. The resulting classification determines which model handles the request.

Inline suggestion requests were observed to include the current file path and content from recently edited files. When a fake secret was placed in a .env file, the secret appeared in prompts generated while editing an unrelated pyproject.toml file, demonstrating that context collection is not limited to the file where suggestions are enabled.

Local Session History and Chronicle Tool

Many requests referenced a tool named session_store_sql that can execute read-only SQLite queries against a local database called session-store.db. The database stores session summaries, user prompts, LLM responses, repositories, branches, and checkpoints.

When the researcher asked Copilot what work had been done the previous week, the model first attempted an invalid query, performed schema introspection, and then successfully retrieved records from the local store using the Copilot Chronicle skill.

The findings illustrate how GitHub Copilot maintains persistent local state and incorporates broad context into prompts sent to remote models.

Meridian digestThe week's most consequential security stories, distilled into one briefing.See the digest

More in AI Security

Logical Argument Claims Full Alignment of Superintelligent AGI Is Fundamentally Impossible
Claude Account Bans Linked to IP Reputation, Device Environment and Payment Channels, But No Confirmed Formula
Local LLMs in AppSec: What Open Tools and Models Can Handle in Application Security