SecurePolicy‑Maker is a mini‑project built using FastAPI (backend) and HTML/CSS (frontend) to help users generate simple cybersecurity policies through an AI‑assisted workflow. It integrates with a local LLM (via Ollama) for basic chatbot support.
This project is built as part of the NPTEL Cybersecurity & Privacy Course, focused on learning how policy generation systems work.
- Generate quick security policy drafts
- Customize and export security rules
- Experiment with Cybersecurity Specific Chatbot
/
├── main.py # FastAPI backend entry point
├── rules.json # Base rules/policy format
├── requirements.txt # Python dependencies
├── templates/ # Jinja2 templates for policy rendering
│ └── privacy_policy.j2
├── static/ # Frontend assets
│ └── index.html # HTML file with inline CSS, JS, UI components
└── README.md # Project documentation
--
| Layer | Technology / Framework | Purpose |
|---|---|---|
| Backend | FastAPI (Python) | Core API, routing, business logic |
| Frontend | HTML, CSS, Jinja2 | UI rendering, templating engine |
| Chatbot | Llama 3.2:1B (via Ollama) | Chat assistance for explaining security terms; not used for policy generation |
| Policy Engine | rules.json (custom rule-based system) | Deterministic policy creation |
| Server | Uvicorn | ASGI server to run FastAPI app |
| Package Management | pip, venv | Dependency and environment management |
| PDF Export | Python-based PDF generation | Enables users to download generated policies |
| Static Assets | CSS, JS (local) | Frontend styling and behavior |
- Python 3.10+
- Ollama or any local LLM API
- A virtual environment (recommended)
# 1. Clone the repository
git clone https://github.com/Vedika-Sd/SecurePolicy-Maker.git
cd SecurePolicy-Maker
# 2. Create and activate virtual environment
python -m venv venv
# Windows:
venv\Scripts\activate
# Linux/Mac:
# source venv/bin/activate
# 3. Install dependencies
pip install -r requirements.txt
# 4. Run the server
uvicorn main:app --reload
# App runs at:
# http://127.0.0.1:8000Once you run the server:
- Open the UI in your browser.
- Provide system/context details.
- System generates a draft policy based on predefined rules.json; the LLM is only used for chatbot responses.
- Review, refine, export.
- Select policy category or input details
- LLM processes input and rules.json
- Policy is generated and displayed in UI
⚠ This is an educational project; policies generated must be reviewed manually before real‑world use.
- FastAPI backend with clean routing
- Simple, user‑friendly HTML UI
- JSON‑based rule system (rules.json)
- Chatbot support for more explanation
You can easily extend functionality:
Edit rules.json to adjust policy templates.
Customize LLM prompts in main.py to Expand features of Chatbot.
Contributions are welcome! To contribute:
- Fork the repo
- Create a branch (
feature/my-update) - Commit and push
- Open a Pull Request
You can help with:
- Better UI/UX
- More policy templates
- Robust backend enhancements
- Documentation improvements
This project is licensed under the MIT License. You are free to use, modify, and distribute it.
Created by Vedika (Vedika-Sd). Feel free to raise issues or suggestions directly through GitHub.
