policy-generator
README.md
# AI Policy & Compliance Generator




An AI-powered tool that auto-generates tailored **security framework reports**, **compliance documentation**, **IAM access policies**, and **KPI dashboards** based on a specified industry, regulatory framework, and target audience. Built with the Model Context Protocol (MCP) SDK, Gemma 4 via Ollama, and Python.
---
## Features
- Generate full security policy documents (ISO 27001, NIST CSF, SOC 2, CIS Controls)
- Produce IAM governance reports and access management policies by org type
- Output stakeholder-ready formats: Markdown reports, PowerPoint slide decks, and HTML dashboards
- Runs fully locally via Ollama — no cloud API keys required
- MCP server integration allows Claude Desktop to invoke generation via natural language
---
## Architecture
```
User Prompt (Claude Desktop / CLI)
│
▼
MCP Server (mcp_server.py)
│
▼
Generator Engine (generator.py)
│
┌────┴────┐
▼ ▼
Ollama Report Builder
(Gemma 4) (report_builder.py)
│
┌────────┼────────┐
▼ ▼ ▼
.md .pptx dashboard
report slides (HTML)
```
---
## Requirements
- Python 3.10+
- [Ollama](https://ollama.com/) installed and running locally
- Gemma 4 model pulled: `ollama pull gemma2:9b`
- MCP SDK: `pip install mcp`
---
## Installation
```bash
git clone https://github.com/charlie-netdevops/ai-policy-compliance-generator.git
cd ai-policy-compliance-generator
pip install -r requirements.txt
ollama pull gemma2:9b
```
---
## Usage
### CLI Mode
```bash
python main.py \
--framework ISO27001 \
--industry healthcare \
--audience "IT Security Team" \
--output report
```
### MCP Mode (Claude Desktop)
Add to your `claude_desktop_config.json`:
```json
{
"mcpServers": {
"policy-generator": {
"command": "python",
"args": ["/path/to/ai-policy-compliance-generator/mcp_server.py"]
}
}
}
```
Then in Claude Desktop:
> *"Generate an ISO 27001 access control policy for a pharma company targeting the CISO"*
---
## Sample Output
```
Framework : ISO 27001 — Access Control (A.9)
Industry : Pharmaceutical
Audience : CISO / Compliance Team
Generated : 2025-11-14
POLICY: Access Control and Identity Management
----------------------------------------------
1. Purpose
Ensure that access to information systems is authorized, monitored,
and revoked in a timely manner to protect confidentiality, integrity,
and availability of organizational data assets.
2. Scope
Applies to all employees, contractors, and third-party users with
access to [Organization] information systems and networks.
3. Policy Statements
3.1 All user accounts must follow the principle of least privilege.
3.2 Access requests must be approved by the data owner and documented.
3.3 User access reviews must be conducted quarterly...
[truncated — see outputs/sample_iso27001_report.md]
```
---
## Project Structure
```
ai-policy-compliance-generator/
├── main.py # CLI entry point
├── mcp_server.py # MCP server for Claude Desktop
├── requirements.txt
├── config/
│ └── config.yaml # Model and output settings
├── src/
│ ├── generator.py # Core LLM generation logic
│ ├── report_builder.py # Markdown / PPTX / HTML output
│ └── dashboard.py # KPI dashboard renderer
├── templates/
│ ├── iso27001_template.md
│ ├── iam_policy_template.md
│ └── nist_csf_template.md
├── outputs/
│ └── sample_iso27001_report.md
└── tests/
└── test_generator.py
```
---
## Frameworks Supported
| Framework | Status |
|---|---|
| ISO 27001 | ✅ |
| NIST CSF | ✅ |
| SOC 2 Type II | ✅ |
| CIS Controls v8 | ✅ |
| PIPEDA (Canada) | ✅ |
| Custom | ✅ |
---
## Author
**Yash Patel** — IT Analyst | Cybersecurity & IAM
[LinkedIn](https://linkedin.com/in/yashpatelnetworking) | [Portfolio](https://charlie-netdevops.github.io/CharlieNetdevops/)
This server cannot be deployed
Maintenance
ActivityInactive
ResponsivenessOutdated data