Skip to content

Governance Model

江河 edited this page Jul 21, 2026 · 2 revisions

Governance Model

dbgov classifies operations into R0-R3 risk tiers. The tool's measured plan is authoritative; AI agents must not infer blast radius on their own.

Tier Meaning Required Authorization
R0 Reads and inspection: query, explain, schema list/describe, schema dump to stdout, schema diff/plan, audit query/verify, doctor None, but audited
R1 Small safe writes, including schema dump --dir and export --dir --yes or interactive confirmation
R2 Elevated writes or protected-context R1 --yes and non-empty --ticket
R3 Destructive operations and governance-control changes R2 authorization plus the precise --allow-* flag

R3 Allow Flags

Operation Required Flag
Destructive schema apply/import --allow-destructive
No-WHERE update/delete --allow-no-where
Reconcile prune --allow-production-prune
Destructive rollback --allow-destructive and/or --allow-production-prune
Context set/use/import/credential migration --allow-context-change
Context deletion --allow-context-delete
Role set/unset --allow-role-change
Confirmed audit prune --allow-audit-prune

Governance-control changes authorize against the persisted pre-change policy. Preview modes return before authorization and do not mutate their target.

AI Agent Rules

  1. Run capabilities -o json before assuming available features.
  2. Use -o json for integration paths.
  3. Use explain, schema plan, and --dry-run as the source of impact.
  4. Stop and ask a human when a command requires ticket, allow flag, or high-risk confirmation.

Clone this wiki locally