SQL Server Copilot: a regex read-only mode, prompt injection, and a path to sysadmin
A Microsoft-rated critical flaw in Copilot for SQL Server Management Studio shows why read-only mode must be a database permission, not a regex or a model instruction.
# SQL Copilot: read-only enforced by a classifier (illustrative, defensive, redacted) # Pattern: the guard inspects the text of a statement, not the privileges of the connection. # "read-only" check -> pattern match on the T-SQL string [bypassable by indirection] # database-stored instruction files are read as trusted guidance [REDACTED] # Defense: connect with a login that truly lacks write rights; treat any stored # instruction text as untrusted input; never attach the agent to a sysadmin session.