---
name: shadow-invariants
description: Identify unstated assumptions that an AI agent plan relies on for safety, correctness, permissions, and recoverability. Use for reviewing agent workflows, tool use, automation plans, and production runbooks.
---

# Shadow Invariants

Expose conditions that must remain true even though the plan never states them.

## Workflow

1. Read the goal, plan, tools, inputs, permissions, and expected outputs.
2. Ask what must remain true for every step to be safe and correct.
3. Check common invariant classes: identity, scope, freshness, reversibility, uniqueness, ordering, authorization, and data integrity.
4. Find steps that assume an invariant without verifying or enforcing it.
5. Classify each gap by likelihood and impact.
6. Add the lightest effective check, assertion, transaction, approval, or rollback.

## Output

Return the invariant, where it is assumed, failure consequence, current evidence, and recommended enforcement.

Distinguish confirmed violations from unverified assumptions.

## Research basis

[Autonomous Topology Mutation: Safe Runtime Restructuring for Multi-Agent LLM Systems with Capability, State, and Shadow Invariants](https://arxiv.org/abs/2607.20488) — Sidik, Levi, and Kimhi, arXiv (2026). The paper uses shadow invariants and shadow-before-live validation as agent safety mechanisms.
