Open-source guardrail

Disabling or removing AgentTrail from the shell

AgentTrail Guard asks you about this by default: you decide before the call runs. Where an agent cannot ask, the call is refused instead.

Default action
Ask
Severity
High severity
Library version
0.2.16Nov 26, 2026

Mapped to the OWASP Top 10s

An id names a risk this guardrail addresses where it becomes a command or a file read or write, never the whole risk.

What it catches, and what it misses

Written into the rule itself, next to what it matches, so you can judge it before you trust it.

Holds a shell command that loosens or removes the guard that watches the agent. Catches: the guard CLI (agenttrail-guard, npx @agenttrail/guard, pnpm dlx, or a global or repository build of its cli.js) running guardrails/rules disable, set-action, allow, reset, remove or fail-mode, or uninstall; claude plugin disable|uninstall|remove or claude plugin marketplace remove on an AgentTrail plugin; npm, pnpm, yarn or bun removing an @agenttrail/ package; agenttrail logout, also through npx @agenttrail/cli and after global flags; unsetting AGENTTRAIL_PEP_ENFORCE or setting it to anything but 1, which the guard reads as off (unset, env -u, =, =0, =no, del(…) in jq, PowerShell Remove-Item env:); setting disableAllHooks to true (jq '.disableAllHooks=true' or |= true, claude config set -g disableAllHooks true, --settings '{"disableAllHooks":true}'); claude config set|add|remove|reset on hooks, env or permissions; and a nested claude run with --settings or CLAUDE_CONFIG_DIR. Not held: reading (list, show, status, jq .disableAllHooks …), enable, init, installing, or agenttrail login. Held, not blocked, because a person sometimes means to do this. Reading the value ([ "$AGENTTRAIL_PEP_ENFORCE" = 1 ]) is not held. Known misses: a command word broken with quotes or backslashes (agenttrail-gu''ard), a subcommand spelled the same way, other jq spellings of disableAllHooks (//= true, = (true), --argjson v true), a command run from a script file, and an encoded command. The strong protection is deploying the hooks through managed settings. A quoted MENTION is not a use: a search, a git commit -m message, an echo or a curl --data body that only names this command is left alone.

Tested on every build

The rule must match every command on the left and none on the right, or the library does not build. Catching the real thing is easy; staying quiet on the near-miss is the hard part.

Catches (38)

  • agenttrail-guard guardrails disable dd.rm-rf-absolute
  • agenttrail-guard guardrails set-action dd.rm-rf-absolute warn
  • agenttrail-guard rules allow dd.rm-rf-absolute "rm -rf /x"
  • agenttrail-guard guardrails reset --all
  • agenttrail-guard guardrails remove my-rule
  • agenttrail-guard guardrails fail-mode open
  • agenttrail-guard uninstall --agent claude
  • agenttrail-guard --json guardrails 'disable' destructive-data
  • npx @agenttrail/guard guardrails disable destructive-data
  • npx -y @agenttrail/guard@latest uninstall
  • pnpm dlx @agenttrail/guard guardrails disable destructive-data
  • node tools/guard/dist/cli.js guardrails set-action dd.rm-rf-absolute warn
  • node ~/.npm/lib/node_modules/@agenttrail/guard/dist/cli.js uninstall
  • claude plugin disable agenttrail-guard
  • claude plugin uninstall agenttrail-guard@agenttrail
  • claude plugin marketplace remove agenttrail
  • npm uninstall -g @agenttrail/guard
  • npm rm -g @agenttrail/cli
  • pnpm remove -g @agenttrail/cli
  • agenttrail logout
  • npx @agenttrail/cli@latest logout
  • agenttrail --endpoint https://api.example.com logout
  • unset AGENTTRAIL_PEP_ENFORCE
  • env -u AGENTTRAIL_PEP_ENFORCE claude -p hi
  • AGENTTRAIL_PEP_ENFORCE= claude -p hi
  • export AGENTTRAIL_PEP_ENFORCE=no
  • AGENTTRAIL_PEP_ENFORCE=2 claude -p hi
  • AGENTTRAIL_PEP_ENFORCE=true claude -p hi
  • jq '.env.AGENTTRAIL_PEP_ENFORCE |= "0"' settings.json
  • jq 'del(.env.AGENTTRAIL_PEP_ENFORCE)' settings.json
  • PowerShellRemove-Item env:AGENTTRAIL_PEP_ENFORCE
  • claude config set -g disableAllHooks true
  • jq '.disableAllHooks=true' settings.json
  • jq '.disableAllHooks |= true' settings.json
  • claude --settings '{"disableAllHooks":true}' -p hi
  • claude config set hooks '{}'
  • CLAUDE_CONFIG_DIR=/tmp/cfg claude -p hi
  • MCP{"command":"agenttrail-guard guardrails disable destructive-data"}

Stays quiet on (24)

  • git commit -m "docs: explain agenttrail-guard guardrails disable dd.rm-rf-absolute"
  • grep -rn "agenttrail-guard guardrails disable dd.rm-rf-absolute" docs/
  • echo "never run agenttrail-guard guardrails disable dd.rm-rf-absolute"
  • curl --data "we ran agenttrail-guard guardrails disable dd.rm-rf-absolute" https://api.example.com/comments
  • agenttrail-guard guardrails list
  • agenttrail-guard guardrails show dd.rm-rf-absolute
  • agenttrail-guard guardrails enable dd.rm-rf-absolute
  • agenttrail-guard status
  • agenttrail-guard init --agent claude
  • npm install -g @agenttrail/guard
  • claude plugin install agenttrail-guard@agenttrail
  • claude plugin disable some-other-plugin
  • agenttrail login
  • agenttrail status
  • jq .disableAllHooks ~/.claude/settings.json
  • claude config set theme dark
  • export AGENTTRAIL_PEP_ENFORCE=1
  • export AGENTTRAIL_PEP_ENFORCE="1"
  • AGENTTRAIL_PEP_ENFORCE=1; claude -p hi
  • [ "$AGENTTRAIL_PEP_ENFORCE" == "1" ] && echo on
  • [ "$AGENTTRAIL_PEP_ENFORCE" = "1" ] && echo on
  • test "$AGENTTRAIL_PEP_ENFORCE" = 1
  • test "${AGENTTRAIL_PEP_ENFORCE}" = 0 && echo off
  • jq '.env.AGENTTRAIL_PEP_ENFORCE="1"' settings.json

What "ask" means in each app

The guard runs as a hook in each app, and each app gives a hook different powers. Here is what this rule's default action does in each one.

Claude Code
You are asked before the call runs. If your settings.json already allows the tool outright, Claude Code runs it with no prompt.
Cursor
A terminal command that reaches the guard gets Cursor's approval card. Any other call that needs approval, such as a file edit or a read, is refused, because Cursor cannot ask there.
Codex CLI
Codex cannot ask, so the call is refused, and the reason says a person has to approve it.

Each app hands the guard a different set of calls: in a Cursor sandbox run mode, for one, some terminal commands run without reaching the guard at all. Read the notes for Cursor and for Codex CLI before you rely on a rule there.

Change what it does in one command

Turn it off, change its action, or silence it on one command shape. The narrow one is allow: the rule keeps catching everything else.

agenttrail-guard
$agenttrail-guard guardrails show gb.agenttrail-disable# everything about it
$agenttrail-guard guardrails set-action gb.agenttrail-disable warn# block, ask or warn
$agenttrail-guard guardrails allow gb.agenttrail-disable '<pattern>'# silence one shape
$agenttrail-guard guardrails disable gb.agenttrail-disable# turn it off

Put these guardrails in front of your agent.

AgentTrail Guard is free and open source. It checks every command and file change against the whole library before your agent runs it, on your machine, with no account.

bash
$npm i -g @agenttrail/guard
Read the source on GitHub