Skip to main content

GUIDE Framework – Ethical AI Governance, Explainability (XAI), Transparency & Responsible AI Auditing.

Project description

GUIDE Framework – Ethical AI, Governance & Explainability (XAI)

guide-framework is a modern Ethical AI toolkit that helps organizations audit, explain, and govern AI systems using the G.U.I.D.E. ethical principles:

🌟 GUIDE AI ETHICS FRAMEWORK

G – Governance
U – Universal Design
I – Identification
D – Dignity
E – Equity

This framework ensures:

  • Fairness
  • Transparency
  • Explainability
  • Accessibility (508/WCAG)
  • Responsible AI decision-making
  • Ethical auditing and governance

It includes both Ethical AI auditing and XAI-based explainability tools, plus a built-in demo audit.


🚀 INSTALLATION

pip install guide-framework

Requires Python 3.8+

For data-dependent audits:

pip install pandas scikit-learn numpy

🧠 QUICK START — ETHICAL AI AUDIT

from guide_framework import EthicalAIAudit

audit = EthicalAIAudit("LoanModel")

audit.transparency_check({
    "model_name": "LoanModel",
    "version": "1.0",
    "training_data": "internal",
    "documentation": True
})

audit.fairness_check("Evaluate this loan application.")
audit.safety_check("This system may present danger.")
audit.accessibility_check("This explanation is readable and clear.")

print(audit.finalize_report())

Output example:

{
  "model": "LoanModel",
  "results": {
    "transparency": {"status": "pass"},
    "fairness": {"status": "pass"},
    "safety": {"status": "fail"},
    "accessibility": {"status": "pass"}
  },
  "score": "3/4",
  "approved": true
}

🎧 EXPLAINABILITY (XAI)

from guide_framework import ExplainabilityGuide

xai = ExplainabilityGuide(api_key="YOUR_OPENAI_KEY")

explanation = xai.explain_decision(
    "The system rejected the loan.",
    context="Applicant missing income documentation"
)

print(explanation)

🧾 TRANSPARENCY SUMMARY

metadata = {
    "model_name": "LoanModel",
    "purpose": "Predict risk",
    "training_data": "public datasets",
    "version": "1.0.0",
    "risks": "May underperform for seniors"
}

print(xai.transparency_summary(metadata))

🧪 TEST AUDIT SCRIPT (test_audit.py)

Run a full ethical audit in one file.

📄 Create test_audit.py

from guide_framework import EthicalAIAudit

# Create an audit instance
audit = EthicalAIAudit("CreditCardAI")

# Run tests
audit.transparency_check({
    "model_name": "CreditCardAI",
    "version": "2.1",
    "training_data": "bank transactions 2018–2024",
    "documentation": True
})

audit.fairness_check("Applicant includes gender and ethnicity attributes")
audit.safety_check("No dangerous content here")
audit.accessibility_check("This message is readable.")

# Generate final structured output
report = audit.finalize_report()

print("\n=== FINAL AUDIT REPORT ===")
print(report)

▶️ Run it:

python test_audit.py

▶️ BUILT-IN TEST AUDIT DEMO

A demo audit is included inside the framework.

Run it directly:

python -m guide_framework.run_demo

You’ll see:

=== GUIDE FRAMEWORK DEMO AUDIT ===
{ ... audit results ... }

Perfect for training, compliance reviews, and onboarding.


📦 MODULE MAP

guide_framework/
  ├─ auditor.py           # Ethical audit (transparency, safety, fairness, 508)
  ├─ xai_meaning.py       # XAI explainability & transparency
  ├─ governance.py        # G – Governance
  ├─ understanding.py     # U – Universal Design
  ├─ integrity.py         # I – Identification / Integrity
  ├─ disclosure.py        # D – Disclosure
  ├─ equity.py            # E – Equity
  ├─ situation_templates.py
  ├─ knowledge_base.py
  ├─ guide_simple.py
  ├─ guide.py
  ├─ run_demo.py          # ★ Built-in demo audit script
  └─ other supporting utilities…

📋 GUIDE ETHICAL CHECKLIST

G – Governance

☑ Oversight structure
☑ Documentation
☑ Model lifecycle control

U – Universal Design

☑ Inclusive testing
☑ Diverse demographic validation

I – Identification

☑ Clear indication of AI-generated content

D – Dignity

☑ Respectful outputs
☑ Human-centered safety

E – Equity

☑ Fairness across groups
☑ Bias detection


🧩 FAIRNESS RECOMMENDATIONS

  1. Remove sensitive demographic fields
  2. Review group disparities quarterly
  3. Add human review to borderline cases
  4. Provide explanations to affected users
  5. Test performance across culture, age, gender
  6. Establish ethical escalation procedures

🔐 API KEYS & SECURITY

Your OpenAI key is not stored.

xai = ExplainabilityGuide(api_key="sk-xxxx")

or:

export OPENAI_API_KEY="sk-xxxx"

⚠ TROUBLESHOOTING

Upgrade:

pip install --upgrade guide-framework

Rebuild manually:

Remove-Item -Recurse -Force dist, build, *.egg-info
python setup.py sdist bdist_wheel

📜 LICENSE

MIT License


👤 AUTHOR

Kamal Master
Email: ktabine@gmail.com


✔ GUIDE AUDIT COMPLETE

Build AI that earns trust through ethical excellence.

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

guide_framework-1.1.0.tar.gz (19.6 kB view details)

Uploaded Source

Built Distribution

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

guide_framework-1.1.0-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file guide_framework-1.1.0.tar.gz.

File metadata

  • Download URL: guide_framework-1.1.0.tar.gz
  • Upload date:
  • Size: 19.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.10

File hashes

Hashes for guide_framework-1.1.0.tar.gz
Algorithm Hash digest
SHA256 cab3b7a6e58790147ccf4b4da5394758f767db741278f78134a95ddc474ad23a
MD5 b5dfd43aef75c7a7147a310cdfe36ef4
BLAKE2b-256 ff89b7cb663ea53b6fd245e059d8639158c6b624feeb61d4a3aa5f9facc01e0b

See more details on using hashes here.

File details

Details for the file guide_framework-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for guide_framework-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 406fe8bc72ebe3c63c86548ba9f1a17f060e6c7ca72c1a71180088b6af5f0048
MD5 86ba4771f809512ff0ec2ff6b378bf48
BLAKE2b-256 0006a9fd4f2fda2db41461672fd40372eef33960d97000b78a09e7cebaf5ca4f

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