# lexguard

> Lexicons that score text for a concept, plus evaluators for pydantic-evals, DeepEval, and
> Inspect AI built on top

lexguard is not only an evals add-on. The core API — `Lexicon.signal()`, `.fires()`, `.denied()`
— is plain functions over a string with no evals framework involved, useful as a guardrail, a
unit-test assertion, or a log filter. `.spec()` compiles a lexicon into a framework-agnostic
`RuleSpec`; `.absent()` / `.expected()` and the integration modules turn that into an evaluator
for whichever eval framework a project uses. The core has no dependencies — each framework is an
optional extra (`lexguard[pydantic-evals]`, `lexguard[deepeval]`, `lexguard[inspect-ai]`).

## Documentation

- [README](README.md): install, the core `signal()`/`fires()`/`denied()` API, and both the
  standalone and framework-integrated ways of running a lexicon
- [Writing a lexicon](docs/writing-a-lexicon.md): building your own `Lexicon` for a new domain
- [Rules](docs/rules.md): `.absent()` / `.expected()`, the `when` / `unless` guards, and `Observe`
- [Agents](docs/agents.md): checking pydantic-ai agent output, structured or plain text
- [Integrations](docs/integrations.md): the framework-agnostic `RuleSpec`, plus DeepEval and
  Inspect AI adapters

## Project Information

- **Source Code**: https://github.com/benomahony/lexguard
- **PyPI Package**: https://pypi.org/project/lexguard

## AI Integration

- **Agent Skill**: Claude Code skill available in `.skills/lexguard/SKILL.md` for enhanced project interaction
