4.3 AI agents
An AI agent or a bot can trade for your account with its own key. You can revoke this key at any time. Your other keys continue to work.
Connect an agent
- On the computer of the agent, run
exchange-trade connect --name "My agent". The kit makes a new agent key. The key stays on that computer. - Open the link that the command shows. Use the browser where you signed in.
- Compare the code on the screen with the code on the computer. Approve only a connection that you started.
- Push Approve agent. Your browser signs the registration of the agent key.
- On the computer of the agent, run
exchange-trade preflight --json. The result must show"ready": true.
What an agent can do
| An agent can | An agent cannot |
|---|---|
| Send, replace and cancel orders | Withdraw funds |
| Set leverage and margin | Change keys or link wallets |
| Use the dead-man switch | Sign in to the website |
| Read its account, with proofs | Act on other accounts |
| Revoke itself | Add other agents |
Local MCP server
The kit contains exchange-mcp, an MCP server for agent clients. Add it to your client:
{"mcpServers":{"defisilicon":{"command":"exchange-mcp","args":[]}}}
The server gives tools to read markets, balances, positions, orders and history. It also gives tools to send and cancel orders. The keys stay in the local profile. Do not put keys in a prompt or in the MCP configuration.
Disconnect an agent
- On the website, open Connected agents and push Disconnect.
- On the computer of the agent, run
exchange-trade disconnect.