Forum Discussion
How does GitHub Copilot in SSMS 22 handle database context collection before generating a response?
Documented behavior is that Copilot can use the active query editor and connected database context, including relevant metadata. Database instructions can add database-specific guidance. Microsoft does not publish a fixed internal sequence for collecting, ranking, and sending schema context, so that orchestration should not be treated as a product contract.
Context is bounded by the SSMS connection and identity. Generated actions run under the database user’s permissions; Copilot grants no additional SQL privileges. Agent mode can require approval before execution. Apply least privilege and review generated SQL, especially in production.
To validate behavior, create a low-privilege login, capture SQL Audit or Extended Events, and compare activity while changing the active database and editor contents. This shows what your build reads or executes without guessing about undisclosed internals. Distinguish metadata from data: object names and definitions may supply context, while reading rows requires permission and observable queries.