haechi 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +154 -0
- package/README.md +102 -0
- package/SECURITY.md +31 -0
- package/docs/README.md +35 -0
- package/docs/current/api-stability.ko.md +48 -0
- package/docs/current/api-stability.md +48 -0
- package/docs/current/expert-gap-review-ai-llm-mcp-encryption.ko.md +107 -0
- package/docs/current/expert-gap-review-ai-llm-mcp-encryption.md +107 -0
- package/docs/current/global-privacy-compliance-review.ko.md +110 -0
- package/docs/current/global-privacy-compliance-review.md +110 -0
- package/docs/current/initial-plan-ai-llm-mcp-encryption.ko.md +214 -0
- package/docs/current/initial-plan-ai-llm-mcp-encryption.md +214 -0
- package/docs/current/mvp-0.1-implementation-scope.ko.md +79 -0
- package/docs/current/mvp-0.1-implementation-scope.md +79 -0
- package/docs/current/open-source-modular-architecture.ko.md +387 -0
- package/docs/current/open-source-modular-architecture.md +387 -0
- package/docs/current/prd-ai-llm-mcp-encryption.ko.md +260 -0
- package/docs/current/prd-ai-llm-mcp-encryption.md +262 -0
- package/docs/current/privacy-filtering-policy-draft.ko.md +307 -0
- package/docs/current/privacy-filtering-policy-draft.md +307 -0
- package/docs/current/release-0.2-implementation-scope.ko.md +46 -0
- package/docs/current/release-0.2-implementation-scope.md +46 -0
- package/docs/current/release-0.3-implementation-scope.ko.md +86 -0
- package/docs/current/release-0.3-implementation-scope.md +86 -0
- package/docs/current/release-0.3.2-hardening-scope.ko.md +64 -0
- package/docs/current/release-0.3.2-hardening-scope.md +64 -0
- package/docs/current/release-0.4-implementation-scope.ko.md +121 -0
- package/docs/current/release-0.4-implementation-scope.md +121 -0
- package/docs/current/release-process.ko.md +48 -0
- package/docs/current/release-process.md +48 -0
- package/docs/current/risk-register-release-gate.ko.md +154 -0
- package/docs/current/risk-register-release-gate.md +154 -0
- package/docs/current/shared-responsibility.ko.md +38 -0
- package/docs/current/shared-responsibility.md +38 -0
- package/docs/current/threat-model.ko.md +68 -0
- package/docs/current/threat-model.md +68 -0
- package/examples/llm-prompt-filtering/input.json +13 -0
- package/examples/plugins/custom-filter.plugin.json +29 -0
- package/haechi.config.example.json +70 -0
- package/package.json +74 -0
- package/packages/audit/index.mjs +262 -0
- package/packages/cli/bin/haechi.mjs +341 -0
- package/packages/cli/runtime.mjs +287 -0
- package/packages/core/index.mjs +309 -0
- package/packages/crypto/index.mjs +142 -0
- package/packages/filter/index.mjs +189 -0
- package/packages/mcp-stdio/index.mjs +105 -0
- package/packages/plugin/index.mjs +83 -0
- package/packages/policy/index.mjs +165 -0
- package/packages/policy-bundle/index.mjs +91 -0
- package/packages/privacy-profiles/index.mjs +92 -0
- package/packages/protocol-adapters/index.mjs +111 -0
- package/packages/proxy/index.mjs +534 -0
- package/packages/token-vault/index.mjs +262 -0
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
# Open-Source Modular Architecture Draft
|
|
2
|
+
|
|
3
|
+
- Status: Draft 0.1
|
|
4
|
+
- Date: 2026-06-08
|
|
5
|
+
- Product: Haechi
|
|
6
|
+
- Purpose: Define a structure for open-source/self-hosted security infrastructure — not SaaS — where encryption, policy, and privacy filtering logic can be swapped out easily
|
|
7
|
+
|
|
8
|
+
## 1. Direction
|
|
9
|
+
|
|
10
|
+
Haechi's initial goal is not a commercial SaaS product. It is a small, security-auditable open-source module that other developers can attach to their own AI/LLM/MCP applications.
|
|
11
|
+
|
|
12
|
+
The core idea is not "Haechi provides all the answers" but rather "Haechi provides safe boundaries and test standards; users swap in their own implementations within those boundaries."
|
|
13
|
+
|
|
14
|
+
Therefore, the priorities for the initial design are:
|
|
15
|
+
|
|
16
|
+
1. A working MCP/LLM protection demo
|
|
17
|
+
2. Replaceable provider interfaces
|
|
18
|
+
3. Reference implementations
|
|
19
|
+
4. Conformance tests and negative security tests
|
|
20
|
+
5. Plugin capability declarations and fail-closed loading
|
|
21
|
+
|
|
22
|
+
### 1.1 Adoptability Criteria
|
|
23
|
+
|
|
24
|
+
Even a sound security design is hard to spread as OSS if it is difficult to adopt. Haechi treats the following adoptability criteria as product requirements.
|
|
25
|
+
|
|
26
|
+
| Criterion | Target |
|
|
27
|
+
|---|---|
|
|
28
|
+
| 5-minute local demo | Run `haechi init` through local key, sample policy, and dry-run audit |
|
|
29
|
+
| 30-minute MCP/LLM PoC | Route an existing MCP host or LLM HTTP call through the local proxy |
|
|
30
|
+
| 1-day custom filter PoC | Add a custom dictionary/regex/rule and run fixture tests |
|
|
31
|
+
| Minimal code changes | In proxy mode, start by changing only base URL/env vars — no app code changes |
|
|
32
|
+
| Incremental enforcement | Start with `dry-run`, then progress to `redact`, `tokenize`, `encrypt`, `block` |
|
|
33
|
+
| Easy replacement | Swap providers via config or dependency injection |
|
|
34
|
+
|
|
35
|
+
The adoption path is divided into three stages:
|
|
36
|
+
|
|
37
|
+
1. No-code adoption: local proxy, sidecar, env var, target URL change
|
|
38
|
+
2. Low-code adoption: middleware or SDK wrapper in 10 lines or fewer
|
|
39
|
+
3. Custom adoption: replace `PolicyEngine`, `FilterEngine`, `CryptoProvider`, `AuditSink`
|
|
40
|
+
|
|
41
|
+
## 2. Non-Goals
|
|
42
|
+
|
|
43
|
+
- Hosted SaaS control plane
|
|
44
|
+
- Billing, subscriptions, tenant admin portal
|
|
45
|
+
- Sales-oriented evidence pack targeting SOC 2/ISO certification
|
|
46
|
+
- Built-in KCMVP or FIPS certified providers
|
|
47
|
+
- Developing custom cryptographic primitives
|
|
48
|
+
- Production-grade support for all LLM/MCP/A2A/gRPC protocols in 0.1
|
|
49
|
+
- Providing regulatory compliance assurance language
|
|
50
|
+
|
|
51
|
+
## 3. Proposed Package Structure
|
|
52
|
+
|
|
53
|
+
```text
|
|
54
|
+
packages/
|
|
55
|
+
core/ # pipeline, context model, plugin registry, errors
|
|
56
|
+
crypto/ # reference CryptoProvider, envelope format
|
|
57
|
+
keys/ # local KeyProvider, Vault/KMS adapter skeleton
|
|
58
|
+
policy/ # JSON/YAML reference PolicyEngine
|
|
59
|
+
filter/ # PII/secret reference FilterEngine
|
|
60
|
+
token-vault/ # local encrypted TokenVault reference
|
|
61
|
+
audit/ # JSONL AuditSink, safe event schema
|
|
62
|
+
mcp/ # MCP Streamable HTTP proxy, stdio wrapper
|
|
63
|
+
llm/ # OpenAI-compatible HTTP adapter
|
|
64
|
+
grpc/ # protobuf/gRPC adapter skeleton
|
|
65
|
+
a2a/ # A2A adapter skeleton
|
|
66
|
+
cli/ # local demo and fixture runner
|
|
67
|
+
testing/ # conformance fixtures, negative tests
|
|
68
|
+
examples/
|
|
69
|
+
mcp-tool-protection/
|
|
70
|
+
llm-prompt-filtering/
|
|
71
|
+
custom-policy-engine/
|
|
72
|
+
custom-filter-engine/
|
|
73
|
+
custom-audit-sink/
|
|
74
|
+
docs/
|
|
75
|
+
current/
|
|
76
|
+
specs/
|
|
77
|
+
threat-model/
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
For the initial public release, `core`, `crypto`, `policy`, `filter`, `audit`, `mcp`, `llm`, `cli`, `testing`, and `examples` are sufficient. `grpc` and `a2a` can remain at the interface and skeleton level.
|
|
81
|
+
|
|
82
|
+
## 3.1 Adoption Modes
|
|
83
|
+
|
|
84
|
+
| Mode | Scope of change | When to use | Example |
|
|
85
|
+
|---|---|---|---|
|
|
86
|
+
| Local proxy | Almost no code changes | Quickly protect LLM HTTP or MCP Streamable HTTP | Change base URL to `http://localhost:1016` |
|
|
87
|
+
| SDK wrapper | Small code changes | Pass more precise in-app context | `haechi.protectMessage(...)` |
|
|
88
|
+
| Middleware | Insert into web/API server | Gateways like Express/Fastify/FastAPI | request/response hook |
|
|
89
|
+
| Sidecar | Deploy alongside self-hosted service | Container/server runtime environments | app -> sidecar -> provider |
|
|
90
|
+
| Protocol adapter | Per-protocol integration | MCP stdio, gRPC, A2A | adapter normalize/denormalize |
|
|
91
|
+
| Custom provider | Replace specific logic | In-house policy/filter/key management needed | custom `FilterEngine` |
|
|
92
|
+
|
|
93
|
+
Proxy mode is the top UX priority for the initial release. Requiring users to significantly rewrite existing apps before they can evaluate the value of the security module slows adoption.
|
|
94
|
+
|
|
95
|
+
The minimal configuration example is as follows:
|
|
96
|
+
|
|
97
|
+
```yaml
|
|
98
|
+
mode: proxy
|
|
99
|
+
target:
|
|
100
|
+
type: llm-http
|
|
101
|
+
upstream: https://api.openai.example/v1
|
|
102
|
+
policy:
|
|
103
|
+
preset:
|
|
104
|
+
- korean-pii
|
|
105
|
+
- secrets-only
|
|
106
|
+
- llm-redact
|
|
107
|
+
mode: dry-run
|
|
108
|
+
keys:
|
|
109
|
+
provider: local
|
|
110
|
+
keyFile: ./.haechi/dev.keys.json
|
|
111
|
+
audit:
|
|
112
|
+
sink: jsonl
|
|
113
|
+
path: ./.haechi/audit.jsonl
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
The initial command flow looks like:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
haechi init --preset mcp-basic --profile kr
|
|
120
|
+
haechi proxy --config haechi.yaml --dry-run
|
|
121
|
+
haechi report --audit ./.haechi/audit.jsonl
|
|
122
|
+
haechi test-plugin ./plugins/my-filter
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## 4. Core Pipeline
|
|
126
|
+
|
|
127
|
+
```text
|
|
128
|
+
ProtocolAdapter
|
|
129
|
+
|
|
|
130
|
+
v
|
|
131
|
+
Core Pipeline
|
|
132
|
+
|
|
|
133
|
+
+-- normalize input
|
|
134
|
+
+-- attach security context
|
|
135
|
+
+-- run FilterEngine.detect
|
|
136
|
+
+-- run PolicyEngine.decide
|
|
137
|
+
+-- transform payload
|
|
138
|
+
| +-- redact
|
|
139
|
+
| +-- mask
|
|
140
|
+
| +-- tokenize
|
|
141
|
+
| +-- encrypt
|
|
142
|
+
| +-- block
|
|
143
|
+
+-- emit AuditSink event
|
|
144
|
+
|
|
|
145
|
+
v
|
|
146
|
+
Protected protocol output
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
The pipeline must sit above protocol-specific implementations. MCP, LLM HTTP, gRPC, and A2A adapters must all share the same `SecurityContext`, `PolicyDecision`, `Detection`, and `AuditEvent` models.
|
|
150
|
+
|
|
151
|
+
## 5. Replaceable Provider Boundaries
|
|
152
|
+
|
|
153
|
+
| Provider | Responsibility | Default implementation | Why users replace it |
|
|
154
|
+
|---|---|---|---|
|
|
155
|
+
| `CryptoProvider` | Encrypt, decrypt, rewrap, envelope metadata validation | XChaCha20-Poly1305 or AES-GCM based envelope | Organization cipher format standards, JWE, HPKE, HSM integration |
|
|
156
|
+
| `KeyProvider` | Resolve key IDs, provide data keys/wrapping keys, rotation | Local software key | Vault, AWS KMS, GCP KMS, Azure Key Vault, HSM |
|
|
157
|
+
| `PolicyEngine` | Decide how to process payloads | JSON/YAML policy | OPA/Rego, CEL, custom ABAC/RBAC policies |
|
|
158
|
+
| `FilterEngine` | Detect PII/secrets and generate transform candidates | regex/checksum/dictionary | Custom privacy rules, NER, local classifier |
|
|
159
|
+
| `TokenVault` | Store tokenization originals, reveal, purge | Local encrypted vault | DB, organization vault, zero-retention tokenization |
|
|
160
|
+
| `AuditSink` | Record audit events without plaintext | JSON Lines | SIEM, OpenTelemetry-safe exporter, custom log pipeline |
|
|
161
|
+
| `ProtocolAdapter` | Normalize/denormalize protocol input/output | MCP/LLM reference adapter | In-house gateway, agent framework, custom socket |
|
|
162
|
+
| `ClassifierPlugin` | Semantic classification | None or local-only demo | Domain-specific sensitive data classifiers |
|
|
163
|
+
|
|
164
|
+
## 6. Interface Draft
|
|
165
|
+
|
|
166
|
+
Starting with TypeScript interfaces is practical for the initial implementation. A Python SDK sharing the same JSON-compatible request/response model is a realistic approach.
|
|
167
|
+
|
|
168
|
+
```ts
|
|
169
|
+
export interface HaechiProvider {
|
|
170
|
+
id: string;
|
|
171
|
+
version: string;
|
|
172
|
+
capabilities: ProviderCapabilities;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export interface CryptoProvider extends HaechiProvider {
|
|
176
|
+
encrypt(request: EncryptRequest): Promise<EnvelopeCiphertext>;
|
|
177
|
+
decrypt(request: DecryptRequest): Promise<PlaintextResult>;
|
|
178
|
+
rewrap?(request: RewrapRequest): Promise<EnvelopeCiphertext>;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export interface KeyProvider extends HaechiProvider {
|
|
182
|
+
resolveKey(request: KeyResolveRequest): Promise<KeyDescriptor>;
|
|
183
|
+
rotateKey?(request: KeyRotationRequest): Promise<KeyRotationResult>;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export interface PolicyEngine extends HaechiProvider {
|
|
187
|
+
decide(input: PolicyInput): Promise<PolicyDecision>;
|
|
188
|
+
validatePolicy?(bundle: PolicyBundle): Promise<PolicyValidationResult>;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export interface FilterEngine extends HaechiProvider {
|
|
192
|
+
detect(input: FilterInput): Promise<Detection[]>;
|
|
193
|
+
transform(input: TransformInput): Promise<TransformResult>;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export interface TokenVault extends HaechiProvider {
|
|
197
|
+
tokenize(input: TokenizeInput): Promise<TokenizeResult>;
|
|
198
|
+
reveal(input: RevealInput): Promise<RevealResult>;
|
|
199
|
+
purge(input: PurgeInput): Promise<PurgeResult>;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export interface AuditSink extends HaechiProvider {
|
|
203
|
+
record(event: AuditEvent): Promise<void>;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export interface ProtocolAdapter extends HaechiProvider {
|
|
207
|
+
normalize(input: ProtocolInput): Promise<NormalizedMessage>;
|
|
208
|
+
denormalize(output: ProtectedMessage): Promise<ProtocolOutput>;
|
|
209
|
+
}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## 7. Security Context
|
|
213
|
+
|
|
214
|
+
The context received by providers must be a canonical context, not protocol-specific raw metadata.
|
|
215
|
+
|
|
216
|
+
```ts
|
|
217
|
+
export interface SecurityContext {
|
|
218
|
+
tenantId?: string;
|
|
219
|
+
userId?: string;
|
|
220
|
+
agentId?: string;
|
|
221
|
+
sessionId?: string;
|
|
222
|
+
taskId?: string;
|
|
223
|
+
contextId?: string;
|
|
224
|
+
modelProvider?: string;
|
|
225
|
+
modelId?: string;
|
|
226
|
+
protocol: "mcp" | "llm-http" | "grpc" | "a2a" | "socket" | "custom";
|
|
227
|
+
operation: string;
|
|
228
|
+
resourceUri?: string;
|
|
229
|
+
toolName?: string;
|
|
230
|
+
region?: string;
|
|
231
|
+
policyVersion: string;
|
|
232
|
+
aad: CanonicalAad;
|
|
233
|
+
}
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
The key principle is that `SecurityContext` serves as the common basis for cryptographic AAD, policy evaluation, and audit events. The same payload must produce a different security decision and a different ciphertext when the tenant, task, tool, model, or policy version differs.
|
|
237
|
+
|
|
238
|
+
## 8. Plugin Manifest
|
|
239
|
+
|
|
240
|
+
A plugin must not merely register code. It must first declare what it is capable of doing.
|
|
241
|
+
|
|
242
|
+
```yaml
|
|
243
|
+
haechiPlugin:
|
|
244
|
+
id: example-custom-filter
|
|
245
|
+
version: 0.1.0
|
|
246
|
+
kind: filter-engine
|
|
247
|
+
runtime: node
|
|
248
|
+
entrypoint: ./dist/index.js
|
|
249
|
+
compatibility:
|
|
250
|
+
haechiCore: ">=0.1.0 <0.2.0"
|
|
251
|
+
capabilities:
|
|
252
|
+
readsPlaintext: true
|
|
253
|
+
writesPlaintext: false
|
|
254
|
+
networkEgress: false
|
|
255
|
+
fileWrite: false
|
|
256
|
+
auditWrite: false
|
|
257
|
+
externalSecrets: false
|
|
258
|
+
dataHandling:
|
|
259
|
+
storesPayload: false
|
|
260
|
+
retention: none
|
|
261
|
+
logsRawPayload: false
|
|
262
|
+
tests:
|
|
263
|
+
conformance: ./fixtures/conformance.json
|
|
264
|
+
negative: ./fixtures/negative.json
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
If a plugin requests a capability not declared in its manifest, loading is rejected. Fail-closed is the default for any plugin that cannot be verified.
|
|
268
|
+
|
|
269
|
+
## 9. Easy Replacement Usage Examples
|
|
270
|
+
|
|
271
|
+
Users should be able to keep the default filters as-is and add only a custom filter that catches their organization's internal project names, customer codes, and contract numbers.
|
|
272
|
+
|
|
273
|
+
```ts
|
|
274
|
+
import { createHaechi } from "@haechi/core";
|
|
275
|
+
import { referenceCrypto } from "@haechi/crypto";
|
|
276
|
+
import { localKeyProvider } from "@haechi/keys";
|
|
277
|
+
import { yamlPolicyEngine } from "@haechi/policy";
|
|
278
|
+
import { koreanPiiFilter } from "@haechi/filter";
|
|
279
|
+
import { jsonlAuditSink } from "@haechi/audit";
|
|
280
|
+
import { myInternalCodeFilter } from "./my-filter";
|
|
281
|
+
|
|
282
|
+
export const haechi = createHaechi({
|
|
283
|
+
crypto: referenceCrypto(),
|
|
284
|
+
keys: localKeyProvider({ keyFile: "./dev.keys.json" }),
|
|
285
|
+
policy: yamlPolicyEngine({ policyFile: "./haechi.policy.yaml" }),
|
|
286
|
+
filters: [
|
|
287
|
+
koreanPiiFilter(),
|
|
288
|
+
myInternalCodeFilter()
|
|
289
|
+
],
|
|
290
|
+
audit: jsonlAuditSink({ path: "./audit.jsonl" })
|
|
291
|
+
});
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
Another user can swap only the policy engine to OPA/Rego while keeping the rest as reference implementations.
|
|
295
|
+
|
|
296
|
+
```ts
|
|
297
|
+
export const haechi = createHaechi({
|
|
298
|
+
crypto: referenceCrypto(),
|
|
299
|
+
keys: localKeyProvider(),
|
|
300
|
+
policy: opaPolicyEngine({ bundlePath: "./policy-bundle" }),
|
|
301
|
+
filters: [koreanPiiFilter()],
|
|
302
|
+
audit: jsonlAuditSink()
|
|
303
|
+
});
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
## 10. Plugin Security Review Items
|
|
307
|
+
|
|
308
|
+
A plugin architecture provides extensibility but also introduces new attack surface. The following items are treated as test requirements starting from MVP.
|
|
309
|
+
|
|
310
|
+
| Item | Risk | Requirement |
|
|
311
|
+
|---|---|---|
|
|
312
|
+
| Plaintext access | filter, crypto, policy plugins read prompt/tool results | `readsPlaintext` must be declared in manifest |
|
|
313
|
+
| Network egress | classifier sends original content to an external endpoint | Blocked by default; opt-in also requires audit |
|
|
314
|
+
| Log leakage | plugin debug logs store original content | Raw payload logging prohibited — fixture test required |
|
|
315
|
+
| Policy bypass | custom policy weakens a hard block rule | Global emergency block priority is fixed |
|
|
316
|
+
| Audit tampering | plugin omits or alters audit events | Core generates the final audit event directly |
|
|
317
|
+
| Key misuse | custom crypto reuses a nonce or omits AAD | Must pass conformance negative tests |
|
|
318
|
+
| Supply chain | malicious dependency included | SBOM, dependency policy, signed release |
|
|
319
|
+
| Version drift | core and plugin schema mismatch | Compatibility range and schema validation |
|
|
320
|
+
|
|
321
|
+
## 11. Conformance Tests
|
|
322
|
+
|
|
323
|
+
To make provider replacement straightforward, tests must be part of the interface contract.
|
|
324
|
+
|
|
325
|
+
Required test categories:
|
|
326
|
+
|
|
327
|
+
- `golden`: Verify deterministic result structure for valid inputs
|
|
328
|
+
- `tamper`: Fail on AAD, ciphertext, or policy version tampering
|
|
329
|
+
- `cross-context`: Fail to decrypt under a different tenant/task/tool/model
|
|
330
|
+
- `replay`: Fail on nonce/session/stream sequence reuse
|
|
331
|
+
- `privacy-leak`: Audit/log/metric must not contain plaintext
|
|
332
|
+
- `policy-conflict`: Hard block takes priority over allow overrides
|
|
333
|
+
- `capability`: Fail when a capability outside the manifest is used
|
|
334
|
+
- `regional-profile`: Verify action differences across EU/US/KR profiles
|
|
335
|
+
- `custom-filter`: User rule conflicts, rollback, fixture-based validation
|
|
336
|
+
|
|
337
|
+
## 12. OSS Release Strategy
|
|
338
|
+
|
|
339
|
+
Starting with a small initial repository is preferable.
|
|
340
|
+
|
|
341
|
+
Recommended initial release artifacts:
|
|
342
|
+
|
|
343
|
+
- `README.md`: Problem statement, demo, installation, non-compliance disclaimer
|
|
344
|
+
- `SECURITY.md`: Vulnerability reporting, supported versions, prohibited claims
|
|
345
|
+
- `docs/threat-model/`: AI/MCP threat model
|
|
346
|
+
- `docs/specs/`: Envelope, policy, filter, and audit schemas
|
|
347
|
+
- `examples/`: MCP tool-call protection and LLM prompt filtering demo
|
|
348
|
+
- `packages/testing/`: Plugin conformance tests
|
|
349
|
+
- `LICENSE`: Apache-2.0 as the primary candidate
|
|
350
|
+
|
|
351
|
+
Apache-2.0 is the primary license candidate. The explicit patent grant makes it more favorable for enterprise and developer adoption in open-source security infrastructure. MIT is also viable if simplicity and permissive terms are the top priority.
|
|
352
|
+
|
|
353
|
+
## 13. Implementation Priorities for 0.1
|
|
354
|
+
|
|
355
|
+
| Order | Implementation | Reason |
|
|
356
|
+
|---:|---|---|
|
|
357
|
+
| 1 | `@haechi/core` pipeline and provider registry | The foundation of all replaceable structure |
|
|
358
|
+
| 2 | `PolicyEngine`, `FilterEngine`, `CryptoProvider` interfaces | The points users will most want to customize |
|
|
359
|
+
| 3 | Reference JSON/YAML policy | Easy-to-understand default policy |
|
|
360
|
+
| 4 | Korean PII/secret reference filter | Best demonstrates local adoptability and baseline protection coverage |
|
|
361
|
+
| 5 | Envelope crypto reference | Core demo of the encryption solution |
|
|
362
|
+
| 6 | MCP Streamable HTTP proxy | Proves the AI/MCP-specific positioning |
|
|
363
|
+
| 7 | OpenAI-compatible adapter | Proves LLM gateway adoptability |
|
|
364
|
+
| 8 | JSONL audit sink | Enables verification that no plaintext is exposed |
|
|
365
|
+
| 9 | Conformance/negative tests | Establishes credibility as a security project |
|
|
366
|
+
| 10 | Custom filter/policy examples | Proves in practice that replacement is easy |
|
|
367
|
+
|
|
368
|
+
## 14. Open Decisions
|
|
369
|
+
|
|
370
|
+
- Whether to fix interfaces as TypeScript-first, or define JSON Schema/IDL first
|
|
371
|
+
- Whether the reference crypto format should be JWE or a compact custom envelope
|
|
372
|
+
- Whether to start the policy language as a custom YAML or prioritize CEL/OPA compatibility
|
|
373
|
+
- Whether plugin sandboxing should go as far as Node process isolation, or start with manifest and test gates
|
|
374
|
+
- Whether to include a Python SDK in 0.1 or defer to 0.2
|
|
375
|
+
- Whether to choose Apache-2.0 or MIT
|
|
376
|
+
|
|
377
|
+
## 15. Conclusion
|
|
378
|
+
|
|
379
|
+
This direction is better suited to open-source distribution and self-hosted adoption than a SaaS model. Rather than making the feature set look large, a stronger project signal is a small core that actually protects MCP/LLM payloads and ensures that the same security tests pass even when users swap out policy, filter, or crypto components.
|
|
380
|
+
|
|
381
|
+
An appropriate initial tagline:
|
|
382
|
+
|
|
383
|
+
```text
|
|
384
|
+
AI context protection toolkit for MCP and LLM apps.
|
|
385
|
+
Pluggable crypto, policy, privacy filtering, and audit.
|
|
386
|
+
Self-hosted by default. No SaaS required.
|
|
387
|
+
```
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
# PRD: AI/LLM/MCP 특화 암호화 솔루션
|
|
2
|
+
|
|
3
|
+
- 문서 상태: Draft 0.1
|
|
4
|
+
- 작성일: 2026-06-08
|
|
5
|
+
- 제품명: Haechi
|
|
6
|
+
- 기준: 초기 PRD/SRS/보안검토 아카이브를 AI/LLM/MCP 특화 방향으로 재정렬
|
|
7
|
+
|
|
8
|
+
## 1. 목적
|
|
9
|
+
|
|
10
|
+
Haechi는 AI 애플리케이션, LLM gateway, MCP client/server, agent runtime, A2A agent network에서 오가는 prompt, context, tool-call, resource, retrieval snippet, artifact, streaming event를 보호하는 암호화 솔루션이다.
|
|
11
|
+
|
|
12
|
+
핵심 목적은 단순 전송구간 보호가 아니라, AI 워크플로우의 의미 단위인 `message`, `tool call`, `resource`, `task`, `context`, `artifact`, `agent identity`를 암호화 정책과 키 관리의 단위로 끌어올리는 것이다.
|
|
13
|
+
|
|
14
|
+
초기 제품 형태는 SaaS가 아니라 오픈소스/self-hosted 보안 인프라다. 사용자는 Haechi를 라이브러리, CLI, sidecar proxy, MCP wrapper 형태로 자기 AI 애플리케이션에 붙이고, 암호화 방식, 정책 평가, 개인정보 필터링, 감사 저장소를 자기 환경에 맞게 갈아끼울 수 있어야 한다.
|
|
15
|
+
|
|
16
|
+
## 2. 배경
|
|
17
|
+
|
|
18
|
+
일반 TLS는 client와 server 사이의 전송 채널을 보호한다. 그러나 LLM/agent 시스템에서는 다음 지점에서 평문 노출이 반복된다.
|
|
19
|
+
|
|
20
|
+
- LLM gateway, prompt router, observability pipeline
|
|
21
|
+
- MCP client와 server 사이의 JSON-RPC message
|
|
22
|
+
- MCP tool input/output, resource content, prompt template
|
|
23
|
+
- RAG retrieval snippet과 vector metadata
|
|
24
|
+
- A2A agent message, task state, artifact
|
|
25
|
+
- gRPC streaming chunk와 metadata
|
|
26
|
+
- agent tool-call 로그, trace, replay record
|
|
27
|
+
- model provider 전송 전후의 prompt/context 변환 지점
|
|
28
|
+
|
|
29
|
+
Haechi는 이런 AI-native 데이터 단위를 정책 기반으로 암호화, 토큰화, redaction, 권한 평가, 감사하는 계층이다.
|
|
30
|
+
|
|
31
|
+
개인정보 필터링은 Haechi의 핵심 기능이다. 암호화는 데이터를 보호하지만, 모델이나 tool에 평문으로 공개되는 순간에는 별도 통제가 필요하다. Haechi는 prompt, context, MCP tool input/output, resource, retrieval snippet, generated artifact에서 개인정보를 탐지하고 `allow`, `redact`, `mask`, `tokenize`, `encrypt`, `block`, `human-review` 중 하나로 처리한다.
|
|
32
|
+
|
|
33
|
+
## 3. 제품 포지셔닝
|
|
34
|
+
|
|
35
|
+
Haechi는 범용 보안솔루션, LLM gateway, MCP framework, agent framework를 대체하지 않는다. AI/LLM/MCP 대상 솔루션에 추가 장착되는 암호화 및 context protection module이다.
|
|
36
|
+
|
|
37
|
+
상용화나 SaaS control plane은 초기 목표가 아니다. 초기 포지셔닝은 "작지만 검증 가능한 OSS core + 교체 가능한 reference engine + 실사용 가능한 AI/MCP 예제"다. Haechi가 제공하는 기본 구현은 정답이 아니라 기준 구현이며, 사용자는 `CryptoProvider`, `PolicyEngine`, `FilterEngine`, `KeyProvider`, `AuditSink` 같은 경계를 통해 자체 구현을 주입할 수 있어야 한다.
|
|
38
|
+
|
|
39
|
+
| 대상 솔루션 | 적용 방식 |
|
|
40
|
+
|---|---|
|
|
41
|
+
| LLM gateway | OpenAI-compatible/Anthropic-compatible HTTP adapter 또는 middleware |
|
|
42
|
+
| MCP host/client | MCP client proxy, SDK wrapper, policy interceptor |
|
|
43
|
+
| MCP server | tool/resource/prompt response encryption wrapper |
|
|
44
|
+
| Agent runtime | task/context/artifact scoped encryption |
|
|
45
|
+
| A2A server/client | AgentCard 검증, message/task/artifact 암호화 adapter |
|
|
46
|
+
| gRPC AI service | protobuf field encryption, streaming message protection |
|
|
47
|
+
| RAG pipeline | retrieval snippet, source metadata, artifact encryption |
|
|
48
|
+
| Observability platform | prompt/tool/result redaction, sealed audit event |
|
|
49
|
+
|
|
50
|
+
## 4. 핵심 차별점
|
|
51
|
+
|
|
52
|
+
- AI 의미 단위 보호: prompt, system message, tool args, tool result, MCP resource, A2A artifact를 별도 보호 대상으로 취급한다.
|
|
53
|
+
- Context-bound encryption: tenant, user, agent, model, task, context, tool, resource URI를 AAD와 복호화 권한 평가에 포함한다.
|
|
54
|
+
- Policy before model: 어떤 정보가 모델에 평문으로 공개될 수 있는지 정책으로 결정한다.
|
|
55
|
+
- Selective reveal: 모델이 반드시 알아야 하는 부분만 평문으로 공개하고 나머지는 토큰화 또는 암호문으로 유지한다.
|
|
56
|
+
- MCP/A2A native: JSON-RPC id, method, session id, task id, artifact id, AgentCard, streaming event를 정책 context로 사용한다.
|
|
57
|
+
- Observability-safe: 로그, trace, metric, replay artifact에 prompt와 tool output이 평문으로 남지 않도록 한다.
|
|
58
|
+
- Privacy filtering first: 모델, agent, tool, 로그로 전달되기 전에 개인정보를 먼저 탐지하고 정책을 적용한다.
|
|
59
|
+
- Easy adoption: 기존 AI 애플리케이션을 크게 수정하지 않고 proxy, middleware, SDK wrapper, sidecar, config preset으로 붙일 수 있어야 한다.
|
|
60
|
+
|
|
61
|
+
## 5. 비목표
|
|
62
|
+
|
|
63
|
+
- LLM이 암호문을 직접 이해하게 만드는 범용 암호기법은 목표가 아니다.
|
|
64
|
+
- 완전동형암호 기반 LLM 추론은 MVP 범위가 아니다.
|
|
65
|
+
- 모든 외부 LLM provider에 대해 종단간 비가시성을 보장한다고 주장하지 않는다.
|
|
66
|
+
- prompt injection 자체를 완전히 방지한다고 주장하지 않는다.
|
|
67
|
+
- MCP 또는 A2A protocol 자체를 대체하지 않는다.
|
|
68
|
+
- 초기 버전에서 hosted SaaS, multi-tenant control plane, 과금, SLA, 영업용 compliance pack을 제공하지 않는다.
|
|
69
|
+
- 자체 암호 primitive를 발명하지 않는다. 검증된 표준과 라이브러리를 조합하고, 구현 경계를 테스트한다.
|
|
70
|
+
|
|
71
|
+
## 6. 사용자군
|
|
72
|
+
|
|
73
|
+
| 사용자군 | 요구 |
|
|
74
|
+
|---|---|
|
|
75
|
+
| AI 플랫폼 보안책임자 | prompt/context/tool-call 평문 노출 최소화 |
|
|
76
|
+
| LLM gateway 운영자 | provider별 policy, redaction, encryption, audit |
|
|
77
|
+
| MCP 서버 개발자 | tool input/output과 resource content 보호 |
|
|
78
|
+
| Agent framework 개발자 | task/context/artifact 단위 암호화 |
|
|
79
|
+
| RAG 운영자 | retrieval snippet과 source metadata 보호 |
|
|
80
|
+
| 준법/감사 담당자 | 누가 어떤 context를 어떤 모델/agent/tool에 공개했는지 추적 |
|
|
81
|
+
| 개인정보보호 책임자 | 개인정보, 고유식별정보, 민감정보의 AI 처리 전 필터링과 공개 범위 통제 |
|
|
82
|
+
| 오픈소스 도입 개발자 | 기본 구현을 참고하되 crypto, policy, filtering, audit 구현을 쉽게 교체 |
|
|
83
|
+
| OSS 기여자/리뷰어 | 작은 범위에서도 보안 설계, 테스트, 문서화 수준이 검증된 프로젝트 확인 |
|
|
84
|
+
|
|
85
|
+
## 7. 비즈니스 요구사항
|
|
86
|
+
|
|
87
|
+
| ID | 요구사항 | 우선순위 | 검증 |
|
|
88
|
+
|---|---|---:|---|
|
|
89
|
+
| BR-AI-001 | 제품은 AI/LLM/MCP 대상 솔루션에 추가 장착 가능한 암호화 모듈로 제공되어야 한다. | Must | PoC |
|
|
90
|
+
| BR-AI-002 | 제품은 prompt, context, tool-call, resource, artifact의 평문 노출 지점을 줄여야 한다. | Must | threat model |
|
|
91
|
+
| BR-AI-003 | 제품은 MCP stdio와 Streamable HTTP를 모두 고려한 adapter 전략을 제공해야 한다. | Must | MCP PoC |
|
|
92
|
+
| BR-AI-004 | 제품은 gRPC streaming과 A2A message/task/artifact 보호를 지원해야 한다. | Should | protocol PoC |
|
|
93
|
+
| BR-AI-005 | 제품은 외부 LLM provider 사용 시 평문 공개 범위를 정책적으로 제어해야 한다. | Must | policy test |
|
|
94
|
+
| BR-AI-006 | 제품은 로그, trace, replay, metric에서 AI 민감정보를 제거하거나 봉인해야 한다. | Must | observability test |
|
|
95
|
+
| BR-AI-007 | 제품은 KMS/HSM/Vault 기반 키 관리와 tenant/agent/task 단위 key separation을 지원해야 한다. | Must | key test |
|
|
96
|
+
| BR-AI-008 | 제품은 개인정보, 고유식별정보, 민감정보, credential, secret을 모델/tool/agent 공개 전에 탐지하고 정책적으로 처리해야 한다. | Must | privacy filtering test |
|
|
97
|
+
| BR-AI-009 | 제품은 한국 개인정보 환경을 고려한 탐지 규칙과 고객별 custom entity rule을 지원해야 한다. | Should | Korean PII fixture test |
|
|
98
|
+
| BR-AI-010 | 제품은 한국, EU/UK, 미국, 일본, 싱가포르, 캐나다, 브라질 등 주요 시장의 개인정보 규제 프로파일을 정책으로 선택할 수 있어야 한다. | Must | regional profile test |
|
|
99
|
+
| BR-AI-011 | 제품은 cross-border transfer, data residency, subprocessors, model provider region을 정책 결정 context에 포함해야 한다. | Must | transfer policy test |
|
|
100
|
+
| BR-AI-012 | 제품은 정보주체 권리 대응, 감사, DPIA/PIA, DSAR export를 지원할 수 있는 decision record와 data flow evidence를 남겨야 한다. | Should | audit evidence review |
|
|
101
|
+
| BR-AI-013 | 제품은 고객/tenant별 커스텀 필터링 규칙, dictionary, classifier, action override를 지원해야 한다. | Must | custom filter test |
|
|
102
|
+
| BR-AI-014 | 제품은 AAD canonicalization, nonce/replay 방어, key lifecycle, signed policy distribution을 암호 보안의 1급 요구사항으로 제공해야 한다. | Must | crypto negative test |
|
|
103
|
+
| BR-AI-015 | 제품은 MCP, A2A, gRPC, LLM gateway adapter별 transport, auth, lifecycle, metadata scrub 보안 계약을 정의해야 한다. | Must | protocol contract test |
|
|
104
|
+
| BR-AI-016 | 제품은 hosted SaaS 의존 없이 library, CLI, local proxy, self-hosted sidecar로 사용할 수 있어야 하며 key custody와 telemetry 경계를 명시해야 한다. | Must | deployment review |
|
|
105
|
+
| BR-AI-017 | 제품은 상용 evidence pack보다 OSS 신뢰 자료를 우선 제공해야 한다: `SECURITY.md`, threat model, conformance test, SBOM, signed release artifact, 보안 테스트 결과. | Must | OSS trust review |
|
|
106
|
+
| BR-AI-018 | 제품은 plaintext leak, policy conflict, KMS fault, replay, region-deny, custom DSL bypass를 build-blocking security test로 검증해야 한다. | Must | CI gate test |
|
|
107
|
+
| BR-AI-019 | 제품은 암호화, 키 관리, 정책 평가, 개인정보 필터링, token vault, audit, protocol adapter를 교체 가능한 provider interface로 분리해야 한다. | Must | plugin boundary review |
|
|
108
|
+
| BR-AI-020 | 제품은 기본 reference implementation을 제공하되 사용자가 자체 구현을 주입할 수 있는 dependency injection, plugin manifest, compatibility contract를 제공해야 한다. | Must | plugin conformance test |
|
|
109
|
+
| BR-AI-021 | 제품은 plugin이 평문 접근, 네트워크 송신, 파일 쓰기, audit 기록 같은 capability를 명시하고 fail-closed 정책으로 평가되도록 해야 한다. | Must | plugin security test |
|
|
110
|
+
| BR-AI-022 | 제품은 기존 AI/LLM/MCP 대상 솔루션에 낮은 변경 비용으로 적용되어야 하며, 5분 local demo, 30분 MCP/LLM PoC, 1일 내 custom filter PoC를 목표로 해야 한다. | Must | adoption test |
|
|
111
|
+
| BR-AI-023 | 제품은 보안 기본값을 유지하면서도 `init`, preset policy, dry-run, report-only mode, copy-paste middleware 예제로 적용 장벽을 낮춰야 한다. | Must | quickstart review |
|
|
112
|
+
|
|
113
|
+
## 8. 제품 요구사항
|
|
114
|
+
|
|
115
|
+
| ID | 요구사항 | 우선순위 |
|
|
116
|
+
|---|---|---:|
|
|
117
|
+
| PRD-AI-001 | 제품은 prompt message role별 암호화, redaction, tokenization 정책을 지원해야 한다. | Must |
|
|
118
|
+
| PRD-AI-002 | 제품은 MCP JSON-RPC method별 정책을 지원해야 한다. | Must |
|
|
119
|
+
| PRD-AI-003 | 제품은 MCP tool input/output, resource content, prompt template을 보호 대상으로 분류해야 한다. | Must |
|
|
120
|
+
| PRD-AI-004 | 제품은 A2A agent id, task id, context id, artifact id를 암호화 AAD와 복호화 권한 평가에 포함해야 한다. | Should |
|
|
121
|
+
| PRD-AI-005 | 제품은 gRPC protobuf field encryption과 opaque message encryption을 모두 지원 가능한 구조를 가져야 한다. | Should |
|
|
122
|
+
| PRD-AI-006 | 제품은 streaming chunk별 nonce와 stream/session binding을 지원해야 한다. | Should |
|
|
123
|
+
| PRD-AI-007 | 제품은 모델 provider로 평문을 보내기 전 policy decision record를 남겨야 한다. | Must |
|
|
124
|
+
| PRD-AI-008 | 제품은 prompt/tool/resource/artifact 로그를 기본 redaction 처리해야 한다. | Must |
|
|
125
|
+
| PRD-AI-009 | 제품은 customer-managed key와 provider-managed key를 구분해야 한다. | Must |
|
|
126
|
+
| PRD-AI-010 | 제품은 MCP/A2A discovery metadata의 신뢰 검증과 allowlist를 지원해야 한다. | Should |
|
|
127
|
+
| PRD-AI-011 | 제품은 deterministic rule, checksum validation, dictionary/NER, pluggable classifier를 조합한 개인정보 필터링 pipeline을 제공해야 한다. | Must |
|
|
128
|
+
| PRD-AI-012 | 제품은 주민등록번호, 외국인등록번호, 여권번호, 운전면허번호, 휴대전화번호, 이메일, 주소, 계좌번호, 카드번호, 건강정보, 생체정보, 인증정보, API key/secret을 기본 탐지 대상으로 포함해야 한다. | Must |
|
|
129
|
+
| PRD-AI-013 | 제품은 개인정보 탐지 결과별 처리방식을 `redact`, `mask`, `tokenize`, `encrypt`, `block`, `human-review`로 지정할 수 있어야 한다. | Must |
|
|
130
|
+
| PRD-AI-014 | 제품은 모델 호출 전 pre-filter와 모델/tool 응답 후 post-filter를 모두 지원해야 한다. | Must |
|
|
131
|
+
| PRD-AI-015 | 제품은 필터링 결과의 원문을 로그에 남기지 않고 entity type, confidence, rule id, action, decision id만 감사해야 한다. | Must |
|
|
132
|
+
| PRD-AI-016 | 제품은 regional privacy profile을 통해 탐지 카탈로그, 기본 action, transfer rule, retention rule, audit field를 전환할 수 있어야 한다. | Must |
|
|
133
|
+
| PRD-AI-017 | 제품은 GDPR/UK GDPR의 personal data, special category data, pseudonymisation, international transfer 요구를 정책 항목으로 표현할 수 있어야 한다. | Must |
|
|
134
|
+
| PRD-AI-018 | 제품은 CCPA/CPRA의 sensitive personal information과 limit-use 요구를 정책 항목으로 표현할 수 있어야 한다. | Should |
|
|
135
|
+
| PRD-AI-019 | 제품은 HIPAA PHI와 PCI cardholder data를 sector profile로 분리해 탐지, redaction, tokenization, logging 금지 정책을 적용할 수 있어야 한다. | Should |
|
|
136
|
+
| PRD-AI-020 | 제품은 global deployment에서 tenant별 data residency와 model provider region allowlist를 강제할 수 있어야 한다. | Must |
|
|
137
|
+
| PRD-AI-021 | 제품은 regex, checksum validator, keyword dictionary, deny/allow list, JSONPath/protobuf path, semantic classifier를 조합한 custom filter DSL을 제공해야 한다. | Must |
|
|
138
|
+
| PRD-AI-022 | 제품은 custom filter rule의 draft, validate, test, approve, publish, rollback lifecycle을 지원해야 한다. | Must |
|
|
139
|
+
| PRD-AI-023 | 제품은 custom filter rule 충돌 시 global profile, sector profile, tenant rule, app rule, emergency rule의 우선순위를 명확히 적용해야 한다. | Must |
|
|
140
|
+
| PRD-AI-024 | 제품은 고객이 제공한 custom dictionary와 fixture를 암호화 저장하고 audit 가능한 접근통제를 적용해야 한다. | Should |
|
|
141
|
+
| PRD-AI-025 | 제품은 custom classifier plugin을 local-only, customer-managed endpoint, external endpoint 중 하나로 배포할 수 있어야 한다. | Should |
|
|
142
|
+
| PRD-AI-026 | 제품은 암호화 AAD를 canonical JSON, Unicode normalization, tenant/user/agent/model/task/tool/resource/policy version으로 고정해야 한다. | Must |
|
|
143
|
+
| PRD-AI-027 | 제품은 streaming chunk, retry, cancellation, partial delivery에서 nonce uniqueness, stream sequence, replay cache를 강제해야 한다. | Must |
|
|
144
|
+
| PRD-AI-028 | 제품은 key 생성, rotation, rewrap, retirement, destruction evidence, backup/restore drill을 key lifecycle로 관리해야 한다. | Must |
|
|
145
|
+
| PRD-AI-029 | 제품은 token vault의 retention, deletion, DSAR export, re-identification approval, access audit을 지원해야 한다. | Must |
|
|
146
|
+
| PRD-AI-030 | 제품은 policy bundle 서명, version pinning, emergency block, fail-closed validation, stale policy rejection을 지원해야 한다. | Must |
|
|
147
|
+
| PRD-AI-031 | 제품은 MCP authorization, token passthrough 금지, per-client consent, stdio credential handling, protocol version negotiation을 검증해야 한다. | Must |
|
|
148
|
+
| PRD-AI-032 | 제품은 A2A AgentCard signature, authenticated extended card, transport parity, push notification security를 검증해야 한다. | Should |
|
|
149
|
+
| PRD-AI-033 | 제품은 OpenTelemetry baggage, span attribute, metric label, exception, crash dump, replay artifact에서 원문 민감정보를 제거해야 한다. | Must |
|
|
150
|
+
| PRD-AI-034 | 제품은 provider-neutral LLM message schema와 provider adapter mapping을 가져야 한다. | Should |
|
|
151
|
+
| PRD-AI-035 | 제품은 RAG/vector namespace, embedding/source metadata, citation, index deletion propagation 정책을 지원해야 한다. | Should |
|
|
152
|
+
| PRD-AI-036 | 제품은 agent memory를 ephemeral/durable로 구분하고 TTL, purge, export, cross-task recall 차단을 지원해야 한다. | Should |
|
|
153
|
+
| PRD-AI-037 | 제품은 tenant별 config store, audit sink, quota, admin RBAC, blast-radius 제한을 제공해야 한다. | Must |
|
|
154
|
+
| PRD-AI-038 | 제품은 SBOM, artifact signing, provenance, dependency vulnerability policy, classifier/plugin trust policy를 제공해야 한다. | Should |
|
|
155
|
+
| PRD-AI-039 | 제품은 `CryptoProvider` interface를 통해 envelope encryption, decrypt, rewrap, key id resolution을 교체 가능하게 제공해야 한다. | Must |
|
|
156
|
+
| PRD-AI-040 | 제품은 `KeyProvider` interface를 통해 local key, Vault, KMS, HSM, test key provider를 동일 계약으로 연결할 수 있어야 한다. | Must |
|
|
157
|
+
| PRD-AI-041 | 제품은 `PolicyEngine` interface를 통해 JSON/YAML reference policy 외에 CEL, OPA/Rego, 사용자 자체 정책 엔진을 연결할 수 있어야 한다. | Must |
|
|
158
|
+
| PRD-AI-042 | 제품은 `FilterEngine` interface를 통해 rule/checksum/dictionary 기반 reference filter와 사용자 자체 classifier를 교체할 수 있어야 한다. | Must |
|
|
159
|
+
| PRD-AI-043 | 제품은 `TokenVault` interface를 통해 local encrypted vault, DB-backed vault, external vault를 교체할 수 있어야 한다. | Should |
|
|
160
|
+
| PRD-AI-044 | 제품은 `AuditSink` interface를 통해 JSONL, OpenTelemetry-safe exporter, SIEM webhook, custom sink를 교체할 수 있어야 한다. | Must |
|
|
161
|
+
| PRD-AI-045 | 제품은 `ProtocolAdapter` interface를 통해 MCP, LLM HTTP, gRPC, A2A adapter가 같은 protect/reveal pipeline을 사용하도록 해야 한다. | Must |
|
|
162
|
+
| PRD-AI-046 | 제품은 모든 provider/plugin에 대해 golden fixture, negative fixture, capability manifest, compatibility version test를 제공해야 한다. | Must |
|
|
163
|
+
| PRD-AI-047 | 제품은 기존 코드를 거의 수정하지 않는 local proxy mode를 제공해야 한다. 사용자는 target base URL과 policy file만 지정해 LLM/MCP 요청을 우회시킬 수 있어야 한다. | Must |
|
|
164
|
+
| PRD-AI-048 | 제품은 10줄 이내의 SDK wrapper/middleware 예제로 Node와 Python AI 앱에 적용할 수 있어야 한다. | Must |
|
|
165
|
+
| PRD-AI-049 | 제품은 `haechi init` 또는 동등한 CLI로 sample policy, local key, audit path, MCP/LLM preset을 생성해야 한다. | Must |
|
|
166
|
+
| PRD-AI-050 | 제품은 `dry-run` 또는 `report-only` mode를 제공해 실제 차단/암호화 전에 어떤 prompt/tool/resource가 탐지될지 확인할 수 있어야 한다. | Must |
|
|
167
|
+
| PRD-AI-051 | 제품은 기본 preset을 제공해야 한다: `mcp-basic`, `llm-redact`, `korean-pii`, `secrets-only`, `local-only`, `strict-block`. | Must |
|
|
168
|
+
| PRD-AI-052 | 제품은 사용자가 `CryptoProvider`, `PolicyEngine`, `FilterEngine`, `AuditSink`를 코드 수정 없이 config에서 교체할 수 있는 경로를 제공해야 한다. | Should |
|
|
169
|
+
| PRD-AI-053 | 제품은 적용 실패 시 원문 유출보다 요청 차단을 우선하되, 개발 모드에서는 원인과 수정 방법을 평문 데이터 없이 설명해야 한다. | Must |
|
|
170
|
+
|
|
171
|
+
## 9. MVP 범위
|
|
172
|
+
|
|
173
|
+
MVP는 좁게 시작한다.
|
|
174
|
+
|
|
175
|
+
실제 0.1 구현 범위는 `docs/current/mvp-0.1-implementation-scope.md`를 기준으로 한다. 아래 항목 중 Python SDK, Vault/KMS adapter, MCP stdio wrapper, RAG sample은 0.1 이후로 넘길 수 있다.
|
|
176
|
+
|
|
177
|
+
- TypeScript/Node SDK
|
|
178
|
+
- Python SDK
|
|
179
|
+
- core provider interface package
|
|
180
|
+
- plugin manifest schema
|
|
181
|
+
- provider conformance test harness
|
|
182
|
+
- local CLI demo
|
|
183
|
+
- one-command `init` quickstart
|
|
184
|
+
- dry-run/report-only mode
|
|
185
|
+
- copy-paste Node/Python middleware examples
|
|
186
|
+
- MCP/LLM preset policy files
|
|
187
|
+
- MCP Streamable HTTP proxy
|
|
188
|
+
- MCP stdio wrapper
|
|
189
|
+
- OpenAI-compatible HTTP request/response adapter
|
|
190
|
+
- prompt/tool/resource redaction and envelope encryption
|
|
191
|
+
- 개인정보 필터링 pipeline
|
|
192
|
+
- 한국 개인정보 기본 탐지 규칙
|
|
193
|
+
- Vault 또는 AWS KMS adapter 중 1개
|
|
194
|
+
- local software key provider
|
|
195
|
+
- JSON policy file
|
|
196
|
+
- audit event JSON Lines
|
|
197
|
+
- MCP tool-call sample
|
|
198
|
+
- RAG snippet protection sample
|
|
199
|
+
- reference `CryptoProvider`, `PolicyEngine`, `FilterEngine`, `KeyProvider`, `AuditSink`
|
|
200
|
+
|
|
201
|
+
MVP에서 제외한다.
|
|
202
|
+
|
|
203
|
+
- 완전동형암호 또는 암호문 LLM 추론
|
|
204
|
+
- 모든 LLM provider native SDK 지원
|
|
205
|
+
- KCMVP provider 내장
|
|
206
|
+
- A2A full server implementation
|
|
207
|
+
- gRPC bidirectional streaming production adapter
|
|
208
|
+
- GUI 관리 콘솔
|
|
209
|
+
- hosted SaaS control plane
|
|
210
|
+
- 과금, tenant admin portal, SLA
|
|
211
|
+
- SOC 2/ISO 상용 evidence pack
|
|
212
|
+
|
|
213
|
+
## 10. 핵심 보안 원칙
|
|
214
|
+
|
|
215
|
+
- 모델이 처리해야 하는 값과 모델이 볼 필요가 없는 값을 분리한다.
|
|
216
|
+
- 개인정보는 모델 공개 전에 먼저 분류하고, 공개 목적이 명확하지 않으면 기본 차단 또는 tokenization한다.
|
|
217
|
+
- 모델 provider에 평문으로 공개한 데이터는 더 이상 Haechi만으로 비가시성을 보장할 수 없다고 명시한다.
|
|
218
|
+
- tool-call과 resource 결과는 기본적으로 민감정보로 취급한다.
|
|
219
|
+
- agent/task/context 경계를 AAD와 복호화 권한에 포함한다.
|
|
220
|
+
- observability pipeline은 제품의 1급 보안 경계로 취급한다.
|
|
221
|
+
- prompt injection 방어와 암호화는 별도 통제이며, 어느 하나가 다른 하나를 대체하지 않는다.
|
|
222
|
+
- 교체 가능한 provider/plugin은 신뢰 경계다. 평문 접근, 네트워크 송신, 파일 쓰기, audit 조작 가능성을 capability로 드러내고 테스트한다.
|
|
223
|
+
- reference implementation은 사용자가 바꿀 수 있어야 하지만, conformance test와 보안 negative test는 바꾸지 않는 기준선으로 유지한다.
|
|
224
|
+
|
|
225
|
+
## 11. 미결정 사항
|
|
226
|
+
|
|
227
|
+
- MCP adapter를 proxy 우선으로 만들지 SDK wrapper 우선으로 만들지 결정해야 한다.
|
|
228
|
+
- OpenAI-compatible API를 1차 LLM adapter로 둘지 provider-agnostic schema를 먼저 만들지 결정해야 한다.
|
|
229
|
+
- RAG vector search에서 embedding 자체를 보호할지, source text와 metadata 보호에 집중할지 결정해야 한다.
|
|
230
|
+
- A2A는 adapter 수준으로 둘지 full protocol gateway로 갈지 결정해야 한다.
|
|
231
|
+
- confidential computing/TEE를 2차 로드맵에 포함할지 결정해야 한다.
|
|
232
|
+
- 개인정보 탐지에서 ML/LLM classifier를 사용할 경우 그 classifier 자체에 개인정보를 평문 전송할지 여부를 결정해야 한다.
|
|
233
|
+
- 주민등록번호 등 고위험 식별자는 기본 block으로 둘지, 고객 정책에 따라 tokenization을 허용할지 결정해야 한다.
|
|
234
|
+
- EU/UK 데이터에 대해 SCC/IDTA 등 transfer mechanism 검증을 제품이 evidence로만 지원할지, policy enforcement까지 할지 결정해야 한다.
|
|
235
|
+
- HIPAA/PCI 같은 sector profile을 MVP에 포함할지 후순위 예제로 둘지 결정해야 한다.
|
|
236
|
+
- custom filter DSL을 제품 자체 문법으로 만들지, OPA/Rego 또는 CEL 같은 기존 정책 언어를 부분 채택할지 결정해야 한다.
|
|
237
|
+
- custom classifier plugin이 외부 endpoint를 호출할 때 개인정보 전송을 기본 금지할지 customer opt-in으로 둘지 결정해야 한다.
|
|
238
|
+
- provider/plugin API를 TypeScript 우선으로 안정화한 뒤 Python에 맞출지, 언어 중립 IDL을 먼저 둘지 결정해야 한다.
|
|
239
|
+
- 오픈소스 라이선스를 Apache-2.0으로 둘지 MIT로 둘지 결정해야 한다.
|
|
240
|
+
|
|
241
|
+
## 12. 참고
|
|
242
|
+
|
|
243
|
+
- Model Context Protocol Specification, latest: https://modelcontextprotocol.io/specification/
|
|
244
|
+
- Model Context Protocol Authorization: https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization
|
|
245
|
+
- Model Context Protocol Security Best Practices: https://modelcontextprotocol.io/docs/tutorials/security/security_best_practices
|
|
246
|
+
- Model Context Protocol official repository: https://github.com/modelcontextprotocol/modelcontextprotocol
|
|
247
|
+
- NSA MCP Security Design Considerations: https://www.nsa.gov/Portals/75/documents/Cybersecurity/CSI_MCP_SECURITY.pdf
|
|
248
|
+
- NSA/Five Eyes Careful Adoption of Agentic AI Services: https://media.defense.gov/2026/Apr/30/2003922823/-1/-1/0/CAREFUL%20ADOPTION%20OF%20AGENTIC%20AI%20SERVICES_FINAL.PDF
|
|
249
|
+
- A2A Agent2Agent Protocol: https://a2a-protocol.org/latest/specification/
|
|
250
|
+
- gRPC Core Concepts: https://grpc.io/docs/what-is-grpc/core-concepts/
|
|
251
|
+
- 개인정보의 안전성 확보조치 기준: https://law.go.kr/LSW/admRulInfoP.do?admRulSeq=2100000192069&chrClsCd=010201
|
|
252
|
+
- KISA 암호이용 FAQ: https://seed.kisa.or.kr/kisa/bbs/faq.do
|
|
253
|
+
- European Commission GDPR overview: https://commission.europa.eu/law/law-topic/data-protection/reform/what-does-general-data-protection-regulation-gdpr-govern_en
|
|
254
|
+
- European Commission Standard Contractual Clauses: https://commission.europa.eu/law/law-topic/data-protection/international-dimension-data-protection/standard-contractual-clauses-scc_en
|
|
255
|
+
- California CCPA: https://www.oag.ca.gov/privacy/ccpa
|
|
256
|
+
- HHS HIPAA Privacy Rule: https://www.hhs.gov/hipaa/for-professionals/privacy/index.html
|
|
257
|
+
- NIST Privacy Framework: https://www.nist.gov/privacy-framework
|
|
258
|
+
- RFC 8446, TLS 1.3
|
|
259
|
+
- RFC 7516, JSON Web Encryption
|
|
260
|
+
- RFC 9180, Hybrid Public Key Encryption
|