Skip to content

Loop detection: rate-based vs payload-similarity — notes from building a stdlib-only spend firewall #2

Description

@kindrat86

Found agent-budget via MCP listings — the progressive ALLOW/WARN/THROTTLE/BLOCK ladder is a much saner failure mode than the cliff-edge blocking most tools do, and 809 tests is respectable.

Question about your loop detection: are you detecting loops from call rate alone, or do you also look at payload similarity (same tool + same args repeating)? We built a guardrail in the same space (AgentShield — stdlib-only Python, per-transaction rules evaluated pre-call) and rate-only velocity checks gave us false positives on legitimately bursty agents, while payload hashing caught the stuck-retry case — which is the expensive one: a stuck loop burns $50–$200 in ~10 minutes in our tests.

We also maintain a 56-scenario attack eval suite (split transactions to dodge limits, timezone-boundary daily caps, etc.) — happy to share the scenario list if it's useful for your test matrix. https://agentshield.fly.dev

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions