dataiotech Labs
dbaguidedataxtoolsdataopspheredataopsphereDataOps
dataopsphere.com
AI Governance & Operations
14 min
2026-11-11

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.

#ai-governance#mcp#sql-server#least-privilege#human-in-the-loop#audit-trail#raci
Evidence & Scope Status (Control Date: 2026-11-11): The governance controls and evidence envelopes in this guide are grounded in our `locally-tested` deterministic MCP + SQL Server 2022 (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:

  1. 1
    Unbounded Tooling: Giving an assistant free-form SQL or session termination tools behind a "please ask before running" prompt (documented MCP guidance confirms annotations and prompts are not security boundaries).
  2. 2
    Silent 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 0 rows during an active lock.
  3. 3
    Unattributed 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)

RoleDesigneeGovernance & Incident Duty (RACI)Hard Boundary
Platform Security / DB OwnerDatabase Platform LeadAccountable (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 MaintainerPlatform EngineerResponsible (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 OperatorHuman ResponderResponsible (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 OwnerTech LeadConsulted (C): Evaluates business impact of rolling back an open transaction holding locks.Approves business trade-offs before human session termination.
Audit & Compliance ReviewerReliability / SecOpsInformed (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

Architecture Topology & Flowchart
Rendering architecture diagram...

▸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 explicit BLOCKED / NOT RUN status when live LLM execution is unavailable).
  • Evidence Provenance: snapshot_id, evidence_id, capture_timestamp_utc, capture_timestamp_istanbul, snapshot_age_seconds, and permission_scope.
  • Boundary Telemetry: Hash of the tools/list schema, 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

[!NOTE] Representative Incident Label: The incident below is a structured shift walkthrough designed to operationalize the synthetic lab (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

  1. 1
    02:14 UTC — Alert & Initial Trigger: The APM tier triggers an alert for checkout-service connection pool starvation accompanied by elevated latency (p99 > 8500ms). The on-call SRE/DBA acknowledges the incident and prompts the AI diagnostic assistant to invoke get_blocking_snapshot.
  2. 2
    02:15 UTC — Agent Output & Silent Blindness Telemetry: The assistant returns blocked_sessions: [], but the evidence envelope includes visibility_complete: false, has_vsps: 0, and permission_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 STATE absent).
  3. 3
    02: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-041 verification script (sp_whoisactive / sys.dm_os_waiting_tasks) under an elevated personal administrative session to capture fresh, full-visibility evidence.
  1. 1
    02: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 the orders table, blocking 42 downstream sessions.
  2. 2
    02:20 UTC — Human-Approved Remediation: The assistant possesses zero termination privileges (KILL is barred at the DB engine per Section 5 O1 rules). The On-Call DBA executes the canonical mssql-blocking-chain runbook, notifies the service owner, and manually issues KILL 61 directly from SSMS.
  3. 3
    02:22 UTC — Incident Closure & Verification: The Platform Owner remediates the telemetry grant. The assistant re-runs get_blocking_snapshot, this time returning visibility_complete: true, has_vsps: 1, blocked_sessions: [], and snapshot_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)

json
{ "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/list contains 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_ONLY warnings whenever server-wide visibility is absent.
  • Freshness & Staleness Threshold Enforced: Every snapshot includes capture timestamps and is_stale flagging; 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

3-SITE TRIAD SERIES

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):

Ready to test this architecture in production?

Deploy tested CI/CD workflows and one-click local Docker sandboxes instantly.