---
title: "Why one session is not enough"
lesson_id: "01"
---

# Why one session is not enough

- **Lesson ID:** 01
- **Goal:** State that a single session reply must not fire a costly side effect. Name the gate.
- **Human lesson:** [01-one-session-is-not-enough.html](01-one-session-is-not-enough.html)

## Prerequisites

LanguageModelSession on iOS 27 or macOS 27. Xcode 27.

## Inputs, outputs, and artifacts

- **Inputs:** A high-cost action such as refund, delete, or send.
- **Outputs:** The rule that a reply is a draft, and that the app owns the gate.
- **Artifacts:** Progressive .flow diagrams, environment setup, and a two-session Swift sketch.

## Agent build steps

1. Show two LanguageModelSession values with different Dynamic Profiles.
2. Say Foundation Models has no vote API.
3. Place a gate in front of side-effect tools.
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

- A single session can plan and call tools. That is fine for drafts.
- One model reply is a sample, not consent to refund, delete, or send.
- There is no Foundation Models vote API. You write the gate.
- Parallel agreement needs two or more sessions.

## Takeaways

- A reply is not consent to act.
- Side-effect tools stay closed until the gate passes.
- The app decides when a draft may execute.

## Acceptance checks

- A single session is marked as not enough for side effects.
- Sibling links, progressive .flow diagrams, and the Agent brief link are present.
- [ ] Proceed to [lesson brief](02-profiles-and-sessions.llms.md).
