SQL Sage · your own AI account in SSMS
← Back to site

Your own AI account in SSMS — Claude or ChatGPT/Codex, without an API key

SQL Sage is an extension for SQL Server Management Studio 22 that drives the AI subscription you already pay for — a Claude account or a ChatGPT/Codex account — from the panel next to your query editor. There is no API key to create and none for us to hold. This page is the mechanics: how the sign-in really works, what leaves your machine, where the two providers genuinely differ, and what the safety gate does before any SQL runs.

On this page

  1. What it is
  2. How keyless sign-in works
  3. Keyless vs BYOK vs API-key add-ins
  4. Claude or ChatGPT/Codex — what differs
  5. What it does with your SQL
  6. The safety gate
  7. What leaves your machine
  8. Proof and accountability
  9. New models, no new release
  10. Requirements and first run

01An add-in inside SSMS, not a website

SQL Sage installs into SQL Server Management Studio 22 on Windows and runs as part of the SSMS process on your own machine. It is not a web app, not an online SQL editor, and nothing about your database is proxied through our servers. The assistant lives in a dockable panel beside the query editor, and a connection bar at the top of that panel shows the server, database and login the current chat is using — at all times, not on hover. By default the chat follows whichever query window is active; when you are working across several servers you can pin it to one window so it keeps that connection while you move around. Either way an answer is grounded in a known engine edition, version and database rather than in SQL Server in general.

The same panel talks to either provider. Picking Claude or OpenAI is a pair of tabs in the status bar, with the model dropdown beside them — not a different product, a different install, or a different licence — and your conversation history survives switching provider or model mid-session.

02How keyless sign-in actually works

Most AI add-ins ask you for an API key. SQL Sage asks for nothing, because it does not talk to Anthropic or OpenAI at all. It talks to the command-line tool already installed and signed in on your machineclaude (Claude Code) for the Claude channel, codex for the ChatGPT/Codex channel — and lets that tool carry the authentication it already holds.

Concretely, on the Claude channel SQL Sage launches the CLI in non-interactive mode with a streaming JSON transcript (claude -p --output-format stream-json --verbose --include-partial-messages) and writes the prompt to the process's standard input rather than onto the command line — a schema-heavy prompt for a large production database would otherwise exceed the Windows command-line limit. Tokens are streamed back as they arrive, which is why the answer appears word by word instead of after a pause.

Zero token custody, by construction. On the keyless channels there is no code path in SQL Sage that reads, copies, stores, or transmits your provider credentials — it cannot leak a token it never receives. (The one exception is the optional BYOK key you type in yourself, covered two sections below.) Your session lives where you created it, in the CLI's own storage; we never touch those files. The panel's only question is the one the CLI can answer for itself — claude auth status on one channel, codex login status on the other — and it displays the reply, including which account and plan you are signed in as.

The practical consequences are worth spelling out. Rotating or revoking access is done in your Claude or ChatGPT account and takes effect immediately, with nothing to clean up in SSMS. If your CLI session expires, SQL Sage does not silently fall back to some other credential — the channel simply reports itself unavailable until you sign in again. And because the inference runs on your own subscription, usage is billed by your provider under the terms you already accepted: SQL Sage is not an intermediary for AI inference, does not meter it, and does not resell access to models.

03Keyless vs BYOK vs an API-key add-in

Three arrangements are easy to confuse, so here is what each one actually means for you.

ArrangementWhat you supplyWho holds the secretWho is billed
Keyless (default)A Claude or ChatGPT account, signed in inside the local CLIThe CLI on your machine — SQL Sage never receives itYour existing subscription
BYOK (advanced)Your own Anthropic API keyOne opaque blob on your machine, encrypted with Windows DPAPI scoped to your user account (%LOCALAPPDATA%\SqlSage\byok.dat) — never in plaintext, the registry, or version controlYour Anthropic API account, per token
A typical API-key add-inAn API key pasted into the toolThe tool, wherever it chooses to keep itUsually your API account; sometimes the vendor resells inference

BYOK exists as an escape hatch for people who cannot or will not install a CLI — for instance on a locked-down workstation. Note the asymmetry honestly: BYOK is implemented for Anthropic only. There is no OpenAI API-key path, so reaching ChatGPT or Codex means going through the Codex CLI. If your organisation forbids both a CLI and an outbound API key, no configuration of SQL Sage will help, and it is better to know that before you install.

04Claude or ChatGPT/Codex — what actually differs

For everyday T-SQL work — explaining an error, reading an execution plan, rewriting a query — both channels get the same tools, the same schema context and the same safety gate, because all of that lives in SQL Sage rather than in the model. What differs is a small number of concrete engineering facts, not marketing positioning:

Everything else is symmetric: both channels call the same tools, obey the same safety gate, write to the same audit log, and keep your conversation when you switch between them mid-session.

05What it does with your SQL

The assistant reasons about the server in front of you, because it can measure it. It has 26 authored tools — deterministic queries we wrote and reviewed, not SQL the model improvises — covering the catalogue, Query Store, the plan cache, wait and index statistics, live requests, deadlock history, permissions and backups. The model chooses which one to call and interprets what comes back; it does not invent the numbers.

Every SQL block the assistant writes carries a classification badge — READ, WRITE, DDL, or SQL? for a statement that cannot be proven safe — and a one-click toolbar: Copy · Insert · New query · Run · Format · Prove ≡. Press Run on anything that is not a plain read and the confirmation dialog names the class again in its own words: WRITE, DDL, or UNSAFE for the unprovable case. Insert is deliberately not Run: putting text in your editor and executing it against a database are two different buttons.

06The safety gate: classify first, then decide

Nothing an AI writes reaches your server on trust. Before execution, every batch is split on GO the way SSMS splits it and parsed into an abstract syntax tree by ScriptDom — Microsoft's own T-SQL parser, the TSql180Parser — then classified as Read, Write, DDL or Unknown. A batch takes the worst class any statement in it earns. The classification is deterministic and escalates on exactly the cases that catch people out:

There is one more gate on your side of the keyboard: when you press F5 on something genuinely destructive — a DELETE or UPDATE with no WHERE, a DROP, a TRUNCATE — SQL Sage asks first, using the same parser.

The parser is the chokepoint, and that matters more than any instruction in a prompt could: a model cannot talk its way past a gate that is not made of words.

07What leaves your machine — and what does not

The assistant needs enough context to be useful, which is your query text and the shape of your schema. It does not need your data, so by default it never sees it.

Because inference runs on your own account, your direct relationship with Anthropic or OpenAI governs how that context is handled; we are not a sub-processor for it. The Privacy Policy spells this out field by field, and the sub-processor list names everyone we do use.

08Proof and accountability, not just answers

Confidence is cheap and a plausible answer about production is dangerous. The parts of SQL Sage that exist to prove things run deterministically on the server and cost no AI tokens:

09New models appear without a new release

Model line-ups change faster than any extension ships. SQL Sage reads its model list from a small hosted catalogue served from the same CDN as its update manifest — refreshed at most once every 30 minutes, size-capped, and abandoned after a three-second timeout — so when a new Claude or ChatGPT/Codex model becomes available it shows up in the picker without you installing anything. If the catalogue cannot be reached, the panel falls back to the list built into your version: being offline costs you choice, not the product. One caveat stated plainly: the catalogue governs what the picker offers, not what the CLI on your machine will accept, so a brand-new model also needs a CLI recent enough to run it.

One hardening detail, since it is the kind of thing that gets skipped: a model identifier is eventually passed as an argument to a CLI that may be launched through a .cmd shim, where argument quoting does not neutralise shell metacharacters. Every identifier is therefore validated against a strict format rule before it can reach the command line — alphanumerics, dots, underscores and hyphens only, 64 characters at most, no whitespace and no shell metacharacter — and a malformed string is replaced with a known-good alias rather than passed on. Be precise about what that buys: a well-formed name for a model that does not exist still reaches the CLI, which rejects it. What cannot get through is an injected command.

10Requirements and first run

  1. Install SQL Sage and reopen SSMS — the panel appears, or open it from View → Other Windows → SQL Sage.
  2. In the status bar pick your provider. Sign in with Claude finishes in the console window that opens; then click Refresh. Sign in with OpenAI goes through the Codex CLI.
  3. Choose a model, then select some T-SQL and press Ctrl+Alt+Shift+E.

Every install starts a 30-day free trial with all features, no credit card and no account, and licence checks fail safe — there is a 14-day offline grace period, so a flaky network or a week on a plane will not lock you out. The step-by-step walkthrough lives in the documentation; if you are weighing this against GitHub Copilot in SSMS or other add-ins, the side-by-side comparison is the honest version, with sources.

Download SQL Sage