Give agents access to your app's live state

Let agents investigate UI, stored data, and app-specific state in your iOS app with tools scoped to development.

Use remote tools to answer questions about what the app is showing, what it has stored, and which app-specific state is driving its behavior. Enable only the inspection or development actions your workflow needs.

Remote tools let the local host player and CLI clients inspect or operate on a paired iOS app. Keep them scoped to local development and QA builds.

Important Security Rule

Do not ship native tool suites in TestFlight, App Store, CI release, or other distributable builds unless the capability is explicitly approved.

Do this:

  • add the aggregate Ansight product or individual tool products only to local development builds
  • set ANSIGHT_ALLOW_REMOTE_TOOLS=true only for those local builds
  • use the narrowest runtime guard that works for the workflow

Do not do this:

  • ship tool products in distribution builds
  • leave ANSIGHT_ALLOW_REMOTE_TOOLS=true in shared release configuration
  • expose write or critical tools when read-only inspection is enough

Build-Time Opt-In

export ANSIGHT_ALLOW_REMOTE_TOOLS=true

Without this local-development opt-in, the SwiftPM build tool and CocoaPods build phase fail when they detect concrete AnsightTool implementations.

Runtime Registration

The aggregate Ansight product registers the standard native tool suites for you:

import Ansight

let options = try AnsightOptions.createBuilder(.ansightDeveloperDefaults)
    .withReadOnlyToolAccess()
    .build()

try AnsightRuntime.shared.initializeAndActivateAnsightSdk(options: options)

Core-only apps can register suites directly:

import AnsightCore
import AnsightToolsDatabase
import AnsightToolsFileDescriptorDiagnostics
import AnsightToolsFileSystem
import AnsightToolsPreferences
import AnsightToolsClipboard
import AnsightToolsReflection
import AnsightToolsSecureStorage
import AnsightToolsVisualTree

try AnsightRuntime.shared.registerVisualTreeTools()
try AnsightRuntime.shared.registerDatabaseTools()
try AnsightRuntime.shared.registerFileDescriptorDiagnosticsTools()
try AnsightRuntime.shared.registerFileSystemTools()
try AnsightRuntime.shared.registerPreferencesTools()
try AnsightRuntime.shared.registerClipboardTools()
try AnsightRuntime.shared.registerPurchaseTools()
try AnsightRuntime.shared.registerReflectionTools()
try AnsightRuntime.shared.registerSecureStorageTools()

Registered tools stay hidden and unusable until toolGuard allows their policy.

Runtime Availability

tool.query evaluates each visible tool against current app state. Catalog entries include runtime.available, reasonCode, reason, requiredState, remediation, retryable, and evaluatedAtUtc, plus a top-level executable flag. Availability is evaluated again immediately before tool.call; an unavailable call returns a structured error instead of running the tool. Tools without prerequisites return .availableNow.

Suite Registration API

SuiteProductCommon registration API
VisualTreeAnsightToolsVisualTreeregisterVisualTreeTools()
DatabaseAnsightToolsDatabaseregisterDatabaseTools(options:), AnsightDatabaseToolsOptions.createBuilder(), addRoot(alias:path:), includePlatformRoots(...)
FileSystemAnsightToolsFileSystemregisterFileSystemTools(options:), AnsightFileSystemToolsOptions.createBuilder(), addRoot(alias:path:)
File Descriptor DiagnosticsAnsightToolsFileDescriptorDiagnosticsregisterFileDescriptorDiagnosticsTools(options:), AnsightFileDescriptorDiagnosticsOptions(...)
PreferencesAnsightToolsPreferencesregisterPreferencesTools(options:), AnsightPreferencesToolOptions(defaultStore:allowedStores:allowedKeys:allowedKeyPrefixes:)
ClipboardAnsightToolsClipboardregisterClipboardTools(); included by Ansight
PurchasesAnsightCoreregisterPurchaseTools(), PurchaseStoreKit.refresh(productIds:)
SecureStorageAnsightToolsSecureStorageregisterSecureStorageTools(options:), AnsightSecureStorageToolsOptions.createBuilder(), withStorageIdentifier(...), withAppleService(...), allowKey(...), allowKeyPrefix(...)
ReflectionAnsightToolsReflectionAnsightReflectionRootRegistry.register(...), registerGetter(...), deregister(...), clear(), registerReflectionTools(options:), AnsightReflectionToolsOptions.createBuilder(), allowRoot(...), allowTypePrefix(...)
Custom Toolsapp coderegisterTool(_:), registerTool(_:replaceExisting:), isToolRegistered(...)
ArtifactsAnsightCore / AnsightregisterArtifactProvider(...), registerArtifactProviders(...), unregisterArtifactProvider(...), clearArtifactProviders()

Guard Levels

GuardWhat it allows
withToolsDisabled() / .disabledNo discovery, no execution.
withReadOnlyToolAccess() / .readOnlyMaximum policy .read.
withReadWriteToolAccess() / .readWriteMaximum policy .write.
withAllToolAccess() / .fullAccessMaximum policy .critical.

Tool Suites

Artifacts are a core provider model rather than a separate native tool package. Registering an artifact provider adds the .read policy artifacts.query and artifacts.request tools. See Artifacts.

SuiteProductTypical use
VisualTreeAnsightToolsVisualTreeInspect the foreground UIKit hierarchy, capture screenshots, and manage diagnostic overlays.
DatabaseAnsightToolsDatabaseDiscover SQLite databases, inspect schema, and run read-only queries.
FileSystemAnsightToolsFileSystemList directories, read files, download files, push, copy, move, and delete files inside approved roots.
File Descriptor DiagnosticsAnsightToolsFileDescriptorDiagnosticsCount and inspect open process descriptors, limits, and utilization.
PreferencesAnsightToolsPreferencesRead and mutate UserDefaults values under store/key allow-lists.
ClipboardAnsightToolsClipboardRead, check, set, and clear the active app’s device clipboard.
PurchasesAnsightCoreRecord and validate StoreKit evidence on Apple simulators.
SecureStorageAnsightToolsSecureStorageRead and mutate Keychain values under explicit key allow-lists.
ReflectionAnsightToolsReflectionInspect explicitly registered live object roots and optionally call root-owned mutation/invocation adapters.
Custom Toolsapp codeExpose narrow app-specific development operations.

For most teams:

  1. Start with VisualTree and Database.
  2. Use .readOnly by default.
  3. Use File Descriptor Diagnostics for resource-leak investigations, with targets disabled unless paths are needed.
  4. Add FileSystem, Preferences, or SecureStorage only for a specific debugging workflow.
  5. Add Reflection only after registering narrow roots and type/root filters.
  6. Add Artifacts when app-specific output should become a streamed file or durable session artifact.
  7. Add Custom Tools only for narrow operations that packaged suites cannot cover.
  8. Keep write and delete operations off unless the workflow genuinely depends on them.