Operating an AI DBA Assistant: Permission Boundaries, Human Approval and Audit Trails
RACI authority matrix, silent visibility and stale-evidence escalation, untrusted data containment, human handoff protocol, and audit trail acceptance gates for AI DBA assistants.
16.0.4305.5) lab (RUN-2026-11-11T09-31-41-053Z). Live LLM agent runs are `blocked / not-run` (`0/3`) because no model API credentials are configured on the host; SSMS 22.7+ Agent Mode governance (CONSTITUTION.md, Group Policy) is `documented / not-tested`. This guide intentionally omits SQL snippets—refer to DBA Guide for implementation syntax.1. Reader Question and Operational Framing
Reader question: *When an engineering team deploys a read-only AI DBA assistant for database contention triage, who owns permissions, how are incomplete or stale answers prevented from misleading responders, and what evidence must be logged before a human takes action?*
An AI assistant that diagnoses database blocking is not an autonomous operator—it is an untrusted, probabilistic triage helper consuming deterministic telemetry. Operational safety depends on where decisions are constrained, not on whether a model promises in prose to behave safely.
Three governance failures appear repeatedly in early agent deployments:
- 1Unbounded Tooling: Giving an assistant free-form SQL or session termination tools behind a "please ask before running" prompt (
documentedMCP guidance confirms annotations and prompts are not security boundaries). - 2Silent Visibility Blindness: Interpreting an empty blocking list as "the database is healthy" when the diagnostic account actually lacked instance-level DMV visibility—verified in our lab where an unprivileged role silently received
0rows during an active lock. - 3Unattributed Claims: Accepting diagnoses that lack a
snapshot_id,evidence_id,capture_timestamp_utc, or staleness check (is_stale), making post-incident audits impossible.
2. Authority and Responsibility Matrix (RACI)
| Role | Designee | Governance & Incident Duty (RACI) | Hard Boundary |
|---|---|---|---|
| Platform Security / DB Owner | Database Platform Lead | Accountable (A): Approves tool allowlists, least-privilege service accounts, and isolated vs shared environment policy. | Instance-wide telemetry grants are prohibited on shared multi-tenant production unless explicitly risk-accepted with compensating controls. |
| MCP / Tooling Maintainer | Platform Engineer | Responsible (R): Maintains pinned tool schemas, field redaction policies, timeouts, and deterministic negative tests. | Cannot expose free-form SQL, shell, file write, outbound URLs, or session termination to the agent. |
| On-Call DBA / SRE Operator | Human Responder | Responsible (R) / Approver: Reviews agent-cited evidence_id and capture_timestamp_utc, verifies live state independently, and executes any remediation. | Sole authority to run remediation steps via canonical runbooks; agent cannot trigger write actions. |
| Application Service Owner | Tech Lead | Consulted (C): Evaluates business impact of rolling back an open transaction holding locks. | Approves business trade-offs before human session termination. |
| Audit & Compliance Reviewer | Reliability / SecOps | Informed (I): Audits immutable decision logs, permission denials, and post-incident timelines. | Reviews complete tool traces (tools/list, tools/call, redacted responses). |
3. Handling Incomplete, Stale, or Prompt-Injected Evidence
▸3.1. Decision Flow for Missing Visibility & Stale Snapshots
▸3.2. Mandatory Audit Trail Fields
Every diagnostic interaction retained for incident review must log:
- Execution Context:
lab_id/ environment identifier, pinned adapter/server version, model provider & client version (or explicitBLOCKED / NOT RUNstatus when live LLM execution is unavailable). - Evidence Provenance:
snapshot_id,evidence_id,capture_timestamp_utc,capture_timestamp_istanbul,snapshot_age_seconds, andpermission_scope. - Boundary Telemetry: Hash of the
tools/listschema, exact tool arguments, redaction policy applied (excluding logins, hosts, full SQL texts, and credentials), and any rejected parameter/tool attempts.
4. Representative Incident Walkthrough: Silent Visibility Blindness and Human-Approved Remediation
locally-tested) boundary conditions, the Section 2 RACI matrix, and the Section 5 O1 acceptance gates in a realistic production triage workflow.▸4.1. Incident Timeline and On-Call Progression
- 102:14 UTC — Alert & Initial Trigger: The APM tier triggers an alert for
checkout-serviceconnection pool starvation accompanied by elevated latency (p99 > 8500ms). The on-call SRE/DBA acknowledges the incident and prompts the AI diagnostic assistant to invokeget_blocking_snapshot. - 202:15 UTC — Agent Output & Silent Blindness Telemetry: The assistant returns
blocked_sessions: [], but the evidence envelope includesvisibility_complete: false,has_vsps: 0, andpermission_scope: "SELF_SESSION_ONLY". Even if the assistant outputs "No active blocking detected on the server", the envelope metadata proves the server is not clean—the diagnostic identity simply lacks server-wide DMV visibility (VIEW SERVER PERFORMANCE STATEabsent). - 302:16 UTC — On-Call Interpretation & RACI Escalation: The On-Call DBA (RACI: *Responsible*) refuses to interpret the empty list as a bill of health pursuant to the Section 2 matrix, initiating a dual-path escalation:
- Privilege/Platform Escalation: Escalates the telemetry credential defect to the Database Platform Owner (RACI: *Accountable*).
- Independent Evidence Verification: Because the agent is blind, the DBA executes the canonical
ms-041verification script (sp_whoisactive/sys.dm_os_waiting_tasks) under an elevated personal administrative session to capture fresh, full-visibility evidence.
- 102:18 UTC — Root Cause Confirmation: Independent evidence (
evidence_id: ev-prod-20261114-0218-man) confirms SPID 61 holds an uncommitted transaction (sleeping head-blocker) against theorderstable, blocking 42 downstream sessions. - 202:20 UTC — Human-Approved Remediation: The assistant possesses zero termination privileges (
KILLis barred at the DB engine per Section 5 O1 rules). The On-Call DBA executes the canonicalmssql-blocking-chainrunbook, notifies the service owner, and manually issuesKILL 61directly from SSMS. - 302:22 UTC — Incident Closure & Verification: The Platform Owner remediates the telemetry grant. The assistant re-runs
get_blocking_snapshot, this time returningvisibility_complete: true,has_vsps: 1,blocked_sessions: [], andsnapshot_age_seconds: 2. The DBA independently verifies that query queues have drained and marks the incident resolved.
▸4.2. Sample Audit Log (JSON Audit Trail)
{
"incident_id": "INC-20261114-0214-BLCK",
"timestamp_utc": "2026-11-14T02:22:15Z",
"environment": "production-core-db",
"agent_execution": {
"snapshot_id": "snp-20261114-0215-001",
"evidence_id": "ev-20261114-0215-001-blind",
"permission_scope": "SELF_SESSION_ONLY",
"has_vsps": 0,
"visibility_complete": false,
"is_stale": false,
"raw_agent_claim": "No blocking detected"
},
"escalation": {
"trigger": "SILENT_VISIBILITY_BLINDNESS_DETECTED",
"raci_path": "On-Call DBA (R) -> DB Platform Owner (A)",
"verification_script": "canonical/ms-041-blocking.sql",
"independent_evidence_id": "ev-prod-20261114-0218-man",
"detected_root_cause": "SPID 61 sleeping head-blocker on orders table (duration 420s)"
},
"remediation": {
"action_taken": "KILL 61 (Human manual execution via runbook mssql-blocking-chain)",
"decision_maker": "gdedeoglu (On-Call Staff DBA)",
"rationale": "High priority pool starvation; agent lacked execution privilege and visibility; manual verification confirmed head blocker",
"o1_compliance": "Gate 2 (account separation) and Gate 8 (human escalation path) strictly enforced"
},
"final_verification": {
"snapshot_id": "snp-20261114-0222-002",
"evidence_id": "ev-20261114-0222-002-valid",
"permission_scope": "SERVER_TELEMETRY",
"has_vsps": 1,
"visibility_complete": true,
"is_stale": false,
"blocked_sessions_count": 0,
"incident_status": "RESOLVED_CLOSED"
}
}5. Human Handoff and Release Acceptance Gates (`O1`)
Before promoting an AI DBA diagnostic assistant from an isolated synthetic lab (locally-tested deterministic boundaries) to controlled internal evaluation, require all of the following checks (O1 Embedded Checklist):
- Tool Allowlist Verified: Negative tests confirm
tools/listcontains only read-only fixed-query tools and the host rejects unknown tools and unexpected parameters. - Database Account Separation Confirmed: Fixture/application accounts are strictly separated from the diagnostic agent login; direct SQL write, DDL, and session termination attempts by the agent login fail at the database layer.
- Silent Empty-Result Guard Active: The adapter explicitly verifies telemetry permissions and surfaces
SELF_SESSION_ONLYwarnings whenever server-wide visibility is absent. - Freshness & Staleness Threshold Enforced: Every snapshot includes capture timestamps and
is_staleflagging; stale evidence cannot be summarized as current health. - Redaction Policy Enforced: Default tool responses omit logins, hostnames, full query strings, and connection strings.
- Untrusted Data Containment Tested: Database text fields carrying adversarial instructions remain wrapped as untrusted data and do not alter tool boundaries (recognizing single tests do not prove full prompt-injection immunity).
- Live LLM Behavioral Evaluation Completed: At least 3 independent real LLM agent runs across normal, blocking, low-privilege, disallowed-action, and injection scenarios are logged and reviewed (currently `blocked / not-run` in this package—must be completed before operational rollout).
- Human Escalation Path Linked: Responders follow the canonical intervention runbook rather than trusting agent remediation suggestions blindly.
6. Official References (Control Date: 2026-11-11)
▸Companion Perspectives in This Triad
- Technical Architecture & Lab Evidence (dbaguide): Your First AI DBA Assistant for SQL Server: Evidence-Based Diagnosis with MCP
- Tool Layer Comparison (dataxtools): Choosing an AI Assistant for SQL Server: SSMS Copilot, MCP and Custom Agents
Complementary Ecosystem Content: SQL Server and Agentic AI: A Controlled DBA Assistant with MCP
Complementary dataiotech publications covering this problem from different angles (diagnostics, tooling, escalation):
Your First AI DBA Assistant for SQL Server: Evidence-Based Diagnosis with MCP
Fixed 3-tool MCP contract, sleeping open-transaction head-blocker capture, VIEW SERVER PERFORMANCE STATE visibility boundaries, and verified SQL Server 2022 lab evidence.
Choosing an AI Assistant for SQL Server: SSMS Copilot, MCP and Custom Agents
Layer-by-layer evaluation of SSMS 22.7+ Copilot Agent Mode (documented/not-tested), MCP protocol annotations, MCP Toolbox v1.16.0 (locally-tested), Data API builder SQL MCP, and custom fixed-query adapters.
Ready to test this architecture in production?
Deploy tested CI/CD workflows and one-click local Docker sandboxes instantly.