Skip to content
Content

How do I evaluate iMessage integration security?

Evaluate iMessage integration security: verify signed webhooks, protect keys, check who sent a message and require approval before sensitive actions.

How do I evaluate iMessage integration security?

Check whether your app can verify webhook signatures and identify who sent a message, whether keys stay out of the agent and whether sensitive actions require approval. Keiki is SOC 2 and HIPAA compliant, signs the turn requests and event webhooks it sends your app, keeps your keys out of the agent and asks for Face ID before sensitive actions on eligible lines.

Key takeaways

  • Judge an iMessage API by what happens after a text arrives: who sent it, what the agent may do and who approves it.
  • Keiki is SOC 2 and HIPAA compliant. It encrypts stored credentials with AES-256-GCM and keeps only a hash of each API key.
  • Turn requests and event webhooks Keiki sends your app are signed, so your app can reject forged and replayed requests.
  • An identity webhook ties each verified sender to an account in your product before the model reads anything.
  • Sensitive tools wait for a Face ID approval in Keiki Vault on eligible lines, and a teammate can take over the thread from the inbox.

What should a secure iMessage API protect?

Your credentials, your customers' accounts and the actions your agent takes. A line API that only forwards texts leaves all three to you. Keiki covers them in the platform.

Secrets you save are encrypted at rest and can't be read back from the dashboard or the API. A secret bound to a host reaches the agent's sandbox only as a placeholder, and the real value is added to outgoing requests to that host. Secrets never enter the prompt, the transcript, traces or tool arguments. See Security for the full list of controls.

How do I check that a request really came from Keiki?

Verify the raw request body before you act on it. Turn requests to an external harness carry Keiki's Ed25519 platform signature, or an HMAC under your own signing secret. Event webhooks carry a Keiki-Signature HMAC-SHA256 under your signing secret, and webhooks to an external agent can also carry a Keiki-Signature-Ed25519 header. With a signing secret, verifyKeikiRequest from @onkeiki/channels checks the HMAC and the replay window for you.

Delivery is at least once, so deduplicate completed work by the verified event ID. See Event webhooks for the headers and retry rules.

How does Keiki know who is texting my agent?

Configure an identity webhook. Your app verifies the callback, looks up the sender in your own accounts and returns that account's scopes. iMessage lines bought through Keiki carry the provider-verified sender and whether the chat is a DM, and the model can't choose those fields. Imported lines don't carry that evidence, so identity callbacks don't run for them and tools that require scopes are refused.

For an unknown or unlinked sender, return a fixed reply. It ends the turn before history, suspended tool runs or the model are read:

{ "userId": null, "scopes": [], "ttlSeconds": 0, "reply": "Connect your account at https://app.example/connect/..." }

Never authorize from an account ID the model supplies or an unchecked phone number in tool arguments. See Conversation authentication.

How do I stop an agent from taking a risky action on its own?

Mark the tool policy.approval: "ask". It never runs on the model's say-so. In a direct iMessage conversation on an eligible line, Keiki sends a Keiki Vault approval card with Approve and Decline, and both buttons run Face ID. Keiki checks the signature, the clock, the enrolled key and the tool's required scopes before the action runs. Where no card can be sent, the agent asks in words instead. Set approvalProof: "verified" so a reply in words can't approve: with no card to send, the tool is refused or falls back to its own approval flow.

Declare policy.requiredScopes on account tools, and have your tool server re-check the account and resource ownership on every call. When a request needs a person, a teammate takes over the thread from the team inbox. For payments, Keiki sends a Vault Pay card so customers pay with Apple Pay in the conversation.

Is it safer to build on Keiki or bring my own agent?

Both paths share the same signed requests, identity checks, approvals and inbox. Pick by where you want the model and its keys to live.

Hosted on Keiki. Keiki runs the agent and its code in an isolated sandbox per agent. Playground and eval runs never share a machine with live conversations. Keiki's own provider credentials never reach a sandbox, generated tool code or a prompt.

Bring your own. Run the model loop in your app with the external harness or the AI SDK handler. Your provider keys stay in your app. With a signing secret, the handler signs each turn API and MCP request with a short-lived credential bound to that agent and turn. If you self-host with the SDK, the agent's history is stored in your own database.

What should I test before customers text the line?

  1. Send your handler a request with a bad signature and check that it's rejected.
  2. Text the line from a number that isn't linked to an account and check that the fixed reply comes back.
  3. Trigger a tool that needs approval, then approve and decline it with Face ID.
  4. Have a teammate take over the conversation and confirm the agent doesn't reply over them.

For line health and sending limits, see Are iMessage APIs reliable, or can your number get banned?. For the packages behind each path, see Is there an iMessage SDK for building AI agents?.

Quick start for AI coding agents

Read setup.md and connect the Keiki MCP server at https://onkeiki.com/mcp. For an existing supported app, run npx @onkeiki/cli login and then npx @onkeiki/cli init from the app directory. The CLI writes the signing secret to your env file and adds that file to .gitignore when needed.

FAQ

Is Keiki SOC 2 compliant? Keiki is SOC 2 and HIPAA compliant.

Can the model see my API keys or secrets? No. Secrets never enter the prompt, the transcript, traces or tool arguments, and a saved secret can't be read back.

Do identity checks run on imported iMessage lines? No. Imported lines don't carry provider-verified sender evidence, so those turns run without a principal and scoped tools are refused.

Does a Face ID approval prove who the customer is? No. It approves one action with the key enrolled on that iPhone. Use the identity webhook to decide which account a sender belongs to.

What if my receiver gets the same event twice? Delivery is at least once. Deduplicate completed work by the verified event ID, not the attempt ID.