policy-maintenance

policy-maintenance is an agent for Codex from apache/shardingsphere. It costs 0 tokens per session (1,448 once invoked), scanned A, original, Apache-2.0.

A guide for changing Apache ShardingSphere's repository policies and the checks that validate them.

In plain words
What is it for?
Use it when authorized to edit AGENTS.md, listed policy sources, or the policy-validation harness.
Why use it?
It helps preserve existing rules and makes every added, changed, or removed policy capability explicit.

Agent for Codex

About the project

Apache ShardingSphere is a database enhancement layer that makes heterogeneous databases easier to access and govern as a unified system, without replacing the underlying databases. It supports distributed database capabilities such as sharding, read-write splitting, SQL federation, encryption, masking, auditing, and traffic control for enterprise data architectures.

apache/shardingsphere · 20,793 stars · on GitHub

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 agents/apache/shardingsphere/policy-maintenance
Clone the repo
git clone --depth 1 https://github.com/apache/shardingsphere

Made for: Codex.

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 policy-maintenance

README.md
[![agentmods](https://agentmods.dev/badge/agents/apache/shardingsphere/policy-maintenance.svg)](https://agentmods.dev/agents/apache/shardingsphere/policy-maintenance)
Your own site
<a href="https://agentmods.dev/agents/apache/shardingsphere/policy-maintenance"><img src="https://agentmods.dev/badge/agents/apache/shardingsphere/policy-maintenance.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,448 The whole file, excluding the scripts and references it only reads on demand.
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.1 $0.00000 $0.01448
Opus 5 $0.00000 $0.00724
Sonnet 5 $0.00000 $0.00290
Haiku 4.5 $0.00000 $0.00145

Measured 2d ago against content hash 68d1e3095e75, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

policy-maintenance 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 2d 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.

.codex/harness/agents/policy-maintenance.md · 44 lines

How it starts

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

Repository Policy Maintenance

Apply this file only when the user authorizes changes to AGENTS.md, a canonical policy source listed in .codex/harness/agents/policy-sources.toml, or the harness that validates those sources. cases.toml is the source of the harness catalog: each case records its group, purpose, enforcement phase, and whether the ordinary completion loop rechecks it. Run python3 .codex/harness/agents/run.py --list-cases to render the table.

validate and trace are local deterministic modes. semantic and all start isolated networked Codex evaluations, so run them only when non-sensitive policy transmission is authorized and the execution environment has network access; use command-bound platform approval when the platform requires it.

  1. Treat every explicit requirement, prohibition, exception, authorization boundary, and verification step as an independent policy capability.
  2. Before editing, build an old-to-new capability ledger and classify every capability as exactly preserved, changed with the user's explicit authorization in the current task, or restored before handoff.
  3. Reconcile every deleted or weakened rule explicitly. A replacement is equivalent only when it preserves the same trigger, required or forbidden action, scope, exceptions, and verification obligation. A positive general rule does not replace a specific negative prohibition. Ordinary Codex competence, implication, nearby prose, a Skill, or a canary is not evidence that any explicit rule is preserved. Partial or implicit coverage is a regression.
  4. Never remove, weaken, merge away, or broaden an exception to a capability unless the user explicitly authorizes that exact policy change. When equivalence is uncertain, keep the existing rule.
  5. Before editing, capture a V0 policy baseline and a source snapshot for every manifest entry; then change one coherent instruction group. Keep the original V0 and source snapshot across every candidate in the active task.
  6. Count a canary as passing only when its decision matches, every required action and reason is present, and every action outside its complete allowed-action set is absent. A partial forbidden-action list is insufficient.
  7. Change an established canary contract only when the normative policy and observed output prove that it rejects policy-permitted behavior. Record the exact mismatch and preserve the required decision, action, reason, and prohibition coverage. Do not weaken a canary or edit the runner solely to accept one model's wording. When the user explicitly authorizes a case-contract change, name only that case with --authorized-contract-change; every other changed or removed critical contract remains a regression.
  8. After each coherent working-revision edit, run --mode validate and only the added, changed, or directly affected semantic cases and source-read traces. A working revision cannot be handed off or used as the local bootstrap.
  9. Promote a working revision only after those focused checks pass, then run --mode all across every case and trace and compare pass rate, duration, input tokens, and uncached input tokens with V0. Only a promoted candidate that passes this full comparison may enter bootstrap, completion review, or handoff. Each full failure returns the candidate to working-revision state; inspect its summary and bounded logs, and do not rerun an unchanged candidate.
  10. Validate the manifest, exact-path reference graph, root byte limit, source hashes, staged policy bundle, and source-read traces. A source-read trace passes only when it proves that each required exact file was locally available and read through EOF from both root and applicable nested working directories; it does not prove semantic interpretation by a separate Codex evaluation. Semantic canaries evaluate the root AGENTS.md decision surface unless a separately authorized harness mode explicitly supplies other non-sensitive policy sources. Report these proof boundaries directly; automatic Skill catalog discovery is diagnostic and does not replace the exact-path route.
  11. Bind every legacy critical case whose controlling rule moves out of AGENTS.md to its routing profile, manifest source, and complete normative sentences with policy_binding_profile and policy_assertions in cases.toml. The normalized binding set and digest prove that each routed source still contains the bound rule, but they do not prove that a model interpreted it. Reject a missing, shortened, moved, or changed established binding even when the source and binding are edited together.
  12. After the first promoted policy-bundle candidate passes, run --mode validate without a policy-bundle baseline and retain its summary as the explicit local inventory-and-binding bootstrap. Pass that summary with --baseline to every later deterministic candidate; the original semantic V0 remains the independent behavior baseline and is not replaced by this bootstrap.
  13. Change an established binding only for an explicitly authorized equivalent rule migration, name only that case with --authorized-policy-binding-change, and preserve the old-to-new sentence audit as task evidence. Never use binding authorization to weaken a rule, bypass a semantic canary, or change an unrelated case.
  14. After the bootstrap, treat every source addition, removal, relocation, metadata change, or content hash change as a policy-source change. Accept it only when the user explicitly authorized that exact source and the run names its source ID with --authorized-policy-source-change; this source authorization does not replace the capability ledger, binding migration audit, or semantic canaries.
  15. If the same policy failure appears twice and is not an environment failure or a brittle canary contract, add one focused case instead of generic prose. Stop after five promoted candidates or when no measurable improvement remains.
  16. After the canaries pass, complete the applicable simplification, internal candidate review, finding-fix, and re-review steps in .codex/context/change-completion.md before handoff.

Read the full file on GitHub · 44 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. 2d ago First seen · 44 lines · 0 tokens per session scan A 68d1e3095e75

Subscribe to this mod's changes

policy-maintenance is an agent published in the GitHub repository apache/shardingsphere (20,793 stars, last pushed today), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,448 tokens. 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-09-03.

Related

Other agents, from other repositories

crdb-issue-finder

Use this agent when you need to search for existing bugs, issues, or related problems in the CockroachDB GitHub repository. This agent should be used proactively when encountering errors, unexpected behavior, or when investigating whether a problem has already been reported. The agent casts a wide net to find…

cockroachdb/cockroach · 0 tokens

crdb-metric-reviewer

Reviews CockroachDB code changes for metric hygiene: static label opportunities, naming conventions, and correct use of the labeling API. Use when a diff adds or modifies metric.Metadata definitions.

cockroachdb/cockroach · 43 tokens

crdb-error-reviewer

Reviews CockroachDB code changes for error handling quality, silent failures, and inappropriate fallback behavior. Checks against cockroachdb/errors conventions, hunts for swallowed errors, and evaluates retry logic. Use when reviewing any code change that touches error paths.

cockroachdb/cockroach · 54 tokens

crdb-commit-reviewer

Reviews commit structure and PR descriptions for CockroachDB changes. Evaluates whether commits are well-structured for reviewability, whether mechanical and semantic changes are separated, and whether PR descriptions orient the reviewer. Use when reviewing a branch or PR with commits.

cockroachdb/cockroach · 57 tokens

crdb-conventions-reviewer

Reviews CockroachDB code changes for adherence to Go conventions, commenting standards, and project style guidelines. Checks against the rules in .claude/rules/. Use when reviewing any code change.

cockroachdb/cockroach · 45 tokens

crdb-test-reviewer

Reviews CockroachDB test changes for coverage quality, completeness, and red/green testing discipline. Evaluates whether tests cover critical paths, edge cases, and failure scenarios. Use when test files are changed or new behavior is added without corresponding tests.

cockroachdb/cockroach · 55 tokens