Komplette Prompt-Schutz-Lösung — von einfachem Base64-Encoding bis hin zum verschlüsselten API-Proxy mit Watermarking.
# 1. Prompt-Vault Abhängigkeiten installieren
cd prompt-vault
npm install
# 2. .env Datei erstellen (siehe unten)
copy .env.example .env
# Dann .env mit deinem Editor öffnen und ausfüllen!
# 3. Prompts verschlüsseln
npm run encrypt
# 4. BEIDE Server starten
cd ..
.\start-servers.ps1Öffne dann:
- Web Interface: http://localhost:8000 (Prompt Generator)
- Vault Health Check: http://localhost:3700/api/health
PromptAmor/
│
├── 📄 main.py # FastAPI Backend (Port 8000)
│ ├── Speichert Prompts in PostgreSQL
│ ├── Generiert Armor-Blöcke (Base64 + SHA256)
│ └── Liefert Web-Interface unter /
│
├── 📁 static/
│ └── index.html # Web-UI zum Erstellen & Kopieren
│
├── 📁 prompt-vault/ # NODE.JS SERVER (Port 3700)
│ ├── server.js # API-Proxy zu Anthropic
│ ├── lib/
│ │ ├── promptManager.js # AES-256-GCM Verschlüsselung
│ │ ├── watermark.js # Zero-Width Unicode Watermarks
│ │ └── auth.js # Bearer Token Auth
│ ├── prompts/
│ │ ├── raw/ # Klartext-Prompts (.md)
│ │ └── encrypted/ # Verschlüsselte Vault-Dateien
│ └── scripts/
│ └── encryptPrompts.js # Verschlüsselungsscript
│
├── 📁 web/ # Astro 5 PWA (GitHub Pages)
│ └── (Wird separat deployed)
│
├── 📁 generator/
│ └── prompt-armor-generator.py # Python CLI Tool
│
└── 📄 start-servers.ps1 # Startet beide Server gleichzeitig
CREATE DATABASE prompt_armor;
CREATE TABLE armored_prompts (
id SERIAL PRIMARY KEY,
title VARCHAR(255) NOT NULL,
raw_prompt TEXT NOT NULL,
armor_block TEXT NOT NULL,
sha256_hash VARCHAR(64) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);Passwort in main.py anpassen (Zeile 40):
DB_CONFIG = {
"password": "DEIN_PASSWORT",
...
}Erstelle prompt-vault/.env:
# Geheimer Schlüssel für die Vault-Verschlüsselung (32+ Zeichen)
VAULT_SECRET=dein-sehr-langer-geheimer-schluessel-hier-12345
# Dein Anthropic API Key
ANTHROPIC_API_KEY=sk-ant-api03-...
# API Tokens für Clients (kommagetrennt)
# Erstelle mit: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
API_TOKENS=dein-token-hier,optional-zweiter-token
# Port (default: 3700)
PORT=3700
# Anthropic Model
DEFAULT_MODEL=claude-sonnet-4-20250514
MAX_TOKENS=4096Verwendung: Prompt generieren → Kopieren → In KI einfügen
// Beispiel: Prompt erstellen
POST http://localhost:8000/api/prompts
{
"title": "SEO Artikel",
"raw_prompt": "Schreibe einen SEO-Text über..."
}
// Response:
{
"armor_block": "=== PROMPT-ARMOR v1.0 ===\nINTEGRITY: SHA256:..."
}Sicherheit:
- ✅ Tamper-Evident (Hash prüft Integrität)
⚠️ Base64 ist kein echtes Verschlüsseln (kann dekodiert werden)- ✅ Einfach zu nutzen
Verwendung: Prompt bleibt server-seitig, KI-Antworten werden durch Proxy geleitet
# Prompt ausführen (Prompt bleibt auf Server!)
curl -X POST http://localhost:3700/api/run \
-H "Authorization: Bearer DEIN_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"prompt_id": "seo-article",
"variables": {"topic": "AI Security", "keyword": "prompt protection"}
}'Sicherheit:
- ✅ Echte AES-256-GCM Verschlüsselung
- ✅ Prompt niemals zum Client
- ✅ Zero-Width Watermarking (Nachverfolgbarkeit)
- ✅ Rate Limiting (30 req/min)
- ✅ Bearer Token Auth
- Datei erstellen in
prompt-vault/prompts/raw/:
---
id: mein-prompt
name: Mein Prompt
author: Dein Name
copyright: (c) 2024 Dein Name
version: 1.0.0
description: Was dieser Prompt macht
---
Du bist ein Experte für {{topic}}.
Schreibe einen Artikel über {{keyword}} mit {{word_count}} Wörtern.- Verschlüsseln:
cd prompt-vault
npm run encrypt- Server neu starten (lād die verschlüsselten Prompts)
.\start-servers.ps1# Terminal 1: FastAPI (Port 8000)
python -m uvicorn main:app --reload
# Terminal 2: Vault (Port 3700)
cd prompt-vault
npm start| Methode | Endpoint | Beschreibung |
|---|---|---|
| GET | / |
Web Interface |
| POST | /api/prompts |
Prompt speichern & Armor generieren |
| GET | /api/prompts |
Alle Prompts auflisten |
| GET | /api/prompts/{id} |
Einzelnen Prompt holen |
| Methode | Endpoint | Auth | Beschreibung |
|---|---|---|---|
| GET | /api/health |
Nein | Health Check |
| GET | /api/prompts |
Ja | Prompt-Metadaten |
| POST | /api/run |
Ja | Prompt ausführen |
# 1. Health Check
curl http://localhost:3700/api/health
# 2. Prompts auflisten
curl http://localhost:3700/api/prompts -H "Authorization: Bearer DEIN_TOKEN"
# 3. Prompt ausführen
curl -X POST http://localhost:3700/api/run `
-H "Authorization: Bearer DEIN_TOKEN" `
-H "Content-Type: application/json" `
-d '{"prompt_id": "seo-article", "variables": {"topic":"Test","keyword":"demo","word_count":"100"}}'Prompt-Armor License v1.0
- Persönliche Nutzung: Kostenlos
- Kommerzielle Nutzung: Lizenz erforderlich
Kontakt: [email protected]
Belkis Aslani — Prompt-Armor Konzept & Entwicklung