Skip to main content

Runtime enforcement layer for LLM outputs.

Project description

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

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

ega-1.0.0.tar.gz (149.3 kB view details)

Uploaded Source

Built Distribution

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

ega-1.0.0-py3-none-any.whl (108.1 kB view details)

Uploaded Python 3

File details

Details for the file ega-1.0.0.tar.gz.

File metadata

  • Download URL: ega-1.0.0.tar.gz
  • Upload date:
  • Size: 149.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for ega-1.0.0.tar.gz
Algorithm Hash digest
SHA256 37f79a8a1ff0f2e795c7af4ae7cc3254be4481f54aed82cbd1b96bb92f6473f5
MD5 bb1c800114077ccda76d64c376aa9d1f
BLAKE2b-256 733784d1235a05351dc8394a589514e418897e2bad044cf2ff0db47937fee30c

See more details on using hashes here.

File details

Details for the file ega-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: ega-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 108.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for ega-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6f46718bda5ee8c0b2ccb8b6f8a2adb6c50393ec2db997ce02bce7d0d72fc842
MD5 20253f94f6f8254f8d07d78c34c04de2
BLAKE2b-256 a2608f39e7680fec3ea06afcef036f5606602329c2d5ffc5f94bda22d42b3cf7

See more details on using hashes here.

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