An AI agent running on a laptop can read your files, run your tools and use your keys, but only while you are sitting in front of it. Away from the desk, the usual answers are a remote desktop app or a cloud copy of the agent, and both mean either a tiny screen or moving your files somewhere else. A simpler route is to give the agent a chat bot of its own: you text the bot from your phone, the laptop picks the message up, the agent does the work locally, and the answer comes back as a reply. Below is how that is set up in the osFoundry desktop app with a Telegram bot, in four steps, and what keeps strangers from talking to your agent.
1. Create your own bot
In Telegram, open a chat with @botfather and send /newbot. It asks for a display name and a username ending in "bot", then replies with a token that looks like 123456789:ABCdef.... That token is the bot's password. Whoever holds it can read the bot's messages and send as it, so it should only go to one place, the app, and not into a chat or a notes file.
The bot is yours, not a shared service bot. Nobody else has its token, and you can delete it in BotFather at any time.
2. Connect the laptop
In the app, open Device, then Background. Two things are needed on this screen. First, turn on "Keep agents running". Otherwise, closing the last window stops every agent, and a message from your phone would wait until you open the app again. With the switch on, closing the window hides the app in the menu bar and agents keep running.
Then paste the token into "Message agents from your phone" and click Connect.
Copy only the token itself, not BotFather's whole sentence around it ("Use this token to access the HTTP API: ..."). That is the most common paste mistake, and Telegram rejects such a token on every request. The token goes into the operating system's keychain, not into the app's database, and it is never sent to osFoundry.
Nothing on the laptop has to be reachable from the internet. The app asks Telegram for new messages and Telegram holds each request open for up to 25 seconds, answering as soon as something arrives. There is no webhook, no open port and no server to run, which also means it only works while the laptop is on and the app is running.
3. Pair your phone with a channel
Messages from the phone go to a channel in the app, and the agents in that channel answer them. Open the channel, click Agents, and at the bottom of the panel, under "Reach this channel from Telegram", click "Pair a phone". The app shows a one-time code.
Send /pair and the code to your bot in a direct message. The bot replies "Paired with laptop", the channel's name. The code expires after 10 minutes and works once.
This step is the actual lock. A bot's username can be found by anyone, and anyone can message it. The token only proves the laptop is the bot; it doesn't say who is writing. So the app answers only the Telegram account that sent the pairing code, identified by its numeric account id, not its display name or @username, which can be changed or taken over. Messages from anyone else are dropped without a reply, so to a stranger the bot looks like one nobody runs. Pairing is also refused in a group chat. Otherwise, everyone in that group could give the agent instructions.
4. Ask
Write to the bot as you would to a person, for example "What did I save to Downloads today?". The message appears in the channel under your Telegram name, the agent works on the laptop, and its answer is sent back to the chat.
If the channel has one agent, it answers. With more than one, start the message with the agent's handle, such as @helper. Otherwise, the bot asks which one you meant rather than guessing. To end the pairing from the phone, send /unpair. In the app, the × next to the paired name does the same.
Two limits are worth knowing before relying on it. What you type from the phone is treated as untrusted input, the same as an incoming email, because whoever holds your phone can type it. And a tool that is set to ask for approval every time can't ask while no window is open, so in the background that call is refused, not queued. The Background screen shows whether any tool is set that way.
Without the app
The same setup can be built with a Telegram bot, a long-polling loop and a list of allowed account ids, and a small script is enough for a single machine. The parts that are easy to get wrong are the ones above: answering strangers, pairing in groups, and trusting a username. The AI agents page describes the agents, channels and triggers this builds on, and the app is free from the osFoundry download page for macOS, Windows and Linux.




Top comments (0)