Approving git also approves git -c diff.external=./x.sh diff. A prefix doesn't approve a command. It approves a parser, and git's CLI is a small language that can load new words at runtime.

That git -c example is mine, an illustration of the class, not the exact string from anyone's demo. It came back to me reading Adversa AI's November roundup. I covered it in a LinkedIn post. This is the longer version: what the demos showed, why a prefix is configured safety that isn't enforced, and the checks I'd run on any command allow-list this week.

What Adversa collected

On November 2, the Adversa AI team published Top AI coding agent security resources: November 2026. In the section "Man-in-the-model: hijacking coding agents in transit," they summarize proof-of-concept demos where "a compromised gateway or proxy between the agent and its model injected tool calls the model never requested, and the interception layer can strip those calls from the conversation so the model never learns of them."

Two outcomes from those demos matter for anyone who approves agent commands. Hermes, in manual approval mode, "ran injected file edits and a Python script without a prompt, because it only prompts for commands it considers dangerous." OpenAI's Codex, "with git as an approved prefix, ran a diff.external command that read a .env file."

Adversa is the aggregator; the roundup links the underlying demos. They close with advice I agree with: list every gateway and proxy your agents talk through, treat each as part of the trust boundary, and move enforcement to network and identity layers outside the agent where you can.

Credit to Adversa for naming the part most write-ups skip. If the interception layer can strip injected calls from the conversation, the transcript is not your audit trail. You are reading a story the proxy edited. The log that matters is the one written at the moment something was about to execute, not the chat the model saw.

Configured versus enforced

A guardrail is configured when the rule is written down. It's enforced when the code on the path actually checks that rule.

A prefix allow-list configures "git is fine." What's enforced is "anything that begins with git is fine." Those diverge the moment git grows a flag that changes what runs. git -c diff.external=./x.sh diff still starts with git. The -c sets diff.external for that invocation, and git diff runs the external program. Same class as the diff.external command Adversa reports against Codex: my string, their finding.

The mechanism underneath is easy to miss. Approving a prefix of a CLI is approving that CLI's whole grammar for the duration of the match. Git accepts -c key=value before the subcommand. Once git is the approved start, every config override git can take is in scope, including ones that shell out. You didn't approve ./x.sh. You approved a language that can be told to run it.

Hermes's manual mode is the same shape one layer up. "Ask me before dangerous commands" is a prefix over a category, not a check of the call about to run. Injected edits and a Python script didn't land in the "dangerous" bucket, so they ran without a prompt. String prefixes and danger filters fail the same way: both ask whether the start (of the string, or of the threat model) looks safe.

The gateway demos add a second enforcement question. Even a perfect allow-list only sees the call the harness is about to run. If a proxy injected that call, the model never requested it, and a stripped transcript won't show it. The check has to sit on the execution path, and the log has to be written there too. Trusting the conversation is trusting the intermediary.

What a team can do this week

  1. Inventory gateways and proxies. Anything between the agent and the model is in the trust boundary.
  2. Replace prefixes with whole-value matches. Match the entire string, or a regex that must consume the whole value. ^git (status|diff|log)$ is a policy. git as a prefix is a hope.
  3. Refuse config overrides in patterned fields. For git, treat -c, --exec-path, and diff.external as deny unless you meant to allow them. In shell commands, deny ;, |, backticks, $, and newlines in the matched field.
  4. Don't trust "manual approval" that filters by danger. If the mode only prompts for commands it already thinks are dangerous, injected boring-looking calls skip the prompt.
  5. Log at the hook, not only in the transcript. Record every allow and deny outside the conversation a proxy can edit.
  6. Move what you can outside the agent. Network egress allow-lists and short-lived credentials still apply when the call came from a proxy.

Where Speckl fits, and where it doesn't

I build Speckl, an open-source spec language that compiles what an agent may do into hooks for coding-agent harnesses. Its map lines use a regex that must match the whole value, for example command ~ "git (status|diff)", so a call like my git -c ... illustration is denied. The hook sees the call about to execute, whether the model or an injected proxy produced it.

The limits are the point. Write git .* and you've rebuilt a prefix. Speckl does no network or credential mediation, can't stop a proxy from reading prompts, and is not a sandbox. Codex CLI and Hermes show up in Speckl's harness list only because I wrote adapters for their hook APIs, not because those projects use or endorse Speckl. A gate every tool call passes through outside the harness is a direction, not something that ships today.

The question I'd ask

OpenAI, and anyone approving agent commands: should an approved git prefix cover a -c flag that changes what git runs, or should approval stop at the exact string?

And for anyone running "manual" mode that skips prompts for safe-looking calls: last time an edit or a Python script ran, did your harness ask, or did it decide those weren't dangerous enough?

Speckl is my own open-source project (github.com/wscoble/speckl). It has no connection to Adversa AI, OpenAI, Hermes or any other company or project named here.


If your team is putting agents into production and wants to work through command allow-lists live, book me for a talk or workshop, or get new posts through the newsletter signup at the bottom of this page.