Switch between net position mode and long/short hedge mode. net: one position per instrument (default). long_short_mode: separate long and short positions. [CAUTION] Requires no open positions or pending orders.
AI agents use account_set_position_mode to create or update resources in Okx Trade — usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your Okx Trade environment.
| Parameter | Type | Required | Description |
|---|---|---|---|
posMode | string | Yes | long_short_mode=hedge; net_mode=one-way |
Parameters from the server's own tool schema.
This tool writes/modifies account trading configuration settings reversibly. While it doesn't move money directly (Financial category), it fundamentally alters how positions are managed in the account, which could affect trading behavior and risk exposure. The operation is reversible (can switch back), so it's Write rather than Destructive.
From the tool's definition Tool modifies account configuration state by switching position modes (net mode vs long/short hedge mode). Description explicitly states it 'Switch between' modes, indicating a state change operation.
Attacks that exploit this kind of access
Switch between net position mode and long/short hedge mode. net: one position per instrument (default). long_short_mode: separate long and short positions. [CAUTION] Requires no open positions or pending orders. It is categorised as a Write tool in the Okx Trade MCP Server, which means it can create or modify data. Consider rate limits to prevent runaway writes.
account_set_position_mode accepts 1 parameter: posMode. Required: posMode. The full parameter table on this page comes from the server's own tool schema.
Register the Okx Trade MCP server in PolicyLayer and add a rule for account_set_position_mode: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Okx Trade. Nothing to install.
account_set_position_mode is a Write tool with medium risk. Write tools should be rate-limited to prevent accidental bulk modifications.
Yes. Add a rate_limit block to the account_set_position_mode rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for account_set_position_mode. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
account_set_position_mode is provided by the Okx Trade MCP server (@okx_ai/okx-trade-mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
Every MCP server has a record like this.
Type a name, get the same breakdown: verified identity, auth posture, risk grade, capabilities, recommended policy.
Teams ship this data inside their own products. See what a licence covers →