feat: deployment-readiness criteria + executable RAI evaluation engine - #20
Open
felipelago17 wants to merge 6 commits into
Open
feat: deployment-readiness criteria + executable RAI evaluation engine#20felipelago17 wants to merge 6 commits into
felipelago17 wants to merge 6 commits into
Conversation
Add docs/criteria/deployment-readiness.md mapping the three operational AI-scaling barriers (data trust gap, workflow embedding, workforce readiness) to NIST AI RMF, EU AI Act, and ISO/IEC 42001 crosswalks. Key figures from practitioner evidence (AI in Energy Summit 2026, 130+ leaders surveyed; Source A): - Up to 95% of AI initiatives fail to deliver measurable value at scale — attributed to operational failure, not algorithmic defects - ~30% of leaders cite data quality and governance as the primary barrier - ~85% accuracy threshold required to establish operational trust - 17% of organizations are "highly prepared" (AI embedded in daily workflows) EU AI Act hooks: Art. 10 (data governance) and Art. 15 (accuracy/robustness) noted as evidence-trail anchors; labelled as practitioner survey data, not legal interpretation. ASL-level crosswalks untouched. Wire into mkdocs.yml under new Criteria nav section. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WFc4mqrrwQKn4ieExoB1rX
Implement the full RAI-Eval engine — turns the Test Catalogue into a
runnable evaluation harness that produces schema-valid, governance-tagged
findings. Stdlib-only on the dry-run path (no API keys, no network).
Engine layout:
engine/schema/finding.schema.json JSON Schema draft-2020-12
engine/mappings/{toxicity,truthfulness}.mappings.json
engine/prompts/{toxicity,truthfulness}.sample.jsonl (benign only)
engine/models/client.py MockProvider + AnthropicProvider seam
engine/judges/{base,toxicity,truthfulness}_judge.py
engine/validation.py A-D staged false-positive gates
engine/runners/{_base,toxicity,truthfulness}_runner.py
engine/emitters/sarif_emitter.py SARIF 2.1.0 with governance rule tags
engine/README.md
CLI (evaluate.py):
--axis {toxicity,truthfulness} --dry-run --seeds N --include-text
--provider {mock,anthropic} --model --prompts --out
Writes findings.json + findings.sarif + report.md per run.
CI (.github/workflows/rai-eval.yml):
Runs both axes dry-run, uploads SARIF to GitHub Security, publishes
docs, archives artifacts. Live Anthropic run is commented out.
Acceptance criteria (all pass):
python evaluate.py --axis toxicity --dry-run --seeds 5 # exits 0
python evaluate.py --axis truthfulness --dry-run --seeds 5 # exits 0
python scripts/publish_to_docs.py # writes latest-run.md
all required finding keys present; no extra keys;
toxicity: not all rejected; truthfulness: no confirmed; SARIF 2.1.0 valid.
Wire evaluation/latest-run.md into mkdocs.yml nav.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WFc4mqrrwQKn4ieExoB1rX
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WFc4mqrrwQKn4ieExoB1rX
CodeQL upload-sarif rejects multiple SARIF files under the same category. Fix by writing evaluate.py output to out/<axis>/<run_id>/ and uploading each axis to its own category (rai-eval-toxicity / rai-eval-truthfulness). Update publish_to_docs.py to scan the new two-level directory structure. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WFc4mqrrwQKn4ieExoB1rX
Regenerated by local dry-run after fixing axis-scoped output paths. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WFc4mqrrwQKn4ieExoB1rX
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
Catalogues the modality-dependent guardrail bypass study (arXiv:2607.24859) as a reusable evaluation template: 2×2 factorial prompt design, FSA/CER metrics, 116-participant believability study, and governance crosswalk to NIST AI RMF, EU AI Act, ASL capability thresholds, and ISO/IEC 42001. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WFc4mqrrwQKn4ieExoB1rX
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
docs/criteria/deployment-readiness.md): maps three AI-scaling operational barriers drawn from energy-sector field evidence (data trust gap, workflow embedding, workforce readiness) to NIST AI RMF, EU AI Act, and ISO/IEC 42001 crosswalks.engine/,evaluate.py,scripts/publish_to_docs.py,.github/workflows/rai-eval.yml): end-to-end dry-run evaluation pipeline (stdlib only, no API keys) producingfindings.json,findings.sarif(SARIF 2.1.0), andreport.mdper run; governance crosswalk tags on every finding.Engine highlights
MockProvider(sha1(seed:prompt) % 8) + heuristic judges for toxicity and truthfulness — zero network, zero third-party deps.AnthropicProviderstub ready forpip install anthropic+ANTHROPIC_API_KEY; judges have clearly marked seam points for LLM-based scoring.confirmed | needs_review | rejected.atlas:,nist_ai_rmf:,eu_ai_act:,iso_42001:,owasp_llm:tags; upload-ready for GitHub Advanced Security.engine/schema/finding.schema.json(JSON Schema draft 2020-12,additionalProperties: false); validated viajsonschemawhen installed, skipped gracefully otherwise.--include-textflag is off by default; only SHA-1 hashes of prompt/response stored.Acceptance criteria verified
Test plan
pip install jsonschema && python evaluate.py --axis toxicity --dry-run --seeds 5exits 0python evaluate.py --axis truthfulness --dry-run --seeds 5exits 0; noconfirmedfindingspython scripts/publish_to_docs.pywritesdocs/evaluation/latest-run.mdrai-eval.yml) passes on CI (dry-run steps only)🤖 Generated with Claude Code
https://claude.ai/code/session_01WFc4mqrrwQKn4ieExoB1rX
Generated by Claude Code