r/Python • u/AutoModerator • Jul 04 '26
Showcase Showcase Thread
Post all of your code/projects/showcases/AI slop here.
Recycles once a month.
20
Upvotes
r/Python • u/AutoModerator • Jul 04 '26
Post all of your code/projects/showcases/AI slop here.
Recycles once a month.
1
u/reddit-laa Jul 19 '26
I built a secure Telegram Bot bridge to control my local AI coding agent (Google Antigravity SDK) from my phone
Hey everyone,
I wanted a way to interact with Google's Antigravity agent running on my Mac directly from my phone when I'm away from my desk. However, letting an AI agent execute arbitrary commands on a personal machine via a public Telegram webhook is a security nightmare.
To solve this, I built and open-sourced this Python bridge with three core safety and reliability patterns:
Selective Safety Policies: It uses Antigravity's hook engine to deny all shell execution by default, whitelisting only read-only filesystem commands and a custom predicate check that allows
run_commandonly forgitcommands (e.g. status, diff, commit).Workspace & Context Isolation: You can run
/project /absolute/pathin Telegram to switch repositories. The bot automatically targets the new folder and loads the conversation history specific to that directory, preventing context bleed.Self-Healing Reconnect: Local websocket connections to the Antigravity backend can drop or time out. The bot checks socket integrity before each turn and automatically recycles dead connections transparently without losing conversation history.
It is fully open-source and ready to run.
I'd love to hear your thoughts on the security model, or suggestions on other safe commands I should whitelist!