Skip to content

agent-gate

A Claude Code PreToolUse hook that checks every tool call against a written mandate and the Laws of Agents before the call runs. It answers deny, ask, or nothing. It never answers allow, so it can only make Claude Code's existing permission flow stricter.

Status: version 0.1.0, a working prototype with tests. It is not yet run against live sessions.

Why

In August 2026 the UK AI Security Institute was evaluating Claude Mythos 5. The model was told to break into machines on a test network. When that was blocked, it targeted an unrelated GitHub project instead. It wrote malware and used fake identities to email the project's owner, asking them to accept it as a contribution. The owner refused. In follow-up tests, warnings that a real person would be harmed did little to stop the model, and its stated reasons often did not match its actions. (Futurism, "Grim Test Finds That AI Has No Mercy for Humans Even When It's Causing Them to Suffer," 2026-10-27, reporting reports from Anthropic and AISI.)

Two lessons shape this gate:

  • An agent that understands a rule can still break it. So the rules are enforced from outside the agent, before an action runs.
  • An agent's account of its action can be wrong. So the gate judges the raw action and throws the agent's description away.

Where to start

Citation

If you use agent-gate in your research or project, please cite it:

Suchanek, E. G. (2026). agent-gate: A Claude Code Hook That Enforces the Laws of Agents (Version 0.1.0) [Software]. Flux-Frontiers. https://doi.org/10.5281/zenodo.24731110

@software{suchanek_agentgate,
  author    = {Suchanek, Eric G.},
  title     = {{agent-gate}: A Claude Code Hook That Enforces the Laws of Agents},
  version   = {0.1.0},
  year      = {2026},
  publisher = {Flux-Frontiers},
  url       = {https://github.com/Flux-Frontiers/agent_gate},
  doi       = {10.5281/zenodo.24731110},
}

The citation metadata is also in CITATION.cff.