Files
agent-zero/plugins/_telegram_integration/default_config.yaml
Alessandro 1eba072653 Require explicit Telegram administrators for settings changes
Accepted Telegram senders could use /permissions and its callbacks to
persistently remove their own tool restrictions. The same access also
exposed instance-wide plugin toggles.

Add a per-bot admin_users allowlist and enforce it when opening settings
and processing every settings callback. Administrators must still pass
allowed_users; an omitted or empty admin_users list grants nobody settings
access. Resolve membership from the current bot configuration on each
event so revocation applies to existing buttons.

Expose the administrator list in the WebUI and document its defaults.
Add regression coverage for message and callback routes, denied writes,
authorized policy persistence, runtime tool decisions, and revocation.

Validation:
- Conda framework: 123 tests and 41 subtests passed.
- Docker framework: 9 focused tests and 41 subtests passed.
- WebUI: administrator field renders, parses entries, and clears correctly.
- JavaScript syntax and git diff checks passed.
- Restarted the bound Docker instance and verified HTTP 200.

Telegram network delivery was not exercised; tests use synthetic events
and disposable policy files without changing live bot access settings.
2026-11-01 07:22:49 +01:00

19 lines
1.4 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
bots: []
# Example bot:
# - name: my_bot
# enabled: true
# notify_messages: false # Show a WebUI notification for each incoming Telegram message.
# token: ""
# mode: polling # polling or webhook
# webhook_url: "" # required if mode=webhook, your A0 base URL e.g. https://yourdomain.com (webhook path appended automatically)
# webhook_secret: "" # required for webhook mode: random 32–256 characters (A-Z, a-z, 0-9, _ and -)
# allowed_users: [] # Telegram user IDs or @usernames. Empty = allow all.
# admin_users: [] # Allowed users permitted to change plugins or tool policy. Empty = no administrators.
# group_mode: mention # mention (respond when @mentioned or replied to) | all (respond to every message) | off (ignore groups)
# welcome_enabled: false # Send a greeting when someone joins the group
# welcome_message: "" # Welcome template. Use {name} for the new member's name. Default: "Welcome, {name}!"
# user_projects: {} # Map Telegram user_id to project name, e.g. { "123456": "my_project" }
# default_project: "" # Fallback project if user not in user_projects
# attachment_max_age_hours: 0 # Hours to keep downloaded attachments. 0 = keep forever.
# agent_instructions: "" # Extra instructions for the agent in Telegram chats