Borrowing it
Nothing to install: this file belongs to freshaengineering/lang_ex. 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/freshaengineering/lang_ex/main/AGENTS.mdgit clone --depth 1 https://github.com/freshaengineering/lang_exWrote 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/instructions/freshaengineering/lang_ex/agents-md)<a href="https://agentmods.dev/instructions/freshaengineering/lang_ex/agents-md"><img src="https://agentmods.dev/badge/instructions/freshaengineering/lang_ex/agents-md/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/instructions/freshaengineering/lang_ex/agents-md"><img src="https://agentmods.dev/badge/instructions/freshaengineering/lang_ex/agents-md.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.03305 | $0.03305 |
| Opus 5.5 | $0.01322 | $0.01322 |
| Sonnet 5.5 | $0.00661 | $0.00661 |
| Haiku 4.5 | $0.00331 | $0.00331 |
Grade A, and why
lang_ex 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 2mo 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 — 240 lines — stays where its author put it; the contents beside it link to each section on GitHub.
LangEx
Graph-based agent orchestration for Elixir. Builds stateful, multi-step LLM workflows using nodes, edges, conditional routing, state reducers, human-in-the-loop interrupts, and checkpointing. Inspired by LangGraph, built on BEAM primitives.
- Version: 0.11.0, Elixir: ~> 1.16
- Deps:
req,jason,telemetry; optionalredix,postgrex,ecto_sql,opentelemetry_api,opentelemetry_telemetry - Test: ExUnit with
mimicfor mocking
Commands
mix deps.get # Install dependencies
mix compile --warnings-as-errors # Compile (0 warnings required)
mix test # Run all tests (integration excluded)
mix test --include integration # Also run Redis/Postgres tests (needs docker compose up)
mix test path/to/test.exs:42 # Run specific test
mix format # Auto-format
mix format --check-formatted # Check formatting
Integration tests read LANG_EX_REDIS_URL / LANG_EX_POSTGRES_URL
(defaults match docker-compose.yml).
Always run mix compile --warnings-as-errors before considering work done. Zero warnings required.
Architecture
LangEx (facade: invoke/3, stream/3, get_state/2, get_state_history/2, update_state/3, delete_thread/2)
├── Graph # Builder: new, add_node (+retry/cache/defer/timeout/on_error), add_edge, compile, to_mermaid
│ ├── Graph.Compiled # Compiled executable graph
│ ├── Graph.Pregel # Super-step execution engine (internal)
│ ├── Graph.RetryPolicy # Exponential backoff + jitter for retry: nodes
│ ├── Graph.State # State management with reducers
│ ├── Graph.NodeCache # Bounded ETS memoization for cache: nodes
│ └── Graph.Stream # Lazy event streaming with modes + emit/1
├── NodeError / NodeTimeoutError # Structured node failure contract ({:error, %NodeError{}})
├── LLM # Behaviour for provider adapters
│ ├── LLM.Anthropic # Claude adapter (streaming SSE)
│ │ ├── Anthropic.SSE # SSE state machine (internal)
│ │ └── Anthropic.Formatter # Message wire format (internal)
│ ├── LLM.OpenAI # GPT adapter
│ ├── LLM.Gemini # Gemini adapter
│ ├── LLM.Resilient # Retry wrapper with backoff
│ ├── LLM.ChatModel # Graph node helper for LLM calls
│ └── LLM.Registry # Provider resolution by model string
├── Tool # Tool/function definition struct
│ ├── Tool.Node # Graph node for parallel tool execution
│ └── Tool.Annotation # Error recovery guidance for LLM
├── Message # Chat message types (Human, AI, System, Tool, RemoveMessage)
├── Middleware # Composable agent hooks for Prebuilt.agent
│ ├── Middleware.ModelRequest # The model call as data, with override/2
│ ├── Middleware.Summarization # LLM-summarised, persisted context compaction
│ ├── Middleware.ContextEditing # Clears stale tool-result contents (no LLM)
│ ├── Middleware.TodoList # write_todos planning tool + :todos state
│ ├── Middleware.ToolSelector # LLM tool pre-selection for large tool sets
│ ├── Middleware.ToolApproval # Human review of guarded tool calls (HITL)
│ ├── Middleware.ToolRetry # Retries transient tool failures in place
│ ├── Middleware.CallBudget # Caps model calls / tokens per run
│ ├── Middleware.ModelFallback # Retries a failed call on fallback models
│ ├── Middleware.Subagent # Delegation to nested agents as tools
│ ├── Middleware.Filesystem # Sandboxed file tools
│ └── Middleware.Rubric # Completion gate scoring the final answer
├── Checkpoint / Checkpointer # Pause/resume with Memory, Redis, or Postgres
├── Store # Long-term memory (ETS / Postgres backends)
├── Migration # Versioned Postgres migrations (V1, V2)
├── Prebuilt # Ready-made agent graph constructor
├── Command / Send / Interrupt # Graph control flow primitives
├── Config # Layered config resolution
├── ContextCompaction # Context window budget enforcement
└── Telemetry # Telemetry event definitions (+ Runs, OTel bridge)
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.
- 2mo ago First seen · 240 lines · 3,305 tokens per session scan A 5fb94eb02032
lang_ex AGENTS.md is an instructions file published in the GitHub repository freshaengineering/lang_ex (45 stars, last pushed 1mo ago), licensed MIT. It adds 3,305 tokens to every session, about $0.0132 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.
lang_ex AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| lang_ex AGENTS.mdfreshaengineering/lang_ex | Instructions file | 45 | 1mo ago | MIT | A | 3,305 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | yesterday | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |