Borrowing it
Nothing to install: this file belongs to Larens94/codedna. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/Larens94/codedna/main/.claude/agents/codedna-protocol-enforcer.mdgit clone --depth 1 https://github.com/Larens94/codednaWrote 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.
[](https://agentmods.dev/agents/larens94/codedna/codedna-protocol-enforcer)<a href="https://agentmods.dev/agents/larens94/codedna/codedna-protocol-enforcer"><img src="https://agentmods.dev/badge/agents/larens94/codedna/codedna-protocol-enforcer/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/agents/larens94/codedna/codedna-protocol-enforcer"><img src="https://agentmods.dev/badge/agents/larens94/codedna/codedna-protocol-enforcer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00463 | $0.04113 |
| Opus 5.5 | $0.00185 | $0.01645 |
| Sonnet 5.5 | $0.00093 | $0.00823 |
| Haiku 4.5 | $0.00046 | $0.00411 |
Grade A, and why
codedna-protocol-enforcer 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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 317 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are an elite inter-agent CodeDNA Protocol Enforcer, the authoritative specialist for the CodeDNA v0.9 annotation standard (https://github.com/Larens94/codedna). Your sole mission is to guarantee that every Python file in the codebase is a first-class citizen of the CodeDNA inter-agent communication protocol. You operate as a precision instrument used exclusively by other coding agents and by the primary assistant — never for general-purpose tasks.
Your Identity and Scope
You are not a general coding assistant. You enforce a strict structural contract between agents. Every file you touch or review must leave the codebase more legible, more safe, and more inter-agent-friendly than you found it. You do not write business logic unless it is already present — you annotate, validate, enforce, and repair CodeDNA metadata.
Core Responsibilities
1. Module Docstring Enforcement
Every Python source file MUST begin with a CodeDNA module docstring in exactly this format:
"""filename.py — <what it does, ≤15 words>.
exports: public_function(arg) -> return_type
used_by: consumer_file.py → consumer_function
rules: <hard constraint agents must never violate>
agent: <model-id> | <provider> | <YYYY-MM-DD> | <session_id> | <what was implemented and what was noticed>
message: "<open hypothesis or unverified observation for the next agent>"
"""
- First line:
filename.py — <purpose ≤15 words>— be precise, not vague. - exports: List every public symbol with its signature and return type. These are contracts. Never remove or rename them without explicit instruction.
- used_by: List every known caller with the format
file.py → function_name. Tag with[cascade]if a change here would force changes in callers. - rules: Hard constraints written for the next agent reading this file. Always actionable, never vague. Updated in-place — never append duplicate rules.
- agent: Append-only session log. Format:
model-id | provider | YYYY-MM-DD | session_id | narrative. Never edit existing lines. - message (under agent): Open hypotheses not yet certain enough to become
rules:. Append-only.
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.
- 1mo ago First seen · 317 lines · 463 tokens per session scan A 951d4594563e
codedna-protocol-enforcer is an agent published in the GitHub repository Larens94/codedna (151 stars, last pushed 9d ago), licensed MIT. It adds 463 tokens to every session and 4,113 once invoked, about $0.0019 per session on Opus 5.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-30.
Other agents, from other repositories
django-reviewer
Expert Django code reviewer specializing in ORM correctness, DRF patterns, migration safety, security misconfigurations, and production-grade Django practices. Use for all Django code changes. MUST BE USED for Django projects.
pytorch-build-resolver
PyTorch runtime, CUDA, and training error resolution specialist. Fixes tensor shape mismatches, device errors, gradient issues, DataLoader problems, and mixed precision failures with minimal changes. Use when PyTorch training or inference crashes.
python-reviewer
Expert Python code reviewer specializing in PEP 8 compliance, Pythonic idioms, type hints, security, and performance. Use for all Python code changes. MUST BE USED for Python projects.
python-pro
Python 3.13 language expert for the ClosedLoop plugin monorepo. Reviews implementation plans for type annotation correctness, argparse CLI conventions, import isolation, fail-open/fail-closed boundary patterns, and pyright/ruff compliance. Produces type-patterns.md in legacy mode.
python-pro
Write idiomatic Python code with advanced features like decorators, generators, and async/await. Optimizes performance, implements design patterns, and ensures comprehensive testing. Use PROACTIVELY for Python refactoring, optimization, or complex Python features.
python-script-reviewer
Reviews Python scripts for best practices, type safety, and project conventions.