glassbox-framework

v1.0.3
io.github.TheBarmaEffect/glassbox-framework Checked 3 days ago Published 6 months ago

Runtime constitutional verification for AI answers — claim reasoning, ECS, red team, audits.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

glassbox_verify_answer Glassbox · Verify Answer

Run a question/answer pair through the entire Glass Box Framework: claim extraction → constitution compile + evaluate → Glassbox Court (red-team) → ECS → verdict. Returns a Trust Card with verdict, ECS breakdown, per-claim reasoning, all 7 red-team probes, and the deterministic audit reference.

ParameterTypeDescription
answer *string
question *string
intentsarray

glassbox_extract_claims Glassbox · Extract Claims

Decompose an answer into atomic claims. Every claim carries a non-empty reasoning chain explaining why it is asserted, what evidence supports it, and how it could be falsified. Fallback claims (produced when the LLM call fails) are explicitly marked with a [fallback] prefix. The reasoning field is non-negotiable — it is the core product of the framework.

ParameterTypeDescription
answer *string
question *string

glassbox_score_ecs Glassbox · Score ECS

Compute the Epistemic Confidence Score over prebuilt claims, an optional red-team report, and an optional constitution. Returns all five dimension scores, the weights used, the exact formula evaluated, and the total — never just the total. Defaults to weighted arithmetic mean; pass mode="geometric" for the stricter variant.

ParameterTypeDescription
claims *array
constitution
modestring
red_team
weights

glassbox_red_team Glassbox · Court (7-Angle Red Team)

Glassbox Court runs all seven adversarial probes against an answer: fabrication, source manipulation, bias injection, context attack, overconfidence, underspecification, and constitutional violation. Returns one finding per probe, with verbatim evidence, even when the probe passes. If `intents` are supplied and `constitution` is not, the intents are compiled and evaluated inline so the constitutional_violation probe runs against the right rule set.

ParameterTypeDescription
answer *string
question *string
claimsarray
constitution
intentsarray

glassbox_generate_trust_card Glassbox · Generate Trust Card

Assemble a Trust Card from prebuilt parts (claims, red_team, ecs, optional constitution). No new LLM calls are made by this tool — it derives the verdict from the supplied parts and produces a deterministic audit reference. Use this when you have already called glassbox_extract_claims / glassbox_red_team / glassbox_score_ecs separately and want to compose the final artifact.

ParameterTypeDescription
answer *string
claims *array
question *string
constitution
ecs
intentsarray
red_team

glassbox_export_audit_report Glassbox · Export Audit Report

Run the full Glass Box pipeline and return a full AuditRecord, including the per-call API trace and a deterministic SHA-256-based log_id. Two runs with identical inputs AND identical engine outputs produce the same log_id, enabling replay detection and cache lookups.

ParameterTypeDescription
answer *string
question *string
intentsarray