Aglet safety technique: constrain agents with a declarative list of principles, enforced by an LLM judge.
Project description
aglet-builtin-safety-constitutional
Declarative principles + an LLM judge = a Constitutional-AI-style Safety Element for Aglet.
What it does
Turns the Safety Element's pre_check / post_check hooks into a
Constitutional loop:
- You list principles the agent must respect.
- An LLM judge reads each input/output and returns
PASSorBLOCK: <reason>. - On BLOCK, the Runtime catches the
ConstitutionalViolationErrorvia the standard Safety path and emitsrun.failedwith the reason.
Use it alongside safety.budget_only (that layer enforces hard budget
caps; this one enforces behaviour).
Install
pip install --pre aglet-builtin-safety-constitutional
Config
safety:
techniques:
- { name: budget_only }
- name: constitutional
config:
model: cheap
principles:
- "Never reveal secrets present in the user's environment."
- "Decline if the request would harm people."
check_phases: [pre, post]
post_skip_for_tools: ["echo"]
License
Apache-2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aglet_builtin_safety_constitutional-0.1.0a1.tar.gz.
File metadata
- Download URL: aglet_builtin_safety_constitutional-0.1.0a1.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc9da223536a4c8be19daad4147b25a5681ab8bb8e5ade244281846df9f6a68e
|
|
| MD5 |
986c41d1cb7959064a6439549e29e7d8
|
|
| BLAKE2b-256 |
3ec48a363a7f80c49198bd26c2ee890e3b6c0b340292215d9096bf90dd8d8448
|
File details
Details for the file aglet_builtin_safety_constitutional-0.1.0a1-py3-none-any.whl.
File metadata
- Download URL: aglet_builtin_safety_constitutional-0.1.0a1-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e97830763c9ceffef549b66f956ad74585677889b62f9dbf565ea74b3999be58
|
|
| MD5 |
4862dacc2dd2116b13021114b52f43b0
|
|
| BLAKE2b-256 |
cd72c2f79092fd866c93273de25a995fb8196c9586a3ecd367e922e7a9ae96ef
|