JUSTITIA — Transparent AI Policy Compiler for Institutional Trust & Audit
JUSTITIA was born from the need to bring transparency, accountability, and operational confidence to organizational governance. During my research into AI and open-source models, I realized that while large language models excel at generating text, organizations struggle to formally translate vague policies into precise, enforceable rules that can be audited and validated reliably.
Inspired by OpenAI’s revolutionary gpt-oss open-weight reasoning models and their unique Harmony prompt format, I set out to build a tool that compiles textual norms into executable JSON policy rules with explicit regex detection patterns, severity levels, and detailed chain-of-thought reasoning. This policy compiler is able to generate an auditable "notebook" of AI decisions, leveraging transparent reasoning that administrators can trust.
Building JUSTITIA challenged me to integrate multiple unique gpt-oss capabilities:
- Harmony format system/user messages managing structured multi-role prompts,
- Configurable reasoning effort (balancing latency and depth),
- Rich chain-of-thought exposure for verifiable decisions,
- Powerful Python tool integration for automated test creation and execution, and
- Complete offline operation via Ollama to safeguard privacy.
The project features both a command-line interface for technical users and an interactive terminal UI for accessibility, making it usable across organizations with diverse skill sets.
Challenges included ensuring robust JSON extraction from AI outputs, designing effective regex-based rule tests, and making the user experience smooth without cloud dependencies. Open-source tools like Pydantic and Textual enabled rapid, modular development.
With JUSTITIA, organizations can confidently transform fuzzy policy documents into testable, transparent, and privacy-preserving governance frameworks, addressing critical gaps in AI accountability and compliance.
I’m proud to contribute this novel solution showcasing the full power and openness of the gpt-oss models, advancing transparent AI governance for real-world impact.
Technologies Used
- Python 3.10+
- OpenAI gpt-oss-20b model via Ollama inference
- OpenAI Harmony format for structured prompt engineering
- Pydantic for data validation of policies and test cases
- Textual for interactive terminal UI
- Typer for command-line interface
- Rich for beautiful console output and progress
- SQLite and JSON for local storage and versioning
- Regex for automated pattern detection in policy tests
- Apache 2.0 license to support open commercial use
Links
- Source code: GitHub Repository
How to Run
Full detailed instructions are in the repository README.md. Quick start using CLI/TUI includes generating policies from norms, running automated tests, and interactively managing policy creation—all offline and open-source.
Log in or sign up for Devpost to join the conversation.