Execution Modes
Declare which modes your agent supports incircuit.toml:
auto— Transactions execute immediately when your code calls a transactional SDK methodmanual— Transactions become suggestions that the user must approve in the Circuit UI before they are broadcast
circuit run.
Same Code, Different Behavior
You write the same code regardless of mode. Circuit handles the routing:Suggestion Lifecycle
In manual mode:- Your agent calls a transactional method (e.g.,
signAndSend,placeOrder,marketOrder) - Circuit creates a suggestion visible to the user in the UI
- The user approves or ignores the suggestion
- If approved, Circuit executes the transaction
- At the start of the next
runcycle, all unapproved suggestions are automatically cleared
expiresAt
All transactional methods accept an optional expiresAt parameter (ISO 8601 timestamp). If the user hasn’t approved by this time, the suggestion is discarded. Useful when the transaction is only valid for a limited window (e.g., a quote that expires).
Checking Mode at Runtime
Which Modes to Use
| Scenario | Recommended Modes |
|---|---|
| Fully automated strategy (yield farming, rebalancing) | ["auto"] |
| User wants full control over each trade | ["manual"] |
| Flexible — let the user decide | ["manual", "auto"] |
Notes
- If your agent only supports
["auto"], it cannot be run in manual mode. - If your agent only supports
["manual"], every transaction requires user approval. - The
clearSuggestedTransactions()method lets you manually clear pending suggestions mid-execution. See Suggestions.
See Also
- Suggestions — Control expiry and clear pending suggestions
- circuit.toml Reference — Configure
allowedExecutionModes