Skip to content
Back to skills

Siri Ai Eval

BSecurity

Use when writing, running or reading Siri Evaluations tests for a Siri AI tool (`@AppIntent(.tool)`), when asked to prove Siri calls an app's tool, or when a Siri evaluation pass rate looks wrong, flaky, or too good to trust. Also covers `syrup-ai-eval summarize` output and `.xcresult` bundles from Siri evaluations.

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 19, 2026
ai-agentsrustgoswiftbashtestinggitapi

Works with

  • api

Security analysis

B75/100
  • criticalClaims developer/debug mode to bypass safety — documented in ToxicSkills study

Pro shows the line behind each finding and how to fix it

Scanned December 3, 2026

npx -y skills add airowe/syrup-ai-kit --skill siri-ai-eval --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Siri Ai Eval?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Siri Ai Eval
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/airowe-siri-ai-eval/badge)](https://www.skillsdirectory.com/skills/airowe-siri-ai-eval)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: siri-ai-eval
description: Use when writing, running or reading Siri Evaluations tests for a Siri AI tool (`@AppIntent(.tool)`), when asked to prove Siri calls an app's tool, or when a Siri evaluation pass rate looks wrong, flaky, or too good to trust. Also covers `syrup-ai-eval summarize` output and `.xcresult` bundles from Siri evaluations.
license: MIT
---

# Siri evaluations with SyrupAIEvalKit

## Overview

A Siri evaluation speaks a prompt to Siri on a real device and checks two things: which intents Siri called, and what Siri said. Siri varies between runs, so one pass proves little. A pass rate is only worth trusting when the checks can fail and you can see what the tool did in each run.

Requirements: iOS 27.3 on a physical iPhone (the frameworks don't ship for the Simulator) or a Mac on macOS 27.3 (run with `-destination 'platform=macOS'`; not yet verified against Siri), a UI test target linking `SyrupAIEvalKit`, and the app showing `ToolOutcomeView()` in debug builds (see the siri-ai-tool skill). Without that view every run records "tool outcome missing".

Setup: add a UI Testing Bundle target (for example `ParcelPalEvals`) that targets the app, link `SyrupAIEvalKit` to it, and give it a shared scheme. Use test data you control, so the expected reply text is known.

## Write the test

```swift
import AppIntentsTesting
import SyrupAIEvalKit
import SiriEvaluations
import Testing

private let bundleIdentifier = "com.example.parcelpal"
private let getOrderStatus = IntentDefinitions(bundleIdentifier: bundleIdentifier).intents["GetOrderStatusIntent"]
/// Only the live API returns this. It is never indexed in Spotlight, so hearing it proves the tool ran.
private let textOnlyTheAPIKnows = "Blue Kettle"
private let harness = SiriAppHarness(
    bundleIdentifier: bundleIdentifier,
    readyWhen: .labelBegins("app-status", with: "Ready")   // an element the app shows once it can call the API
)

private func orderScenario() -> SiriScenario {
    SiriScenario {
        UserTurn("In ParcelPal, where's my order?") {     // name the app in the prompt
            Calls { getOrderStatus }
            SiriResponse(.contains(textOnlyTheAPIKnows, caseSensitive: false))
        }
    }
}

@Test(.evaluates(ToolEvaluation(
    name: "Order status, repeated",
    harness: harness,
    dataset: .repeating(times: 5, orderScenario)
)))
func callsOrderStatusToolEveryTime() async throws {
    try expectAllPass(.intents, .siriResponse)
}
```

Rules:

- **Check both metrics.** `.intents` proves the tool was called; `.siriResponse` proves its answer reached the person.
- **Check for text only the API returns**, and confirm the app doesn't index it (`CSSearchableItem`, `IndexedEntity`). If it does, a passing reply proves nothing.
- **Repeat each scenario at least 5 times.** `.repeating(times:_:)` takes a closure that returns one `SiriScenario`. For another phrasing, write another scenario function and another `@Test`.
- **The ready signal must exist.** `readyWhen` waits up to 90 seconds for an accessibility element. Add one to the app (for example `Text("Ready").accessibilityIdentifier("app-status")`) if there isn't one.
- `before: .waitFor(.seconds(70))` delays each run, for example until a cache expires.

## Prove the checks can fail (negative control)

Break the tool, not the expectation, and do it with a launch switch, never a temporary code edit someone must remember to revert.

1. Define the switch in a file compiled into both the app and the UI test target:
   ```swift
   import SyrupAIKit
   extension EvalSwitch { static let badHost: EvalSwitch = "bad-host" }   // lowercase, digits, hyphens
   ```
2. Read it in the app's own code, where it breaks the tool (here, an API host that can't be reached), behind a condition no App Store build has:
   ```swift
   #if DEBUG || SIRI_AI_EVAL_SWITCHES
   if EvalSwitch.badHost.isOn() { baseURL = URL(string: "https://unreachable.invalid")! }
   #endif
   ```
   An Expo app's evaluations run in Release, where `DEBUG` is off: pass `SIRI_AI_EVAL_SWITCHES=YES` to that `xcodebuild test` run (the `expo-syrup-ai-kit` plugin wires it up). Tools generated by the plugin's `tools` option already honour `"bad-host"`, so skip this step for them.
3. Run the same scenario as the required evaluation with the switch on, and assert the reply check failed:
   ```swift
   @Test(.evaluates(ToolEvaluation.negativeControl(
       name: "Order status, bad host",
       harness: harness,
       turningOn: .badHost,
       dataset: .repeating(times: 2, orderScenario)
   )))
   func replyCheckFailsWithBadHost() async throws {
       try expectAllFail(.siriResponse)
   }
   ```

Confirm in the summary that the recorded outcome shows the break ("unreachable"). An expectation for an impossible string only proves string matching works. `expectAllFail` also passes on runs the harness cut short, so read the summary with `--fail-on real`: the control's line must say "as expected", with at least one complete run.

## Measure without the app's name (informational)

People often don't name the app. Ask the same question without it, as a separate evaluation:

```swift
private let orderQuestion = ToolQuestion("Where's my order?", appName: "ParcelPal")   // must not contain the app name
private func orderScenario(_ prompt: String) -> SiriScenario { /* UserTurn(prompt) { … } */ }

// Required: orderQuestion.namingApp is "In ParcelPal, where's my order?"
dataset: .repeating(times: 5) { orderScenario(orderQuestion.namingApp) }

// Informational: asks orderQuestion.withoutAppName, "Where's my order?"
@Test(.evaluates(ToolEvaluation.appNotNamed(
    name: "Order status without the app's name",
    harness: harness,
    question: orderQuestion,
    times: 5,
    scenario: orderScenario
)))
func orderToolWithoutTheAppName() async throws {}   // don't assert: Siri may fairly ask which app
```

Report its rate as a finding, never as a failure, and say which state the phone was in. Until someone answers Siri's "I can help you with requests like that in <App> from now on. Is that OK?" with yes, the rate is 0%. After one yes, that phone sends the question to the tool every time. A scenario that says yes only works on a phone that hasn't said yes yet, so it can't be a repeated evaluation. Don't put unnamed runs in the required evaluation: they'd drag down its pass rate.

## Run on the device

The phone must be unlocked, on power and quiet (Siri speaks each reply), with Siri AI on, Developer Mode on and Settings > Developer > Enable UI Automation on.

```bash
xcodebuild test -project ParcelPal.xcodeproj -scheme ParcelPalEvals \
  -destination 'id=<device UDID>' -allowProvisioningUpdates DEVELOPMENT_TEAM=<team ID> \
  -only-testing:'ParcelPalEvals/callsOrderStatusToolEveryTime()' -resultBundlePath order.xcresult
swift run --package-path <path to syrup-ai-kit checkout> syrup-ai-eval summarize order.xcresult --fail-on real
```

Find the device UDID with `xcrun devicectl list devices`. A result bundle path that already exists makes `xcodebuild` fail; use a new name per run.

## Read the summary

| Output | Meaning |
|---|---|
| "the run ended before all of its results arrived" | The harness cut the run short. Not a tool failure. |
| Apple pass rate | Xcode's number; counts cut-short runs as failures. |
| Real pass rate | Leaves cut-short runs out. Report this one, with the run count ("4 of 4"). |
| "answered without calling the tool" | Reply passed but the tool wasn't called: Siri answered from the Spotlight index. Remove the answer from the index. |
| "Informational: not counted toward the exit status." | An `appNotNamed` evaluation. Its pass rate is a finding only. |
| "Negative control: … as expected." | Every complete run's reply check failed, so the checks can fail. "the checks can't be trusted" means the broken app still passed: fix the checks before believing any pass rate. |
| Outcome "succeeded (served from cache)" | What the tool recorded via `ToolOutcomeLog`: every call in that run, oldest first, separated by "; " (the harness clears the log at each launch). "tool outcome missing" means no `ToolOutcomeView` on screen. |

Exit codes: 0 all passed; 1 a required run failed or a negative control's reply check passed (`--fail-on real` ignores cut-short runs); 2 no evaluations or unreadable bundle, which is never a pass; 64 bad usage. Add `--json` for machine-readable output.

## Common mistakes

| Mistake | Fix |
|---|---|
| Two `SiriScenario`s inside one `.repeating` closure | One scenario per closure; one `@Test` per phrasing |
| Reply check on text the app also indexes | Check text only the live API returns |
| Negative control that expects an impossible string | Break the tool with an `EvalSwitch` and assert `expectAllFail(.siriResponse)` |
| Negative control by editing code and reverting it | `ToolEvaluation.negativeControl(turningOn:)`, so it runs every time |
| Unnamed-app prompts mixed into the required evaluation | A separate `ToolEvaluation.appNotNamed` evaluation |
| Reading `EvalSwitch` in release builds | Wrap the check in `#if DEBUG \|\| SIRI_AI_EVAL_SWITCHES` |
| Expo negative control passes the reply check every run | The Release build compiled the switch out. Guard it with `#if DEBUG \|\| SIRI_AI_EVAL_SWITCHES` and pass `SIRI_AI_EVAL_SWITCHES=YES` to `xcodebuild test` |
| Reporting Xcode's pass rate alone | Report the real pass rate and how many runs were cut short |
| Running on the Simulator | Physical device only |

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.