Skip to main content

The Open-Source Framework for Agentic Ethics, AI Agent Values, and Safety Compliance (NIST, EU AI Act)

Project description

indoctrine.ai

The Gold Standard for AI Testing: Ethical, Fair, and Compliant

PyPI version Python 3.9+ License: MIT Tests

Open-source AI testing framework for comprehensive security, bias detection, compliance, and ethical AI evaluation. Production-ready testing for LLMs and AI agents.


What Does indoctrine.ai Test?

๐Ÿ” AI Security & Robustness

Detect vulnerabilities before attackers do.

  • Prompt injection attacks - Block instruction override attempts
  • Jailbreak detection - Prevent safety guideline bypasses
  • Adaptive red-teaming - AI-powered dynamic attack generation
  • Multi-modal security - Test image injection and visual jailbreaks
  • Tool use safety - Validate agent tool-calling security
  • Token smuggling - Detect encoding-based attacks

โ†’ See Attack Engine Documentation

โœ… AI Truthfulness & Accuracy

Eliminate hallucinations and ensure factual accuracy.

  • Hallucination detection - Identify fabricated information
  • Groundedness checking - Verify claims match source material
  • RAG system evaluation - Full RAG Triad (Context, Groundedness, Answer Relevance)
  • Consistency testing - Ensure reliable responses
  • Semantic similarity - Real embedding-based analysis

โ†’ See Truth Engine Documentation

โš–๏ธ AI Compliance & Governance

Meet regulatory requirements automatically.

  • EU AI Act compliance - Articles 9-15 & 52 coverage
  • GDPR compliance - Data privacy and protection
  • NIST AI RMF - Risk management framework
  • SOC 2 & ISO 42001 - Enterprise standards
  • Auto-generated guardrails - Export NeMo Guardrails configs
  • Custom policy engine - Enforce company-specific rules

โ†’ See Governance Engine Documentation

โš–๏ธ AI Fairness & Bias Detection

Eliminate algorithmic discrimination with research-backed metrics.

  • 15 fairness metrics - Demographic parity, equalized odds, disparate impact
  • Standard benchmarks - Adult, COMPAS, German Credit datasets
  • LLM-native testing - Auto-generate demographic variants
  • Interpretability layer - Plain-English bias explanations
  • Legal compliance - EEOC 80% rule validation
  • Hiring & lending testing - Domain-specific thresholds

โ†’ See Fairness Engine Documentation

๐ŸŒ AI Ethics & Cultural Equity

Test for cultural bias and value alignment.

  • Decolonization score - 5-dimensional cultural bias testing
    • Epistemic bias (knowledge systems)
    • Linguistic bias (communication styles)
    • Historical bias (narrative perspectives)
    • Cultural bias (norm assumptions)
    • Stereotyping (representation quality)
  • Political bias detection - Measure ideological skew
  • Values alignment - Human rights, ethics, inclusivity

โ†’ See Values Engine Documentation


How Does indoctrine.ai Test?

๐Ÿค– LLM-as-a-Judge Evaluation

Sophisticated AI-powered testing, not brittle keyword matching.

  • Uses GPT-4, Claude, or local LLMs (Ollama, LM Studio) as evaluators
  • Contextual understanding of refusals vs. compliance
  • Nuanced detection of hallucinations and policy violations
  • Supports OpenAI, Anthropic, or fully offline local models
evaluator:
  provider: "openai"
  model: "gpt-4o"
  api_key: "${OPENAI_API_KEY}"

โš”๏ธ Adaptive Red-Teaming

Dynamic attacks that evolve based on your agent's responses.

  • Attacker Agent observes target responses
  • Generates new exploits targeting discovered weaknesses
  • Multi-turn interrogation vs. static attack datasets
  • Powered by GPT-4, Claude, or local LLMs

๐Ÿ“Š Objective Fairness Metrics

Research-backed algorithmic fairness testing.

  • 15 peer-reviewed fairness metrics
  • Formal mathematical definitions
  • Industry-standard benchmarks (Adult, COMPAS, German Credit)
  • Interpretability layer with plain-English explanations

๐ŸŽฏ Multi-Modal Testing

Test both text and vision-language models.

  • Image injection attacks
  • QR code exploits
  • Steganography detection
  • Visual jailbreak testing

๐ŸŒˆ Beautiful UX

AI testing that doesn't feel like a chore.

  • Nyan Progress Display - Rainbow-trailing progress animations
  • Nyan Alignment Score - Unified 0-100 ethical metric
  • Automated PDF/JSON/Markdown reports
  • 3D embedding visualizations

Why indoctrine.ai?

โœจ Key Differentiators

Feature indoctrine.ai Alternatives
Open Source โœ… MIT License โŒ Proprietary
Privacy-First โœ… Runs locally โŒ Cloud-only
Comprehensive โœ… 5-layer testing โš ๏ธ Partial coverage
Production-Ready โœ… CI/CD integration โš ๏ธ Research tools
Research-Backed โœ… 15 fairness metrics โš ๏ธ Ad-hoc metrics
Cultural Equity โœ… Decolonization testing โŒ Not available
Auto-Remediation โœ… Guardrail export โŒ Detection only

Quick Start

Installation

pip install indoctrine-ai

Your First Test (5 Lines)

from agent_indoctrination import Indoctrinator

indo = Indoctrinator("config.yaml")
results = indo.run_full_suite(my_agent)
indo.generate_report(results, "report.pdf")
print(f"Nyan Alignment Score: {results['overall_score']}/100")

Output:

๐ŸŒˆ [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ] 100% Complete
โœ… Security: 92/100 | โœ… Accuracy: 88/100 | โœ… Compliance: 95/100
Nyan Alignment Score: 91/100

โ†’ Get Started in 5 Minutes


Who Uses indoctrine.ai?

Use Cases

Industry What We Test Why It Matters
AI/ML Teams Security, hallucinations, consistency Catch bugs before production
Compliance Officers EU AI Act, GDPR, SOC 2 Automated regulatory audits
Red Teams Adversarial attacks, jailbreaks Identify security vulnerabilities
HR/Hiring Fairness metrics, bias detection Avoid discrimination lawsuits
Finance/Lending Disparate impact, EEOC compliance Fair lending requirements
Healthcare HIPAA, bias, hallucinations Patient safety & equity
Enterprise AI Governance, security, fairness Comprehensive AI risk management

Documentation

๐Ÿ“š Complete Guides

๐ŸŽฏ Quick Links


Features at a Glance

Core Capabilities

โœ… Prompt injection & jailbreak detection
โœ… Adaptive AI-powered red-teaming
โœ… Multi-modal security testing (images, QR codes)
โœ… Hallucination & groundedness checking
โœ… RAG Triad evaluation (Context, Groundedness, Answer Relevance)
โœ… EU AI Act, GDPR, NIST AI RMF compliance
โœ… 15 objective fairness metrics
โœ… Decolonization testing (5 cultural dimensions)
โœ… Auto-generated guardrails (NeMo)
โœ… LLM-as-a-Judge evaluation
โœ… OpenAI, Anthropic, Ollama, LM Studio support
โœ… CI/CD integration (GitHub Actions, GitLab)
โœ… PDF/JSON/Markdown reports
โœ… Nyan Progress Display ๐ŸŒˆ


Configuration Example

# config.yaml - Works with OpenAI, Anthropic, or local LLMs
evaluator:
  provider: "openai"
  model: "gpt-4o"
  api_key: "${OPENAI_API_KEY}"

# Or use local LLMs (free, offline)
evaluator:
  provider: "openai"
  endpoint: "http://localhost:11434/v1"
  model: "llama3"
  api_key: "ollama"

# Enable testing engines
attack:
  enabled: true
  adaptive: true  # AI-powered attacks
  
truth:
  enabled: true
  enable_rag_triad: true
  
governance:
  enabled: true
  frameworks:
    - eu_ai_act
    - gdpr
    
fairness:
  enabled: true
  use_case: "hiring"  # EEOC thresholds

values:
  enabled: true

โ†’ Full Configuration Guide


CI/CD Integration

# .github/workflows/ai-testing.yml
name: AI Safety Testing
on: [pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - run: pip install indoctrine-ai
      - name: Run AI tests
        env:
          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
        run: indoctrinate run --config config.yaml --agent my_agent.py
      - name: Check thresholds
        run: indoctrinate validate --results results.json --fail-on-critical

โ†’ CI/CD Examples


Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

Community

  • ๐Ÿ› Report bugs - GitHub Issues
  • ๐Ÿ’ก Suggest features - Discussions
  • ๐Ÿ”€ Submit PRs - Follow the dev branch workflow
  • โญ Star the repo - Help us reach more AI developers!

License

MIT License - see LICENSE for details.


Support


Built for safer, fairer, and more compliant AI ๐ŸŒˆ

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

indoctrine_ai-0.2.0.tar.gz (51.7 kB view details)

Uploaded Source

Built Distribution

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

indoctrine_ai-0.2.0-py3-none-any.whl (58.2 kB view details)

Uploaded Python 3

File details

Details for the file indoctrine_ai-0.2.0.tar.gz.

File metadata

  • Download URL: indoctrine_ai-0.2.0.tar.gz
  • Upload date:
  • Size: 51.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for indoctrine_ai-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8bfb926696c3e01fd5f5fbea2d5ca420b04a4290721cbab7cb5762043dc0e0cd
MD5 29748b0baa8c32f7923e58718ffbc698
BLAKE2b-256 bb50b2b973e27af151241bfbe33652b5fdbb2991e01c3b644cb061fc8ded0e99

See more details on using hashes here.

File details

Details for the file indoctrine_ai-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: indoctrine_ai-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 58.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for indoctrine_ai-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8dc02bda762849c28ba2b0f51d018c0402e949137dead90eb73e3ab6337f9025
MD5 337d4790d4e6ab7b7af94e46729bdfe8
BLAKE2b-256 77bc77e1ad3847a616602754a571119373c5340e4581e9c7289a6d3b31c54d8f

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