High Risk →

ib_stop_loss

Analyze and manage downside stop-loss orders for PMCC, naked LEAPS, and stock positions. Default mode is dry-run — no orders are placed unless execute=True. Stop price = basis × (1 - stop_pct/100). Basis is max(current_mid, avg_cost) normally; current_mid only when forced=True (can lower existing...

How to control ib_stop_loss ↓

AI agents invoke ib_stop_loss to trigger actions in Trading Skills. What it does depends on the arguments the agent supplies, and its effects often reach beyond the immediate call — builds kicked off, notifications sent, workflows started.

High Risk

While this tool involves financial operations (stop-loss orders), its primary function is to execute trading commands that modify account positions and orders in real-time. It cancels existing orders and places new conditional orders, which are Execute-class operations.

From the tool's definition 'In execute mode: orphan SL_FALL_ orders are cancelled, then new conditional stop orders are placed' and 'Requires TWS or IB Gateway running locally' — this tool executes financial orders against a live or paper trading account when execute=True.

Documented attack patterns abuse exactly the kind of access ib_stop_loss gives an agent:

PolicyLayer is an MCP gateway — it sits between your AI agents and Trading Skills, and nothing reaches the server without passing your rules. This is the rule we recommend for ib_stop_loss:

policy.json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "ib_stop_loss": {
      "limits": [
        {
          "counter": "ib_stop_loss_rate",
          "window": "minute",
          "max": 10,
          "scope": "grant"
        }
      ]
    }
  }
}

ib_stop_loss stays usable, but rate-capped — a runaway agent can't fire it dozens of times a minute. Everything else on the server is denied unless you say otherwise.

  1. Create a free account and register Trading Skills — nothing to install.
  2. Add this policy — paste it, or build it visually.
  3. Point your MCP client (Claude, Cursor, anything) at your gateway URL.
RATE-LIMIT THIS TOOL →

Free to start. No card required.

Go deeper

What does the ib_stop_loss tool do? +

Analyze and manage downside stop-loss orders for PMCC, naked LEAPS, and stock positions. Default mode is dry-run — no orders are placed unless execute=True. Stop price = basis × (1 - stop_pct/100). Basis is max(current_mid, avg_cost) normally; current_mid only when forced=True (can lower existing stops). In execute mode: orphan SL_FALL_ orders are cancelled, then new conditional stop orders are placed. PMCC stops use combo BAG orders (atomic LEAPS + shorts). Requires TWS or IB Gateway running locally. Args: port: IB port (7496 for live, 7497 for paper) account: Specific account ID (optional) symbols: Comma-separated symbols to filter (optional, e.g. 'NVDA,QQQ') stop_pct: Loss % that triggers exit (default 40) short_near_strike_pct: Alert when spot is within this % of short strike (default 5) price_mode: Option pricing — 'mid' (bid+ask)/2 or 'last' execute: Place conditional stop-loss orders (default False = dry-run) forced: Use current mid as basis, can lower existing stops (requires execute=True). It is categorised as a Execute tool in the Trading Skills MCP Server, which means it can trigger actions or run processes. Use rate limits and argument validation.

How do I enforce a policy on ib_stop_loss? +

Register the Trading Skills MCP server in PolicyLayer and add a rule for ib_stop_loss: 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 Trading Skills. Nothing to install.

What risk level is ib_stop_loss? +

ib_stop_loss is a Execute tool with high risk. Execute tools should be rate-limited and have argument validation enabled.

Can I rate-limit ib_stop_loss? +

Yes. Add a rate_limit block to the ib_stop_loss 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.

How do I block ib_stop_loss completely? +

Set action: deny in the PolicyLayer policy for ib_stop_loss. 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.

What MCP server provides ib_stop_loss? +

ib_stop_loss is provided by the Trading Skills MCP server (staskh/trading_skills). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.

Enforce policy on every Trading Skills tool call.

Deterministic rules across all 35 Trading Skills tools. Per-identity grants. Full audit log. Live in minutes. Nothing to install.

Free to start. No card required.

35 Trading Skills tools catalogued and risk-classified — across an index of 42,500+ MCP servers.

// GET IN TOUCH

Have a question or want to learn more? Send us a message.

Message sent.

We'll get back to you soon.