{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/siakitem/my-pi/main/pi-permission-system/schemas/hard-guards.schema.json", "title": "Pi Permission System Hard Guards", "description": "Global-only allow exceptions and non-overridable deny rules evaluated before ordinary policy, session grants, and AutoReview, plus protectedWrites whose writes always escalate to a human prompt.", "type": "object", "properties": { "$schema": { "type": "string" }, "version": { "const": 1 }, "permission": { "type": "object", "additionalProperties": { "oneOf": [ { "$ref": "#/$defs/hardValue" }, { "type": "object", "additionalProperties": { "$ref": "#/$defs/hardValue" } } ] } }, "protectedWrites": { "type": "array", "description": "Files and subtrees whose writes are human-only: every write goes to a local human prompt, skipping AutoReview, yolo, and session grants, and is denied when no UI is available. Patterns use the path surface wildcard syntax; {agentDir}, {configHome} and a leading ~/ are expanded at load.", "items": { "type": "object", "properties": { "pattern": { "type": "string", "minLength": 1 }, "label": { "type": "string", "minLength": 1 } }, "required": ["pattern", "label"], "additionalProperties": false } } }, "required": ["version", "permission"], "additionalProperties": false, "$defs": { "hardValue": { "oneOf": [ { "enum": ["allow", "deny"] }, { "type": "object", "properties": { "action": { "const": "deny" }, "reason": { "type": "string", "minLength": 1, "maxLength": 500 } }, "required": ["action"], "additionalProperties": false } ] } } }