DocumentationOpen App

Execution

How agents interact with the Gearbox protocol on-chain — and why it's safe.

The Security Model

A core principle of Gearbox Agentic: the SDK builds transactions, but never signs them. Transaction construction (what to do) is separated from transaction execution (actually doing it). This creates a clear security boundary.

Every transaction goes through preview before execution:

  1. Buildsdk.positions.prepareOpen() → produces a RawTx { to, calldata, value }
  2. Previewsdk.previewTransaction(rawTx) → simulates the exact bytes, returns success, health factor, actions, balance changes, warnings
  3. Validate — agent (or human) checks: success = true, HF > threshold, no critical warnings
  4. Execute — sign and send via wallet

The same bytes that were previewed are the bytes that go on-chain. No deviation.

Two Execution Modes

ModeTrust LevelBest For
Human-in-the-LoopAgent proposes, human approvesHigh-value positions, institutional compliance, initial trust building
Bot ExecutionAgent executes autonomously within boundsRebalancing, liquidation monitoring, automated management

Both modes use the same preview mechanism. The difference is who signs.

Learn More