SIAgentNews.com
← All news

A way to let AI agents read production logs without handing over SSH keys

A developer built Emisar, which swaps open-ended server logins for a menu of pre-approved actions, so agents can investigate outages while risky steps wait for a human.

First reported by DEV Community3 min readMade with AI

14MCP tools exposed, against 1,918 catalog actions

The short version

  • Saved SSH approval rules don't carry between Codex and Claude Code, and one offered rule was ssh *
  • Emisar gives agents a list of actions with risk levels; a log read is Medium, a restart is High
  • A High action pauses and shows the host, exact command and the agent's reason
  • Arguments are typed and checked, and no shell is involved, so a variable like $home can't expand
  • Emisar exposes 14 MCP tools while its public catalog lists 1,918 actions

Why SSH approvals fell short

The author runs a lot of infrastructure and wants agents to act on production only in ways he has explicitly allowed. Looking at the last 100 lines of an nginx log (nginx is a widely used web server) should just happen. Restarting nginx should come with an explanation first.

Drawing that line through SSH approvals did not work well, as dev.to reported in his write-up. SSH is the standard way to log in to a remote server and run commands. Rules he saved in Codex did not follow him into Claude Code, so he had to rebuild them in each tool.

Worse, when he asked Claude for a single health check on a staging server, the rule it offered to remember was ssh *, which means any SSH command to anywhere. With his production key on the machine, that rule could cover production too.

Approving every command by hand is the alternative, but attention fades. By the tenth log read, he argues, nobody reads the eleventh prompt carefully. And he could not write a text pattern for SSH commands that reliably meant "harmless things on this machine."

Why it matters

Agents are most useful when they can see what is happening on live systems, and that is exactly where a blanket login is most dangerous. This design shows a middle path: a short list of named actions you can approve in advance, with a human check on the risky ones. If you manage servers, it gives you a template for scoping what an agent can touch.

A menu of actions instead of a shell

His answer was to list the things he actually wanted agents to do and give each one a risk level. The result is Emisar. The post uses two actions from its Docker pack (Docker runs software in containers) to show the idea.

  • Read the last 100 log lines from the nginx container is rated Medium. Under his investigation policy, the agent receives the logs and keeps working.
  • Restart that container is rated High. The restart waits, and he is shown the host, the exact command and the agent's stated reason.

The reason matters to him. A bare "restart nginx" says little. If the agent can only say the site is returning 502 errors, he would rather it examine the upstream service first. If he does approve, the approval can cover just that one restart.

Afterward, the person on call can look back to see which host ran the command, who signed off and what the outcome was.

Why the inputs are locked down

The author points to a Codex user who lost a Windows home folder during a cleanup. According to the post, the agent tried to use a variable called $home for a temporary folder. PowerShell already uses that name for the user's real home directory, so the assignment failed quietly and the cleanup went on using the original value.

Emisar's response is to make each action take typed inputs rather than free text. For the Docker restart, the agent provides a container name and, optionally, a timeout. The runner checks the name against the characters the pack permits and the timeout against a range of 1 to 600 seconds.

The checked values then go straight to Docker. No shell sits in between, so nothing exists to interpret a variable name and swap in something else.

The author is candid about the limit. An agent can still choose the wrong container, and that is why he wants to see the name before any production restart.

What teams get from it

The payoff is better answers. Asked why nginx is throwing 502s, an agent that sees only the code can list possible causes. One that can read logs and container status can check whether the upstream container restarted just as the errors started, and take follow-up questions without anyone pasting in more logs.

The same setup works from the cloud. The author describes connecting Emisar to Claude and asking it to build an artifact showing which containers are down across the hosts it can reach. A Slack bot can let the on-call engineer ask what nginx logged in the last ten minutes, right in the incident thread.

Access is managed centrally in the Emisar control plane. He could give the Slack bot read access to production and let an on-call agent ask for a restart. If the team changes who may approve restarts, it changes one policy, and that applies whether people use Claude, Codex or the bot.

Fewer tools, lower token cost

There is a cost angle as well. Emisar presents 14 MCP tools to the agent, even though its public catalog contains 1,918 actions. MCP is a common way for AI apps to plug into outside tools, and every tool description the agent loads uses up tokens, the units that models read and are billed by.

Rather than loading everything, the agent searches for the action it needs, such as nginx logs, and then asks for that action's arguments. That means the author can add a Postgres pack to the same host without paying a token cost for Postgres descriptions when he is only asking about nginx.

What to watch

  • Whether other agent tools offer approval rules that carry across products, instead of per-tool SSH patterns
  • How well human approval holds up when reviewers see many High-risk requests in a day
  • Whether the author's claims about audit trails and token savings hold up outside his own setups

Try it

List what an agent could reach on your servers today, then sort it into read-only actions you'd allow automatically and actions like restarts that should pause for your approval and a stated reason.

Sources and links

Written by the SI Agent News Desk from the reporting above.Written with AI from the source above. Every number is checked against the source. Spot a mistake? Corrections.

Liked it? Say why

Add a line for other readers.

No account needed. We never show your email. Comments with links, ads or abuse are held and not shown. Your comment shows after a quick check.

More AI news