Enterprise governance platform for AI-generated code: legal, security, and architectural alignment
Project description
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-commithook (universal backstop, fires for every agent and every human committing to a governed repo) and a Claude CodePreToolUsehook that interceptspyproject.tomledits 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, callsrequest-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 + agent identity | ✅ shipped |
| 4. Pluggable org-mode auth | ✅ shipped |
| 4. Pluggable approval proposers (local-file, local-git, GitHub PR) + hot-reload | ✅ shipped |
Every registry change now flows through a proposer: opens a PR (GitHub), commits to a local repo (local-git), writes the YAML directly (local-file), or just logs (log-only / evaluation). The server hot-reloads on merge or YAML write — no restarts. See Approvals & Reloads for the full flow, GitHub permission requirements, and the "why-is-this-pending" panel on the dashboard.
The dashboard's classify endpoint that mutated the in-memory registry
in Phase 3 is gone — every change now has a single source of truth in
registry.yml, with a reload trigger pulling the new state into
memory.
[image placeholder: approval-flow screenshot or GIF]
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
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 lex_align-2.2.3.tar.gz.
File metadata
- Download URL: lex_align-2.2.3.tar.gz
- Upload date:
- Size: 73.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43d8ee1178f1cecfc9b1571f67ee058acd2e4df57df495764a3261a385bfeaf9
|
|
| MD5 |
a122b72868864da22d6fb20d4b17d96c
|
|
| BLAKE2b-256 |
aca6f6d17b1651d77c9c3018c6964db9861f5807532f0854d104a65108ca7756
|
Provenance
The following attestation bundles were made for lex_align-2.2.3.tar.gz:
Publisher:
release.yml on dlfelps/lex-align
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lex_align-2.2.3.tar.gz -
Subject digest:
43d8ee1178f1cecfc9b1571f67ee058acd2e4df57df495764a3261a385bfeaf9 - Sigstore transparency entry: 1422223330
- Sigstore integration time:
-
Permalink:
dlfelps/lex-align@471988b899026a0a500e524a17ba595fa8a276fb -
Branch / Tag:
refs/tags/v2.2.3 - Owner: https://github.com/dlfelps
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@471988b899026a0a500e524a17ba595fa8a276fb -
Trigger Event:
release
-
Statement type:
File details
Details for the file lex_align-2.2.3-py3-none-any.whl.
File metadata
- Download URL: lex_align-2.2.3-py3-none-any.whl
- Upload date:
- Size: 99.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
165f580707f12ef4b800761a5b408b085a158e7a604f0270de43cfa3387a2ece
|
|
| MD5 |
d5469692f74683ff58aa36030478f532
|
|
| BLAKE2b-256 |
33407245bb3e0e94afff3b060dc9ac2d99a94e925890acfcbcf9692e5190efa4
|
Provenance
The following attestation bundles were made for lex_align-2.2.3-py3-none-any.whl:
Publisher:
release.yml on dlfelps/lex-align
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lex_align-2.2.3-py3-none-any.whl -
Subject digest:
165f580707f12ef4b800761a5b408b085a158e7a604f0270de43cfa3387a2ece - Sigstore transparency entry: 1422223430
- Sigstore integration time:
-
Permalink:
dlfelps/lex-align@471988b899026a0a500e524a17ba595fa8a276fb -
Branch / Tag:
refs/tags/v2.2.3 - Owner: https://github.com/dlfelps
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@471988b899026a0a500e524a17ba595fa8a276fb -
Trigger Event:
release
-
Statement type: