feat(acl): caller identity transmission for cross-bot access control#270
feat(acl): caller identity transmission for cross-bot access control#270wonb168 wants to merge 6 commits into
Conversation
bugfix: 群里不@也在回复
Inject caller identity (name, platform, Feishu appId, peerName) into the callee's system prompt so bots can perform permission checks. - Add CallerInfo type to src/types.ts - Inject caller identity into Claude/Codex system prompt - Auto-resolve caller platform/appId from local registry - Pass caller through ApiTaskOptions and message-bridge - Change X-MetaBot-Origin header from 'peer' to actual peer name - Add --as flag to bin/mb CLI for specifying caller - Fix skill-hub-routes header check for peer origin detection - Remove unused Kimi engine Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…into system prompt - Reject /api/talk requests with no caller (403) so bots must use mb talk - Inject METABOT_CALLER env var into Claude/Codex subprocess for identity propagation - Append own feishu appId + mb-talk guidance to agent system prompt - Apply same identity injection to Codex executor Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ent_activity card Resolve conflicts preserving: - CallerInfo type + agent_activity CardStatus (types.ts) - botName param in createSpawnFn + preferEnvAuth logic + METABOT_CALLER injection (executor.ts) - CallerInfo import + TeamState/TeamMember/TeamTask imports (message-bridge.ts) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Thanks for the contribution! The ACL work itself looks solid and is a real gap we want filled. Before we can merge, though, the PR needs to be split — it currently bundles three unrelated changes, and one of them is a regression we can't take. 1. ✅ Caller identity / ACL (keep — this is what we want)
If you re-base just these into a fresh feature branch (e.g. 2. 🟡 Markdown table → Feishu The 3. ❌ Kimi engine removal (please revert)
It's actively supported and chosen by users running on Moonshot subscriptions. Could you drop the deletion ( One more thing: the branch is your fork's Thanks again — happy to review as soon as the ACL piece is on its own branch. 🙏 |
…BOT_USER_ID - mb talk: add --user flag and METABOT_USER_ID env auto-read - message-bridge: pass userId in apiContext for both executeQuery and executeApiTask - executor + persistent-executor: inject METABOT_USER_ID into Claude subprocess env, surface in system prompt so mb talk auto-propagates to subagents Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
CallerInfotype — carriesname,platform,appId,peerName,userIdacross bot calls/api/talkrequests: no caller → 403, so agents must usemb talk(not raw curl)METABOT_CALLERenv var into Claude/Codex subprocess somb talkcalls chain identity automaticallyappId+ mb-talk guidance to agent system prompt for downstream ACL--asflag tombCLI for manual caller overrideX-MetaBot-Originheader: now sends actual peer name instead of literal"peer"Use case
Enables
caiwu-agent(or any agent) to require a valid FeishuappIdfrom callers and look up project permissions in a config table — without any changes to the MetaBot core routing layer.Test plan
mb talk <bot> <chatId> <prompt>auto-includes caller identity (no manual--asneeded)curl /api/talkwithoutcallerfield returns 403peerNamein caller identityCaller identity:line with appId when called via peer🤖 Generated with Claude Code