Skip to main content

EGA

EGA is not an eval tool. It is a runtime enforcement layer.

What problem it solves

LLM outputs are candidates, not answers. EGA verifies each claim against source evidence at runtime before allowing output downstream. Eval tools score after the fact. EGA enforces before emit.

Install

pip install ega

Usage

from ega import verify_answer
from ega.config import PipelineConfig, VerifierConfig
from ega.contract import PolicyConfig

config = PipelineConfig(
    policy=PolicyConfig(),
    verifier=VerifierConfig(use_oss_nli=True),
)

result = verify_answer(
    llm_output="The company was founded in 2001 and has 500 employees.",
    source_text="The company was founded in 2001. It currently employs 500 people.",
    config=config,
    return_pipeline_output=True,
)

print(result["payload_status"])
# ACCEPT or REJECT

What you get back

Every response includes payload_status, per-unit audit records with authority and decision, and tracking_id. Distribution drift signal is available when calibration data is present. Use summarize_result() to extract operational signals for logging.

Output modes

Mode Behavior
strict Full payload or rejection metadata — nothing partial
adapter Validation envelope with accepted and rejected fields separated

Set via output_mode in PipelineConfig.

Current limitations

  • Sentence-level segmentation, not semantic claim decomposition
  • Calibration bootstrapped on pilot data, not production-grade
  • Clean inputs may show authority=conformal_oor until recalibrated on production data
  • Structured output BM25 routing untested on real pipelines
  • Not benchmarked against RAGAS or TruLens

CLI

ega run --answer-file answer.txt --evidence-file evidence.json

answer.txt — plain text LLM output. evidence.json — JSON array of {id, text, metadata} objects.


Changelog | License | Issues

Metadata

Release files for ega 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ega 1.0.0
File Size Uploaded
ega-1.0.0.tar.gz 149.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ega 1.0.0
File Interpreter ABI Platform
ega-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 257.3 kB

Release files / ega-1.0.0.tar.gz

Download URL ega-1.0.0.tar.gz
Size 149.3 kB
Tags Source
SHA-256 checksum
How to use checksums
37f79a8a1ff0f2e795c7af4ae7cc3254be4481f54aed82cbd1b96bb92f6473f5
BLAKE2b-256 checksum
How to use checksums
733784d1235a05351dc8394a589514e418897e2bad044cf2ff0db47937fee30c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release files / ega-1.0.0-py3-none-any.whl

Download URL ega-1.0.0-py3-none-any.whl
Size 108.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6f46718bda5ee8c0b2ccb8b6f8a2adb6c50393ec2db997ce02bce7d0d72fc842
BLAKE2b-256 checksum
How to use checksums
a2608f39e7680fec3ea06afcef036f5606602329c2d5ffc5f94bda22d42b3cf7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page