Skip to content

Support per-user usage limits and spending budgets #24

Closed

Description

@ylembachar

Problem

Several users share one agent and its model budget. A deployment-wide spending cap protects the account, but one user can exhaust it and prevent everyone else from using the agent.

Requirements

  • Support configurable per-user request-rate limits and spending budgets.
  • Support per-run limits to stop a single request from causing an expensive loop.
  • Count each run’s model usage against the sender’s userID recorded by the Gateway, including retries.- Allow deployments to assign scheduled jobs and shared tasks to a separate budget.
  • Preserve usage accounting across restarts.
  • When a limit is reached, stop further calls, preserve task state, and notify the user without another model call. Do not repeatedly retry budget refusals.

Integration

Use the model proxy’s spending controls where available. Concorde should provide trusted attribution and handle limit errors; it does not need its own billing system.

Budget amounts, reset periods, allowed models and shared-task charging rules are deployment configuration.

Acceptance criteria

  • One user exhausting their allowance does not block other users unless the overall deployment budget is also exhausted.
  • All model calls within a run, including retries, count toward the applicable budget.
  • Users cannot bypass limits by claiming another identity or starting a new session.
  • Restarting the service does not reset usage.
  • Limits reject further work rather than only sending spending alerts.
  • Tests cover exhausted budgets, rate limits, restarts and recovery after a quota resets.

Activity

  1. ylembachar commented on Oct 26, 2026

    @ylembachar
    Author
    • Implement the token tracker as a component that is passed to the runtime that stores all usages per user in the DB
    • Token tracker should provide an interface to retrieve the token usage
    • Have an example to show how to use the token tracker to implement limits in the prompt/signal handler
  2. blockchainluffy commented on Oct 30, 2026

    @blockchainluffy
    Contributor

    Completed with #32 and #31

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions