Skip to main content

Enterprise governance platform for AI-generated code: legal, security, and architectural alignment

Project description

lex-align

lex-align

Docs · Getting started · Agent support · For agents

lex-align enforces your dependency policy before AI agents or developers can commit it. Every package gets checked against your approved registry, OSV CVE scores, and license rules — returning one of three deterministic verdicts so agents can act without ambiguity. Full docs at dlfelps.github.io/lex-align.


Why

Your AI coding agent adds packages to pyproject.toml faster than anyone can review them. By the time legal notices the AGPL dep, or security spots the critical CVE, it's already in main. You need the check to happen before the bytes are written, not after the PR is open.


How it works

A FastAPI server is the source of truth. The client is thin: a CLI plus hooks.

  • Three gates per check: internal registry → OSV CVE → PyPI license.
  • Three-verdict vocabulary: ALLOWED, PROVISIONALLY_ALLOWED, DENIED — small, deterministic, easy for an agent to branch on.
  • Two enforcement points: a git pre-commit hook (universal backstop, fires for every agent and every human committing to a governed repo) and a Claude Code PreToolUse hook that intercepts pyproject.toml edits before the file is written.
  • Use first, approve in parallel: an unknown package that passes CVE and license checks comes back PROVISIONALLY_ALLOWED. The agent uses it, calls request-approval, and keeps moving — formal review runs async.

Python and pyproject.toml only. Self-hosted via Docker Compose. Single-user mode is the default.


Quickstart

# Server (host you control)
pip install "lex-align[server]"
lex-align-server init && cd lexalign
lex-align-server registry compile registry.yml registry.json
docker compose up -d

# Client (per-project)
pip install lex-align
cd /path/to/your/project
lex-align-client init
lex-align-client check --package httpx

For server tuning, registry authoring, hook layout, and Claude Code wiring, see the full Getting Started guide.


Agent support

Primary target is Claude Code — pre-commit hook, PreToolUse edit-time intercept, and an auto-written CLAUDE.md so every session knows how to use check and request-approval. Cursor, Aider, and anything else committing to a governed repo are backstopped by the pre-commit hook. Full matrix: agent support.


Project status

Phase Status
1. Server core (registry, license, CVE, audit, evaluate) ✅ shipped
2. Thin client (init, check, request-approval, pre-commit, Claude hooks) ✅ shipped
3. Approval workflow UI + reporting endpoints 🟡 stubbed
4. Dashboards, PR-creation workflow, org-mode auth ⏸ deferred

request-approval persists each submission today, but the reviewer UI and the PR-creation workflow against the registry repo are not here yet. If you need a polished triage dashboard, this isn't that tool — yet.


Contributing

uv sync --all-extras --all-groups
uv run pytest

Tests live under tests/client/ and tests/server/. PRs welcome — file issues for bugs, license-policy edge cases, or agent-integration gaps.


License

See LICENSE.

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

lex_align-2.2.2.tar.gz (43.2 kB view details)

Uploaded Source

Built Distribution

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

lex_align-2.2.2-py3-none-any.whl (59.3 kB view details)

Uploaded Python 3

File details

Details for the file lex_align-2.2.2.tar.gz.

File metadata

  • Download URL: lex_align-2.2.2.tar.gz
  • Upload date:
  • Size: 43.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lex_align-2.2.2.tar.gz
Algorithm Hash digest
SHA256 2d48ffdfaceb69bbfab05b8944fa9c299f8a428f494ea8e725eb4a537234163f
MD5 88018e1a1fdec202ec370c123f0a0117
BLAKE2b-256 dcdc48de534d16b7e853a84a41ddbf1a571dc9f093dbda1d53edf44e43563699

See more details on using hashes here.

Provenance

The following attestation bundles were made for lex_align-2.2.2.tar.gz:

Publisher: release.yml on dlfelps/lex-align

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lex_align-2.2.2-py3-none-any.whl.

File metadata

  • Download URL: lex_align-2.2.2-py3-none-any.whl
  • Upload date:
  • Size: 59.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lex_align-2.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8da45993a27299ef2f5a79f09c8a4d6a382f66b7e826bc82b7103476918fb95c
MD5 d3e288967c915f566fcae3b6a4c3120b
BLAKE2b-256 8d403f0bd1befb642fa6d3eb5546912b26150657d0f4f53c80a64d4b14091d02

See more details on using hashes here.

Provenance

The following attestation bundles were made for lex_align-2.2.2-py3-none-any.whl:

Publisher: release.yml on dlfelps/lex-align

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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