Separation of Duties for Ai-assisted Changes

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up separation of duties for ai assisted changes by splitting draft and run roles. An AI tool or developer writes the change, while a separate human reviewer approves and runs it. Teams often start by giving AI coding helpers broad cloud or database keys. When permissions are too wide, an unreviewed script can delete tables or expose phone numbers. How separation of duties for ai assisted changes works in practice A safe setup splits your change workflow into three distinct roles. The

AI-Assisted Vulnerability Discovery + DPoP (Demonstration of Proof-of-Possession): the complete guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free white paper. No spam. Unsubscribe anytime.

You set up separation of duties for ai assisted changes by splitting draft and run roles. An AI tool or developer writes the change, while a separate human reviewer approves and runs it. Teams often start by giving AI coding helpers broad cloud or database keys. When permissions are too wide, an unreviewed script can delete tables or expose phone numbers.

How separation of duties for ai assisted changes works in practice

A safe setup splits your change workflow into three distinct roles. The first role is the builder role, which includes the developer and the AI tool. This role can read schema layouts and write code drafts in a test space. It holds no keys to live data or live servers.

The second role is the reviewer role, held by a peer engineer or team lead. This person checks the AI output for logic bugs and unsafe commands. Source control tools enforce this step with branch rules that block self-approval. The builder cannot merge their own pull request or bypass the peer check.

The third role is the runner role, which applies the approved change to live systems. Teams often assign this role to an automated deployment pipeline or a release manager. The pipeline uses its own separate identity to log in and run the update. No single person or AI agent controls all three steps from start to finish.

What native role splits solve and what they miss

Native role splits in source control and cloud platforms stop unreviewed code merges. They ensure a second human looks at every pull request before a build starts. They also keep long-lived admin keys out of developer laptops and local AI tools. This setup works well for planned code releases that follow a standard pipeline.

Still, static role setups only check who logs in at the start of a session. They do not inspect what individual commands or queries do while they run in flight. During a live incident, an engineer often needs direct shell or database rights to fix a bug. Once that engineer logs in, they can paste any AI-generated command straight into the live prompt.

AI-Assisted Vulnerability Discovery + DPoP (Demonstration of Proof-of-Possession): architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Standard cloud and database roles cannot pause a single risky command for peer approval. They also cannot rewrite sensitive fields like emails or card numbers in query results on the fly. If an engineer copies query results into an AI prompt, raw customer data leaves your system. You need command-level checks and data masking to close this operational gap.

How to design command-level review and data rules

Start by listing every live system where engineers run interactive commands or queries. Group your actions into safe read queries and high-risk write commands. Safe reads can run right away if masking rewrites matched fields like national IDs in results. High-risk writes should trigger a real-time approval check from a second team member.

Next, map each approval rule to a dedicated reviewer group in your chat or ticket tool. When an engineer sends an AI-assisted write command, the system holds the request. A peer checks the exact statement and clicks approve or deny. This brings true duty splitting to live console sessions, not just git branches.

Add runtime guardrails and masking beside your databases and APIs

Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits inline in the protocol beside the service as an open-source proxy, a sidecar for your database or API. On every production query an agent or human runs, hoop.dev decides whether to pass, mask, block, or escalate it for review.

Before a query runs, hoop.dev guardrails check the statement against your rules, an AI Analyzer you configure can score intent or hold risky calls for human approval, and hoop.dev data masking rewrites sensitive fields in responses in memory. Explore the MIT-licensed project on GitHub.

Frequently asked questions

Can an AI agent approve a pull request as the second reviewer?

An AI agent can scan code for style issues and common bugs before human review. Still, a human with separate accountability must give the final approval to keep true duty separation.

How do we handle urgent fixes when a second reviewer is asleep?

Set up an on-call rotation so a backup reviewer is always awake and available. If someone uses an emergency break-glass role, log every command for a mandatory morning audit.

Does duty separation apply to read-only database queries?

Read queries do not change data, so they rarely need peer approval to run. Instead, apply data masking to rewrite emails and card numbers in results before they reach AI prompts.

Save the open-source gateway.

hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.