execlaw AGENTS.md

execlaw AGENTS.md is an instructions file for Codex, OpenCode from crockpotveggies/execlaw. It costs 4,210 tokens per session, scanned C, original, Apache-2.0.

A repository guide for AI coding agents working on execlaw, a self-hosted Rust framework for building and running agents on the operator’s own hardware. It explains the codebase, its rules, structure, and design.

In plain words
What is it for?
Use it when editing execlaw: first learn how the Rust workspace and web app are organised, then follow the project’s architecture, plugin, event-log, and tool-access rules.
Why use it?
It gives an agent the project context and non-negotiable rules before it changes code. This reduces the risk of edits that conflict with the system’s architecture or security model.

Instructions file for CodexOpenCode

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 instructions/crockpotveggies/execlaw/agents-md
Clone the repo
git clone --depth 1 https://github.com/crockpotveggies/execlaw

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for execlaw AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/crockpotveggies/execlaw/agents-md.svg)](https://agentmods.dev/instructions/crockpotveggies/execlaw/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/crockpotveggies/execlaw/agents-md"><img src="https://agentmods.dev/badge/instructions/crockpotveggies/execlaw/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 4,210 This file is loaded in full into every session.
When invoked 4,210 The same file — it is already loaded in full.
Security scan C 2 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.04210 $0.04210
Opus 5 $0.02105 $0.02105
Sonnet 5 $0.00842 $0.00842
Haiku 4.5 $0.00421 $0.00421

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

Security

Grade C, and why

execlaw AGENTS.md scanned grade C with 2 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 4d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

unreadable). Don't `rm -rf ~/.execlaw/` without explicit user

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -X DELETE "http://127.0.0.1:3031/api/admin/plugins/<id>" \
AGENTS.md · 388 lines

How it starts

The opening of the file, as written. The whole thing — 388 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md

Guide for AI coding agents (Claude Code, Cursor, Aider, etc.) working on this repo. The product itself is also a coding-capable agent platform — this doc is about agents editing execlaw, not agents running on execlaw.

If you are an agent and you have not yet read docs/architecture.md, do that first. The rest of this file assumes you've internalised the 12 design principles in §2 of that doc.


1. What this codebase is

execlaw is a self-hosted Rust agent framework. Single-operator, runs on the operator's hardware, no cloud LLMs ever. It's built around three load-bearing abstractions:

  1. An append-only event log (SQLite, optionally SQLCipher-encrypted). Every action is a row in state_events; replay reconstructs state.
  2. A plugin framework that loads ZIP bundles at runtime — manifest declares tools, sidecars, transports, identity providers, OAuth clients, webhook routes. Two runtime tiers: script (Rhai) and subprocess (JSON-RPC).
  3. A trust ladder + Rule of Two policy gate that decides which tools the agent can call given the principal's trust class and the turn's sensitivity.

The Rust workspace lives in crates/. The SPA lives in web/. First-party plugins live in plugins/. Documentation lives in docs/ (architecture, agent-model, plugins, sidecar-supervisor, runner-design, voice-followups). Inline source comments still cite MIGRATION_PLAN.md §X for historical rationale; the file itself was retired once its content was distributed across the in-tree docs.


2. Non-negotiable rules

These are axioms. Violating any of them will require a re-do.

  1. No cloud LLMs. Anthropic, OpenAI, Gemini, Mistral cloud — none of them, on any code path, ever. Inference happens against a local OpenAI-compatible endpoint (vLLM / OpenArc / similar). If a feature seems to require a cloud LLM, the answer is "design it differently or don't ship it."
  2. Plugins, not hardcoded built-ins. If a host crate references a specific plugin id by name in production code (e.g. if plugin_id == "signal"), that's a leak. The host knows about plugins only through manifest-declared surfaces (registry lookups, capability gates). Test fixtures and doc-comment examples are fine.
  3. SQLite is the source of truth. No environment variables for configuration, no .env files, no shared TOML/YAML in /etc. Operator-editable config lives in config_* tables; secrets live in the SQLCipher vault keyed by an OS-keyring master key.
  4. Effects go through the outbox. The LLM never makes external HTTP calls directly. It emits a tool_use event; the host enqueues a state_outbox row with a framework-minted idempotency key; a separate relay drains it.
  5. tool_use and tool_result always pair in the same commit. Enforced by EventLog::commit_turn::enforce_tool_pairing(). If a turn fails mid-tool, a synthetic cancellation tool_result must be committed alongside.
  6. Tests are mandatory for non-trivial code. Per the project's axiom #13, every non-trivial function, every invariant, every public API has tests. Security-critical code has adversarial tests. cargo test --workspace must pass before any commit.
  7. Performance regressions are blocked by Criterion benchmarks. Per axiom #14, hot paths have benchmarks with explicit budgets. Don't claim a speedup without numbers.
  8. Never create commits without explicit human approval. A user asking you to fix a bug is not the same as authorising a commit. Wait for "commit", "push", or equivalent before invoking git.
  9. Never push to main/master. The active branch is foundation. Force-pushing to anything other than your own ad-hoc branch requires explicit user permission.

Read the full file on GitHub · 388 lines

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. 4d ago First seen · 388 lines · 4,210 tokens per session scan C 446f717781a9

Subscribe to this mod's changes

execlaw AGENTS.md is an instructions file published in the GitHub repository crockpotveggies/execlaw (5 stars, last pushed 24d ago), licensed Apache-2.0. It adds 4,210 tokens to every session, about $0.0210 per session on Opus 5. A static security scan graded it C with 2 findings (recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,345 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

next.js AGENTS.md

Instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens