Swift Guide

Swift is the Forge surface for iOS, macOS, and Apple-platform agent experiences. Read this tab when identity-aware agents need to feel native on a device while still satisfying the same ANVIL contract as the server runtimes.

Language perspective

Swift users should focus on local identity, user consent, UI-bound approval flows, and provider boundaries that fit Apple-platform application structure.

Primary surfaces:

  • forge-swift/Sources/ForgeCore
  • forge-swift/Sources/ForgeAgent
  • forge-swift/Sources/ForgeIdentity
  • forge-swift/Sources/ForgeAuth
  • forge-swift/Sources/ForgeMCP
  • local runtime and UI integration adapters

Follow this path

  1. Start with Identity and Glyphs.
  2. Read Agents and Agent events.
  3. Add Capabilities for user-approved tools.
  4. Read Web Substrate only where Swift shares app flows with web surfaces.
  5. Use Security Model before device-local storage decisions.
swift test
python3 tools/release_gate.py --root .

Contract focus

Contract Swift reading lens
Identity Make the agent DID and glyph visible where users need trust cues.
Capability Map sensitive actions to explicit approval and local UX states.
Events Keep UI state synchronized with agent lifecycle and tool events.
Security Treat local key material, prompts, and credentials as platform-sensitive data.
Providers Keep provider calls behind the shared Forge contract.

Identity

DIDs, roots, lineage, and seeded production identities.

Glyphs

Deterministic identity rendering for user-facing trust surfaces.

Agent events

Runtime events that drive native UI state.

Security model

How identity, capabilities, and approval interact.

Current guidance

Use Swift for native Apple experiences. Do not lower the contract for local UX: the same identity, authority, and telemetry requirements still apply.