Permission overlay inheritance

From ychampion/cskill-agents · View interactive version

Permission overlay inheritance is an AI agent skill from the GitHub repository ychampion/cskill-agents. Layer child permission rules over parent session policy without dropping root-level grants or mutating shared state.

How to use this skill

Skill file

SKILL: Permission Overlay Inheritance

Domain: permission-gating

Trigger: Apply when a subagent or nested workflow needs a narrower permission contract but must still inherit the parent session's top-level grants.

Source Pattern: Distilled from reviewed subagent orchestration, isolation, and lifecycle implementations.

Core Method

Start from the current app state, then derive a child-specific permission view by overlaying only the fields the child actually owns: permission mode, promptability flags, session-scoped allow rules, and effort level. Preserve parent bypass and SDK-level permissions so nested agents cannot accidentally weaken operator intent, and return the original state unchanged when no overlay is needed. This keeps permission inheritance explicit, composable, and side-effect-free.

Key Rules

Example Application

If a background review agent should only use Read and Grep while the main session still has broader CLI-granted access, build its permission context as an overlay so the child narrows its own session rules without discarding the root-level contract.

Anti-Patterns (What NOT to do)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.