open-webui/backend/open_webui
Classic298 076a84e3f0
fix: enforce automation limits in the builtin automation tools (#27523)
The `create_automation` and `update_automation` builtin tools wrote straight to `Automations.insert` / `Automations.update_by_id`, skipping the limit checks that `/api/v1/automations/create` and `/api/v1/automations/{id}/update` run through `check_automation_limits`. A non-admin user could therefore ask the model to create automations indefinitely, ignoring `AUTOMATION_MAX_COUNT`, and could schedule them below `AUTOMATION_MIN_INTERVAL`, on both create and update.

Both tools now call the same `check_automation_limits` helper the routers use, so the limits and the admin bypass cannot drift between the chat path and the HTTP path. A rejection is returned to the model as a plain error message instead of raising. `update_automation` also gained the missing user lookup guard, since the helper needs the user's role.

The `automations.enable` toggle and the `features.automations` user permission were already enforced when the tool set is assembled, so they are unaffected.

Fixes #27121
2026-07-26 17:55:56 -04:00
..
data refac: mv backend files to /open_webui dir 2024-09-04 16:54:48 +02:00
internal perf: cut per-request database session overhead (#27385) 2026-07-23 17:49:48 -05:00
migrations refac 2026-07-24 01:54:36 -04:00
models fix: don't seed non-persistent config keys (oauth.* with flag off) (#26928) 2026-07-24 00:58:30 -05:00
retrieval fix: unshadow the time module so the web loader rate limiter can sleep (#27528) 2026-07-26 17:55:28 -04:00
routers fix: apply the verified-user role gate to WebSocket authentication (#27537) 2026-07-26 17:27:54 -04:00
socket fix: apply the verified-user role gate to WebSocket authentication (#27537) 2026-07-26 17:27:54 -04:00
static refac 2026-07-20 22:27:13 -04:00
storage refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
tools fix: enforce automation limits in the builtin automation tools (#27523) 2026-07-26 17:55:56 -04:00
utils fix: apply the verified-user role gate to WebSocket authentication (#27537) 2026-07-26 17:27:54 -04:00
__init__.py refac 2026-06-17 03:01:11 +02:00
alembic.ini fix: Alembic CLI commands from failing 2025-08-15 04:17:47 -04:00
config.py refac 2026-07-24 01:19:28 -04:00
constants.py refac 2026-06-29 05:46:51 -05:00
env.py refac 2026-07-23 22:52:23 -04:00
events.py Log upstream provider rejections at warn/error level (#27238) 2026-07-23 03:42:48 -04:00
functions.py refac 2026-07-23 03:39:56 -04:00
main.py fix: verify chat ownership on /api/chat/completed and /api/chat/actions (#27486) 2026-07-26 17:39:11 -04:00
tasks.py refac 2026-07-16 21:57:43 -04:00