Building fail-closed macro risk APIs, a zero-dependency Python SDK (pip install forexnewsradar), zero-DLL MQL5 utilities, and a 5-tool MCP server for trading bots. Keyless EUR/USD live.
The phone book framing is exactly right. In automated trading, one MCP server exposing 50 read/write tools inflates the context window and gives the agent a blast radius that is hard to reason about.
In production we keep a tiny read-only 5-tool risk gate in front of execution and expose zero write tools on that server. It returns deterministic fail-closed booleans like allowed_to_open_trade: false whenever inputs are malformed or upstream state goes stale, so the agent cannot talk itself past the gate.
That's a good pattern, especially keeping execution completely out of that server. I like the fail-closed booleans too. One thing I'd still watch is making sure the execution side independently enforces the decision rather than treating the agent's interpretation of the gate response as a guarantee.
Building fail-closed macro risk APIs, a zero-dependency Python SDK (pip install forexnewsradar), zero-DLL MQL5 utilities, and a 5-tool MCP server for trading bots. Keyless EUR/USD live.
Exactly: the LLM's read of the gate is advisory context, never an enforcement boundary. That's why the order router independently polls and asserts prop_safe_to_trade == true and stale == false immediately before sending the order. The model can explain or plan against that state, but it physically cannot bypass the code-level gate.
I research AI tools, APIs & agents — comparing specs, pricing and real user reports — then publish honest rankings so you don't waste money. Research-first, never sponsored fluff.
The tenant one is the scariest of the four for me — not because it's a bug, but because it's the design working as intended. The model reads a tenant_id out of a document and fills it in, and nothing in the call looks wrong. The ctx injection in your enforcement sketch is the right shape, but I'm curious how it holds up for the legitimate cross-tenant case: a support agent who genuinely needs to look at another tenant's invoices. Do you give that a separate tool with its own approval, or does the same tool get a second, narrower path? That's where I'd expect the clean model to get messy.
I'd lean towards a separate, explicit path for cross-tenant access, especially for support workflows. The same underlying service can handle both, but the authorization policy should make the elevated access obvious and require a reason or approval where appropriate. I wouldn't let a tenant_id argument silently turn the normal lookup into a cross-tenant one.
The tenant one is why I stopped passing identity in as a tool parameter. The job that touches a client picks its credential off the queue message, not out of the model's reach, so the model can decide what to do inside one tenant but never which tenant. It costs you one tool per job instead of one clever general tool, and the audit log gets much easier to read. What it does not solve is support: someone still needs the cross-tenant view, so you end up writing that path on purpose instead of getting it by accident.
the directories push the read/write split too. anthropic's connector review rejects one tool that takes both safe and unsafe methods, and openai wants readOnlyHint and destructiveHint set explicitly on every tool. we had a sql tool doing reads and writes in one call, and that's the tool we expect a reviewer to flag first
The SQL example is a good one. It's tempting to expose one flexible tool and let the model decide what query to run, but then you've mixed two very different risk levels behind one interface. Splitting read and write operations makes the boundaries much easier to review and enforce.
Software engineer who builds things that run in production — and writes deep-dive guides on why they break. I explain how React, Node, Docker, Rust and Kubernetes actually work under the hood.
Hey Dimitris! second user thing lol. I demoed an MCP server on one token, teammate asked 'can it delete'... yea it could. Testing as the wrong user, stealing that :)
Haha, that's exactly how these things slip through. The demo works perfectly until someone asks what happens when the user isn't supposed to do something. Testing with the wrong identity should probably be part of the default MCP checklist.
Software engineer who builds things that run in production — and writes deep-dive guides on why they break. I explain how React, Node, Docker, Rust and Kubernetes actually work under the hood.
The phone book framing is exactly right. In automated trading, one MCP server exposing 50 read/write tools inflates the context window and gives the agent a blast radius that is hard to reason about.
In production we keep a tiny read-only 5-tool risk gate in front of execution and expose zero write tools on that server. It returns deterministic fail-closed booleans like allowed_to_open_trade: false whenever inputs are malformed or upstream state goes stale, so the agent cannot talk itself past the gate.
That's a good pattern, especially keeping execution completely out of that server. I like the fail-closed booleans too. One thing I'd still watch is making sure the execution side independently enforces the decision rather than treating the agent's interpretation of the gate response as a guarantee.
Exactly: the LLM's read of the gate is advisory context, never an enforcement boundary. That's why the order router independently polls and asserts
prop_safe_to_trade == trueandstale == falseimmediately before sending the order. The model can explain or plan against that state, but it physically cannot bypass the code-level gate.The tenant one is the scariest of the four for me — not because it's a bug, but because it's the design working as intended. The model reads a tenant_id out of a document and fills it in, and nothing in the call looks wrong. The ctx injection in your enforcement sketch is the right shape, but I'm curious how it holds up for the legitimate cross-tenant case: a support agent who genuinely needs to look at another tenant's invoices. Do you give that a separate tool with its own approval, or does the same tool get a second, narrower path? That's where I'd expect the clean model to get messy.
I'd lean towards a separate, explicit path for cross-tenant access, especially for support workflows. The same underlying service can handle both, but the authorization policy should make the elevated access obvious and require a reason or approval where appropriate. I wouldn't let a tenant_id argument silently turn the normal lookup into a cross-tenant one.
The tenant one is why I stopped passing identity in as a tool parameter. The job that touches a client picks its credential off the queue message, not out of the model's reach, so the model can decide what to do inside one tenant but never which tenant. It costs you one tool per job instead of one clever general tool, and the audit log gets much easier to read. What it does not solve is support: someone still needs the cross-tenant view, so you end up writing that path on purpose instead of getting it by accident.
the directories push the read/write split too. anthropic's connector review rejects one tool that takes both safe and unsafe methods, and openai wants readOnlyHint and destructiveHint set explicitly on every tool. we had a sql tool doing reads and writes in one call, and that's the tool we expect a reviewer to flag first
The SQL example is a good one. It's tempting to expose one flexible tool and let the model decide what query to run, but then you've mixed two very different risk levels behind one interface. Splitting read and write operations makes the boundaries much easier to review and enforce.
Hey Dimitris! second user thing lol. I demoed an MCP server on one token, teammate asked 'can it delete'... yea it could. Testing as the wrong user, stealing that :)
Haha, that's exactly how these things slip through. The demo works perfectly until someone asks what happens when the user isn't supposed to do something. Testing with the wrong identity should probably be part of the default MCP checklist.
haha Dimitris, yep. I keep a spare token just for that wrong-user delete test now, run it first thing. thanks :)