Best for
- Design a settings system for a coding-agent CLI or runtime
- Separate user, project, local, flag, and managed policy sources
- Review how managed settings should override user configuration
vasilyu1983/AI-Agents-public/frameworks/shared-skills/skills/ai-coding-agents-settings-policy/SKILL.md
Designs settings and policy layers for coding-agent runtimes. Use when modeling source precedence, managed policy, env controls, or runtime settings validation.
Decision brief
Use this skill to design or review the settings and policy layer of a coding-agent runtime: settings sources, precedence, managed policy, validation, safe environment handling, and runtime application of settings changes.
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Declared | Source record | Install path and trigger |
| Claude Code | Declared | Source record | Install path and trigger |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/vasilyu1983/AI-Agents-public --skill "frameworks/shared-skills/skills/ai-coding-agents-settings-policy"Inspect the Agent Skill "ai-coding-agents-settings-policy" from https://github.com/vasilyu1983/AI-Agents-public/blob/53f6cb73ea53a2646e3e7d4665062ad66f3683ac/frameworks/shared-skills/skills/ai-coding-agents-settings-policy/SKILL.md at commit 53f6cb73ea53a2646e3e7d4665062ad66f3683ac. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
1. Define source layers. Separate user, shared project, local gitignored, CLI-flag, and managed-policy sources. 2. Freeze precedence. Document one merge order and keep it consistent across disk reads, UI display, and runtime application. 3. Make managed policy authoritative. Pol…
Review the “ASCII Flow” section in the pinned source before continuing.
Review the “Quick Reference” section in the pinned source before continuing.
Design a settings system for a coding-agent CLI or runtime
Review the “Use Other Skills” section in the pinned source before continuing.
Permission review
The documentation asks the agent to run terminal commands or scripts.
**Protect dangerous env and customization surfaces.** Whitelist what can be applied automatically; strip or gate anything that could redirect providers or execute shell code.Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 97/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 82 | Source | Repository attention, not individual Skill quality |
| Compatibility | 2 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Use this skill to design or review the settings and policy layer of a coding-agent runtime: settings sources, precedence, managed policy, validation, safe environment handling, and runtime application of settings changes.
This skill owns configuration and policy architecture for coding-agent runtimes. For project memory in AGENTS.md or CLAUDE.md, use ../agents-memory/SKILL.md.
settings sources
defaults + managed policy + user + project + local + flags + env
|
v
precedence merge
deterministic order + source provenance + plugin-only restrictions
|
v
validation
schema + forbidden keys + unsafe env + unknown options
|
v
runtime application
provider policy + tools + permissions + plugins + UI + cache invalidation
|
v
audit record
effective settings without secrets
| Question | Read | Outcome |
|---|---|---|
| How should settings sources and policy precedence work? | references/settings-source-precedence-and-managed-policy.md | Source model, merge order, managed policy, plugin-only restrictions |
| How should settings be validated and applied safely? | references/settings-validation-and-safe-runtime-application.md | Schema validation, invalid-rule handling, safe env controls, runtime re-application |
| What are the exact override examples for each settings layer? | references/settings-precedence-table.md | Full precedence table: managed > CLI flags > local > project > user, with concrete examples and cache invalidation |
| Which sources can enable plugin surfaces? | references/plugin-only-restriction-recipes.md | Trust-class recipes for locking, scoping, and logging plugin-surface activations |
| How is ToolSearch gated by settings policy? | references/deferred-tool-policy-layer.md | Settings keys, policy decision flow, and interaction with tool-pool assembly |
| How does OpenAI Codex separate config layers from managed requirements? | references/openai-codex-managed-config-and-requirements.md | Layer stack, requirements constraints, managed-hooks-only mode, debug surfaces |
| Need | Use Instead |
|---|---|
| Broader coding-agent architecture | ../ai-coding-agents/SKILL.md |
| Tool approval and permission modes | ../ai-coding-agents-permissions/SKILL.md |
| Plugin package architecture | ../ai-coding-agents-plugins/SKILL.md |
| AGENTS.md or CLAUDE.md repo memory | ../agents-memory/SKILL.md |
| Generic config or schema design outside agent runtimes | ../software-devtools/SKILL.md |
Verified against code.claude.com/docs/en/settings and code.claude.com/docs/en/hooks on 2026-07-11. The Claude Code precedence order is the reference implementation for the settings-precedence-table.md model in this skill:
managed (highest, cannot be overridden)
> CLI flags (session-only)
> .claude/settings.local.json (gitignored; allow rules apply without a trust dialog)
> .claude/settings.json (project, checked in; requires the trust dialog)
> ~/.claude/settings.json (user, lowest)
The most common audit mistake is inverting the last three: local is the most specific and highest-precedence editable file, not the least. A clean ~/.claude/settings.json changes nothing in a repo that carries a conflicting .claude/settings.local.json.
cleanupPeriodDays (any editable scope; default 30, minimum 1) controls how many days of session files and other application data Claude Code deletes at startup. Setting it to 0 is a validation error, not "disable cleanup." When auditing a fleet for stale-session accumulation or unexpected data loss, check this key before assuming a bug — 30 days is the shipped default and a lower value elsewhere is a deliberate override, not drift.
These keys are honored only when set in managed/enterprise policy; the same key in user or project settings is silently ignored. This is the strongest lockdown class — verify this distinction before telling an operator "just set X in your project settings," because for this table that advice is wrong.
| Key | Type | Effect |
|---|---|---|
allowManagedPermissionRulesOnly | boolean | User/project permission rules (allow/ask/deny) are ignored; only managed-settings rules apply |
allowManagedHooksOnly | boolean | Only managed hooks, SDK hooks, and plugin hooks force-enabled via managed enabledPlugins load; user/project/other-plugin hooks are blocked |
allowManagedMcpServersOnly | boolean | Only the managed allowedMcpServers allowlist is respected; deniedMcpServers still merges from all sources on top of it |
claudeMd | string | Organization-managed CLAUDE.md-style instructions injected as memory; ignored if set anywhere other than managed/policy settings |
disableSideloadFlags | boolean | Rejects --plugin-dir, --plugin-url, --agents, and --mcp-config CLI flags at startup — closes the loophole where a user could otherwise sideload past strictKnownMarketplaces for a single run |
forceRemoteSettingsRefresh | boolean | Blocks CLI startup until remote managed settings are freshly fetched; the CLI exits on fetch failure rather than falling back to a cached or absent policy |
blockedMarketplaces | array | Blocklist enforced on marketplace add and on every plugin install/update/refresh/auto-update, so a marketplace added before the policy existed still loses access |
forceLoginMethod | "claudeai" | "console" | "gateway" | Restricts login to one account class |
forceLoginOrgUUID | string or array of UUIDs | Requires login to a specific Anthropic organization (or any of a listed set) |
allowAllClaudeAiMcps | boolean | Loads claude.ai connectors alongside a deployed managed-mcp.json, which otherwise takes exclusive control and suppresses them |
allowedChannelPlugins / deniedMcpServers | array | Allow/deny lists for channel plugins and MCP servers respectively; the deny list always wins over the allow list, even against managed servers |
Do not describe these as "managed-only" — a user or project file can set them too; policy is simply the layer that makes the choice non-negotiable for that user or repo.
| Key | Type | Effect |
|---|---|---|
disableAutoMode | "disable" | Prevents auto permission mode from being activated; removed from the Shift+Tab cycle and rejects --permission-mode auto at startup |
disableAgentView | boolean | Turns off background agents and agent view (claude agents, --bg, /background) |
disableBundledSkills | boolean | Removes bundled skills/workflows entirely; /init-style built-in commands stay typable but hidden from the model |
autoUpdatesChannel | "latest" (default) | "stable" | Release channel; "stable" trails by about a week and skips versions with major regressions. There is no "disabled" channel value — to stop auto-updates entirely, set the DISABLE_AUTOUPDATER env var instead |
A prior version of this skill listed strictPluginOnlyCustomization, policyHelper, and parentSettingsBehavior as managed-policy keys. None of the three could be verified against current docs on re-check (2026-07-11) — they have been removed rather than carried forward as unverified claims. If a runtime you are auditing needs "all customization must come through plugins" or "policy context injected into the system prompt" behavior, treat it as a custom control you are designing, not an existing Claude Code key, until you find it in current docs yourself.
| Event | Trigger | Use Case |
|---|---|---|
ConfigChange | Fires when a configuration file changes during a session, covering user, project, local, and managed settings | Audit trail, policy-compliance checks, external notification on settings drift |
MessageDisplay | Fires while assistant message text is displayed | Display-only — no blocking or decision control; can replace displayed text via hookSpecificOutput.displayContent but never changes the transcript or what the model sees. Do not use it for enforcement; use PreToolUse/PermissionRequest for that. |
Both events follow the standard hook lifecycle alongside PreToolUse, PostToolUse, SessionStart, and SessionEnd, and are available in user, project, and managed-policy hook sources.
Re-verified against learn.chatgpt.com/docs/config-file/config-reference on 2026-07-11. This supersedes an earlier version of this section that was pinned to a May 2026 source snapshot and had drifted on two points — see corrections below.
$CODEX_HOME is the base directory for all Codex user state, defaulting to ~/.codex/ (%USERPROFILE%\.codex\ on Windows). The primary user config file is $CODEX_HOME/config.toml.
Operators can relocate all user state by setting $CODEX_HOME — no config file edits required. Managed/enterprise configuration and CLI flags sit above this in precedence and are not affected by $CODEX_HOME.
Named profiles are separate files next to config.toml, not a [profiles.NAME] table inside it: $CODEX_HOME/<profile-name>.config.toml, selected at launch with --profile <profile-name>. A prior version of this skill showed [profiles.strict] / [profiles.ci] tables inside one config.toml — that syntax is not current and should not be used as a template.
# $CODEX_HOME/ci.config.toml
approval_policy = "never"
[sandbox_workspace_write]
network_access = false
The active profile is selected via --profile ci, letting one Codex install serve multiple use-case contexts (interactive dev, CI, enterprise review) without one file trying to hold every mode.
# ~/.codex/config.toml
approval_policy = "on-request" # default; see AskForApproval enum in ai-coding-agents-permissions
Verified valid values (2026-07-11): "untrusted", "on-request", "never", or a granular object (sub-keys for sandbox_approval, rules, mcp_elicitations, request_permissions, skill_approval). "on-failure" still appears but is deprecated. "unless-trusted" is not a valid value — a prior version of this skill used that spelling; if you find it in an older Codex install or a stale example elsewhere, treat it as the pre-rename form of "untrusted" and do not propagate the old spelling into new configs.
Current documented order (highest first): managed/enterprise configuration > CLI flags > project-scoped .codex/config.toml > profile file (via --profile) > user-level $CODEX_HOME/config.toml. A fixed set of security-critical keys — provider selection, authentication, notification routing, telemetry routing, and the approval/sandbox trio (approval_policy, sandbox_mode, sandbox_workspace_write) — are deliberately ignored if set in project-scoped config, so a compromised or careless repo cannot loosen its own sandbox. Treat "which keys project config is allowed to touch" as a threat-modeling question, not an oversight, when designing an equivalent for another CLI.
Goose introduces two settings-layer patterns beyond the standard user/project/flag/managed-policy stack: custom distros as policy-delivery mechanism, and .goosehints-style narrative project hints as a distinct source class.
Goose's Custom Distributions (see ai-coding-agents-release-distribution) bake an allowlist, provider pinning, and branding into the binary itself. From the settings layer's perspective, this is a new source class: read-only, above CLI flags in precedence, immutable at runtime.
distro_policy to the source-precedence table as the highest immutable layer (above managed_policy, which can be updated without a binary change). Effective-settings UI must attribute wins to the distro layer explicitly so operators can explain "why can't I change this."--version output and visible in the effective-settings debug view. Managed-policy layers can still narrow further but cannot broaden beyond the distro envelope..goosehints — narrative project-hint layerGoose loads .goosehints as a per-project narrative file (similar to AGENTS.md / CLAUDE.md). This is not structured settings — it is unstructured guidance for the agent about the project. But it is a source layer in the sense that the agent consumes it deterministically at session start.
AGENTS.md, CLAUDE.md, .goosehints, .cursorrules — are implementations of that source class. The agents-memory skill owns the content side; the settings-policy layer owns the source-loader plumbing.references/settings-source-precedence-and-managed-policy.md — Source layering, managed policy, and customization restrictionsreferences/settings-validation-and-safe-runtime-application.md — Validation, safe env handling, and runtime applicationreferences/settings-precedence-table.md — Concrete precedence table with override examples (managed > CLI flags > local > project > user)references/plugin-only-restriction-recipes.md — Trust-class enforcement for plugin-surface activationsreferences/deferred-tool-policy-layer.md — How ToolSearch trigger is settings-gatedreferences/openai-codex-managed-config-and-requirements.md — OpenAI Codex config layer stack, managed requirements, requirements-only settings, and policy debug surfacesdata/sources.json — Primary documentation and implementation references for settings and policy guidance../ai-coding-agents-permissions/SKILL.md — Permission modes and rule handling../ai-coding-agents-plugins/SKILL.md — Plugin-only customization and extension policy../agents-memory/SKILL.md — Project instruction files rather than runtime settingsclaude_code source snapshot. Re-check upstream code or docs before relying on volatile runtime details.Before applying this skill on a non-trivial task, read learnings.consolidated.md in this directory (and learnings.md if present).
After applying it, if you encountered a pattern worth remembering, a mistake worth preventing, or a domain fact that surprised you, append one dated bullet to learnings.md via agents-skills-feedback-loop/scripts/append_learning.py. Do not modify SKILL.md itself.
Frequently asked questions
Use this skill to design or review the settings and policy layer of a coding-agent runtime: settings sources, precedence, managed policy, validation, safe environment handling, and runtime application of settings changes.
The source record exposes this install command: npx skills add https://github.com/vasilyu1983/AI-Agents-public --skill "frameworks/shared-skills/skills/ai-coding-agents-settings-policy". Inspect the command and pinned source before running it.
The pinned source record declares support for: codex, claude code.
Static rules flagged exec-script in the source; the page lists the matching lines and excerpts.
Alternatives
vasilyu1983/AI-Agents-public
Configures Claude Code hooks and Codex hooks.json/notify callbacks. Use when adding guardrails, preflight, audit trails, worktree automation, or budget enforcement.
vasilyu1983/AI-Agents-public
Guides iOS testing with XCTest, XCUITest, Swift Testing, simctl, and xcresult. Use when choosing destinations, controlling flakes, or parsing test artifacts for native apps.
vasilyu1983/AI-Agents-public
Guides multi-GPU pre-training: DDP, FSDP2, ZeRO, tensor/pipeline/expert parallelism, fp8/Muon. Use when scaling a run, training MoE, or reproducing GPT-2 on rented GPUs.
vasilyu1983/AI-Agents-public
Scans public GitHub repos for agent skills, dev practices, and code patterns. Use when enriching skills, setting team policy, or researching a build domain.