Trust Insights is a new iOS 27 framework that provides behavioral context signals to help apps detect social engineering and coercion attacks. It uses on-device and cloud ML to assess whether a user may be coached by a scammer during sensitive operations like payments or account changes.
• Fills a critical security gap: biometrics and MFA confirm identity but not intent — Trust Insights adds a behavioral layer to catch real-time coaching scams
• Privacy-first architecture keeps device-sourced signals on-device, with only a single output value ever leaving the user's device
• Actionable risk levels (unknown/medium/high) integrate cleanly into existing risk-scoring logic for payments, account changes, and other high-value flows
Demonstrates requesting a coaching-risk insight before confirming a large payment, then adjusting the UI based on the risk level returned and submitting mandatory consumption feedback.
import SwiftUI
import TrustInsights
struct PaymentConfirmationView: View {
let amount: Decimal
let recipient: String
@State private var riskLevel: String = "Checking…"
@State private var showWarning = false
@State private var evaluationResult: IsLikelyBeingCoachedInsight.Result? = nil
@State private var insightEvaluation: InsightEvaluation? = nil
var body: some View {
VStack(spacing: 20) {
Text("Send \(amount, format: .currency(code: "USD")) to \(recipient)")
.font(.title2)
if showWarning {
Label("Unusual activity detected. Please verify this request independently before proceeding.", systemImage: "exclamationmark.triangle.fill")
.foregroundStyle(.orange)
.padding()
.background(.orange.opacity(0.1), in: RoundedRectangle(cornerRadius: 12))
}
Text("Risk signal: \(riskLevel)")
.foregroundStyle(.secondary)
Button("Confirm Payment") {
confirmPayment()
}
.buttonStyle(.borderedProminent)
}
.padding()
.task {
await evaluateTrust()
}
}
private func evaluateTrust() async {
let schema = InsightSchema(insight: IsLikelyBeingCoachedInsight.self)
let context = InsightContext(
operationCategory: .payment,
evaluations: [InsightEvaluation(schema: schema)]
)
let evaluator = InsightEvaluator(context: context)
guard await evaluator.authorizationStatus == .authorized else {
riskLevel = "Unavailable (not authorized)"
return
}
do {
let response = try await evaluator.requestEvaluation()
for result in response.results {
if let coached = result as? IsLikelyBeingCoachedInsight.Result {
insightEvaluation = result.evaluation
evaluationResult = coached
switch coached.value {
case .unknown:
riskLevel = "Unknown"
case .medium:
riskLevel = "Medium — adding friction"
showWarning = true
case .high:
riskLevel = "High — strongly warning user"
showWarning = true
}
}
}
} catch {
riskLevel = "Error: \(error.localizedDescription)"
}
}
private func confirmPayment() {
guard let evaluation = insightEvaluation else { return }
let consumption: InsightConsumption = showWarning ? .usedIncreasedFriction : .usedUnchangedFriction
evaluation.reportConsumption(consumption)
// Proceed with payment logic
}
}• Requires a special entitlement configured in Xcode before the API will work • reportConsumption() is mandatory after every evaluation — omitting it may cause rate limiting • Never treat .unknown or a missing result as low-risk; unknown means no evidence of scam, not absence of risk • Sandbox environment is used during development; production models apply only after App Store distribution • Outright blocking a transaction based solely on a Trust Insights result is not recommended
Requires Internet reachability at evaluation time; evaluation can take a couple of seconds. Users can disable Trust Insights in Settings, which will block authorization.