Skip to content

fix(feishu): honor config group access rules - #62340

Open
lazydao wants to merge 1 commit into
NousResearch:mainfrom
lazydao:agent/feishu-group-rules-auth
Open

fix(feishu): honor config group access rules#62340
lazydao wants to merge 1 commit into
NousResearch:mainfrom
lazydao:agent/feishu-group-rules-auth

Conversation

@lazydao

@lazydao lazydao commented Jul 10, 2026

Copy link
Copy Markdown

Summary

Makes Feishu's existing config.yaml group_rules access policy authoritative at the gateway layer.

An exact group_rules.<chat_id> entry is a chat-scoped allowlist. In particular, policy: open allows everyone in that named group without granting DM access or access from other groups.

Supersedes #61376, which introduced a new environment variable for the same behavior.

Details

  • Declares that the Feishu adapter enforces its config-driven group policy at intake.
  • Lets gateway authorization trust only exact, active group_rules entries that already passed adapter policy.
  • Supports existing open, allowlist, blacklist, and admin_only rules.
  • Does not trust disabled rules.
  • Does not treat top-level/default group_policy: open as authorization.
  • Preserves existing DM, pairing, global allowlist, and profile-isolation behavior.
  • Documents the chat-scoped authorization semantics.

No new environment variable or configuration surface is introduced.

Validation

  • scripts/run_tests.sh tests/gateway/test_feishu_bot_auth_bypass.py tests/gateway/test_config_driven_access_policy.py tests/gateway/test_feishu.py tests/gateway/test_multiplex_profile_authz.py -q
  • Result: 298 passed
  • ruff check on changed Python files
  • git diff --check

@alt-glitch alt-glitch added type/bug Something isn't working comp/gateway Gateway runner, session dispatch, delivery platform/feishu Feishu / Lark adapter area/auth Authentication, OAuth, credential pools P2 Medium — degraded but workaround exists sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data labels Jul 10, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused config-driven authorization fix. Current main still has the reported gap: Feishu applies an exact group_rules policy before dispatch (plugins/platforms/feishu/adapter.py:4270-4275, :4301-4325), but gateway authorization only trusts adapters declaring enforces_own_access_policy (gateway/authz_mixin.py:491-512); Feishu has no override and the base default is false (gateway/platforms/base.py:2412-2437). The no-environment-allowlist path consequently reaches default deny (gateway/authz_mixin.py:513-514).

The proposed exact active-rule check preserves the existing distinction between an operator-named chat rule and broad/default group_policy: open, and the added tests cover the key boundary cases.

Automated hermes-sweeper review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/auth Authentication, OAuth, credential pools comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/feishu Feishu / Lark adapter sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants