Skip to content

Safety: execution commands silently default to USDC when no amount is parsed #6

Description

@David-patrick-chuks-02

Summary

In parseExecutionIntent() (src/lib/execution.ts), the amount defaults to "100" when none is detected:

const amount = extractAmount(normalized) ?? "100";

A user typing something like execute bridge from arbitrum to base (forgetting the amount) would get a quote and execute a $100 USDC bridge without ever stating the amount.

Impact

This is a fund-moving agent; silently picking a default amount removes the need for explicit confirmation and can result in unintended transfers of real funds.

Suggested fix

  • Require an explicit amount and throw a clear error when missing (e.g. "Execution command needs an amount, e.g. execute bridge 25 usdc from arbitrum to base"), or
  • Return the default only in a clearly-labeled preview/dry-run mode, never in the execution path.

Files

  • src/lib/execution.ts (line ~376)
  • src/lib/chat.ts (check whether the same default exists in chat-triggered execution)

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