Skip to main content

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:

  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

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


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

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file aglet_builtin_safety_constitutional-0.1.0a1.tar.gz.

File metadata

File hashes

Hashes for aglet_builtin_safety_constitutional-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 fc9da223536a4c8be19daad4147b25a5681ab8bb8e5ade244281846df9f6a68e
MD5 986c41d1cb7959064a6439549e29e7d8
BLAKE2b-256 3ec48a363a7f80c49198bd26c2ee890e3b6c0b340292215d9096bf90dd8d8448

See more details on using hashes here.

File details

Details for the file aglet_builtin_safety_constitutional-0.1.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for aglet_builtin_safety_constitutional-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 e97830763c9ceffef549b66f956ad74585677889b62f9dbf565ea74b3999be58
MD5 4862dacc2dd2116b13021114b52f43b0
BLAKE2b-256 cd72c2f79092fd866c93273de25a995fb8196c9586a3ecd367e922e7a9ae96ef

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page