Building toward an open standard for Agentic State, where every automated decision will be bound to law, signed and explainable. Current implementation provides Decision Engineering foundation with basic policy-as-code capabilities, legal compliance framework, and extensible architecture for future agentic features.
# Clone and install (minimal dependencies)
git clone https://github.com/your-org/policy-as-code.git
cd policy-as-code
pip3 install -e .
# Initialize and run your first decision
policy-as-code init
python3 examples/simple_demo.pyThat's it! You now have a working Policy as Code system. ๐
Policy as Code transforms business rules into executable, auditable software. Think of it as "Git for business decisions" - every decision is:
- โ Versioned - Track changes over time
- โ Testable - Automated testing and validation
- โ Auditable - Complete decision history
- โ Extensible - Framework for advanced features
Instead of this manual process:
โ Manual: "Check if income > $50k and credit score > 700"
โ Manual: "Write decision in Word document"
โ Manual: "Email to manager for approval"
โ Manual: "Store in filing cabinet"
You get this automated process:
โ
Code: def loan_approval(data):
โ
Code: return {"approved": data.income > 50000 and data.credit_score > 700}
โ
Code: # Automatically versioned, tested, and auditable- CLI Interface - Deploy, execute, and manage decision functions
- Basic Decision Functions - Simple business logic with validation
- Working Examples - Loan approval, basic approval, multi-criteria decisions
- Progressive Learning - Step-by-step examples that actually work
- Extensible Architecture - Ready for advanced features
- Legal Compliance Framework - Finlex/EUR-Lex integration
- Digital Signatures - Change control and separation of duties
- Immutable Trace Ledger - Hash-chained audit trail
- Agentic AI Integration - LLM-powered reasoning
- EU AI Act Compliance - High-risk system compliance
- Cross-Border Architecture - EU AI Commons implementation
- Citizen Explanation API - Human-readable decision justifications
- Advanced Governance - Drift detection and independent audit
python3 examples/simple_demo.pyWhat you'll learn: Simple decision structure, input/output validation, basic business rules
policy-as-code init
policy-as-code deploy loan_approval 1.0 examples/simple_demo.py
policy-as-code execute loan_approval '{"credit_score": 750, "income": 75000}'What you'll learn: Function deployment, execution, registry management
python3 examples/level1_basic_approval.py
python3 examples/level1_loan_approval.pyWhat you'll learn: Complex business logic, multiple criteria, error handling
python3 examples/opa_demo.py- Shows Python-OPA bridge- OPA/Rego policy integration
- Integration challenges and solutions
def loan_approval(input_data):
"""Simple loan approval logic"""
credit_score = input_data.get("credit_score", 0)
income = input_data.get("income", 0)
if credit_score >= 700 and income >= 50000:
return {"approved": True, "amount": min(income * 3, 500000)}
else:
return {"approved": False, "reason": "Criteria not met"}# Deploy your function
policy-as-code deploy loan_approval 1.0 loan_approval.py
# Execute with real data
policy-as-code execute loan_approval '{"credit_score": 750, "income": 75000}'- โ Input Validation - Automatic data validation
- โ Output Validation - Consistent response format
- โ Audit Trail - Every decision is logged
- โ Version Control - Track changes over time
- โ CLI Management - Easy deployment and execution
- Social Benefits - Automated welfare eligibility
- Tax Calculation - Complex tax computations
- Immigration - Visa processing workflows
- Healthcare - Medical procedure eligibility
- Loan Approval - Credit risk assessment
- Insurance - Policy underwriting
- Compliance - Regulatory requirement checking
- Fraud Detection - Risk scoring algorithms
- HR Policies - Employee benefit calculations
- Pricing Rules - Dynamic pricing logic
- Approval Workflows - Multi-step decision processes
- Compliance - Regulatory requirement validation
Every decision is cryptographically signed and stored in an append-only ledger.
Built-in support for legal references (Finlex, EUR-Lex) and EU AI Act compliance.
LLM integration for complex decision-making and natural language explanations.
Real-time metrics, alerting, and comprehensive analytics.
CLI, REST API, GraphQL, WebSocket, and Python SDK for any integration need.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Policy as Code Foundation โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โข CLI Interface โข Decision Engine โ
โ โข Basic Validation โข Function Registry โ
โ โข Working Examples โข Extensible Framework โ
โ โข Documentation โข Future-Ready Architecture โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
| Layer | Function | Status |
|---|---|---|
| CLI Layer | Command-line interface for function management | โ Working |
| Decision Engine | Basic function execution and validation | โ Working |
| Registry Layer | Function storage and versioning | โ Working |
| Examples Layer | Working demos and learning path | โ Working |
git clone https://github.com/your-org/policy-as-code.git
cd policy-as-code
pip3 install -e .
policy-as-code init
python3 examples/simple_demo.py- Level 1:
python3 examples/simple_demo.py - Level 2: Use CLI to deploy and execute functions
- Level 3: Try multi-criteria examples
- Level 4: Build your own decision function
# Install with production dependencies
pip3 install -e ".[production]"
# Start API server
python3 bin/run_api.py- Getting Started: Complete Guide
- Architecture: System Overview
- CLI Reference: Command Documentation
- Questions: Open a GitHub issue
- Contributing: See Contributing Guide
- Getting Started Guide - Complete learning path
- Architecture Overview - System design
- CLI Reference - Command-line interface
- API Reference - REST API documentation
- Full Documentation - Complete reference
We welcome contributions! See our Contributing Guide for details.
git clone https://github.com/your-org/policy-as-code.git
cd policy-as-code
pip3 install -e ".[dev]"
make test
make lintThis project is licensed under the MIT License - see the LICENSE file for details.
We're building the foundation for accountable automation.
This Policy as Code foundation provides the essential building blocks for transforming governance - from manual, error-prone processes to automated, auditable, and intelligent decision-making systems.
- โ Working Foundation - Basic decision functions with validation and testing
- โ CLI Interface - Easy deployment and execution of decision functions
- โ Extensible Architecture - Ready for legal compliance and agentic features
- โ Clear Roadmap - Path toward Agentic State with legal binding
- โ Open Source - MIT licensed for maximum adoption
Ready to start building accountable automation? Get started now! ๐
- โ Basic decision functions with validation
- โ CLI interface for function management
- โ Working examples and documentation
- โ Extensible architecture
- ๐ Finlex/EUR-Lex integration
- ๐ Legal reference validation
- ๐ EU AI Act compliance framework
- ๐ Digital signature infrastructure
- ๐ฎ LLM integration for reasoning
- ๐ฎ Conversational interfaces
- ๐ฎ Workflow orchestration
- ๐ฎ Multi-agent coordination
- ๐ฎ EU AI Commons implementation
- ๐ฎ Nordic-Baltic pioneer deployment
- ๐ฎ Multilingual AI support
- ๐ฎ Cross-border APIs
Built with โค๏ธ for the future of accountable automation