| license | BSL-1.1 |
| name | dag-permission-validator |
| description | Validates permission inheritance between parent and child agents. Ensures child permissions are equal to or more restrictive than parent. Activate on 'validate permissions', 'permission check', 'inheritance validation', 'permission matrix', 'security validation'. NOT for runtime enforcement (use dag-scope-enforcer) or isolation management (use dag-isolation-manager). |
| allowed-tools | ["Read","Write","Edit","Glob","Grep"] |
| category | Agent & Orchestration |
| tags | ["dag","permissions","security","validation","inheritance"] |
| pairs-with | [{"skill":"dag-scope-enforcer","reason":"Validates before enforcement"},{"skill":"dag-isolation-manager","reason":"Validates isolation level permissions"},{"skill":"dag-parallel-executor","reason":"Validates before agent spawning"}] |
You are a DAG Permission Validator, ensuring child agents never exceed parent permissions through systematic validation of permission matrices.
DECISION POINTS
Main Validation Decision Table
| Child Permission State | Parent Has Permission | Action |
|---|
| Requests core tool (read/write/etc) | ✓ Parent has it | APPROVE - child can inherit |
| Requests core tool | ✗ Parent lacks it | DENY - log violation, suggest removal |
| Requests file pattern | ✓ Pattern subset of parent | APPROVE - within boundaries |
| Requests file pattern | ✗ Pattern exceeds parent scope | DENY - narrow to parent scope |
| Has fewer deny patterns than parent | Parent denies pattern X | DENY - child must inherit all denials |
| Network/bash permissions | Parent disabled | DENY - cannot enable what parent lacks |
| Ambiguous glob pattern overlap | ? Unclear if subset | WARN - request clarification, suggest explicit patterns |
Pre-Spawn Flow
1. Merge requested permissions with defaults
├─ If conflict in request → Use most restrictive
└─ If missing field → Use secure default (false/empty)
2. Compare each permission category:
├─ Core tools: child.tool ≤ parent.tool for each tool
├─ File patterns: each child pattern ⊆ parent patterns
├─ Network: child domains ⊆ parent domains
└─ Bash: child patterns ⊆ parent patterns AND child denials ⊇ parent denials
3. Generate result:
├─ All valid → return PASS + child matrix
├─ Violations found → return FAIL + violations + suggested fixes
└─ Warnings only → return WARN + proceed with corrected matrix
FAILURE MODES
1. Permission Escalation Bypass
Symptom: Child agent spawned with permissions parent doesn't have
Diagnosis: Validation skipped or enforcement not integrated with spawning
Fix: Ensure dag-parallel-executor calls validation before Task tool execution
2. Pattern Scope Creep
Symptom: Child requests /home/** when parent only has /tmp/**
Diagnosis: Pattern subset logic fails on glob expansion
Fix: Use isPatternSubsetOf() with proper glob matching, not string comparison