Skip to content

DynamicRules lacks the three auto-ban fields guard-core 3.13.0+ reads #44

Closed

Description

@rennf93

Value this delivers

A dynamic rule pushed from the SaaS is applied in full on guard-core 3.13.0+ instead of ending in Failed to apply dynamic rules: 'DynamicRules' object has no attribute 'enable_rate_limit_auto_ban' on every poll.

What happens

guard-core 3.13.0 added auto_ban_threshold, auto_ban_duration and enable_rate_limit_auto_ban to the rule application step (_apply_feature_toggles reads rules.enable_rate_limit_auto_ban, then rules.auto_ban_threshold, rules.auto_ban_duration). The DynamicRules model that guard-agent hands it (guard_agent/models.py) never defined them, so the attribute access raises, guard-core's handler logs the error and restores its config snapshot, and it repeats on every poll (every 60s on the default interval). Reproduced live on guard-core 3.15.0 / fastapi-guard 7.8.2 / guard-agent 2.9.0 against a fresh SaaS project, before any rule was pushed (the platform default rule already trips it).

Expected

DynamicRules carries the three fields as optional overrides defaulting to None, matching the existing toggle fields, so guard-core skips them when unset and applies them when the backend sends them.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed defect

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions