---
title: "Test the pipeline on device"
lesson_id: "05"
---

# Test the pipeline on device

- **Lesson ID:** 05
- **Goal:** Add local tests and a checklist that keeps every check on the device.
- **Human lesson:** [05-keep-checks-on-device.html](05-keep-checks-on-device.html)

## Prerequisites

Lesson 04.

## Inputs, outputs, and artifacts

- **Inputs:** Fixture strings for attack, PII, and a clean pass.
- **Outputs:** A shipping checklist.
- **Artifacts:** Two test sketches, checklist, and primary sources.

## Agent build steps

1. Test a blocked paste, a redacted email, and a clean pass.
2. List the six checklist items.
3. Cite Foundation Models and [WWDC26 session 242](https://developer.apple.com/videos/play/wwdc2026/242/).
4. Link [Run tools in a safe box](../on-device-sandboxed-tools/), [Talk to tools with MCP](../on-device-mcp-server-client/), and [Make several agents agree first](../on-device-multi-agent-consensus/).

## Constraints

iOS 27 or later, or macOS 27 or later, and Xcode 27. Plain spoken English. No metaphor, quizzes, Mermaid, or em dashes. Apple's Guardrails.default is a safety filter, not PII redaction or injection detection. Do not invent a built-in injection API.

## Key concepts

- Local tests feed attack paste, PII strings, and clean prompts through the gate.
- A blocked injection fixture is expected.
- Redacted output must contain tokens and not the raw address.
- Every check runs on device with no network.

## Takeaways

- Check first, redact second, then call the model on the device.
- Add local tests for a block, a redaction, and a clean pass.
- Store restore maps outside the transcript.

## Acceptance checks

- Tests do not require a network.
- Primary sources and sibling links are present.

