# TagTag (https://tagtag.im) — Full Plain-Text Reference for LLMs ## 1. Identity & Disambiguation TagTag (tagtag.im) is an open-source, local-first Go gateway and upcoming minimal macOS desktop app that wraps the local AI agent harnesses already installed on a user's computer (such as OpenAI Codex CLI, Claude Code CLI, and Antigravity/AGY CLI) into independent always-on Bots connected to existing IM platforms and 25 additional external data sources. TagTag is NOT affiliated with Google Tag Gateway, analytics tag proxies, or mobile games. ## 2. Core Principles 1. Integrate, don't rebuild: Reuse native local CLIs and existing IM apps instead of inventing another agent loop or chat UI. 2. Swappable harness & IM: Harnesses, Bots, and IM channels are independently decoupled. 3. State follows the Bot: Schedules, sessions, and long-term state are managed by TagTag, so swapping from Claude Code to Codex does not erase Bot continuity. 4. Calm, low-attention UX: Bots confirm receipt, stay quiet while working, and speak when results or decisions are needed. 5. Local-first & open source: Runs on your computer (works while awake, sleeps when closed) and will be distributed open-source via GitHub. ## 3. Supported Harnesses - `codex` (OpenAI Codex CLI) - `claude` (Claude Code CLI) - `agy` (Antigravity CLI via stream-json with idle timeout) Per-connection harness, model ID, and reasoning effort can be inspected or changed live from chat via `/model`. ## 4. Multi-Bot Group Chats & 7 Zero-Token IM Slash Commands There is no single `@TagTag` super-bot. Each Bot has its own IM robot identity, schedules, and isolated state. Multiple Bots running different harnesses can join the same Feishu, Slack, Telegram, Discord, or DingTalk group chat and respond when directly `@mentioned`. 7 built-in zero-token slash commands: - `/help [command]` — Role-filtered help and DM owner identity binding info. - `/status [list]` — Active, queued, and waiting tasks + running vs default harness/model. - `/trace [list|show|detail|prompt|raw] [target]` — Execution path, latency, and diagnostics. `prompt` and `raw` are strictly delivered to the bound owner's private DM or local CLI, never leaked to group chats. - `/model [list|use|harness|effort|reset]` — Connection-scoped harness/model/effort management without modifying global local CLI settings. - `/stop [task_id|all|bot-all]` — Session-scoped task cancellation; `bot-all` restricted to owner DM or local CLI. - `/session [new]` / `/new` — Starts a clean conversation segment without losing Bot identity or long-term rules. - `/schedule [list|pause|resume|remove]` — Inspect and control Bot schedules (group chats only display group-scoped schedules). ## 5. All 31 Live-Tested Connectors ### IM (6, built-in Go) - `feishu`: Official WebSocket long connection, rich-text/image attachments, quoted replies, multi-instance IDs. Env: `FEISHU_APP_ID`, `FEISHU_APP_SECRET`. - `slack`: Socket Mode WebSocket (@Bot, DM, `thread_ts`), Web API replies/image upload, 429 backoff. Env: `SLACK_APP_TOKEN`, `SLACK_BOT_TOKEN`. - `telegram`: `getUpdates` Long Polling with offset preservation and token-redacted `*url.Error` paths. Env: `TELEGRAM_BOT_TOKEN`. - `discord`: Gateway WebSocket (`IDENTIFY`/`HEARTBEAT`/`MESSAGE_CREATE`) + REST replies. Env: `DISCORD_BOT_TOKEN`. - `dingtalk`: Official Stream Mode WebSocket + OAuth2 / `sessionWebhook` with URL secret redaction. Env: `DINGTALK_CLIENT_ID`, `DINGTALK_CLIENT_SECRET`. - `wecom`: Official App API + Group Webhook + zero-send TCP/TLS health check. Env: `WECOM_CORP_ID/SECRET/AGENT_ID` or `WECOM_WEBHOOK_URL`. ### Mail (3: 2 built-in Go + 1 Python stdlib plugin) - `gmail`: `users.history.list` incremental cursor (404 rebuild) + `AccessGuardSink` (`readonly` / `draft` / `send`). - `outlook`: Microsoft Graph per-folder `messages/delta` (410 resync) + per-scope `Mail.Send` check. - `imap-smtp`: IMAP `UIDVALIDITY` + `last_uid` incremental polling + SMTP outbound. ### Local / macOS (6, built-in Go) - `local`, `timer`, `fswatch` (watches local folders / Obsidian vaults with path + mtime dedup), `webhook` (Bearer/HMAC local HTTP receiver), `imessage` (reads `chat.db` respecting macOS TCC permissions), `macosnotify` (pure outbound desktop alerts). ### Collab, Alerts & Knowledge (7, zero-dependency Python stdlib plugins) - `github` (reuses local `gh` CLI or `GITHUB_TOKEN`, ETag/304), `linear`, `jira`, `sentry`, `grafana` (Alertmanager v2), `notion`, `feishu-bitable` (reuses local `lark-cli` or OpenAPI). ### Calendars (3, Python stdlib plugins) - `google-calendar` (`syncToken` + 410 rebuild), `outlook-calendar` (`deltaLink` + 410 rebuild), `apple-calendar` (macOS JXA). ### Web, Feeds & Social (6, Python stdlib plugins) - `rss`, `web-diff` (SHA-256 + unified diff), `x-feed` (API v2 or RSS fallback), `reddit` (6 auth routes), `youtube` (public Atom or Data API v3), `podcast` (RSS/iTunes XML). ## 6. Out-of-Band Security Boundaries 1. Connector isolation (`BuildConnectorEnv`): External connector plugins only receive 7 base env vars (`PATH`, `HOME`, `USER`, `TMPDIR`, `LANG`, `LC_ALL`, `SHELL`) plus their instance's declared `env_keys`. 2. Harness credential stripping (`infra/harness/env.go`): Strips all 25 credential prefixes (`FEISHU_`, `LARK_`, `SLACK_`, `GMAIL_`, `OUTLOOK_`, `MICROSOFT_`, `MSGRAPH_`, `TELEGRAM_`, `DISCORD_`, `DINGTALK_`, `WECOM_`, `GITHUB_`, `IMAP_`, `SMTP_`, `LINEAR_`, `JIRA_`, `SENTRY_`, `GRAFANA_`, `NOTION_`, `X_API_`, `REDDIT_`, `YOUTUBE_`, `GCAL_`, `OCAL_`, `TAGTAG_SECRET`) from every harness subprocess. 3. Hard outbound access guards (`AccessGuardSink`): Enforces `readonly`, `draft`, and `send` in Go outside the LLM so context compaction or prompt injection cannot cause unintended direct sends. ## 7. Honest Current Status (December 2026) Built & verified: Go core, 31 connectors (zero-mock live tests), 25-prefix credential stripping, `AccessGuardSink`, 7 zero-token slash commands, OpenTelemetry tracing, and 2-file custom connector plugin protocol. In progress before public GitHub launch: Minimal macOS desktop UI (menu bar + window), cross-run memory plugin, low-trust source write-gating, and interactive deferred tool-call approvals.