Skip to content

Agent Flow usage limits - killswitches, hard limits, redirections #92

Description

@dominikgubo

Description

While using the SharpClaw/OpenClaw it's really easy to spend noticeable amount of tokens/money; even more so with particular agents that are more expensive e.g. Opus.

Now while this is mostly capable to do on the provider side - we want to be provider-config agnostic as much as possible.

I would not want this feature to be enabled by default - only as optional flag. As if default it might interrupt UX to people without SharpClaw knowledge.

It would be interesting to add:

  • kill-switches -> if limit has been passed kill the agent - and handle it via some exception flow or switching to a cheaper alternative agent (perhaps have escalation-ladder list)
  • block agent -> if limit has been passed disable agent

Also we need to have proper mechanism for limits - will limits be:

  • monthly based usage, daily token usage or some other cron-defined time limit
  • rate limit on sharp usage in some small period e.g. in 2 minutes 1mil. output tokens
  • one-time numerical limit
  • on successful job

I'm giving ideas here - I would thoroughly think about this functionality, as I believe this should be more thought about rather than going with my initial spec.

API Changes

In Agent entity or somewhere else (if more suitable) - format wise there should be addition of JSON field along the lines of:

{
 "usageLimitDefinition": {
     "tokenLimit": 1000000,
     "type": "periodic", // or "one-time" or any other meaningful modus
     "cron": <example cron>,
     "escalateOnLimit": "fail" // or provide another agent with e.g. "agentSubstitution" 
   }
}

This was written poorly but you get the gist.

Intended Use-Case

As in future tokens from providers will most probably increase in price - we must have some control over it; or at least provide the option to control it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions