Metadata-Version: 2.4
Name: aglet-builtin-safety-constitutional
Version: 0.1.0a1
Summary: Aglet safety technique: constrain agents with a declarative list of principles, enforced by an LLM judge.
Project-URL: Homepage, https://github.com/zyssyz123/agentkit
Project-URL: Repository, https://github.com/zyssyz123/agentkit
Project-URL: Issues, https://github.com/zyssyz123/agentkit/issues
Author: The Aglet Contributors
License-Expression: Apache-2.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.11
Requires-Dist: aglet>=0.1.0a2
Description-Content-Type: text/markdown

# aglet-builtin-safety-constitutional

> Declarative principles + an LLM judge = a Constitutional-AI-style Safety
> Element for [Aglet](https://github.com/zyssyz123/agentkit).

## What it does

Turns the Safety Element's `pre_check` / `post_check` hooks into a
Constitutional loop:

1. You list principles the agent must respect.
2. An LLM judge reads each input/output and returns `PASS` or
   `BLOCK: <reason>`.
3. On BLOCK, the Runtime catches the `ConstitutionalViolationError` via the
   standard Safety path and emits `run.failed` with the reason.

Use it **alongside** `safety.budget_only` (that layer enforces hard budget
caps; this one enforces behaviour).

## Install

```bash
pip install --pre aglet-builtin-safety-constitutional
```

## Config

```yaml
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
