# 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
- [Lexicons](docs/lexicons/index.md): every lexicon that ships in the box, rendered from
  `lexguard.words` and `lexguard.suites` at build time, one page per group —
  [Request](docs/lexicons/request.md), [Instruction](docs/lexicons/instruction.md),
  [Response](docs/lexicons/response.md), [Domain](docs/lexicons/domain.md), and
  [Bundles](docs/lexicons/bundles.md)
- [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/index.md): the framework-agnostic `RuleSpec`, with its own
  page per framework — [pydantic-evals](docs/integrations/pydantic-evals.md),
  [DeepEval](docs/integrations/deepeval.md), [Inspect AI](docs/integrations/inspect-ai.md)

## 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
