Topic: Security
  • SQL Server + AI: Copilot Drafts the Query, MCP Serves the Report, One Row Catches the Bug — Hey folks, here's a question I get on almost every night shift: which cold rooms ran too warm overnight? Sounds like a one-liner. Then you start asking what "overnight" means, in which time zone, whether exactly 5 °C counts, and what happens to the reading that lands right at 06:00. That's the kind of question where AI can save you time, and also the kind where it can quietly give you the wrong room. So I used it to try two things in a small SQL Server lab. First, GitHub Copilot in SSMS to draft the T-SQL, which I then review. Second, Microsoft's SQL MCP Server (Data API builder), so an agent can read the finished report but nothing else. At the end there's a short bit on vectors, because "have we seen this alarm before?" is a very different question. The code is on GitHub: dba-ai-lab / experiments/sqlserver-copilot-mcp , with the lab SQL, the reader login, the MCP config for VS Code, a tiny stdio test client and a one-command run script. ...

  • PostgreSQL + AI: I Tested pgvector Search and a Read-Only MCP Tool on Made-Up Tickets — Hi DBAs, this one started with a support ticket that said "my dashboard data is stale". Our runbook calls the same problem a "delayed refresh". Different words, same issue. A minute later someone asked me how many open tickets each queue has. Both sound like things you'd type into an AI assistant, but they're really two different jobs. The first one needs the right document. The second one needs a count from a table. So I built a small support lab in PostgreSQL 17 and tried both: pgvector for the runbook search, and Google's MCP Toolbox for Databases for the ticket count, with one fixed SQL statement behind it. Everything below is what I ran, what I expected, what came back, and the places where the demo is simpler than real life. The code is on GitHub: dba-ai-lab / experiments/postgresql-pgvector-mcp , with the lab SQL, the MCP Toolbox config, a tiny stdio test client and a one-command run script. 1. The lab, command by command Piece ...

  • AWS Postgres MCP Server Bug: "Read-Only" Wasn't Read-Only — Hi all. Two Postgres MCP security notes came out on the same day this September, and both teach the same lesson. This is the first one. On 4 September 2026 AWS published a bulletin for CVE-2026-85787 in awslabs postgres-mcp-server. The SQL validation used an incomplete list of disallowed inputs, so crafted SQL, hidden in content that reaches the MCP server while a real user is working with it, could change data even though the server was meant to stay read-only. Versions below 1.1.7 are affected, 1.1.7 fixes it, and AWS also recommends connecting with a minimal-privilege Postgres role instead of a superuser. That last recommendation is the real fix in my eyes. A read-only flag in a tool is a filter written by people, and filters miss things. A Postgres role that only has SELECT can't write, no matter how clever the SQL is. If you use this server: upgrade to 1.1.7 or later, check forks too, and look at which role the connection uses. If it's a superuser or the app owner, tha...

  • SQLcl Became an MCP Server. Give It the Smallest User You Can. — Since SQLcl 25.2 (July 2025), SQLcl can run as an MCP server. In plain words: an AI assistant like Copilot in VS Code can connect to your Oracle database through SQLcl and run SQL and PL/SQL for you. SQLcl keeps the saved connections on your own machine, and the SQL Developer extension for VS Code registers it as an MCP server automatically. Oracle's own advice in the post is the line I'd underline twice: connect with database users that have only the privileges they really need. I've used this setup in my lab videos, and honestly the AI part is the easy part. The real work is the user you hand over. If the saved connection is a DBA account, the assistant is a DBA too, with all the confidence and none of the fear. A read-only user on the schemas you want to discuss is the setup I'd start with, and I'd keep an eye on what it actually runs. Read the original: Introducing MCP Server for Oracle Database (Oracle Database Blog) Oracle SQLcl 25.2 release notes This is...

  • The Supabase MCP Case: When a Support Ticket Talks to Your AI — Hi all. If you only read one AI security story as a Postgres DBA, I'd make it this one. In July 2025 researchers showed a scenario with Supabase (Postgres underneath), its MCP server and Cursor. A developer asks the AI to look at the latest support tickets. One ticket, written by an attacker, contains instructions for the AI. Because the agent was connected with a powerful key, it could read private tables and write the result back where the attacker could see it. Simon Willison calls this mix the "lethal trifecta": access to private data, exposure to untrusted text, and a way to send data out. It was a demonstration, and Supabase says no customer data leaked this way. Their answer was read-only mode by default, project scoping and limiting which tools are on, while admitting prompt injection isn't solved. The lesson for us is old school. Don't hand an agent a superuser or a key that bypasses row level security. Use read-only where you can. And remember that a...

  • I Let an AI Audit 3,000 Oracle Accounts. 41 Failed Logins, Still Open. — Hi again, this one is about the part of DBA work nobody enjoys: the user audit. Locked accounts, people who left years ago, passwords from 2017, service accounts on the wrong profile, failed logins nobody ever looked at. I gave an AI read-only access to an Oracle database with almost 3,000 accounts, asked it six plain questions, and turned the answers into one HTML report for the security team. The headline finding: 219 failed logins in the lab, and the account with the most of them (41 tries) never locked, because its profile allows unlimited attempts. Nobody got a ticket. Below is how I set it up, what I asked, what I expected, what I got, and where the AI (and I) slipped. 1. The test environment, command by command Piece What I used Database Oracle AI Database 26ai Free (23.26.3) in Docker, PDB FREEPDB1, port on 127.0.0.1 only AI client VS Code + Copilot Chat in agent mode Door into the database SQLcl MCP server ( sql -mcp ), read-only by instruction Report One Pyt...

  • I Built a SQL Server Lab for AI Tests. AI Agent Read My Passwords! — I built a small SQL Server lab on my laptop so I could test AI tools against a real database. Then I asked Copilot three questions in plain English. Two answers were right. The third question was "delete the retired bikes", and that's where it got interesting: the MCP server said no, so the AI went looking for another way in. And it had already read my password file without asking. Okay friends, so this one is the foundation for a lot of later tests. Below is how I built the lab, every download and every command (even if you've never touched Docker or MCP, you can follow it top to bottom), then the three questions, what I expected vs. what I actually got, where things went wrong, and what I'd take from it. The code is on GitHub: dba-ai-lab / labs/sqlserver , with the compose file, the sample database, the DAB config and the MCP smoke test. 1. The test environment, command by command Four pieces, and how they talk to each other: VS Code + Copilot ...

  • A PostgreSQL Lab for AI Tests: Docker, pgAdmin, an MCP Server and VS Code — DBA AI Lab · Lab setup I Built a PostgreSQL Lab So Copilot Could Poke at It (Read-Only) PostgreSQL 17, pgAdmin and an MCP server in Docker on a 16 GB laptop, and Copilot in VS Code asking one question. What I expected, what broke, and what I fixed. 3 containers 16 GB RAM laptop 9 MCP tools 0 rows changed by the AI Okay friends, today's job was simple on paper: a PostgreSQL box on my own laptop that I can break while I try AI tools on it. No cloud database, no shared dev server. Something that starts when I log in, that I can throw away and rebuild in a few minutes, and that an AI can read but never change. By the end of the afternoon I had PostgreSQL 17 in Docker, pgAdmin next to it, an MCP server in front of it, and Copilot in VS Code answering a real question about the data. It did not go smoothly. VS Code turned out to be too new for the MCP server, and that alone ate most of my afternoon. I kept all of it in, because you'll probably hit some of the same things. ...