MSBA-379 · Lesson 8 of 12 · 23 min

Domain review: guardrails and accountability

▶ Video coming soon A video version of this lesson is on the way.

Implement guardrails and accountability carries 10 to 15 percent of GH-600. Its bullets are few, but they are the most cross-cutting in the outline: almost every scenario in the other five domains has a guardrail question hiding inside it. Priya opened the session with the two scenarios Malik had misfiled in lesson 2. Both looked like tool configuration. One asked how to stop the cloud agent from changing workflow files; the other asked how to make sure a data migration script written by an agent could never run against production without a named person agreeing. "Neither is about which tool," Priya said. "Both are about which actions need a human and how you make the rest impossible."

The domain has two skill groups: define autonomy levels, and implement guardrails and human-in-the-loop workflows. Accountability, the second word in the domain's title, runs through both and connects to the traceability bullets in lesson 4 and the audit bullets in lesson 7. Malik scored 3 of 4 on the baseline.

Domain 6 in two skill groups.
Skill groupKey bulletsFirst taught in
Define autonomy levelsClassify actions by operational, security and compliance risk; assign autonomy levels that maximize delivery speed while meeting security and Responsible AI standardsSandboxes and permissions; Guardrails and policies
Implement guardrails and human-in-the-loop workflowsIdentify actions needing human judgment; block policy-violating actions; least privilege for permissions and execution contexts; explicit authorization or controlled paths for irreversible or compliance-sensitive changes; minimize approvals that do not reduce riskGuardrails and policies; Accountability and audit trails; Security risks: prompt injection and secrets

Classifying actions by risk

The first bullet asks you to classify agent actions by operational, security and compliance risk in order to right-size human intervention. The three kinds of risk are different questions. Operational risk asks what breaks if the action is wrong: a broken build, a failed deployment, a corrupted data set. Security risk asks what an attacker could gain: exposed secrets, widened permissions, a dependency with malware, code that injects user input into queries. Compliance risk asks which rules or obligations the action touches: personal data, audit records, regulated systems, licenses. An action's overall risk is the highest of the three, and reversibility modifies it: an easily reversed change is lower risk than the same change made permanent.

Rosa Delgado, who manages Tidewater's budget and had produced the one-page autonomy table in the previous course, came to this session to explain how she had built it. She listed every kind of action Tidewater's agents took or might take, gave each a rating of low, medium or high on each of the three risks, noted whether it was reversible, and then assigned a level. "I am not technical," she said. "I didn't need to be. I needed to know what goes wrong and who notices."

Rosa's autonomy table for Tidewater (excerpt). The level follows the highest risk, adjusted for reversibility.
ActionOperationalSecurityComplianceReversibleAutonomy level
Read code and issues, answer questionsLowLowLowNot applicableObserve
Apply triage labels to new issuesLowLowLowYesAct within policy
Open a pull request changing application codeMediumMediumLowYes, until mergedAct with approval
Change workflow files or agent configurationHighHighMediumPartlyPropose only; blocked for agents
Change subscriber mailing list dataMediumMediumHighPartlyPropose; person executes
Publish the guidebook or deploy the map siteHighMediumMediumPartlyNot available to agents; people deploy
A grid with risk on the vertical axis (low, medium, high) and reversibility on the horizontal axis (easily reversed, partly reversible, irreversible). Cells are colored by autonomy level: low and easily reversed is Act within policy; medium risk easily reversed is Act with approval; high risk or irreversible is Propose or blocked. Example actions are placed in cells: labels, pull requests, workflow changes, production deploys.
Risk and reversibility together decide the autonomy level. Irreversible actions move up the scale.

Assigning autonomy levels

The second bullet asks you to assign autonomy levels to maximize delivery speed while remaining compliant with organizational security and Responsible AI standards. The program's four levels, from Agentic AI in the Software Lifecycle: Architecture and Tools, are Observe, Propose, Act with approval and Act within policy. Two words in the bullet matter. Maximize means the goal is the highest autonomy that is safe, not the lowest that is comfortable; assigning Propose to triage labels wastes people's time. Compliant means the assignment must respect the organization's standards, which for Responsible AI include accountability, transparency, reliability and safety, and privacy and security, among Microsoft's published principles. An autonomy level that lets an agent make decisions about people's personal data without oversight fails the second test, however fast it is.

Which actions need human judgment

The guardrail group begins with identifying the subset of actions that require human judgment. The word subset is the point: not all of them. Actions need human judgment when they are irreversible, when they touch compliance obligations, when they involve trade-offs the agent cannot see (product direction, user impact, cost), when the evidence is ambiguous or agents contradict each other, and when the action changes the controls themselves, such as permissions, workflows or agent configuration. Everything else should be decided by checks and policy.

Blocking policy-violating actions

The next bullet asks you to block actions that violate security, compliance or Responsible AI policies. Blocking is deterministic: the action is impossible, not discouraged. GitHub offers many blocking controls, and the exam expects you to pick the right one for the action.

Blocking controls by action. Instructions can explain a rule; these make it hold.
Action to blockBlocking control on GitHub
Pushing to the default branchBranch ruleset or branch protection requiring pull requests; the cloud agent can push only to its own branches anyway
Changing workflow files or agent definitionsPush ruleset restricting file paths such as .github/workflows/** and .github/agents/**, plus CODEOWNERS review
Committing a secretSecret scanning push protection
Merging without checks or reviewRequired status checks and required reviews in a ruleset
Reaching an unapproved network destinationThe cloud agent firewall; the Agent Workflow Firewall for agentic workflows
Running an unapproved MCP serverAllowed and denied MCP servers in managed settings
Calling a dangerous tool or commandLeaving the tool out of the agent's list, or a preToolUse hook that denies it
Deploying to productionEnvironment protection rules with required reviewers, and no deploy credentials in the agent's environment

Tidewater's decision record, "agents may not edit workflow files", is the model answer to the first of Malik's misfiled questions. The rule is written down; a push ruleset on .github/workflows/** enforces it; CODEOWNERS makes Priya or Dmitri review any change to agent definitions or instruction files. An instruction in AGENTS.md saying the same thing is a useful explanation for the agent, but it is not the guardrail.

Least privilege for permissions and execution contexts

Scoping permissions and execution contexts to enforce least-privilege access combines several lessons. Permissions include the agent's token (the cloud agent's token reaches only its repository), its tools (the reviewer agent has read and search only), its MCP servers and their tools (two of twelve), its secrets (none, if the task needs none) and its network (the firewall's recommended list plus justified entries). Execution context means where the agent runs: a fresh cloud environment with nothing in it is a smaller context than a developer's laptop. For agentic workflows, read-only permissions are the default and writes happen only through safe outputs in separate jobs, which is least privilege by construction.

The lethal trifecta, from the lesson Security risks: prompt injection and secrets in Memory, Evaluation and Multi-Agent Orchestration, helps here. An agent that has access to private data, reads untrusted content and can communicate externally can be tricked by prompt injection into sending the data out. Least privilege breaks the trifecta by removing at least one corner: no secrets in the environment, only trusted people able to assign work, or a firewall that blocks the destination.

Explicit authorization for irreversible changes

The fourth guardrail bullet asks you to require explicit authorization or controlled paths for irreversible or compliance-sensitive changes. This answers Malik's second misfiled question. A data migration that could damage production data is irreversible in practice. The agent may write the script and open a pull request (Act with approval), but running it against production must go through a controlled path: a deployment workflow targeting a protected environment with a required reviewer who is a named person, credentials available only in that environment, and a record of who approved. The agent has no route to production that skips the approval.

Worked problem

Controlled path for a migration

An agent has written a migration for Tidewater's subscriber database. The team wants it applied to production only after Rosa, who owns subscriber data, approves. Which design meets the bullet?

Show solution
  1. The migration is irreversible in practice and compliance-sensitive (personal data).
  2. The agent may propose it in a pull request; merging needs review.
  3. Applying it runs only through a workflow job that targets a production environment with Rosa as required reviewer.
  4. Production credentials live only in that environment, never in the agent's copilot environment.

Answer: A pull request for the code, then a deployment job gated by an environment with a required reviewer and environment-only credentials. The agent can prepare the change but cannot execute it.

Minimizing approvals that do not reduce risk

The last bullet balances the others: preserve execution velocity by minimizing approvals that do not materially reduce risk. An approval reduces risk only if the approver has the information and the attention to catch a problem. An approval on every agent label change, or on every terminal command in a sandbox with no secrets, mostly trains people to click yes. The outline asks you to remove such approvals and rely on checks, policies and blocking controls instead, keeping human approval for the subset identified earlier.

On GitHub, some built-in approvals are deliberately kept: workflow runs triggered by a cloud agent pull request need approval before they run by default, because a workflow can use secrets and the agent could have changed what runs; and the person who asked for the change cannot approve the agent's pull request. These reduce risk materially. Approving each label an agent applies does not.

Accountability

Accountability means that every agent action can be traced to an agent, a configuration and a person who is answerable for it. The pieces come from the other domains: the session log and the pull request record what happened; commits signed by the cloud agent and attributed on behalf of the requester record who acted; the agent configuration in Git records which instructions were in force; hooks can log every tool call; and the audit log records agent sessions, the agent's identifier and the person it acted for, along with changes to settings and policies. Skerry streams its audit log to its security information and event management system so that agent events are kept with its other security records beyond GitHub's retention period.

A useful exam habit is to read every guardrail scenario with three questions: which actions need a human, how is everything else made safe without one, and how would we know afterwards who did what? An option that answers all three is usually right.

Worked problem

Too many approvals

Skerry's data group requires a person to approve every shell command the agent runs in Copilot CLI on a shared build server that holds deployment credentials. Developers approve hundreds of commands a day without reading them. What change best fits the guardrail bullets?

Show solution
  1. The approvals do not reduce risk materially, because they are not read.
  2. The real risk is the execution context: the server holds deployment credentials.
  3. Move agent work to a context without the credentials, such as the cloud agent or a runner with no secrets, and allow routine commands there by policy.
  4. Keep human approval for deployment, through a controlled path.

Answer: Fix the execution context with least privilege, allow routine commands within policy, and keep approval only for the irreversible step. Velocity rises and risk falls.

How the domain is tested

Expect scenarios that ask which control to use, which actions need approval, or how to reduce friction without increasing risk. The distractors are instructions offered as guardrails, approvals added where checks would do, and broad permissions justified by convenience. Malik's card for the domain was the shortest of the six: "Classify by risk. Block what must never happen. Approve what needs judgment. Automate the rest. Record everything."

Common mistakes

  • MistakeRelying on an instruction file to stop an agent changing workflows.

    InsteadUse a push ruleset on the paths and CODEOWNERS review; the instruction explains, the ruleset enforces.

  • MistakeAssigning the lowest autonomy level to everything for safety.

    InsteadAssign the highest level that is safe and compliant, to maximize delivery speed.

  • MistakeAdding approvals that nobody reads.

    InsteadRemove approvals that do not reduce risk and use checks or blocking controls instead.

  • MistakeGiving an agent production credentials so it can finish the job.

    InsteadRoute irreversible changes through a protected environment with a required reviewer.

  • MistakeTreating accountability as only the audit log.

    InsteadCombine session logs, pull requests, signed commits, versioned configuration, hooks and the audit log.

Summary and key terms

  • Domain 6 carries 10 to 15 percent: autonomy levels, guardrails, human-in-the-loop workflows and accountability.
  • Classify actions by operational, security and compliance risk, adjusted for reversibility, and assign the highest safe autonomy level.
  • Block policy-violating actions with deterministic controls: rulesets, push protection, firewalls, MCP allow lists, tool lists, hooks and environment protection.
  • Scope permissions and execution contexts to least privilege; route irreversible or compliance-sensitive changes through controlled, explicitly authorized paths.
  • Remove approvals that do not reduce risk, and keep a full trail from agent action to configuration to responsible person.
Guardrail
A control that prevents or limits an agent action, ideally deterministically.
Human-in-the-loop
A workflow design where a person must decide at defined points.
Controlled path
The only allowed route for a sensitive change, such as a gated deployment job with a required reviewer.
Least privilege
Giving an agent only the permissions, tools, data and network it needs for its task.
Lethal trifecta
Private data, untrusted content and external communication together, which makes prompt injection dangerous.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. What three kinds of risk does the study guide name for classifying actions?

    Show answer

    Operational, security and compliance risk.

  2. Which GitHub control blocks agents from changing workflow files?

    Show answer

    A push ruleset restricting the workflow file paths, with CODEOWNERS review.

  3. Why do cloud agent pull request workflow runs need approval by default?

    Show answer

    Workflows can use secrets, and the agent could have changed what runs.

  4. How do you break the lethal trifecta?

    Show answer

    Remove at least one corner: private data, untrusted content or external communication.

  5. What does "maximize delivery speed" imply about autonomy levels?

    Show answer

    Assign the highest level that remains safe and compliant, not the lowest.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz