# SwiftAgent

A type-safe, declarative Swift framework for building AI agent pipelines out of composable steps, built on Apple's FoundationModels, with structured output, permission and sandbox guardrails, and MCP support.

SwiftAgent lets a developer build an AI agent pipeline declaratively, composing a sequence of steps in a body property the way SwiftUI composes views, with the framework auto-synthesizing how each step runs; each step's output becomes the next step's input, forming a compile-time type-checked pipeline, and steps needing more complex control flow can override the run method directly instead.

It is built on Apple's FoundationModels for native on-device AI, generates typed structured output, and includes permission, sandbox and guardrail systems as safety mechanisms alongside Model Context Protocol integration, participant runtimes and a skills system. An optional trait adds alternative model providers, including OpenAI, Claude and Ollama, in place of Apple's own models.

It is distributed as a Swift package, requires Swift 6.4 or later with iOS 26 or macOS 26 or later, and installs by adding it as a Swift Package Manager dependency.

Website: https://github.com/1amageek/SwiftAgent
