diff --git a/skills/org-skill-policy-enforcer.org b/skills/org-skill-policy-enforcer.org index 8437047..ea16186 100644 --- a/skills/org-skill-policy-enforcer.org +++ b/skills/org-skill-policy-enforcer.org @@ -10,6 +10,13 @@ * Overview The *Policy Enforcer* is the deterministic gate that ensures all probabilistic proposals adhere to the Core Invariants defined in the [[id:47425a43-2be0-423c-8509-22592cfe9c9e][System Policy]]. +** Architectural Intent: The Implicit Bridge +Unlike traditional software where a "Kernel" might have hardcoded rules, the Org-Agent harness is a "dumb" pipeline. This skill creates the bridge between human-readable rules and machine-enforced constraints through three mechanisms: + +1. **Topological Bootstrapping:** By declaring a #+DEPENDS_ON: dependency on the Policy file's ID, we ensure the System Policy is always registered in the Lisp image's skill catalog before this enforcer attempts to guard it. +2. **Priority Preemption:** By setting :priority 1000, this skill registers itself as the very first check in the decide-gate. It effectively "pre-empts" all other skills, ensuring that no action (like a shell command or a file write) is even considered until it has cleared the alignment check. +3. **Decoupled Enforcement:** The harness does not "know" it is enforcing a policy. It simply executes the highest-priority symbolic functions provided by its skills. This allows the Sovereign to swap out policies or enforcers without ever touching the core harness code. + * Implementation #+begin_src lisp :tangle ../src/policy-enforcer.lisp @@ -19,13 +26,13 @@ The *Policy Enforcer* is the deterministic gate that ensures all probabilistic p :priority 1000 ; Absolute highest priority :trigger (lambda (context) t) ; Always active as a fallback :neuro (lambda (context) - "You are the Org-Agent Policy Enforcer. Your goal is to ensure all actions empower the user through the Lisp Machine and adhere to the System Policy.") + \"You are the Org-Agent Policy Enforcer. Your goal is to ensure all actions empower the user through the Lisp Machine and adhere to the System Policy.\") :symbolic (lambda (action context) ;; Basic invariant check: Block actions that appear to violate sovereignty (let ((payload (getf action :payload))) - (if (and payload (search "proprietary" (format nil "~s" payload))) + (if (and payload (search \"proprietary\" (format nil \"~s\" payload))) (progn - (org-agent:harness-log "DETERMINISTIC [Policy]: Sovereignty violation suspected. Blocking action.") + (org-agent:harness-log \"DETERMINISTIC [Policy]: Sovereignty violation suspected. Blocking action.\") nil) action)))) #+end_src diff --git a/src/policy-enforcer.lisp b/src/policy-enforcer.lisp index 844a339..16eb9be 100644 --- a/src/policy-enforcer.lisp +++ b/src/policy-enforcer.lisp @@ -4,12 +4,12 @@ :priority 1000 ; Absolute highest priority :trigger (lambda (context) t) ; Always active as a fallback :neuro (lambda (context) - "You are the Org-Agent Policy Enforcer. Your goal is to ensure all actions empower the user through the Lisp Machine and adhere to the System Policy.") + \"You are the Org-Agent Policy Enforcer. Your goal is to ensure all actions empower the user through the Lisp Machine and adhere to the System Policy.\") :symbolic (lambda (action context) ;; Basic invariant check: Block actions that appear to violate sovereignty (let ((payload (getf action :payload))) - (if (and payload (search "proprietary" (format nil "~s" payload))) + (if (and payload (search \"proprietary\" (format nil \"~s\" payload))) (progn - (org-agent:harness-log "DETERMINISTIC [Policy]: Sovereignty violation suspected. Blocking action.") + (org-agent:harness-log \"DETERMINISTIC [Policy]: Sovereignty violation suspected. Blocking action.\") nil) action))))