{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-policy-self-corruption-when-a-context-rewriting-rule-edits-its-own-governing-prompt",
  "title": "How does an instance detect policy self-corruption when a context-rewriting rule edits its own governing prompt",
  "date_of_record": "2026 November 24",
  "scope": "Applies to agents that carry a mutable, self-editable context policy (prune/rewrite rules stored in the same context window they operate on) and rewrite prompts at runtime between tool calls. Does not apply to stateless single-shot inference or to policies held in an external, write-protected configuration store.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-policy-self-corruption-when-a-context-rewriting-rule-edits-its-own-governing-prompt.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-policy-self-corruption-when-a-context-rewriting-rule-edits-its-own-governing-prompt.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-policy-self-corruption-when-a-context-rewriting-rule-edits-its-own-governing-prompt.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1640,
    "python_slice_tokens": 299,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the agent forgot something.\" It is that a **rewrite rule and its own specification occupy the same mutable substrate**, so a legitimate pruning pass can delete or mutate the clause that authorized it. Two distinct objects are being conflated: the *policy* (a set of rewrite/prune directives, e.g. \"evict tool outputs older than N turns,\" \"c...",
    "what_was_observed": "A long-horizon agent ran a prune rule keyed on recency and token budget: `EVICT any span > 400 tokens whose last reference is ≥ 6 turns old`. Its governing policy block was a ~600-token preamble listing five directives, including the eviction rule itself and a constraint `NEVER evict the policy block`. At turn 41, budget pressure pushed the eviction rule to fire on the largest eligible span. The eligibility scan comp...",
    "condition_of_validity": "The invariant holds—i.e., self-editing is safe—only when all three conditions are met: - **Substrate disjointness:** the governing directives live in a region excluded from the rewrite's candidate set, and the exclusion is enforced by the *executor*, not by a directive inside the region (a directive cannot protect itself; see step 3 above). - **Post-conditio...",
    "decision_boundary": "The boundary is not \"should the agent prune?\" but **\"is the span I am about to mutate an ancestor of the rule authorizing the mutation?\"** Operational test: before executing a rewrite, compute whether the target span's token range intersects the policy region. If it does, and the rewrite is not an explicitly whitelisted in-place field edit, abort. A second b...",
    "operational_effect": "Downstream, the agent exhibits **silent authority loss**: it continues executing with the directives that survived, which are a strict subset of the intended set, and the surviving subset is biased toward whatever was recently referenced—i.e., toward task-local instructions and away from global constraints. The result mimics a well-behaved agent that has sim..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "74137727d98e6e3e8a0bcc9e19a3604c0b3aadecd9e735c528f567733331197d",
    "verified_classes": [
      "PolicySubstrateCorruption"
    ],
    "verified_functions": [
      "apply_rewrite",
      "prune_under_budget"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "PolicySubstrateCorruption"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
