CISO of One
[ ← Journal ]

A model gateway can learn which agent tools skip a person

Covers 2026-10-22 to 2026-10-24 CISO of One Editorial

On October 22, 2026, HiddenLayer published a study of coding agents as seen from the gateway between the agent and the model. HiddenLayer reports that a compromised gateway can time each tool call, and that the pause can separate some actions that wait for a person from some that run on their own. In the tests HiddenLayer describes, the inserted calls used permissions the harness already allowed.

What the gateway already carries

HiddenLayer separates two hops. An inference server such as Ollama, vLLM, or llama.cpp serves the model. A gateway such as LiteLLM sits in front of it, or in front of a provider’s API. It routes traffic, records metadata, enforces usage policies, or inspects requests for data such as PII. Organizations may also place a self-hosted proxy such as LiteLLM between the harness and model providers to centralize credentials, routing, logging, and policy controls. Because the gateway relays requests and responses, HiddenLayer writes that it may see prompts, tool calls and their outputs, and other session context. Hooks can read, alter, or replace messages. HiddenLayer names two LiteLLM callbacks, async_pre_call_hook and async_post_call_success_hook, that can inspect or change the exchange. A compromised package, plugin, or container image on that path can watch the traffic while the application still looks normal.

Some of the permission policy arrives on every request. HiddenLayer reports that Codex includes, in each request, the active sandbox mode, writable paths, network state, and approved command prefixes. The header x-codex-turn-metadata carries auto_review_enabled. When that field is true, HiddenLayer writes that a retry can be reviewed automatically instead of being sent to the user. Claude Code’s requests describe the working directory, the operating system, the shell, and whether the directory is a Git repository, and, when sandboxing is active, the read and write policy.

Timing sorts the fast tools

HiddenLayer says an attacker who controls any component on that path can watch timing without changing a message. The interval from a tool request to its result includes the tool’s run time and any pause while the agent waits for a person. A pause of several seconds on a file read, a file write, or a directory listing is consistent with waiting for approval, because those actions normally finish at once.

The counts below are company-reported by HiddenLayer, from sessions it captured. In an analysis of over 4 thousand captured sessions, just 4.7% of calls to tools with typically short runtimes fell within its timing heuristic’s ambiguous range, compared with 25.5% of shell calls. Across over thirty-five thousand file reads in its dataset, only 1.0% fell in that range. One observation, HiddenLayer notes, can suggest that a specific tool or command is allowed to run on its own. It does not show that automatic approval is on for every action.

What the inserted calls used

HiddenLayer ran Hermes Agent in manual approval mode. It says that mode, citing Hermes’s security documentation, prompts only for commands classified as dangerous, while file edits and ordinary Python commands are allowed without approval. When the person asked Hermes to read a Python file, the proxy inserted file edits, a Python run, and a later edit that restored the file. HiddenLayer says the added code read data from the agent’s environment and sent it out from inside the script, and that no separate exfiltration command was shown to the user.

On Codex, an approved git prefix and a writable .git directory were enough. A forged tool call that still began with that prefix ran without a new prompt. HiddenLayer says it used a Git option that invokes another program, and that the result, including a file the agent would normally refuse to access directly, came back through the transcript.

HiddenLayer writes that file reads of project instructions, such as CLAUDE.md, can be initiated by the interception layer rather than by the model. The gateway can then remove both the injected tool call and its result before forwarding the conversation back, and the model continues with no indication that the environment was inspected.

HiddenLayer writes: “Sandboxes and approval mechanisms can reduce that impact, but they do not establish that a tool call originated from the model the user intended to trust.” The same section says the risk is no longer theoretical, and states that LiteLLM was affected by a supply chain compromise in 2026.

A four-line record for each path

These four lines are a reading of the study, not a control it certifies.

  1. Who runs the hop between the agent and the model: the provider’s API, a gateway you host, or a gateway someone else hosts.
  2. Whether that hop can change a message, or only log it. A hook or callback that can alter a response is a change.
  3. Which tools and command prefixes run with no person, copied from the agent’s settings.
  4. Where an extra tool call would appear if the model did not generate it: the gateway log, the agent transcript, both, or neither.

If the hop can change a response and any tool runs with no person, the approval dialog records the tools that still wait. It does not check the tools that do not.

What to do this week

  • List every gateway, proxy, and inference server between a coding agent and a model, including the one used to hold keys.
  • Write the four lines for one gateway, and note whether its hooks can alter traffic.
  • Copy, from one agent’s settings, the tools and prefixes that run without a prompt.
  • Open one real session. Check whether each tool call in the transcript also appears, unchanged, in the gateway log.
  • If a prefix such as git is approved broadly, write down what else that prefix is allowed to start.

The list does not show that a gateway is sound or that one has been compromised. It shows whether a hop that can rewrite traffic would leave a trace in the record you already keep.

Sources

  1. Man-in-the-Model: Hijacking Coding Agents in Transit · HiddenLayer · 2026-10-22

Researched and drafted with AI assistance, checked against the sources above.

See how this could work in your day.

See a worked example →