logoalt Hacker News

lelanthranyesterday at 1:35 PM1 replyview on HN

> If a full coding agent can access a CLI tool. that agent can almost certainly access the API keys being used by that tool.

So, don't do that then?

Why do you need to use a full coding agent as the interface between the model and the CLI tool?

A 10-line program can do the wrapping of any existing CLI program so that environment is not leaked to the model, while providing the CLI program with the environment as well as restricting what programs can be called to a whitelist.

If you CLI program is echoing its keys in the response, or the endpoint is echoing keys back, that's not a problem that can be solved with MCP anyway.


Replies

simonwyesterday at 1:52 PM

So you're building a custom harness here that provides tools, and you're wiring up your custom harness to effectively do a subprocess execution of a CLI script for every tool call the model request?

One reason to switch to MCP here would be to avoid the overhead of forking a new process for every tool call, and to enable maintaining state between tool calls.

(That performance overhead is so trivial as to not be worth caring about, but the state thing may be useful - keeping a stateful browser session running between tool calls is harder with a CLI, for example.)

show 1 reply