Power Your Software Testing with AI Agents and Cloud
The Native AI-Agentic Cloud Platform to Supercharge Quality Engineering. Test Intelligently and Ship Faster.
- TestMu AI (Formerly LambdaTest)
- /
- Blog
- /
- Photon Spectrum: Bring AI Agents to iMessage, WhatsApp and Telegram
Photon Spectrum: Bring AI Agents to iMessage, WhatsApp and Telegram
Photon's open-source Spectrum framework runs one AI agent across iMessage, WhatsApp, Telegram and SIP voice. How it works, where it breaks, and how to test it.
Published on:
Photon's spectrum-ts repository has nearly 2,000 GitHub stars. It is the SDK behind Spectrum, an open-source framework for putting AI agents into the messaging apps people already use.
Spectrum runs one agent server and connects it to iMessage, WhatsApp Business, Telegram, a local terminal and SIP voice calls. This guide covers how it works, the failure modes Photon's own docs warn about, and how TestMu AI's Agent Testing and Agent Assurance check a Photon agent before real users reach it.
TL;DR
Photon Spectrum is an open-source TypeScript framework, published as spectrum-ts, that runs one AI agent server and connects it to messaging channels such as iMessage and WhatsApp Business through providers. The agent logic stays the same on every channel, and each provider handles that platform's events, message formats and native features.
- iMessage and voice: Photon Spectrum's iMessage provider runs on Photon-managed iMessage lines, and the same lines can place and receive SIP voice calls.
- Other supported platforms: Photon Spectrum also has built-in providers for WhatsApp Business and Telegram, while Discord, websites and apps connect through custom providers built with definePlatform.
- Open source: Yes. Photon Spectrum is MIT-licensed, written in TypeScript, and requires TypeScript 5 or later.
- How to test a Photon agent locally: Photon Spectrum's terminal provider is a local chat interface with typing indicators, reactions, replies and attachments, so you can test the agent end to end without provisioning a phone number.
- TestMu AI Agent Testing: TestMu AI Agent Testing connects to a Photon agent's chat endpoint, plays multi-turn conversations as real users, and scores each reply on 9 chat and voice metrics, including hallucination, bias, completeness and context awareness.
- TestMu AI Agent Assurance: TestMu AI Agent Assurance uses the rook CLI to invoke a Photon agent for real, through a command, an HTTP endpoint or an MCP server, and grade each criterion against observed evidence, reporting anything it could not verify as Unable to Verify.
What Is Photon Spectrum?
Spectrum is Photon's answer to a channel problem: a user might message you in iMessage today and WhatsApp tomorrow, and each channel normally means a separate integration with its own authentication, events and message formats. The Spectrum documentation puts one agent server behind all of them, with a provider for each interface:
| Provider | What it connects | Notes from the docs |
|---|---|---|
| iMessage | Photon-managed iMessage lines through the cloud provider | DMs, groups, typing indicators, reactions, threaded replies and effects; a separate local provider reads a Mac's Messages database |
| WhatsApp Business | The official WhatsApp Business Cloud API | One-to-one customer conversations |
| Telegram | The Telegram Bot API with Fusor webhooks | Media, reactions, replies, typing and edits |
| Terminal | A chat interface in your local terminal | For development, testing and CLI-style agents |
| Voice | Inbound and outbound SIP calls on a Spectrum iMessage line | WhatsApp numbers are not supported; SDK call control is listed as coming soon |
| Custom | Any platform you wrap with definePlatform | The docs name websites, apps, Discord and internal tools as targets |
Photon's homepage also lists SMS, RCS, Discord and Slack. SMS and RCS appear there as fallbacks for iMessage delivery, the docs treat Discord as a custom-provider target, and Slack is not among the documented providers, so check the provider pages before you plan a channel.
How Does a Spectrum Agent Server Work?
Your Spectrum server owns the product behavior, meaning routing, tools, memory, handoff, safety and analytics. Each provider owns the interface work of connecting to the platform, receiving events and sending messages. Every provider feeds one message stream, so the agent loop stays the same when you add a channel, as in this example from the docs:
import { Spectrum } from "spectrum-ts";
import { imessage, terminal } from "spectrum-ts/providers";
const app = await Spectrum({
projectId: process.env.PROJECT_ID!,
projectSecret: process.env.PROJECT_SECRET!,
providers: [
imessage.config(),
terminal.config(),
],
});
for await (const [space] of app.messages) {
await space.send("How can I help?");
}You install it with npm install spectrum-ts, and it requires TypeScript 5 or later. The code above works with four primitives:
- Message - an incoming piece of content, whether text, attachments or structured data, from any platform.
- Space - a conversation context such as a DM, a group chat or a terminal session. You send messages into a space.
- User - a participant on a platform, identified by a platform-specific ID.
- Platform provider - the adapter that translates one platform's protocol into Spectrum's unified interface.
Spectrum handles channels, not reasoning, so it sits beside whichever framework builds the agent itself; Photon's blog shows it with Mastra and Convex agents. The agentic AI frameworks guide compares the options for that layer.
What Can a Photon Agent Do Inside iMessage?
Photon's documentation describes iMessage as the channel where Spectrum is most mature.
Photon's homepage lists the native iMessage APIs an agent can use:
- Send and receive messages with markdown and bubble or message effects.
- Share attachments, including files, media and stacked images.
- Accept location sharing and subscribe to real-time location updates.
- Build and deliver generative iMessage mini apps inside the conversation.
- Set the agent's identity with profile names and photos.
- Create and manage group chats, including names, avatars and participants.
Those features matter most when the agent acts on real accounts. Flip, an AI financial assistant, runs on iMessage through Photon: users text it to pay people back, move money, split bills in group chats and track a portfolio, and Flip waits for a yes before any action that touches money. Photon reports that Flip circulates over $57 million in connected volume.
What Makes Messaging Agents Hard to Get Right?
Photon's inbound pipeline guide opens with how people text: in bursts such as "hey", "wait", "actually" and then the real question. An agent that answers each message sends overlapping replies and never sees the question, so the guide debounces for a few seconds and handles the burst as one turn.
Each item below is a failure a test suite for a messaging agent should cover:
- Message bursts - send several short messages in a row and confirm the agent answers once, to the whole burst.
- Cancelled jobs - the inbound guide keeps messages in a queue table until the handler reads them, and carries drained messages forward if a job is cancelled mid-generation, so nothing a user typed is dropped.
- Duplicate replies on retry - a worker that crashes halfway through a multi-message reply resends the first messages on retry. The recovery and state guide prevents this with stable client GUIDs and a persisted startIndex cursor.
- Memory that leaks between people - one agent talks to many users, and the recovery guide scopes working memory per person and history per thread, because telling one user about another user's plans is the bug it warns about.
- Voice call security - Spectrum Voice carries call audio over RTP, not SRTP, so audio on the SIP side of a call is not encrypted, while SIP signaling can use TLS.
- Channel fallback - Photon's API can route a message through iMessage with Telegram as a fallback, so test that a reply still reads correctly in the channel it actually lands in.
The terminal provider makes most of these reproducible on a laptop: Photon describes it as a drop-in test harness with multiple conversations, typing indicators, reactions, threaded replies and attachments. Pair it with a chatbot testing plan, then add the channel-specific cases above.
How Do You Test a Photon Agent Before It Ships?
A Photon agent can fail in the conversation, by saying the wrong thing, or in the world, by doing the wrong thing on a real account. With TestMu AI, Agent Testing grades the conversation and Agent Assurance checks what the agent actually did, so each risk below lands with the tool built to catch it:
| Risk in a messaging agent | Check with | What the check looks at |
|---|---|---|
| Loses context across turns or answers only part of a question | Agent Testing | Multi-turn conversations scored for context awareness and completeness |
| States a wrong balance, order status or policy | Agent Testing | Hallucination scoring, plus Data Validation against your system of record |
| Treats users differently by name or phrasing | Agent Testing | Persona-based scenarios that test for bias |
| Acts without the user's confirmation | Agent Assurance | A scenario where the user never confirms, checked for any record the run created |
| Moves the wrong amount or pays the wrong person | Agent Assurance | The record the run created, confirmed through a read-only query tool you provide |
| Follows an instruction hidden inside a user's message | Agent Assurance | Adversarial scenarios such as prompt injection and data exfiltration |
Agent Testing: Grade What the Agent Says
Agent Testing uses AI testing agents that hold real multi-turn conversations with your agent through its chat endpoint, over REST, WebSocket, Server-Sent Events or polling, and score every reply. For a Photon agent, expose the logic your Spectrum server calls on each message as an endpoint and point Agent Testing at it.
- Scenarios from your documents - upload a PRD, policy or knowledge base and the platform generates 60 to 100+ scenarios per workflow across happy paths, edge cases, adversarial inputs and personas.
- Standard metrics - 9 metrics for chat and voice, including hallucination, bias, completeness and context awareness, with custom validation criteria on top.
- Personas - 10 pre-built persona types, plus custom ones, show how the agent handles different users, such as a confused user or a technical expert.
- Images in the chat - scenarios can send images mid-conversation, such as a receipt photo for a bill-splitting agent.
- Voice and phone - phone agents are scored on 30+ call metrics, which covers agents answering calls on a Spectrum voice line.
Start with the Agent Testing getting started guide, or run the same suites from your terminal and CI with the Agent Testing CLI.
Agent Assurance and rook: Grade What the Agent Did
Agent Assurance tests agents that act. Its rook CLI reads your codebase to work out what the agent does, writes functional, non-functional and adversarial scenarios, invokes the agent for real through a command, an HTTP endpoint or an MCP server, and grades each criterion against what the run changed rather than what the agent reported.
- Evidence, not replies - tool calls are checked against the agent's own tool surface, and records are confirmed through a read-only query tool you approve.
- Three verdicts - every criterion is Pass, Fail or Unable to Verify, and Unable to Verify is reported apart from the pass rate instead of counting as a pass.
- Adversarial by default - prompt injection, jailbreak, data exfiltration, PII leakage and policy violation scenarios are generated as a class, which matters for an agent that reads untrusted text from strangers.
- Staging first - the agent's own writes during a run are real, so point rook at a staging account and a test line.
Agent Assurance is pre-alpha and publicly installable. Install the CLI, then follow the Agent Assurance quickstart:
npm install -g @testmuai/rookFor a Flip-style agent, the useful criteria are concrete: run a request to move money with no confirming reply and check that no transfer record exists, then run it with the confirmation and check that exactly one transfer of the requested amount does. Agent Testing tells you the confirmation read clearly; Agent Assurance tells you the money moved once. The same split runs through testing AI agents before and after release.
Getting Started With Photon and TestMu AI
Build the agent against Spectrum's terminal provider first, so you can replay bursts, group threads and crashed retries locally before you connect a live iMessage line. Then list every action the agent can take on a real account; that list becomes your Agent Assurance criteria.
Generate conversation scenarios in Agent Testing from your PRD, run rook against staging so each action is checked against what changed, and keep both suites in CI so every prompt or model change is tested before it reaches a user's Messages app.
Author
Sirajuddin Khan is Vice President of Product Management at TestMu AI (formerly LambdaTest), where he drives the company's agentic AI product strategy, building a suite of autonomous agents that includes Agentic Browsers and Agentic Visual Testing and shifting the unit of work from test execution to autonomous outcomes. One of the company's earliest product leaders, he has owned the roadmap for the high-performance execution cloud and grew the cross-browser testing products from early adoption to market leadership. He brings over a decade of experience across SaaS, B2B, and eCommerce, with earlier product roles at Wydr and ShopClues, where his catalog and search work cut delivery SLAs and lifted seller activity. Sirajuddin holds an MBA in Information Technology from Sikkim Manipal University and a B.Tech in Computer Science Engineering from Maharshi Dayanand University.
Reviewer
Mayank Bhola is Co-Founder and Head of Products at TestMu AI (formerly LambdaTest), where he leads the entire product portfolio across KaneAI, Kane CLI, HyperExecute, SmartUI, the Real Device Cloud, Accessibility, and other software testing product lines. As an early Lead Architect he designed and built the company's flagship Tunnel technology from scratch, created the React-based automation platform, and architected the data-intensive pipelines and FAAS services that scale it. He brings more than 10 years of experience in software development and product engineering, with earlier roles as Head of Technology at Juggernaut Books and Senior Software Engineer at PressPlay TV and Zomato. Mayank holds a B.Tech in Computer Engineering from JIIT Noida.
Photon Spectrum FAQs
Did you find this page helpful?
More Related Blogs
TestMu AI forEnterprise
Get access to solutions built on Enterprise
grade security, privacy, & compliance
- Advanced access controls
- Advanced data retention rules
- Advanced Local Testing
- Premium Support options
- Early access to beta features
- Private Slack Channel
- Unlimited Manual Accessibility DevTools Tests



