Files
breakpilot-compliance/developer-portal/app/development/byoeh/_components/SdkPseudonymSection.tsx
Sharang Parnerkar 9ec72ed681 refactor(developer-portal): split iace, docs, byoeh pages
Extract each page into colocated _components/ sections to bring
page.tsx files from 1008/891/769 LOC down to 57/23/21 LOC,
well within the 500-line hard cap.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 08:45:13 +02:00

114 lines
4.6 KiB
TypeScript

import { CodeBlock, InfoBox } from '@/components/DevPortalLayout'
export function SdkPseudonymSection() {
return (
<>
<h2 id="sdk-integration">4. SDK-Integration</h2>
<CodeBlock language="typescript" filename="Beispiel: SDK-Integration (TypeScript)">
{`import { BreakpilotSDK, NamespaceClient } from '@breakpilot/compliance-sdk'
// 1. SDK initialisieren mit API-Key
const sdk = new BreakpilotSDK({
apiKey: process.env.BREAKPILOT_API_KEY,
endpoint: 'https://api.breakpilot.de'
})
// 2. Namespace-Client erstellen (pro Mandant/Abteilung)
const namespace = sdk.createNamespace({
tenantId: 'kunde-firma-abc',
passphrase: process.env.ENCRYPTION_PASSPHRASE // Bleibt lokal!
})
// 3. Dokument pseudonymisieren & verschluesselt hochladen
const result = await namespace.upload({
file: documentBuffer,
metadata: { type: 'vertrag', category: 'due-diligence' },
pseudonymize: true,
headerRedaction: true
})
// result.docToken = "a7f3c2d1-4e9b-4a5f-8c7d-..."
// 4. Referenzdokument hochladen (z.B. Pruefkriterien)
await namespace.uploadReference({
file: referenceBuffer,
title: 'Pruefkriterien Vertrag Typ A'
})
// 5. KI-Verarbeitung anstossen
const analysis = await namespace.analyze({
docToken: result.docToken,
prompt: 'Pruefe den Vertrag gegen die Referenzkriterien',
useRAG: true
})
// 6. Ergebnisse entschluesseln (passiert automatisch im SDK)
console.log(analysis.findings)
console.log(analysis.score)
// 7. Re-Identifizierung (Token → Originalname)
const identityMap = await namespace.getIdentityMap()
const originalName = identityMap[result.docToken]`}
</CodeBlock>
<InfoBox type="success" title="Zero-Knowledge-Architektur">
Die Passphrase verlässt niemals das System des Kunden. Das SDK verschluesselt
und entschluesselt <strong>ausschliesslich lokal</strong>.
</InfoBox>
<h2 id="pseudonymisierung">5. Pseudonymisierung: Wie personenbezogene Daten entfernt werden</h2>
<h3>5.1 Der doc_token: Ein zufaelliger Identifikator</h3>
<p>
Jedes Dokument erhaelt einen <strong>doc_token</strong> -- einen 128-Bit-Zufallscode im
UUID4-Format. Dieser Token ist <strong>kryptographisch zufaellig</strong>, kann
<strong> nicht zurueckgerechnet</strong> werden und dient als <strong>eindeutiger Schluessel</strong>
fuer die spaetere Re-Identifizierung.
</p>
<h3>5.2 Header-Redaction: PII wird entfernt</h3>
<div className="not-prose my-6 overflow-x-auto">
<table className="min-w-full divide-y divide-gray-200 text-sm">
<thead className="bg-gray-50">
<tr>
<th className="px-4 py-3 text-left font-medium text-gray-500">Methode</th>
<th className="px-4 py-3 text-left font-medium text-gray-500">Wie es funktioniert</th>
<th className="px-4 py-3 text-left font-medium text-gray-500">Wann verwenden</th>
</tr>
</thead>
<tbody className="divide-y divide-gray-200">
<tr>
<td className="px-4 py-3 font-medium">Einfache Redaction</td>
<td className="px-4 py-3">Definierter Bereich des Dokuments wird entfernt</td>
<td className="px-4 py-3">Standardisierte Formulare mit festem Layout</td>
</tr>
<tr>
<td className="px-4 py-3 font-medium">Smarte Redaction</td>
<td className="px-4 py-3">OpenCV/NER erkennt Textbereiche mit PII und entfernt gezielt</td>
<td className="px-4 py-3">Freitext-Dokumente, variable Layouts</td>
</tr>
</tbody>
</table>
</div>
<h3>5.3 Die Identitaets-Map: Nur der Kunde kennt die Zuordnung</h3>
<CodeBlock language="text" filename="Datenmodell: Namespace-Session (vereinfacht)">
{`NamespaceSession
├── tenant_id = "kunde-firma-abc" ← Pflichtfeld (Isolation)
├── encrypted_identity_map = [verschluesselte Bytes] ← Nur mit Passphrase lesbar
├── identity_map_iv = "a3f2c1..."
└── PseudonymizedDocument (pro Dokument)
├── doc_token = "a7f3c2d1-..." ← Zufaelliger Token (Primary Key)
├── session_id = [Referenz]
└── (Kein Name, keine personenbezogenen Daten)`}
</CodeBlock>
<InfoBox type="success" title="DSGVO Art. 4 Nr. 5 konform">
Die Pseudonymisierung erfuellt die Definition der DSGVO: Personenbezogene Daten
koennen <strong>ohne Hinzuziehung zusaetzlicher Informationen</strong>
(der verschluesselten Identitaets-Map + der Passphrase) nicht mehr einer bestimmten Person zugeordnet werden.
</InfoBox>
</>
)
}