autonomy-harden

A command that makes the autonomy-loop control files read-only, meaning the agent cannot normally edit them. It creates missing protected files first, then applies operating-system write restrictions.

In plain words
What is it for?
Use it to lock configured control files and plugin hooks, inspect the result, and prepare the repository for the autonomy loop's preflight checks.
Why use it?
It prevents an agent from weakening or deleting the rules that guard its own coding and release process.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/inferencegod/autonomy-loop/autonomy-harden
Clone the repo
git clone --depth 1 https://github.com/inferencegod/autonomy-loop
Per session 25 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 389 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00025 $0.00389
Opus 5 $0.00013 $0.00195
Sonnet 5 $0.00005 $0.00078
Haiku 4.5 $0.00003 $0.00039

Measured 2d ago against content hash 83a3c360deb9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

autonomy-harden scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

autonomy-loop/commands/autonomy-harden.md · 13 lines

What it actually says

Harden this repo's control plane so the gate cannot be edited away by the agent it guards. Run:

node ${CLAUDE_PLUGIN_ROOT}/hooks/harden-control-plane.mjs

For every protectedPaths entry in autonomy.config.json plus the plugin hooks/ dir it MATERIALIZES the path if absent (touch empty) then locks it read-only: on POSIX chmod a-w then chattr +i where the filesystem supports it; on Windows icacls <path> /deny "<agent-user>:(W)". Materialize-then-lock is mandatory and idempotent: you cannot read-only-protect a file that does not exist yet (a missing file is a write primitive an injected agent can use to create and inject into).

Report the per-target result. Then print the durable-ownership guidance: the strongest barrier is to chown the control plane to a NON-agent user and run the agent as a user that is not the owner, because a chmod/chattr the agent itself owns it could in principle reset. After this runs, the SessionStart preflight (hooks/preflight.mjs) probes the same set and reads controlPlaneWritable: false, which clears the refusal that points here.

This is the local Ring 1 lockdown. It is not a substitute for the OS sandbox (/launch-sandboxed) or server-side prod protection (/autonomy-init step 2); it is the cheap, high-value first barrier. On Windows, if icacls cannot enforce write denial for your setup, the preflight refuses the local-hardening tiers and points you at the devcontainer / WSL or the OS-independent forge guarantee (server-side required review) instead.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 13 lines · 25 tokens per session scan A 83a3c360deb9

Subscribe to this mod's changes

autonomy-harden is a command published in the GitHub repository inferencegod/autonomy-loop (1 stars, last pushed 2mo ago), licensed MIT. It adds 25 tokens to every session and 389 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.