110-configuration

110-configuration is a cursor rule for coding agents from d-padmanabhan/agent-engineering-handbook. It costs 2,325 tokens per session, scanned A, original, MIT.

A set of engineering rules for storing, overriding, converting, and checking application settings. It covers sources such as system files, user files, project files, environment variables, and command-line options.

In plain words
What is it for?
Use it when designing configuration loading, deciding which setting should take precedence, converting text values into numbers or booleans, and handling secrets safely.
Why use it?
It prevents unclear conflicts between settings and avoids treating every environment variable as the correct data type. It also encourages safe default values and validation.

Cursor rule

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 rules/d-padmanabhan/agent-engineering-handbook/110-configuration
Clone the repo
git clone --depth 1 https://github.com/d-padmanabhan/agent-engineering-handbook

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 110-configuration

README.md
[![agentmods](https://agentmods.dev/badge/rules/d-padmanabhan/agent-engineering-handbook/110-configuration.svg)](https://agentmods.dev/rules/d-padmanabhan/agent-engineering-handbook/110-configuration)
Your own site
<a href="https://agentmods.dev/rules/d-padmanabhan/agent-engineering-handbook/110-configuration"><img src="https://agentmods.dev/badge/rules/d-padmanabhan/agent-engineering-handbook/110-configuration.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,325 This file is loaded in full into every session.
When invoked 2,325 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.02325 $0.02325
Opus 5 $0.01162 $0.01162
Sonnet 5 $0.00465 $0.00465
Haiku 4.5 $0.00232 $0.00232

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

Security

Grade A, and why

110-configuration 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 5d 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.

rules/110-configuration.mdc · 412 lines

How it starts

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

Configuration Management Engineering Ruleset

Goal: Manage configuration consistently across applications with clear precedence, proper validation, and secure defaults.

Configuration Precedence

Configuration is applied in order, with later sources overriding earlier ones:

  1. System configuration (/etc/gitconfig, /etc/app/config.yaml)
  2. User configuration (~/.gitconfig, ~/.app/config.yaml)
  3. Local/project configuration (.git/config, ./config.yaml)
  4. Environment variables (GIT_AUTHOR_NAME=..., APP_API_KEY=...)
  5. Command-line parameters (git commit --author=..., app --api-key=...)

This pattern is used by Git, SSH, and many Unix tools. Use this hierarchy to allow:

  • System defaults
  • User preferences
  • Project settings
  • Runtime environment overrides
  • Explicit command-line overrides

Environment Variables

String Type

Environment variables are strings in the OS. Convert them in your application:

#  GOOD: Explicit conversion
port = int(os.getenv("PORT", "8080"))
timeout = float(os.getenv("TIMEOUT", "30.0"))
debug = os.getenv("DEBUG") == "1"

#  BAD: Assuming type
port = os.getenv("PORT", 8080)  # Wrong! Default should be string

Boolean Values

Use 1 for true. Anything that is not 1 is false.

#  GOOD: Consistent boolean handling
debug = os.getenv("DEBUG") == "1"
verbose = os.getenv("VERBOSE") == "1"
enabled = os.getenv("FEATURE_ENABLED") == "1"

#  BAD: Parsing various strings
debug = os.getenv("DEBUG", "false").lower() in ["true", "1", "yes", "on"]
# This is brittle and opinionated

Rationale:

  • Simple and unambiguous
  • Works across all languages
  • No parsing ambiguity
  • Consistent with Unix conventions

Required Values

Fail fast if required configuration is missing:

#  GOOD: Fail fast with clear error
api_key = os.getenv("API_KEY")
if not api_key:
    raise ValueError(
        "API_KEY environment variable is required. "
        "Set it with: export API_KEY=your-key"
    )

#  BAD: Silent failure or default
api_key = os.getenv("API_KEY", "")  # What if empty string?
# Later: api_key is empty, fails mysteriously

Read the full file on GitHub · 412 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. 5d ago First seen · 412 lines · 2,325 tokens per session scan A 996645ff6f45

Subscribe to this mod's changes

110-configuration is a cursor rule published in the GitHub repository d-padmanabhan/agent-engineering-handbook (16 stars, last pushed 5d ago), licensed MIT. It adds 2,325 tokens to every session, about $0.0116 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-30.