---
title: "Block the action until they agree"
lesson_id: "05"
---

# Block the action until they agree

- **Lesson ID:** 05
- **Goal:** Put the gate inside the side-effect tool and keep those tools off voter sessions.
- **Human lesson:** [05-gate-the-action.html](05-gate-the-action.html)

## Prerequisites

Lesson 04.

## Inputs, outputs, and artifacts

- **Inputs:** Gate and a side-effect Tool.
- **Outputs:** A checklist that binds consensus to execution.
- **Artifacts:** IssueRefund sketch, ToolCallingMode note, checklist, and primary sources.

## Agent build steps

1. Refuse the tool unless Gate.allow.
2. Use ToolCallingMode.disallowed on voter sessions.
3. Cite [WWDC26 session 242](https://developer.apple.com/videos/play/wwdc2026/242/) and Foundation Models docs.
4. Link [Pause and resume long AI jobs](../on-device-durable-workflows/), [Stop prompt attacks and leaks](../on-device-guardrails/), and [Talk to tools with MCP](../on-device-mcp-server-client/).

## Constraints

iOS 27 or later, or macOS 27 or later, and Xcode 27. Plain spoken English. No metaphor, quizzes, Mermaid, or em dashes. Do not claim Dynamic Profiles run several agents in parallel inside one session. Parallel votes need several LanguageModelSession values. Confirm Dynamic Profile names in the installed SDK docs.

## Key concepts

- The gate must sit in the tool, not only in the chat view.
- Voter sessions use no side-effect tools.
- The runner session may call the tool only after the gate allows it.
- Tool calling modes include allowed, disallowed, and required.

## Takeaways

- Several sessions vote, you tally, a judge or person breaks a split, the tool checks the gate.
- Keep side-effect tools off voter sessions.
- One profile body is not a parallel vote.

## Acceptance checks

- Side-effect tools check the gate.
- Voter sessions do not carry those tools.
- Primary sources and sibling links are present.

