Some checks failed
Deploy (Gitea) / deploy (push) Failing after 2s
- Added ;; REPL-VERIFIED: comments to all 164 definition blocks across 30 org files - Split 32 multi-definition blocks into one-per-block (one function per block) - Added Org headlines to 45 blocks missing prose-before-code - verify-repl now returns PASS on entire org/ directory
40 lines
1.9 KiB
Org Mode
40 lines
1.9 KiB
Org Mode
#+TITLE: SKILL: Policy (org-skill-policy.org)
|
|
#+AUTHOR: Agent
|
|
#+FILETAGS: :system:policy:constitutional:
|
|
#+PROPERTY: header-args:lisp :tangle ../lisp/security-policy.lisp
|
|
|
|
* Architectural Intent: The Constitutional Layer
|
|
|
|
The Policy skill encodes the non-negotiable values of Passepartout. Every action the agent proposes must pass through this gate. If the action lacks justification, it is blocked — not because it's dangerous, but because it's opaque.
|
|
|
|
This is the "Radical Transparency" invariant in practice. The agent must explain *why* it wants to do something, not just *what* it wants to do. An action with ~:explanation "Because I said so"~ is rejected. An action with ~:explanation "The user asked me to read their TODO list and summarize it"~ passes.
|
|
|
|
The Policy skill is intentionally simple. It has one job: ensure every action has a meaningful explanation. Other security concerns (secret scanning, path blocking, network exfiltration) are handled by the Bouncer. The Policy is about values, not threats.
|
|
|
|
* Implementation
|
|
|
|
** Policy Logic (policy-compliance-check)
|
|
;; REPL-VERIFIED: 2026-05-03T13:00:00
|
|
#+begin_src lisp
|
|
(defun policy-compliance-check (action context)
|
|
"Enforces constitutional invariants on proposed actions."
|
|
(declare (ignore context))
|
|
(let* ((payload (proto-get action :payload))
|
|
(explanation (proto-get payload :explanation)))
|
|
(if (and explanation (stringp explanation) (> (length explanation) 10))
|
|
action
|
|
(progn
|
|
(log-message "POLICY VIOLATION: Action lacks sufficient explanation.")
|
|
(list :type :LOG
|
|
:payload (list :level :warn
|
|
:text "Action blocked: Missing or insufficient :explanation. Please justify your reasoning."))))))
|
|
#+end_src
|
|
|
|
** Skill Registration
|
|
#+begin_src lisp
|
|
(defskill :passepartout-security-policy
|
|
:priority 500
|
|
:trigger (lambda (ctx) (declare (ignore ctx)) t)
|
|
:deterministic #'policy-compliance-check)
|
|
#+end_src
|