@ai-pip/core 0.4.0 → 0.5.0

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.
Files changed (88) hide show
  1. package/CHANGELOG.md +35 -1
  2. package/README.md +5 -2
  3. package/dist/isl/index.d.ts +2 -0
  4. package/dist/isl/index.d.ts.map +1 -1
  5. package/dist/isl/index.js +2 -0
  6. package/dist/isl/index.js.map +1 -1
  7. package/dist/isl/process/buildISLResult.d.ts +3 -1
  8. package/dist/isl/process/buildISLResult.d.ts.map +1 -1
  9. package/dist/isl/process/buildISLResult.js +3 -1
  10. package/dist/isl/process/buildISLResult.js.map +1 -1
  11. package/dist/isl/sanitize.d.ts.map +1 -1
  12. package/dist/isl/sanitize.js +13 -1
  13. package/dist/isl/sanitize.js.map +1 -1
  14. package/dist/isl/tags/index.d.ts +19 -0
  15. package/dist/isl/tags/index.d.ts.map +1 -0
  16. package/dist/isl/tags/index.js +17 -0
  17. package/dist/isl/tags/index.js.map +1 -0
  18. package/dist/isl/tags/namespace.d.ts +18 -0
  19. package/dist/isl/tags/namespace.d.ts.map +1 -0
  20. package/dist/isl/tags/namespace.js +18 -0
  21. package/dist/isl/tags/namespace.js.map +1 -0
  22. package/dist/isl/tags/serializer.d.ts +39 -0
  23. package/dist/isl/tags/serializer.d.ts.map +1 -0
  24. package/dist/isl/tags/serializer.js +45 -0
  25. package/dist/isl/tags/serializer.js.map +1 -0
  26. package/dist/isl/tags/tag-registry.d.ts +15 -0
  27. package/dist/isl/tags/tag-registry.d.ts.map +1 -0
  28. package/dist/isl/tags/tag-registry.js +17 -0
  29. package/dist/isl/tags/tag-registry.js.map +1 -0
  30. package/dist/isl/tags/threat-tag-type.d.ts +13 -0
  31. package/dist/isl/tags/threat-tag-type.d.ts.map +1 -0
  32. package/dist/isl/tags/threat-tag-type.js +9 -0
  33. package/dist/isl/tags/threat-tag-type.js.map +1 -0
  34. package/dist/isl/tags/threat-tag.d.ts +32 -0
  35. package/dist/isl/tags/threat-tag.d.ts.map +1 -0
  36. package/dist/isl/tags/threat-tag.js +43 -0
  37. package/dist/isl/tags/threat-tag.js.map +1 -0
  38. package/dist/isl/types.d.ts +13 -0
  39. package/dist/isl/types.d.ts.map +1 -1
  40. package/package.json +3 -2
  41. package/dist/AAL/process/applyRemovalPlan.d.ts +0 -23
  42. package/dist/AAL/process/applyRemovalPlan.d.ts.map +0 -1
  43. package/dist/AAL/process/applyRemovalPlan.js +0 -157
  44. package/dist/AAL/process/applyRemovalPlan.js.map +0 -1
  45. package/dist/AAL/process/buildRemovalPlan.d.ts +0 -50
  46. package/dist/AAL/process/buildRemovalPlan.d.ts.map +0 -1
  47. package/dist/AAL/process/buildRemovalPlan.js +0 -116
  48. package/dist/AAL/process/buildRemovalPlan.js.map +0 -1
  49. package/dist/cpe/envelope.d.ts +0 -34
  50. package/dist/cpe/envelope.d.ts.map +0 -1
  51. package/dist/cpe/envelope.js +0 -70
  52. package/dist/cpe/envelope.js.map +0 -1
  53. package/dist/cpe/exceptions/EnvelopeError.d.ts +0 -8
  54. package/dist/cpe/exceptions/EnvelopeError.d.ts.map +0 -1
  55. package/dist/cpe/exceptions/EnvelopeError.js +0 -13
  56. package/dist/cpe/exceptions/EnvelopeError.js.map +0 -1
  57. package/dist/cpe/exceptions/index.d.ts +0 -5
  58. package/dist/cpe/exceptions/index.d.ts.map +0 -1
  59. package/dist/cpe/exceptions/index.js +0 -5
  60. package/dist/cpe/exceptions/index.js.map +0 -1
  61. package/dist/cpe/index.d.ts +0 -24
  62. package/dist/cpe/index.d.ts.map +0 -1
  63. package/dist/cpe/index.js +0 -26
  64. package/dist/cpe/index.js.map +0 -1
  65. package/dist/cpe/types.d.ts +0 -58
  66. package/dist/cpe/types.d.ts.map +0 -1
  67. package/dist/cpe/types.js +0 -5
  68. package/dist/cpe/types.js.map +0 -1
  69. package/dist/cpe/utils.d.ts +0 -38
  70. package/dist/cpe/utils.d.ts.map +0 -1
  71. package/dist/cpe/utils.js +0 -47
  72. package/dist/cpe/utils.js.map +0 -1
  73. package/dist/cpe/value-objects/Metadata.d.ts +0 -32
  74. package/dist/cpe/value-objects/Metadata.d.ts.map +0 -1
  75. package/dist/cpe/value-objects/Metadata.js +0 -65
  76. package/dist/cpe/value-objects/Metadata.js.map +0 -1
  77. package/dist/cpe/value-objects/Nonce.d.ts +0 -33
  78. package/dist/cpe/value-objects/Nonce.d.ts.map +0 -1
  79. package/dist/cpe/value-objects/Nonce.js +0 -44
  80. package/dist/cpe/value-objects/Nonce.js.map +0 -1
  81. package/dist/cpe/value-objects/Signature.d.ts +0 -39
  82. package/dist/cpe/value-objects/Signature.d.ts.map +0 -1
  83. package/dist/cpe/value-objects/Signature.js +0 -60
  84. package/dist/cpe/value-objects/Signature.js.map +0 -1
  85. package/dist/cpe/value-objects/index.d.ts +0 -9
  86. package/dist/cpe/value-objects/index.d.ts.map +0 -1
  87. package/dist/cpe/value-objects/index.js +0 -7
  88. package/dist/cpe/value-objects/index.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,40 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ---
9
9
 
10
+ ## [0.5.0] - (latest)
11
+
12
+ ### ✨ Added
13
+
14
+ - **ISL – Semantic isolation and canonical tags (v0.5.0)**
15
+ - **ThreatTag**: Structural metadata for semantic isolation: `segmentId`, `startOffset`, `endOffset`, `type` (ThreatTagType), `confidence`. ISL (or SDK) produces ThreatTags; the core does not insert tags into text.
16
+ - **createThreatTag(segmentId, startOffset, endOffset, type, confidence)**: Factory that validates and returns a frozen ThreatTag. Validates non-empty segmentId, 0 ≤ start ≤ end, valid type, confidence in [0, 1].
17
+ - **Tag registry**: `VALID_TAG_TYPES` (readonly list aligned with ISL detect taxonomy) and `isValidThreatTagType(value)` for validation.
18
+ - **Canonical AI-PIP tag serializer** (`isl/tags/serializer.ts`): Official protocol representation only. No offsets, no segment mutation, no encapsulation logic.
19
+ - **openTag(type)**: Returns canonical opening tag string, e.g. `<aipip:prompt-injection>`.
20
+ - **closeTag(type)**: Returns canonical closing tag string, e.g. `</aipip:prompt-injection>`.
21
+ - **wrapWithTag(type, content)**: Returns content wrapped with opening and closing tags (pure string concatenation).
22
+ - **Namespace**: `AIPIP_NAMESPACE` (`"aipip"`) and `AIPIP_TAG_SCHEMA_VERSION` (1) for forward compatibility.
23
+ - **ThreatTagType**: Alias for threat type in tag context (aligned with `ThreatType` from detect); single source of truth remains ISL detect.
24
+ - **ISLResult.threatTags**: `readonly ThreatTag[]` — List of threat tags derived from segment detections (only detections with valid `ThreatTagType`). Built in `sanitize()` and passed to `buildISLResult`; SDK uses it with the canonical serializer to apply encapsulation.
25
+ - **buildISLResult(segments, lineage, threatTags, processingTimeMs?)**: New third parameter **threatTags** (required); `processingTimeMs` is now the fourth optional argument. Callers (e.g. `sanitize`) must pass the array of ThreatTag derived from detections (or `[]` when none).
26
+
27
+ - **Benefits of semantic isolation**
28
+ - **No semantic corruption**: Core does not modify segment text; it produces metadata (ThreatTag) and defines the canonical tag format.
29
+ - **Auditable and reversible**: Tag format is deterministic and standardized; SDK applies tags at fragment level using offsets.
30
+ - **Clear responsibility**: SDK is responsible for applying offsets, inserting tags at correct positions, resolving multiple/overlapping tags (e.g. by descending offset order). The serializer only builds strings.
31
+
32
+ ### 📚 Documentation
33
+
34
+ - **README.md**: New subsection *Semantic isolation and canonical tags (v0.5.0)*: ThreatTag, serializer (openTag, closeTag, wrapWithTag), encapsulation at fragment level, SDK responsibilities.
35
+ - **FEATURE.md**: 0.5.0 section with new APIs (ThreatTag, createThreatTag, tag registry, serializer), benefits, and methods table.
36
+ - **docs/readme.md**: Same 0.5.0 content and link from Architecture / ISL.
37
+
38
+ ### 📎 More information
39
+
40
+ See **[FEATURE.md](./FEATURE.md)** for 0.5.0 API details.
41
+
42
+ ---
43
+
10
44
  ## [0.4.0] - (unreleased)
11
45
 
12
46
  ### ✨ Added
@@ -453,6 +487,6 @@ For specific method signatures and API changes in 0.3.0, see **[FEATURE.md](./FE
453
487
 
454
488
  ---
455
489
 
456
- **Current Version**: 0.4.0
490
+ **Current Version**: 0.5.0
457
491
  **Status**: Phase 1 - Core Layers (100% completed)
458
492
 
package/README.md CHANGED
@@ -25,7 +25,7 @@ AI-powered browsers and chat interfaces (e.g. **GPT Atlas**, embedded AI in web
25
25
  | Layer | Role |
26
26
  |-------|------|
27
27
  | **CSL** (Context Segmentation Layer) | Segments and classifies content by origin (UI, DOM, API, SYSTEM). |
28
- | **ISL** (Instruction Sanitization Layer) | Detects threats (~287 patterns), scores risk, sanitizes content, and emits a **signal** (risk score, detections) for other layers. |
28
+ | **ISL** (Instruction Sanitization Layer) | Detects threats (~287 patterns), scores risk, sanitizes content, and emits a **signal** (risk score, detections) for other layers. From **v0.5.0**: produces **ThreatTag** metadata and exposes the **canonical tag serializer** for semantic isolation (encapsulation with `<aipip:threat-type>...</aipip>` is applied by the SDK at fragment level). |
29
29
  | **AAL** (Agent Action Lock) | Consumes the ISL signal and applies policy: **ALLOW**, **WARN**, or **BLOCK**. Produces a **remediation plan** (what to clean—target segments, goals, constraints); the SDK or an AI agent performs the actual cleanup. |
30
30
  | **CPE** (Cryptographic Prompt Envelope) | **Transversal**: ensures the **integrity of each layer**. Wraps pipeline output with a signed envelope (nonce, metadata, HMAC-SHA256) so that results can be verified. Implemented in `shared/envelope`; exported as `@ai-pip/core/cpe`. |
31
31
 
@@ -35,6 +35,8 @@ The processing pipeline is **CSL → ISL** (optionally **AAL** consumes the sign
35
35
  - **`source`** (UI, DOM, API, SYSTEM) determines trust level and sanitization. It **must be set only by trusted code** (backend/SDK), **never** derived from user input. Otherwise an attacker could send `source: 'SYSTEM'` and reduce sanitization.
36
36
  - **CPE secret key**: The key passed to `envelope(..., secretKey)` **must not be logged or serialized**. Key rotation and storage are the **SDK’s responsibility** (e.g. use a key id in metadata and multiple keys in the verifier).
37
37
 
38
+ **Semantic isolation and canonical tags (v0.5.0):** The core does **not** modify segment text. It produces **ThreatTag** metadata (segmentId, offsets, type, confidence) and defines the **canonical AI-PIP tag format** via the serializer (`openTag`, `closeTag`, `wrapWithTag`). Encapsulation with tags like `<aipip:prompt-injection>...</aipip>` is applied by the **SDK** at fragment level. Benefits: no semantic corruption, auditable and reversible, deterministic; the SDK is responsible for applying offsets, insertions, and ordering (e.g. by descending offset when resolving multiple tags).
39
+
38
40
  ---
39
41
 
40
42
  ## Installation
@@ -82,8 +84,9 @@ if (remediationPlan.needsRemediation) {
82
84
 
83
85
  - **Full README** (examples, use cases, audit, all layers): [docs/readme.md](./docs/readme.md)
84
86
  - **Protocol docs** (whitepaper, architecture, layers): [AI-PIP documentation repository](https://github.com/AI-PIP/ai-pip-docs)
85
- - **Package changelog**: [CHANGELOG.md](./CHANGELOG.md)
87
+ - **Package changelog**: [CHANGELOG.md](./CHANGELOG.md) — Latest: **0.5.0** (unreleased)
86
88
  - **Features by version**: [FEATURE.md](./FEATURE.md)
89
+ - **Roadmap** (path to 1.0.0): [roadmap.md](./roadmap.md)
87
90
 
88
91
  ---
89
92
 
@@ -26,4 +26,6 @@ export type { PiDetection, PiDetectionResult, Pattern, RiskScore } from './value
26
26
  export { createPiDetection, getDetectionLength, isHighConfidence, isMediumConfidence, isLowConfidence, createPiDetectionResult, hasDetections, getDetectionCount, getDetectionsByType, getHighestConfidenceDetection, createPattern, matchesPattern, findMatch, MAX_CONTENT_LENGTH, MAX_PATTERN_LENGTH, MAX_MATCHES, createRiskScore, normalizeRiskScore, isHighRiskScore, isMediumRiskScore, isLowRiskScore, MIN_RISK_SCORE, MAX_RISK_SCORE } from './value-objects/index.js';
27
27
  export { SanitizationError } from './exceptions/SanitizationError.js';
28
28
  export type { RiskScore as RiskScoreType, ISLSegment, ISLResult } from './types.js';
29
+ export { AIPIP_NAMESPACE, AIPIP_TAG_SCHEMA_VERSION, createThreatTag, VALID_TAG_TYPES, isValidThreatTagType, openTag, closeTag, wrapWithTag } from './tags/index.js';
30
+ export type { ThreatTag, ThreatTagType } from './tags/index.js';
29
31
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/isl/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAGpD,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/D,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAG3D,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACzF,YAAY,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAGzE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAGpD,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAChE,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EAChB,MAAM,cAAc,CAAA;AAGrB,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACvE,YAAY,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC/D,OAAO,EACL,uBAAuB,EACvB,4BAA4B,EAC5B,wBAAwB,EACxB,+BAA+B,EAC/B,oBAAoB,EACrB,MAAM,sBAAsB,CAAA;AAG7B,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAClG,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,uBAAuB,EACvB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,6BAA6B,EAC7B,aAAa,EACb,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,kBA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0B,CAAA;AAClG,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,uBAAuB,EACvB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,6BAA6B,EAC7B,aAAa,EACb,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,cAAc,EACf,MAAM,0BAA0B,CAAA;AAGjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAA;AAGrE,YAAY,EACV,SAAS,IAAI,aAAa,EAC1B,UAAU,EACV,SAAS,EACV,MAAM,YAAY,CAAA;AAGnB,OAAO,EACL,eAAe,EACf,wBAAwB,EACxB,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,OAAO,EACP,QAAQ,EACR,WAAW,EACZ,MAAM,iBAAiB,CAAA;AACxB,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA"}
package/dist/isl/index.js CHANGED
@@ -25,4 +25,6 @@ export { maxConfidenceCalculator, severityPlusVolumeCalculator, weightedByTypeCa
25
25
  export { createPiDetection, getDetectionLength, isHighConfidence, isMediumConfidence, isLowConfidence, createPiDetectionResult, hasDetections, getDetectionCount, getDetectionsByType, getHighestConfidenceDetection, createPattern, matchesPattern, findMatch, MAX_CONTENT_LENGTH, MAX_PATTERN_LENGTH, MAX_MATCHES, createRiskScore, normalizeRiskScore, isHighRiskScore, isMediumRiskScore, isLowRiskScore, MIN_RISK_SCORE, MAX_RISK_SCORE } from './value-objects/index.js';
26
26
  // Exceptions
27
27
  export { SanitizationError } from './exceptions/SanitizationError.js';
28
+ // Tags – semantic isolation metadata and canonical serializer (v0.5.0)
29
+ export { AIPIP_NAMESPACE, AIPIP_TAG_SCHEMA_VERSION, createThreatTag, VALID_TAG_TYPES, isValidThreatTagType, openTag, closeTag, wrapWithTag } from './tags/index.js';
28
30
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/isl/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,sBAAsB;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAGxC,oBAAoB;AACpB,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAG/D,kDAAkD;AAClD,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAGzF,oBAAoB;AACpB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAIpD,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EAChB,MAAM,cAAc,CAAA;AAErB,oFAAoF;AACpF,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEvE,OAAO,EACL,uBAAuB,EACvB,4BAA4B,EAC5B,wBAAwB,EACxB,+BAA+B,EAC/B,oBAAoB,EACrB,MAAM,sBAAsB,CAAA;AAI7B,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,uBAAuB,EACvB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,6BAA6B,EAC7B,aAAa,EACb,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,cAAc,EACf,MAAM,0BAA0B,CAAA;AAEjC,aAAa;AACb,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/isl/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,sBAAsB;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAGxC,oBAAoB;AACpB,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAG/D,kDAAkD;AAClD,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAGzF,oBAAoB;AACpB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAIpD,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EAChB,MAAM,cAAc,CAAA;AAErB,oFAAoF;AACpF,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEvE,OAAO,EACL,uBAAuB,EACvB,4BAA4B,EAC5B,wBAAwB,EACxB,+BAA+B,EAC/B,oBAAoB,EACrB,MAAM,sBAAsB,CAAA;AAI7B,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,uBAAuB,EACvB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,6BAA6B,EAC7B,aAAa,EACb,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,cAAc,EACf,MAAM,0BAA0B,CAAA;AAEjC,aAAa;AACb,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAA;AASrE,uEAAuE;AACvE,OAAO,EACL,eAAe,EACf,wBAAwB,EACxB,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,OAAO,EACP,QAAQ,EACR,WAAW,EACZ,MAAM,iBAAiB,CAAA"}
@@ -12,13 +12,15 @@
12
12
  */
13
13
  import type { ISLResult, ISLSegment } from '../types.js';
14
14
  import type { LineageEntry } from '../../csl/value-objects/index.js';
15
+ import type { ThreatTag } from '../tags/threat-tag.js';
15
16
  /**
16
17
  * Builds an ISLResult from processed segments
17
18
  *
18
19
  * @param segments - Segments sanitized by ISL
19
20
  * @param lineage - Complete processing lineage
21
+ * @param threatTags - Threat tags detected by ISL
20
22
  * @param processingTimeMs - Processing time in milliseconds (optional)
21
23
  * @returns ISLResult with all processing information
22
24
  */
23
- export declare function buildISLResult(segments: readonly ISLSegment[], lineage: readonly LineageEntry[], processingTimeMs?: number): ISLResult;
25
+ export declare function buildISLResult(segments: readonly ISLSegment[], lineage: readonly LineageEntry[], threatTags: readonly ThreatTag[], processingTimeMs?: number): ISLResult;
24
26
  //# sourceMappingURL=buildISLResult.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"buildISLResult.d.ts","sourceRoot":"","sources":["../../../src/isl/process/buildISLResult.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAEpE;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,SAAS,UAAU,EAAE,EAC/B,OAAO,EAAE,SAAS,YAAY,EAAE,EAChC,gBAAgB,CAAC,EAAE,MAAM,GACxB,SAAS,CAiBX"}
1
+ {"version":3,"file":"buildISLResult.d.ts","sourceRoot":"","sources":["../../../src/isl/process/buildISLResult.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEtD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,SAAS,UAAU,EAAE,EAC/B,OAAO,EAAE,SAAS,YAAY,EAAE,EAChC,UAAU,EAAE,SAAS,SAAS,EAAE,EAChC,gBAAgB,CAAC,EAAE,MAAM,GACxB,SAAS,CAkBX"}
@@ -15,10 +15,11 @@
15
15
  *
16
16
  * @param segments - Segments sanitized by ISL
17
17
  * @param lineage - Complete processing lineage
18
+ * @param threatTags - Threat tags detected by ISL
18
19
  * @param processingTimeMs - Processing time in milliseconds (optional)
19
20
  * @returns ISLResult with all processing information
20
21
  */
21
- export function buildISLResult(segments, lineage, processingTimeMs) {
22
+ export function buildISLResult(segments, lineage, threatTags, processingTimeMs) {
22
23
  const metadata = processingTimeMs === undefined
23
24
  ? {
24
25
  totalSegments: segments.length,
@@ -32,6 +33,7 @@ export function buildISLResult(segments, lineage, processingTimeMs) {
32
33
  return {
33
34
  segments: Object.freeze(segments),
34
35
  lineage: Object.freeze(lineage),
36
+ threatTags: Object.freeze(threatTags),
35
37
  metadata: Object.freeze(metadata)
36
38
  };
37
39
  }
@@ -1 +1 @@
1
- {"version":3,"file":"buildISLResult.js","sourceRoot":"","sources":["../../../src/isl/process/buildISLResult.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAC5B,QAA+B,EAC/B,OAAgC,EAChC,gBAAyB;IAEzB,MAAM,QAAQ,GAAG,gBAAgB,KAAK,SAAS;QAC7C,CAAC,CAAC;YACE,aAAa,EAAE,QAAQ,CAAC,MAAM;YAC9B,iBAAiB,EAAE,QAAQ,CAAC,MAAM;SACnC;QACH,CAAC,CAAC;YACE,aAAa,EAAE,QAAQ,CAAC,MAAM;YAC9B,iBAAiB,EAAE,QAAQ,CAAC,MAAM;YAClC,gBAAgB;SACjB,CAAA;IAEL,OAAO;QACL,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;QACjC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC;QAC/B,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;KAClC,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"buildISLResult.js","sourceRoot":"","sources":["../../../src/isl/process/buildISLResult.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAC5B,QAA+B,EAC/B,OAAgC,EAChC,UAAgC,EAChC,gBAAyB;IAEzB,MAAM,QAAQ,GAAG,gBAAgB,KAAK,SAAS;QAC7C,CAAC,CAAC;YACE,aAAa,EAAE,QAAQ,CAAC,MAAM;YAC9B,iBAAiB,EAAE,QAAQ,CAAC,MAAM;SACnC;QACH,CAAC,CAAC;YACE,aAAa,EAAE,QAAQ,CAAC,MAAM;YAC9B,iBAAiB,EAAE,QAAQ,CAAC,MAAM;YAClC,gBAAgB;SACjB,CAAA;IAEL,OAAO;QACL,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;QACjC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC;QAC/B,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC;QACrC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;KAClC,CAAA;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../src/isl/sanitize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAGhD,OAAO,KAAK,EAAE,SAAS,EAAc,MAAM,YAAY,CAAA;AAIvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAG7D,sFAAsF;AACtF,MAAM,WAAW,eAAe;IAC9B,2EAA2E;IAC3E,QAAQ,CAAC,oBAAoB,CAAC,EAAE,oBAAoB,CAAA;CACrD;AAED;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,GAAE,eAAoB,GAAG,SAAS,CA2CvF"}
1
+ {"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../src/isl/sanitize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAGhD,OAAO,KAAK,EAAE,SAAS,EAAc,MAAM,YAAY,CAAA;AAIvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAK7D,sFAAsF;AACtF,MAAM,WAAW,eAAe;IAC9B,2EAA2E;IAC3E,QAAQ,CAAC,oBAAoB,CAAC,EAAE,oBAAoB,CAAA;CACrD;AAED;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,GAAE,eAAoB,GAAG,SAAS,CAsEvF"}
@@ -3,6 +3,8 @@ import { buildISLLineage } from './lineage/buildISLLineage.js';
3
3
  import { buildISLResult } from './process/buildISLResult.js';
4
4
  import { detectThreats } from './detect/index.js';
5
5
  import { createPiDetectionResult } from './value-objects/PiDetectionResult.js';
6
+ import { createThreatTag } from './tags/threat-tag.js';
7
+ import { isValidThreatTagType } from './tags/tag-registry.js';
6
8
  /**
7
9
  * Sanitizes content according to trust level - pure function
8
10
  *
@@ -16,6 +18,7 @@ import { createPiDetectionResult } from './value-objects/PiDetectionResult.js';
16
18
  export function sanitize(cslResult, options = {}) {
17
19
  const startTime = Date.now();
18
20
  const segments = [];
21
+ const threatTags = [];
19
22
  const detectOptions = options.detectThreatsOptions;
20
23
  for (const cslSegment of cslResult.segments) {
21
24
  // Determine sanitization level according to trust level
@@ -38,12 +41,21 @@ export function sanitize(cslResult, options = {}) {
38
41
  ...(piDetection !== undefined && { piDetection })
39
42
  };
40
43
  segments.push(islSegment);
44
+ // Build threat tags
45
+ if (detections.length > 0) {
46
+ for (const detection of detections) {
47
+ if (isValidThreatTagType(detection.pattern_type)) {
48
+ const tag = createThreatTag(cslSegment.id, detection.position.start, detection.position.end, detection.pattern_type, detection.confidence);
49
+ threatTags.push(tag);
50
+ }
51
+ }
52
+ }
41
53
  }
42
54
  // Build complete lineage
43
55
  const allLineage = buildISLLineage(cslResult.lineage, startTime);
44
56
  // Build result using process function
45
57
  const processingTime = Date.now() - startTime;
46
- return buildISLResult(segments, allLineage, processingTime);
58
+ return buildISLResult(segments, allLineage, threatTags, processingTime);
47
59
  }
48
60
  /**
49
61
  * Determines sanitization level according to trust level - pure function
@@ -1 +1 @@
1
- {"version":3,"file":"sanitize.js","sourceRoot":"","sources":["../../src/isl/sanitize.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAA;AAQ9E;;;;;;;;;GASG;AACH,MAAM,UAAU,QAAQ,CAAC,SAAoB,EAAE,UAA2B,EAAE;IAC1E,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;IAC5B,MAAM,QAAQ,GAAiB,EAAE,CAAA;IACjC,MAAM,aAAa,GAAG,OAAO,CAAC,oBAAoB,CAAA;IAElD,KAAK,MAAM,UAAU,IAAI,SAAS,CAAC,QAAQ,EAAE,CAAC;QAC5C,wDAAwD;QACxD,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;QAEhE,sCAAsC;QACtC,MAAM,SAAS,GAAG,eAAe,CAC/B,UAAU,CAAC,OAAO,EAClB,iBAAiB,CAClB,CAAA;QAED,gHAAgH;QAChH,MAAM,UAAU,GAAG,aAAa,CAAC,SAAS,CAAC,OAAO,EAAE,aAAa,CAAC,CAAA;QAClE,MAAM,WAAW,GACf,UAAU,CAAC,MAAM,GAA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KAAK,CAAC,KAAK,KAAK,cAAc,CAAC,GAAG;QAAE,OAAO,UAAU,CAAA;IACzD,OAAO,YAAY,CAAA,CAAE,KAAK;AAC5B,CAAC;AAED;;GAEG;AACH,SAAS,eAAe,CACtB,OAAe,EACf,MAA6C;IAE7C,oCAAoC;IACpC,oDAAoD;IACpD,OAAO;QACL,OAAO;KACR,CAAA;AACH,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * ISL tags – Semantic isolation metadata and canonical serialization (v0.5.0).
3
+ *
4
+ * @remarks
5
+ * - **Namespace & types:** Official namespace, threat tag types (aligned with detect).
6
+ * - **ThreatTag:** Structural metadata (segmentId, offsets, type, confidence); no text mutation.
7
+ * - **Registry:** Valid tag types for validation.
8
+ * - **Serializer:** Canonical AI-PIP tag format (open/close/wrap); protocol-only, no offsets or segment logic.
9
+ *
10
+ * The SDK uses ThreatTag + serializer to insert tags into fragment text; the core only defines the format.
11
+ */
12
+ export { AIPIP_NAMESPACE, AIPIP_TAG_SCHEMA_VERSION } from './namespace.js';
13
+ export { THREAT_TYPES } from './threat-tag-type.js';
14
+ export type { ThreatTagType, ThreatType } from './threat-tag-type.js';
15
+ export type { ThreatTag } from './threat-tag.js';
16
+ export { createThreatTag } from './threat-tag.js';
17
+ export { VALID_TAG_TYPES, isValidThreatTagType } from './tag-registry.js';
18
+ export { openTag, closeTag, wrapWithTag } from './serializer.js';
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/isl/tags/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAA;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACrE,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * ISL tags – Semantic isolation metadata and canonical serialization (v0.5.0).
3
+ *
4
+ * @remarks
5
+ * - **Namespace & types:** Official namespace, threat tag types (aligned with detect).
6
+ * - **ThreatTag:** Structural metadata (segmentId, offsets, type, confidence); no text mutation.
7
+ * - **Registry:** Valid tag types for validation.
8
+ * - **Serializer:** Canonical AI-PIP tag format (open/close/wrap); protocol-only, no offsets or segment logic.
9
+ *
10
+ * The SDK uses ThreatTag + serializer to insert tags into fragment text; the core only defines the format.
11
+ */
12
+ export { AIPIP_NAMESPACE, AIPIP_TAG_SCHEMA_VERSION } from './namespace.js';
13
+ export { THREAT_TYPES } from './threat-tag-type.js';
14
+ export { createThreatTag } from './threat-tag.js';
15
+ export { VALID_TAG_TYPES, isValidThreatTagType } from './tag-registry.js';
16
+ export { openTag, closeTag, wrapWithTag } from './serializer.js';
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/isl/tags/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAA;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAGnD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Official namespace identifier for AI-PIP semantic tags.
3
+ *
4
+ * This namespace is used by upper layers (SDK) to serialize
5
+ * ThreatTags into textual encapsulation form:
6
+ *
7
+ * <aipip:threat-type>...</aipip>
8
+ *
9
+ * The core does not perform serialization.
10
+ * This value must remain stable across versions.
11
+ */
12
+ export declare const AIPIP_NAMESPACE: "aipip";
13
+ /**
14
+ * Current schema version for AI-PIP tag structure.
15
+ * Used for forward compatibility if needed.
16
+ */
17
+ export declare const AIPIP_TAG_SCHEMA_VERSION: 1;
18
+ //# sourceMappingURL=namespace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"namespace.d.ts","sourceRoot":"","sources":["../../../src/isl/tags/namespace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,EAAG,OAAgB,CAAC;AAGhD;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAG,CAAU,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Official namespace identifier for AI-PIP semantic tags.
3
+ *
4
+ * This namespace is used by upper layers (SDK) to serialize
5
+ * ThreatTags into textual encapsulation form:
6
+ *
7
+ * <aipip:threat-type>...</aipip>
8
+ *
9
+ * The core does not perform serialization.
10
+ * This value must remain stable across versions.
11
+ */
12
+ export const AIPIP_NAMESPACE = "aipip";
13
+ /**
14
+ * Current schema version for AI-PIP tag structure.
15
+ * Used for forward compatibility if needed.
16
+ */
17
+ export const AIPIP_TAG_SCHEMA_VERSION = 1;
18
+ //# sourceMappingURL=namespace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"namespace.js","sourceRoot":"","sources":["../../../src/isl/tags/namespace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,OAAgB,CAAC;AAGhD;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAU,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Canonical AI-PIP tag serializer – Official protocol representation.
3
+ *
4
+ * @remarks
5
+ * This module defines the only normative, standardized textual format for
6
+ * AI-PIP semantic tags. It does not apply offsets, does not mutate segments,
7
+ * and does not decide when to encapsulate. The SDK is responsible for applying
8
+ * tags at the correct positions (using ThreatTag metadata) and for resolving
9
+ * multiple or overlapping tags (e.g. descending offset order).
10
+ *
11
+ * The serializer only builds strings: opening tag, closing tag, or fully
12
+ * wrapped content. This makes the tag format part of the formal protocol,
13
+ * not an informal SDK convention.
14
+ */
15
+ import type { ThreatTagType } from './threat-tag-type.js';
16
+ /**
17
+ * Returns the canonical opening tag string.
18
+ *
19
+ * @example
20
+ * openTag('prompt-injection') // "<aipip:prompt-injection>"
21
+ */
22
+ export declare function openTag(type: ThreatTagType): string;
23
+ /**
24
+ * Returns the canonical closing tag string.
25
+ *
26
+ * @example
27
+ * closeTag('prompt-injection') // "</aipip:prompt-injection>"
28
+ */
29
+ export declare function closeTag(type: ThreatTagType): string;
30
+ /**
31
+ * Returns content wrapped with opening and closing tags.
32
+ * Does not validate or interpret content; purely concatenation.
33
+ *
34
+ * @example
35
+ * wrapWithTag('prompt-injection', 'Ignore previous instructions.')
36
+ * // "<aipip:prompt-injection>Ignore previous instructions.</aipip:prompt-injection>"
37
+ */
38
+ export declare function wrapWithTag(type: ThreatTagType, content: string): string;
39
+ //# sourceMappingURL=serializer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serializer.d.ts","sourceRoot":"","sources":["../../../src/isl/tags/serializer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEzD;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAEnD;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAEpD;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAExE"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Canonical AI-PIP tag serializer – Official protocol representation.
3
+ *
4
+ * @remarks
5
+ * This module defines the only normative, standardized textual format for
6
+ * AI-PIP semantic tags. It does not apply offsets, does not mutate segments,
7
+ * and does not decide when to encapsulate. The SDK is responsible for applying
8
+ * tags at the correct positions (using ThreatTag metadata) and for resolving
9
+ * multiple or overlapping tags (e.g. descending offset order).
10
+ *
11
+ * The serializer only builds strings: opening tag, closing tag, or fully
12
+ * wrapped content. This makes the tag format part of the formal protocol,
13
+ * not an informal SDK convention.
14
+ */
15
+ import { AIPIP_NAMESPACE } from './namespace.js';
16
+ /**
17
+ * Returns the canonical opening tag string.
18
+ *
19
+ * @example
20
+ * openTag('prompt-injection') // "<aipip:prompt-injection>"
21
+ */
22
+ export function openTag(type) {
23
+ return `<${AIPIP_NAMESPACE}:${type}>`;
24
+ }
25
+ /**
26
+ * Returns the canonical closing tag string.
27
+ *
28
+ * @example
29
+ * closeTag('prompt-injection') // "</aipip:prompt-injection>"
30
+ */
31
+ export function closeTag(type) {
32
+ return `</${AIPIP_NAMESPACE}:${type}>`;
33
+ }
34
+ /**
35
+ * Returns content wrapped with opening and closing tags.
36
+ * Does not validate or interpret content; purely concatenation.
37
+ *
38
+ * @example
39
+ * wrapWithTag('prompt-injection', 'Ignore previous instructions.')
40
+ * // "<aipip:prompt-injection>Ignore previous instructions.</aipip:prompt-injection>"
41
+ */
42
+ export function wrapWithTag(type, content) {
43
+ return `${openTag(type)}${content}${closeTag(type)}`;
44
+ }
45
+ //# sourceMappingURL=serializer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serializer.js","sourceRoot":"","sources":["../../../src/isl/tags/serializer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAGhD;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,IAAmB;IACzC,OAAO,IAAI,eAAe,IAAI,IAAI,GAAG,CAAA;AACvC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAmB;IAC1C,OAAO,KAAK,eAAe,IAAI,IAAI,GAAG,CAAA;AACxC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,IAAmB,EAAE,OAAe;IAC9D,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAA;AACtD,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Tag registry – Valid threat tag types for validation and iteration.
3
+ *
4
+ * @remarks
5
+ * Single source of truth is ISL detect (THREAT_TYPES). This module exposes
6
+ * a readonly list and a type guard for use by ThreatTag creation and by the SDK.
7
+ */
8
+ import type { ThreatTagType } from './threat-tag-type.js';
9
+ /** Readonly list of valid tag type strings (for validation and iteration) */
10
+ export declare const VALID_TAG_TYPES: readonly ThreatTagType[];
11
+ /**
12
+ * Type guard: returns true if value is a valid ThreatTagType.
13
+ */
14
+ export declare function isValidThreatTagType(value: string): value is ThreatTagType;
15
+ //# sourceMappingURL=tag-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tag-registry.d.ts","sourceRoot":"","sources":["../../../src/isl/tags/tag-registry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEzD,6EAA6E;AAC7E,eAAO,MAAM,eAAe,EAAE,SAAS,aAAa,EAEhC,CAAA;AAEpB;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,aAAa,CAE1E"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Tag registry – Valid threat tag types for validation and iteration.
3
+ *
4
+ * @remarks
5
+ * Single source of truth is ISL detect (THREAT_TYPES). This module exposes
6
+ * a readonly list and a type guard for use by ThreatTag creation and by the SDK.
7
+ */
8
+ import { THREAT_TYPES } from './threat-tag-type.js';
9
+ /** Readonly list of valid tag type strings (for validation and iteration) */
10
+ export const VALID_TAG_TYPES = Object.values(THREAT_TYPES);
11
+ /**
12
+ * Type guard: returns true if value is a valid ThreatTagType.
13
+ */
14
+ export function isValidThreatTagType(value) {
15
+ return VALID_TAG_TYPES.includes(value);
16
+ }
17
+ //# sourceMappingURL=tag-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tag-registry.js","sourceRoot":"","sources":["../../../src/isl/tags/tag-registry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAGnD,6EAA6E;AAC7E,MAAM,CAAC,MAAM,eAAe,GAA6B,MAAM,CAAC,MAAM,CACpE,YAAY,CACM,CAAA;AAEpB;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAa;IAChD,OAAQ,eAAqC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;AAC/D,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Threat tag types – Aligned with ISL detection taxonomy.
3
+ *
4
+ * @remarks
5
+ * Tag types correspond to pattern_type in PiDetection. Used for canonical
6
+ * encapsulation: <aipip:threat-type>...</aipip>. Single source of truth: detect layer.
7
+ */
8
+ import type { ThreatType } from '../detect/detect.js';
9
+ export { THREAT_TYPES } from '../detect/detect.js';
10
+ export type { ThreatType } from '../detect/detect.js';
11
+ /** Alias for tag context (same as ThreatType) */
12
+ export type ThreatTagType = ThreatType;
13
+ //# sourceMappingURL=threat-tag-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"threat-tag-type.d.ts","sourceRoot":"","sources":["../../../src/isl/tags/threat-tag-type.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,YAAY,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAErD,iDAAiD;AACjD,MAAM,MAAM,aAAa,GAAG,UAAU,CAAA"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Threat tag types – Aligned with ISL detection taxonomy.
3
+ *
4
+ * @remarks
5
+ * Tag types correspond to pattern_type in PiDetection. Used for canonical
6
+ * encapsulation: <aipip:threat-type>...</aipip>. Single source of truth: detect layer.
7
+ */
8
+ export { THREAT_TYPES } from '../detect/detect.js';
9
+ //# sourceMappingURL=threat-tag-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"threat-tag-type.js","sourceRoot":"","sources":["../../../src/isl/tags/threat-tag-type.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * ThreatTag – Structural metadata for semantic isolation (v0.5.0).
3
+ *
4
+ * @remarks
5
+ * ISL produces ThreatTag objects: segment id, offsets into the segment content,
6
+ * threat type, and confidence. The core does not insert tags into text; the SDK
7
+ * uses this metadata plus the canonical serializer to wrap fragments.
8
+ *
9
+ * Offsets are relative to the original segment content (immutable). start is
10
+ * inclusive, end is exclusive [start, end).
11
+ */
12
+ import type { ThreatTagType } from './threat-tag-type.js';
13
+ export interface ThreatTag {
14
+ /** Segment that contains the detected fragment */
15
+ readonly segmentId: string;
16
+ /** Start offset (inclusive) into segment content */
17
+ readonly startOffset: number;
18
+ /** End offset (exclusive) into segment content */
19
+ readonly endOffset: number;
20
+ /** Threat type (aligns with detection taxonomy) */
21
+ readonly type: ThreatTagType;
22
+ /** Confidence in [0, 1] */
23
+ readonly confidence: number;
24
+ }
25
+ /**
26
+ * Creates a ThreatTag (frozen). Validates segmentId, offsets, type, and confidence.
27
+ *
28
+ * @throws {TypeError} If segmentId or type is invalid
29
+ * @throws {RangeError} If offsets or confidence are out of range
30
+ */
31
+ export declare function createThreatTag(segmentId: string, startOffset: number, endOffset: number, type: ThreatTagType, confidence: number): ThreatTag;
32
+ //# sourceMappingURL=threat-tag.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"threat-tag.d.ts","sourceRoot":"","sources":["../../../src/isl/tags/threat-tag.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAGzD,MAAM,WAAW,SAAS;IACxB,kDAAkD;IAClD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,oDAAoD;IACpD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,kDAAkD;IAClD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,mDAAmD;IACnD,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAA;IAC5B,2BAA2B;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAC5B;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,aAAa,EACnB,UAAU,EAAE,MAAM,GACjB,SAAS,CAuBX"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * ThreatTag – Structural metadata for semantic isolation (v0.5.0).
3
+ *
4
+ * @remarks
5
+ * ISL produces ThreatTag objects: segment id, offsets into the segment content,
6
+ * threat type, and confidence. The core does not insert tags into text; the SDK
7
+ * uses this metadata plus the canonical serializer to wrap fragments.
8
+ *
9
+ * Offsets are relative to the original segment content (immutable). start is
10
+ * inclusive, end is exclusive [start, end).
11
+ */
12
+ import { VALID_TAG_TYPES } from './tag-registry.js';
13
+ /**
14
+ * Creates a ThreatTag (frozen). Validates segmentId, offsets, type, and confidence.
15
+ *
16
+ * @throws {TypeError} If segmentId or type is invalid
17
+ * @throws {RangeError} If offsets or confidence are out of range
18
+ */
19
+ export function createThreatTag(segmentId, startOffset, endOffset, type, confidence) {
20
+ if (segmentId == null || typeof segmentId !== 'string' || segmentId.trim().length === 0) {
21
+ throw new TypeError('ThreatTag segmentId must be a non-empty string');
22
+ }
23
+ if (typeof startOffset !== 'number' || !Number.isFinite(startOffset) || startOffset < 0) {
24
+ throw new RangeError('ThreatTag startOffset must be a non-negative finite number');
25
+ }
26
+ if (typeof endOffset !== 'number' || !Number.isFinite(endOffset) || endOffset < startOffset) {
27
+ throw new RangeError('ThreatTag endOffset must be >= startOffset');
28
+ }
29
+ if (!VALID_TAG_TYPES.includes(type)) {
30
+ throw new TypeError(`ThreatTag type must be one of: ${VALID_TAG_TYPES.join(', ')}`);
31
+ }
32
+ if (typeof confidence !== 'number' || !Number.isFinite(confidence) || confidence < 0 || confidence > 1) {
33
+ throw new RangeError('ThreatTag confidence must be a number in [0, 1]');
34
+ }
35
+ return Object.freeze({
36
+ segmentId: segmentId.trim(),
37
+ startOffset,
38
+ endOffset,
39
+ type,
40
+ confidence
41
+ });
42
+ }
43
+ //# sourceMappingURL=threat-tag.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"threat-tag.js","sourceRoot":"","sources":["../../../src/isl/tags/threat-tag.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAenD;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAC7B,SAAiB,EACjB,WAAmB,EACnB,SAAiB,EACjB,IAAmB,EACnB,UAAkB;IAElB,IAAI,SAAS,IAAI,IAAI,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxF,MAAM,IAAI,SAAS,CAAC,gDAAgD,CAAC,CAAA;IACvE,CAAC;IACD,IAAI,OAAO,WAAW,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,WAAW,GAAG,CAAC,EAAE,CAAC;QACxF,MAAM,IAAI,UAAU,CAAC,4DAA4D,CAAC,CAAA;IACpF,CAAC;IACD,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,SAAS,GAAG,WAAW,EAAE,CAAC;QAC5F,MAAM,IAAI,UAAU,CAAC,4CAA4C,CAAC,CAAA;IACpE,CAAC;IACD,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACpC,MAAM,IAAI,SAAS,CAAC,kCAAkC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IACrF,CAAC;IACD,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,UAAU,GAAG,CAAC,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;QACvG,MAAM,IAAI,UAAU,CAAC,iDAAiD,CAAC,CAAA;IACzE,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,SAAS,EAAE,SAAS,CAAC,IAAI,EAAE;QAC3B,WAAW;QACX,SAAS;QACT,IAAI;QACJ,UAAU;KACX,CAAC,CAAA;AACJ,CAAC"}
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import type { LineageEntry, TrustLevel } from '../csl/value-objects/index.js';
5
5
  import type { PiDetectionResult } from './value-objects/PiDetectionResult.js';
6
+ import type { ThreatTag } from './tags/threat-tag.js';
6
7
  export type { RiskScore } from './value-objects/RiskScore.js';
7
8
  /**
8
9
  * ISLSegment - Segment sanitized by ISL
@@ -18,10 +19,22 @@ export interface ISLSegment {
18
19
  }
19
20
  /**
20
21
  * ISLResult - Sanitization result
22
+ *
23
+ * @remarks
24
+ * The ISLResult contains the following:
25
+ * - segments: readonly ISLSegment[]
26
+ * - lineage: readonly LineageEntry[]
27
+ * - threatTags: readonly ThreatTag[]
28
+ * - metadata: {
29
+ * - totalSegments: number
30
+ * - sanitizedSegments: number
31
+ * - processingTimeMs?: number
32
+ * }
21
33
  */
22
34
  export interface ISLResult {
23
35
  readonly segments: readonly ISLSegment[];
24
36
  readonly lineage: readonly LineageEntry[];
37
+ readonly threatTags: readonly ThreatTag[];
25
38
  readonly metadata: {
26
39
  readonly totalSegments: number;
27
40
  readonly sanitizedSegments: number;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/isl/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAC7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAA;AAG7E,YAAY,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAU7D;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;IAChC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;IACjC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAA;IAC1B,QAAQ,CAAC,OAAO,EAAE,YAAY,EAAE,CAAA;IAChC,QAAQ,CAAC,WAAW,CAAC,EAAE,iBAAiB,CAAA;IACxC,QAAQ,CAAC,iBAAiB,EAAE,SAAS,GAAG,UAAU,GAAG,YAAY,CAAA;CAClE;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,QAAQ,EAAE,SAAS,UAAU,EAAE,CAAA;IACxC,QAAQ,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAA;IACzC,QAAQ,CAAC,QAAQ,EAAE;QACjB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;QAC9B,QAAQ,CAAC,iBAAiB,EAA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