haldir AGENTS.md

haldir AGENTS.md is an instructions file for Codex, OpenCode from ExposureGuard/haldir. It costs 1,769 tokens per session, scanned A, original, MIT.

Project instructions for coding agents working on Haldir, a governance system for AI agents. Haldir includes an API, Python software library, command-line tool, web pages, and optional MCP server; MCP is a standard way for an agent to call tools.

In plain words
What is it for?
Use them when developing Haldir, running its Flask API, Python library, command-line tool, tests, or web interface.
Why use it?
They explain the repository structure, development commands, database choices, and project conventions an unfamiliar agent needs before making changes.

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/exposureguard/haldir/agents-md
Clone the repo
git clone --depth 1 https://github.com/ExposureGuard/haldir

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 haldir AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/exposureguard/haldir/agents-md.svg)](https://agentmods.dev/instructions/exposureguard/haldir/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/exposureguard/haldir/agents-md"><img src="https://agentmods.dev/badge/instructions/exposureguard/haldir/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,769 This file is loaded in full into every session.
When invoked 1,769 The same file — it is already loaded in full.
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.01769 $0.01769
Opus 5 $0.00885 $0.00885
Sonnet 5 $0.00354 $0.00354
Haiku 4.5 $0.00177 $0.00177

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

Security

Grade A, and why

haldir AGENTS.md 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 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.

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.

AGENTS.md · 129 lines

How it starts

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

AGENTS.md

Guidance for AI coding agents (Cursor, Codex, Aider, Claude Code, Windsurf, Devin, Copilot Workspace, etc.) working on the Haldir codebase. Read this before making changes. Same conventions a new human engineer would be told on day one — just written in the form every modern agent tool knows to load.

What this project is

Haldir is the governance layer for AI agents: scoped sessions, encrypted vault, immutable audit trail, RFC 6962 Merkle tamper- evidence, SOC2 audit-prep evidence packs. Shipped as:

  • Python Flask REST API (api.py, ~4,000 lines; single-file by design)
  • Python SDK (sdk/) — sync + async HTTPX clients
  • CLI (cli.py) — every API endpoint mirrored as a subcommand
  • Landing + dashboard HTML (landing/)
  • Optional MCP server (emerging; see /.well-known/mcp/mcp.json)

Primary working directory: the repo root. SQLite in dev, Postgres in prod. Single-tenant model per API key; multi-tenancy at the DB row level keyed on tenant_id.

Run + build commands

Task Command
Install deps pip install -r requirements.txt
Run dev server python api.py (or haldir dev via CLI)
Run full tests python -m pytest tests/ -q
Run property tests python -m pytest tests/test_merkle_properties.py -v
Run Merkle benchmarks python bench_merkle.py --tree-size 10000
Type-check mypy api.py haldir_*.py
Build Docker image docker build -t haldir .
Apply DB migrations python -c "import haldir_migrate; haldir_migrate.apply_pending('haldir.db')"

Where things live

api.py                           — Flask app, every REST route
haldir_merkle.py                 — RFC 6962 primitives (stdlib only)
haldir_audit_tree.py             — Tenant-scoped STH + proofs over audit_log
haldir_demo_tamper.py            — /demo/tamper adversarial demo
haldir_compliance.py             — Evidence pack builder + HTML/markdown render
haldir_compliance_score.py       — Audit-prep readiness score
haldir_compliance_scheduler.py   — Recurring evidence delivery
haldir_db.py                     — SQLite + Postgres init/schema
haldir_migrate.py                — Versioned schema migrations
haldir_gate/, haldir_vault/, haldir_watch/  — Core governance primitives
haldir_scopes.py                 — Scope vocabulary + @require_scope decorator
haldir_openapi.py                — OpenAPI 3.1 spec auto-generation
haldir_export.py                 — SIEM / audit-archive streaming exports
haldir_email.py                  — Evidence-pack email delivery
haldir_idempotency.py            — Stripe-style idempotency keys
haldir_health.py                 — /livez + /readyz probe logic
sdk/                             — Python client SDKs
cli.py                           — Argparse-based CLI entry point
landing/                         — Static HTML + CSS for public site
tests/                           — pytest suite (500+ tests)
migrations/                      — Versioned SQL files
.well-known/                     — Agent discovery (MCP, security.txt, ai.txt)

Read the full file on GitHub · 129 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 · 129 lines · 1,769 tokens per session scan A ce32c6abdd6c

Subscribe to this mod's changes

haldir AGENTS.md is an instructions file published in the GitHub repository ExposureGuard/haldir (4 stars, last pushed 4mo ago), licensed MIT. It adds 1,769 tokens to every session, about $0.0088 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.

Related

Other instructions, from other repositories

agent-governance-toolkit copilot-instructions.md

Copilot instructions for microsoft/agent-governance-toolkit, covering copilot instructions for agent-governance-toolkit, architecture, build, test, and lint, python and install (editable, all extras).

microsoft/agent-governance-toolkit · 5,833 tokens

agent-governance-toolkit AGENTS.md

AGENTS.md instructions for microsoft/agent-governance-toolkit, covering agent governance toolkit - repository instructions, project overview, repository layout status, where changes belong and routing rules.

microsoft/agent-governance-toolkit · 1,640 tokens

nexus-gateway CLAUDE.md

Claude Code instructions for AlphaBitCore/nexus-gateway, covering nexus gateway, mandatory rules, pre-edit reading (3-doc rule), mandatory development workflow and current state.

AlphaBitCore/nexus-gateway · 6,441 tokens

agent-passport-system AGENTS.md

AGENTS.md instructions for aeoess/agent-passport-system, covering agents.md, dev environment, test before you ship, pr instructions and code style.

aeoess/agent-passport-system · 852 tokens

agent-passport-system CLAUDE.md

Claude Code instructions for aeoess/agent-passport-system: This file exists so Claude Code picks up repository context. See AGENTS.md for the canonical contributor instructions. Nothing volatile lives here; versions and counts are read from package.json and CI, never from this file.

aeoess/agent-passport-system · 55 tokens

filegrc AGENTS.md

AGENTS.md instructions for Alignbase/filegrc, covering filegrc repository instructions, purpose, agent-facing product surface, product principles and standards alignment.

Alignbase/filegrc · 4,801 tokens