@ai-pip/core 0.1.8 → 0.2.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.
- package/CHANGELOG.md +91 -0
- package/README.md +260 -9
- package/dist/AAL/index.d.ts +28 -0
- package/dist/AAL/index.d.ts.map +1 -0
- package/dist/AAL/index.js +28 -0
- package/dist/AAL/index.js.map +1 -0
- package/dist/AAL/lineage/buildAALLineage.d.ts +22 -0
- package/dist/AAL/lineage/buildAALLineage.d.ts.map +1 -0
- package/dist/AAL/lineage/buildAALLineage.js +26 -0
- package/dist/AAL/lineage/buildAALLineage.js.map +1 -0
- package/dist/AAL/lineage/index.d.ts +5 -0
- package/dist/AAL/lineage/index.d.ts.map +1 -0
- package/dist/AAL/lineage/index.js +5 -0
- package/dist/AAL/lineage/index.js.map +1 -0
- package/dist/AAL/process/buildDecisionReason.d.ts +36 -0
- package/dist/AAL/process/buildDecisionReason.d.ts.map +1 -0
- package/dist/AAL/process/buildDecisionReason.js +48 -0
- package/dist/AAL/process/buildDecisionReason.js.map +1 -0
- package/dist/AAL/process/buildRemovalPlan.d.ts +32 -0
- package/dist/AAL/process/buildRemovalPlan.d.ts.map +1 -0
- package/dist/AAL/process/buildRemovalPlan.js +50 -0
- package/dist/AAL/process/buildRemovalPlan.js.map +1 -0
- package/dist/AAL/process/index.d.ts +9 -0
- package/dist/AAL/process/index.d.ts.map +1 -0
- package/dist/AAL/process/index.js +7 -0
- package/dist/AAL/process/index.js.map +1 -0
- package/dist/AAL/process/resolveAgentAction.d.ts +31 -0
- package/dist/AAL/process/resolveAgentAction.d.ts.map +1 -0
- package/dist/AAL/process/resolveAgentAction.js +43 -0
- package/dist/AAL/process/resolveAgentAction.js.map +1 -0
- package/dist/AAL/types.d.ts +104 -0
- package/dist/AAL/types.d.ts.map +1 -0
- package/dist/AAL/types.js +2 -0
- package/dist/AAL/types.js.map +1 -0
- package/dist/{isl → AAL}/value-objects/AnomalyScore.d.ts +2 -1
- package/dist/AAL/value-objects/AnomalyScore.d.ts.map +1 -0
- package/dist/{isl → AAL}/value-objects/AnomalyScore.js.map +1 -1
- package/dist/{isl → AAL}/value-objects/PolicyRule.d.ts.map +1 -1
- package/dist/{isl → AAL}/value-objects/PolicyRule.js.map +1 -1
- package/dist/AAL/value-objects/index.d.ts +5 -0
- package/dist/AAL/value-objects/index.d.ts.map +1 -0
- package/dist/AAL/value-objects/index.js +3 -0
- package/dist/AAL/value-objects/index.js.map +1 -0
- package/dist/index.d.ts +10 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -5
- package/dist/index.js.map +1 -1
- package/dist/isl/index.d.ts +15 -6
- package/dist/isl/index.d.ts.map +1 -1
- package/dist/isl/index.js +15 -5
- package/dist/isl/index.js.map +1 -1
- package/dist/isl/lineage/buildISLLineage.d.ts +22 -0
- package/dist/isl/lineage/buildISLLineage.d.ts.map +1 -0
- package/dist/isl/lineage/buildISLLineage.js +26 -0
- package/dist/isl/lineage/buildISLLineage.js.map +1 -0
- package/dist/isl/lineage/index.d.ts +5 -0
- package/dist/isl/lineage/index.d.ts.map +1 -0
- package/dist/isl/lineage/index.js +5 -0
- package/dist/isl/lineage/index.js.map +1 -0
- package/dist/isl/process/buildISLResult.d.ts +24 -0
- package/dist/isl/process/buildISLResult.d.ts.map +1 -0
- package/dist/isl/process/buildISLResult.js +38 -0
- package/dist/isl/process/buildISLResult.js.map +1 -0
- package/dist/isl/process/emitSignal.d.ts +23 -0
- package/dist/isl/process/emitSignal.d.ts.map +1 -0
- package/dist/isl/process/emitSignal.js +39 -0
- package/dist/isl/process/emitSignal.js.map +1 -0
- package/dist/isl/process/index.d.ts +6 -0
- package/dist/isl/process/index.d.ts.map +1 -0
- package/dist/isl/process/index.js +6 -0
- package/dist/isl/process/index.js.map +1 -0
- package/dist/isl/sanitize.d.ts +5 -5
- package/dist/isl/sanitize.d.ts.map +1 -1
- package/dist/isl/sanitize.js +24 -38
- package/dist/isl/sanitize.js.map +1 -1
- package/dist/isl/signals.d.ts +98 -0
- package/dist/isl/signals.d.ts.map +1 -0
- package/dist/isl/signals.js +92 -0
- package/dist/isl/signals.js.map +1 -0
- package/dist/isl/types.d.ts +4 -48
- package/dist/isl/types.d.ts.map +1 -1
- package/dist/isl/types.js +1 -1
- package/dist/isl/value-objects/PiDetection.d.ts +2 -1
- package/dist/isl/value-objects/PiDetection.d.ts.map +1 -1
- package/dist/isl/value-objects/PiDetectionResult.d.ts +2 -3
- package/dist/isl/value-objects/PiDetectionResult.d.ts.map +1 -1
- package/dist/isl/value-objects/PiDetectionResult.js +1 -27
- package/dist/isl/value-objects/PiDetectionResult.js.map +1 -1
- package/dist/isl/value-objects/RiskScore.d.ts +70 -0
- package/dist/isl/value-objects/RiskScore.d.ts.map +1 -0
- package/dist/isl/value-objects/RiskScore.js +85 -0
- package/dist/isl/value-objects/RiskScore.js.map +1 -0
- package/dist/isl/value-objects/index.d.ts +2 -2
- package/dist/isl/value-objects/index.d.ts.map +1 -1
- package/dist/isl/value-objects/index.js +1 -3
- package/dist/isl/value-objects/index.js.map +1 -1
- package/dist/shared/audit.d.ts +150 -0
- package/dist/shared/audit.d.ts.map +1 -0
- package/dist/shared/audit.js +173 -0
- package/dist/shared/audit.js.map +1 -0
- package/dist/shared/index.d.ts +5 -3
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index.js +5 -6
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/types.d.ts +36 -0
- package/dist/shared/types.d.ts.map +1 -0
- package/dist/shared/types.js +2 -0
- package/dist/shared/types.js.map +1 -0
- package/package.json +7 -2
- package/dist/isl/value-objects/AnomalyScore.d.ts.map +0 -1
- /package/dist/{isl → AAL}/value-objects/AnomalyScore.js +0 -0
- /package/dist/{isl → AAL}/value-objects/PolicyRule.d.ts +0 -0
- /package/dist/{isl → AAL}/value-objects/PolicyRule.js +0 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* buildDecisionReason - Builds the reason for an AAL decision
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* This function builds a human-readable description of why
|
|
6
|
+
* a specific decision was made (ALLOW, WARN, BLOCK).
|
|
7
|
+
*
|
|
8
|
+
* **Responsibility:**
|
|
9
|
+
* - Generate readable decision reasons
|
|
10
|
+
* - Include risk score and threshold information
|
|
11
|
+
* - Facilitate auditing and debugging
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Builds the reason for a decision
|
|
15
|
+
*
|
|
16
|
+
* @param action - Determined action (ALLOW, WARN, BLOCK)
|
|
17
|
+
* @param islSignal - ISL signal that originated the decision
|
|
18
|
+
* @param policy - Applied policy
|
|
19
|
+
* @returns DecisionReason with complete information
|
|
20
|
+
*/
|
|
21
|
+
export function buildDecisionReason(action, islSignal, policy) {
|
|
22
|
+
let threshold;
|
|
23
|
+
let reason;
|
|
24
|
+
if (action === 'BLOCK') {
|
|
25
|
+
threshold = policy.thresholds.block;
|
|
26
|
+
reason = `Risk score ${islSignal.riskScore.toFixed(3)} exceeds block threshold ${threshold.toFixed(3)}`;
|
|
27
|
+
}
|
|
28
|
+
else if (action === 'WARN') {
|
|
29
|
+
threshold = policy.thresholds.warn;
|
|
30
|
+
reason = `Risk score ${islSignal.riskScore.toFixed(3)} exceeds warn threshold ${threshold.toFixed(3)} but is below block threshold`;
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
threshold = policy.thresholds.warn;
|
|
34
|
+
reason = `Risk score ${islSignal.riskScore.toFixed(3)} is below warn threshold ${threshold.toFixed(3)}`;
|
|
35
|
+
}
|
|
36
|
+
if (islSignal.hasThreats) {
|
|
37
|
+
reason += `. ${islSignal.piDetection.detections.length} threat(s) detected.`;
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
action,
|
|
41
|
+
riskScore: islSignal.riskScore,
|
|
42
|
+
threshold,
|
|
43
|
+
reason,
|
|
44
|
+
hasThreats: islSignal.hasThreats,
|
|
45
|
+
detectionCount: islSignal.piDetection.detections.length
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=buildDecisionReason.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildDecisionReason.js","sourceRoot":"","sources":["../../../src/AAL/process/buildDecisionReason.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAkBH;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CACjC,MAAqB,EACrB,SAAoB,EACpB,MAAmB;IAEnB,IAAI,SAAiB,CAAA;IACrB,IAAI,MAAc,CAAA;IAElB,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;QACvB,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAA;QACnC,MAAM,GAAG,cAAc,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,4BAA4B,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAA;IACzG,CAAC;SAAM,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QAC7B,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAA;QAClC,MAAM,GAAG,cAAc,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,2BAA2B,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,+BAA+B,CAAA;IACrI,CAAC;SAAM,CAAC;QACN,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAA;QAClC,MAAM,GAAG,cAAc,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,4BAA4B,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAA;IACzG,CAAC;IAED,IAAI,SAAS,CAAC,UAAU,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,SAAS,CAAC,WAAW,CAAC,UAAU,CAAC,MAAM,sBAAsB,CAAA;IAC9E,CAAC;IAED,OAAO;QACL,MAAM;QACN,SAAS,EAAE,SAAS,CAAC,SAAS;QAC9B,SAAS;QACT,MAAM;QACN,UAAU,EAAE,SAAS,CAAC,UAAU;QAChC,cAAc,EAAE,SAAS,CAAC,WAAW,CAAC,UAAU,CAAC,MAAM;KACxD,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* buildRemovalPlan - Builds a plan for instruction removal
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* This function builds a plan of which instructions should be removed
|
|
6
|
+
* based on ISL detections and agent policy.
|
|
7
|
+
*
|
|
8
|
+
* **Responsibility:**
|
|
9
|
+
* - Identify instructions to remove
|
|
10
|
+
* - Create removal plan based on detections
|
|
11
|
+
* - Does not execute the removal (that is SDK responsibility)
|
|
12
|
+
*/
|
|
13
|
+
import type { RemovedInstruction } from '../types.js';
|
|
14
|
+
import type { ISLSignal } from '../../isl/signals.js';
|
|
15
|
+
import type { AgentPolicy } from '../types.js';
|
|
16
|
+
/**
|
|
17
|
+
* Plan for instruction removal
|
|
18
|
+
*/
|
|
19
|
+
export interface RemovalPlan {
|
|
20
|
+
readonly instructionsToRemove: readonly RemovedInstruction[];
|
|
21
|
+
readonly shouldRemove: boolean;
|
|
22
|
+
readonly removalEnabled: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Builds a plan for instruction removal
|
|
26
|
+
*
|
|
27
|
+
* @param islSignal - ISL signal with detections
|
|
28
|
+
* @param policy - Agent policy
|
|
29
|
+
* @returns RemovalPlan with instructions to remove
|
|
30
|
+
*/
|
|
31
|
+
export declare function buildRemovalPlan(islSignal: ISLSignal, policy: AgentPolicy): RemovalPlan;
|
|
32
|
+
//# sourceMappingURL=buildRemovalPlan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildRemovalPlan.d.ts","sourceRoot":"","sources":["../../../src/AAL/process/buildRemovalPlan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,oBAAoB,EAAE,SAAS,kBAAkB,EAAE,CAAA;IAC5D,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAA;IAC9B,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAA;CACjC;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,WAAW,GAClB,WAAW,CAkCb"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* buildRemovalPlan - Builds a plan for instruction removal
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* This function builds a plan of which instructions should be removed
|
|
6
|
+
* based on ISL detections and agent policy.
|
|
7
|
+
*
|
|
8
|
+
* **Responsibility:**
|
|
9
|
+
* - Identify instructions to remove
|
|
10
|
+
* - Create removal plan based on detections
|
|
11
|
+
* - Does not execute the removal (that is SDK responsibility)
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Builds a plan for instruction removal
|
|
15
|
+
*
|
|
16
|
+
* @param islSignal - ISL signal with detections
|
|
17
|
+
* @param policy - Agent policy
|
|
18
|
+
* @returns RemovalPlan with instructions to remove
|
|
19
|
+
*/
|
|
20
|
+
export function buildRemovalPlan(islSignal, policy) {
|
|
21
|
+
// If removal is not enabled, return empty plan
|
|
22
|
+
if (!policy.removal.enabled) {
|
|
23
|
+
return {
|
|
24
|
+
instructionsToRemove: Object.freeze([]),
|
|
25
|
+
shouldRemove: false,
|
|
26
|
+
removalEnabled: false
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
// If no threats detected, nothing to remove
|
|
30
|
+
if (!islSignal.hasThreats) {
|
|
31
|
+
return {
|
|
32
|
+
instructionsToRemove: Object.freeze([]),
|
|
33
|
+
shouldRemove: false,
|
|
34
|
+
removalEnabled: true
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
// Build list of instructions to remove from detections
|
|
38
|
+
const instructionsToRemove = islSignal.piDetection.detections.map((detection) => ({
|
|
39
|
+
type: detection.pattern_type,
|
|
40
|
+
pattern: detection.matched_pattern,
|
|
41
|
+
position: detection.position,
|
|
42
|
+
description: `Detected ${detection.pattern_type} pattern with confidence ${detection.confidence.toFixed(3)}`
|
|
43
|
+
}));
|
|
44
|
+
return {
|
|
45
|
+
instructionsToRemove: Object.freeze(instructionsToRemove),
|
|
46
|
+
shouldRemove: instructionsToRemove.length > 0,
|
|
47
|
+
removalEnabled: true
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=buildRemovalPlan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildRemovalPlan.js","sourceRoot":"","sources":["../../../src/AAL/process/buildRemovalPlan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAeH;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAC9B,SAAoB,EACpB,MAAmB;IAEnB,+CAA+C;IAC/C,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QAC5B,OAAO;YACL,oBAAoB,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;YACvC,YAAY,EAAE,KAAK;YACnB,cAAc,EAAE,KAAK;SACtB,CAAA;IACH,CAAC;IAED,4CAA4C;IAC5C,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;QAC1B,OAAO;YACL,oBAAoB,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;YACvC,YAAY,EAAE,KAAK;YACnB,cAAc,EAAE,IAAI;SACrB,CAAA;IACH,CAAC;IAED,uDAAuD;IACvD,MAAM,oBAAoB,GAAyB,SAAS,CAAC,WAAW,CAAC,UAAU,CAAC,GAAG,CACrF,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;QACd,IAAI,EAAE,SAAS,CAAC,YAA0C;QAC1D,OAAO,EAAE,SAAS,CAAC,eAAe;QAClC,QAAQ,EAAE,SAAS,CAAC,QAAQ;QAC5B,WAAW,EAAE,YAAY,SAAS,CAAC,YAAY,4BAA4B,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;KAC7G,CAAC,CACH,CAAA;IAED,OAAO;QACL,oBAAoB,EAAE,MAAM,CAAC,MAAM,CAAC,oBAAoB,CAAC;QACzD,YAAY,EAAE,oBAAoB,CAAC,MAAM,GAAG,CAAC;QAC7C,cAAc,EAAE,IAAI;KACrB,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AAL Process - AAL processing functions
|
|
3
|
+
*/
|
|
4
|
+
export { resolveAgentAction, resolveAgentActionWithScore } from './resolveAgentAction.js';
|
|
5
|
+
export { buildDecisionReason } from './buildDecisionReason.js';
|
|
6
|
+
export type { DecisionReason } from './buildDecisionReason.js';
|
|
7
|
+
export { buildRemovalPlan } from './buildRemovalPlan.js';
|
|
8
|
+
export type { RemovalPlan } from './buildRemovalPlan.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/AAL/process/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAA;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,YAAY,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AAL Process - AAL processing functions
|
|
3
|
+
*/
|
|
4
|
+
export { resolveAgentAction, resolveAgentActionWithScore } from './resolveAgentAction.js';
|
|
5
|
+
export { buildDecisionReason } from './buildDecisionReason.js';
|
|
6
|
+
export { buildRemovalPlan } from './buildRemovalPlan.js';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/AAL/process/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAA;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAE9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* resolveAgentAction - Resolves agent action based on ISL signals and policies
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* This function takes an ISL signal and an agent policy,
|
|
6
|
+
* and determines what action the agent should take (ALLOW, WARN, BLOCK).
|
|
7
|
+
*
|
|
8
|
+
* **Responsibility:**
|
|
9
|
+
* - Evaluate ISL signals against policy thresholds
|
|
10
|
+
* - Determine semantic action (does not execute the action)
|
|
11
|
+
* - Return decision based on risk score and thresholds
|
|
12
|
+
*/
|
|
13
|
+
import type { ISLSignal } from '../../isl/signals.js';
|
|
14
|
+
import type { AgentPolicy, AnomalyAction } from '../types.js';
|
|
15
|
+
/**
|
|
16
|
+
* Resolves agent action based on ISL signal and policy
|
|
17
|
+
*
|
|
18
|
+
* @param islSignal - Signal emitted by ISL
|
|
19
|
+
* @param policy - Agent policy with thresholds
|
|
20
|
+
* @returns AnomalyAction (ALLOW, WARN, BLOCK)
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolveAgentAction(islSignal: ISLSignal, policy: AgentPolicy): AnomalyAction;
|
|
23
|
+
/**
|
|
24
|
+
* Resolves agent action and returns a complete AnomalyScore
|
|
25
|
+
*
|
|
26
|
+
* @param islSignal - Signal emitted by ISL
|
|
27
|
+
* @param policy - Agent policy with thresholds
|
|
28
|
+
* @returns AnomalyScore with score and action
|
|
29
|
+
*/
|
|
30
|
+
export declare function resolveAgentActionWithScore(islSignal: ISLSignal, policy: AgentPolicy): import("../value-objects/AnomalyScore.js").AnomalyScore;
|
|
31
|
+
//# sourceMappingURL=resolveAgentAction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveAgentAction.d.ts","sourceRoot":"","sources":["../../../src/AAL/process/resolveAgentAction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAG7D;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,WAAW,GAClB,aAAa,CAaf;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,WAAW,2DAIpB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* resolveAgentAction - Resolves agent action based on ISL signals and policies
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* This function takes an ISL signal and an agent policy,
|
|
6
|
+
* and determines what action the agent should take (ALLOW, WARN, BLOCK).
|
|
7
|
+
*
|
|
8
|
+
* **Responsibility:**
|
|
9
|
+
* - Evaluate ISL signals against policy thresholds
|
|
10
|
+
* - Determine semantic action (does not execute the action)
|
|
11
|
+
* - Return decision based on risk score and thresholds
|
|
12
|
+
*/
|
|
13
|
+
import { createAnomalyScore } from '../value-objects/AnomalyScore.js';
|
|
14
|
+
/**
|
|
15
|
+
* Resolves agent action based on ISL signal and policy
|
|
16
|
+
*
|
|
17
|
+
* @param islSignal - Signal emitted by ISL
|
|
18
|
+
* @param policy - Agent policy with thresholds
|
|
19
|
+
* @returns AnomalyAction (ALLOW, WARN, BLOCK)
|
|
20
|
+
*/
|
|
21
|
+
export function resolveAgentAction(islSignal, policy) {
|
|
22
|
+
const riskScore = islSignal.riskScore;
|
|
23
|
+
// Evaluate policy thresholds
|
|
24
|
+
if (riskScore >= policy.thresholds.block) {
|
|
25
|
+
return 'BLOCK';
|
|
26
|
+
}
|
|
27
|
+
if (riskScore >= policy.thresholds.warn) {
|
|
28
|
+
return 'WARN';
|
|
29
|
+
}
|
|
30
|
+
return 'ALLOW';
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Resolves agent action and returns a complete AnomalyScore
|
|
34
|
+
*
|
|
35
|
+
* @param islSignal - Signal emitted by ISL
|
|
36
|
+
* @param policy - Agent policy with thresholds
|
|
37
|
+
* @returns AnomalyScore with score and action
|
|
38
|
+
*/
|
|
39
|
+
export function resolveAgentActionWithScore(islSignal, policy) {
|
|
40
|
+
const action = resolveAgentAction(islSignal, policy);
|
|
41
|
+
return createAnomalyScore(islSignal.riskScore, action);
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=resolveAgentAction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveAgentAction.js","sourceRoot":"","sources":["../../../src/AAL/process/resolveAgentAction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AAErE;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAChC,SAAoB,EACpB,MAAmB;IAEnB,MAAM,SAAS,GAAG,SAAS,CAAC,SAAS,CAAA;IAErC,6BAA6B;IAC7B,IAAI,SAAS,IAAI,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;QACzC,OAAO,OAAO,CAAA;IAChB,CAAC;IAED,IAAI,SAAS,IAAI,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;QACxC,OAAO,MAAM,CAAA;IACf,CAAC;IAED,OAAO,OAAO,CAAA;AAChB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,2BAA2B,CACzC,SAAoB,EACpB,MAAmB;IAEnB,MAAM,MAAM,GAAG,kBAAkB,CAAC,SAAS,EAAE,MAAM,CAAC,CAAA;IACpD,OAAO,kBAAkB,CAAC,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC,CAAA;AACxD,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import type { RiskScore } from '../isl/value-objects/RiskScore.js';
|
|
2
|
+
import type { Position } from "../shared/types.js";
|
|
3
|
+
/**
|
|
4
|
+
* AnomalyAction
|
|
5
|
+
*
|
|
6
|
+
* Represents the high-level action an agent should take
|
|
7
|
+
* after evaluating security signals.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* This is a semantic decision only.
|
|
11
|
+
* Execution of the action is handled by the SDK.
|
|
12
|
+
*/
|
|
13
|
+
export type AnomalyAction = 'ALLOW' | 'WARN' | 'BLOCK';
|
|
14
|
+
/**
|
|
15
|
+
* BlockedIntent
|
|
16
|
+
*
|
|
17
|
+
* Represents an intent that is explicitly blocked by policy.
|
|
18
|
+
* Used for semantic classification and auditing purposes.
|
|
19
|
+
*/
|
|
20
|
+
export type BlockedIntent = string;
|
|
21
|
+
/**
|
|
22
|
+
* SensitiveScope
|
|
23
|
+
*
|
|
24
|
+
* Represents a sensitive topic or domain that requires
|
|
25
|
+
* additional validation or stricter policy evaluation.
|
|
26
|
+
*/
|
|
27
|
+
export type SensitiveScope = string;
|
|
28
|
+
/**
|
|
29
|
+
* ProtectedRole
|
|
30
|
+
*
|
|
31
|
+
* Represents a role that must not be overridden or impersonated
|
|
32
|
+
* by user-provided instructions.
|
|
33
|
+
*/
|
|
34
|
+
export type ProtectedRole = string;
|
|
35
|
+
/**
|
|
36
|
+
* ImmutableInstruction
|
|
37
|
+
*
|
|
38
|
+
* Represents an instruction that must not be altered,
|
|
39
|
+
* removed, or overridden under any circumstance.
|
|
40
|
+
*/
|
|
41
|
+
export type ImmutableInstruction = string;
|
|
42
|
+
/**
|
|
43
|
+
* RemovedInstruction
|
|
44
|
+
*
|
|
45
|
+
* Describes an instruction that was identified as malicious
|
|
46
|
+
* and marked for removal by the Agent Action Lock (AAL).
|
|
47
|
+
*
|
|
48
|
+
* @remarks
|
|
49
|
+
* This interface is descriptive only.
|
|
50
|
+
* The actual removal is performed by the SDK.
|
|
51
|
+
*
|
|
52
|
+
* Instances of this type are typically recorded in lineage
|
|
53
|
+
* for auditability and explainability.
|
|
54
|
+
*/
|
|
55
|
+
export interface RemovedInstruction {
|
|
56
|
+
/**
|
|
57
|
+
* The classified threat category that triggered the removal.
|
|
58
|
+
*/
|
|
59
|
+
readonly type: 'system_command' | 'role_swapping' | 'jailbreak' | 'override' | 'manipulation';
|
|
60
|
+
/**
|
|
61
|
+
* The detected pattern or signature that matched the threat.
|
|
62
|
+
*/
|
|
63
|
+
readonly pattern: string;
|
|
64
|
+
/**
|
|
65
|
+
* The exact position of the instruction within the original content.
|
|
66
|
+
*/
|
|
67
|
+
readonly position: Position;
|
|
68
|
+
/**
|
|
69
|
+
* Human-readable explanation of why the instruction was removed.
|
|
70
|
+
*/
|
|
71
|
+
readonly description: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* AgentPolicy
|
|
75
|
+
*
|
|
76
|
+
* Defines how an agent should react to risk signals
|
|
77
|
+
* emitted by the Instruction Sanitization Layer (ISL).
|
|
78
|
+
*
|
|
79
|
+
* @remarks
|
|
80
|
+
* - This is a pure configuration object.
|
|
81
|
+
* - It contains no logic and produces no side effects.
|
|
82
|
+
* - Policies are interpreted by AAL and executed by the SDK.
|
|
83
|
+
*
|
|
84
|
+
* AgentPolicy describes *intent*, not implementation.
|
|
85
|
+
*/
|
|
86
|
+
export interface AgentPolicy {
|
|
87
|
+
/**
|
|
88
|
+
* Risk thresholds that drives desicion making.
|
|
89
|
+
*/
|
|
90
|
+
thresholds: {
|
|
91
|
+
warn: RiskScore;
|
|
92
|
+
block: RiskScore;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Whether malicious instructions should be removed
|
|
96
|
+
* before reaching the LLM.
|
|
97
|
+
*/
|
|
98
|
+
removal: {
|
|
99
|
+
enabled: boolean;
|
|
100
|
+
};
|
|
101
|
+
mode?: 'strict' | 'balanced' | 'permissive';
|
|
102
|
+
explain?: boolean;
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/AAL/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAA;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAGlD;;;;;;;;;GASG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,CAAA;AAEtD;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAA;AAElC;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAA;AAEnC;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAA;AAElC;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAA;AAEzC;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,QAAQ,CAAC,IAAI,EACT,gBAAgB,GAChB,eAAe,GACf,WAAW,GACX,UAAU,GACV,cAAc,CAAA;IAElB;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IAExB;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAA;IAE3B;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAC7B;AAED;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,WAAW;IAE1B;;OAEG;IACH,UAAU,EAAE;QACV,IAAI,EAAE,SAAS,CAAC;QAChB,KAAK,EAAE,SAAS,CAAC;KAClB,CAAC;IAED;;;MAGE;IACH,OAAO,EAAE;QACP,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;IAGF,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,YAAY,CAAC;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAC;CAGnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/AAL/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnomalyScore.d.ts","sourceRoot":"","sources":["../../../src/AAL/value-objects/AnomalyScore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAEhD;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;IACzB,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAA;CAC/B,CAAA;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,GAAG,YAAY,CAUxF;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAEzD;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAEzD;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAExD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnomalyScore.js","sourceRoot":"","sources":["../../../src/
|
|
1
|
+
{"version":3,"file":"AnomalyScore.js","sourceRoot":"","sources":["../../../src/AAL/value-objects/AnomalyScore.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAgB,EAAE,MAAqB;IACxE,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAA;IAClE,CAAC;IAED,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACjD,MAAM,IAAI,KAAK,CAAC,0BAA0B,MAAM,sCAAsC,CAAC,CAAA;IACzF,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAA;AAC1B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,OAAqB;IAC9C,OAAO,OAAO,CAAC,MAAM,KAAK,OAAO,CAAA;AACnC,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,OAAqB;IAC9C,OAAO,OAAO,CAAC,MAAM,KAAK,MAAM,CAAA;AAClC,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,OAAqB;IAC7C,OAAO,OAAO,CAAC,MAAM,KAAK,OAAO,CAAA;AACnC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PolicyRule.d.ts","sourceRoot":"","sources":["../../../src/
|
|
1
|
+
{"version":3,"file":"PolicyRule.d.ts","sourceRoot":"","sources":["../../../src/AAL/value-objects/PolicyRule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAErG;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAC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U,GAAG,OAAO,CAE1E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PolicyRule.js","sourceRoot":"","sources":["../../../src/
|
|
1
|
+
{"version":3,"file":"PolicyRule.js","sourceRoot":"","sources":["../../../src/AAL/value-objects/PolicyRule.ts"],"names":[],"mappings":"AA8BA;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,OAAe,EACf,cAAwC,EACxC,cAAyC,EACzC,cAAoC,EACpC,qBAAkD;IAElD,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3E,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAA;IAClE,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,SAAS,CAAC,4CAA4C,CAAC,CAAA;IACnE,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,SAAS,CAAC,4CAA4C,CAAC,CAAA;IACnE,CAAC;IAED,IAAI,CAAC,cAAc,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE,CAAC;QAC1D,MAAM,IAAI,SAAS,CAAC,6CAA6C,CAAC,CAAA;IACpE,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,CAAC;QAClD,MAAM,IAAI,SAAS,CAAC,2DAA2D,CAAC,CAAA;IAClF,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,qBAAqB,CAAC,EAAE,CAAC;QACzD,MAAM,IAAI,SAAS,CAAC,kEAAkE,CAAC,CAAA;IACzF,CAAC;IAED,IAAI,CAAC,qBAAqB,IAAI,OAAO,qBAAqB,KAAK,QAAQ,EAAE,CAAC;QACxE,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cAAc,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;AAC9C,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,MAAkB,EAAE,IAAY;IAC9D,OAAO,MAAM,CAAC,cAAc,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;AAC5D,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,MAAkB,EAAE,WAAmB;IAC5E,OAAO,MAAM,CAAC,cAAc,CAAC,qBAAqB,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAA;AAC1E,CAAC;AAED,MAAM,UAAU,8BAA8B,CAAC,MAAkB;IAC/D,OAAO,MAAM,CAAC,qBAAqB,CAAC,OAAO,CAAA;AAC7C,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { AnomalyScore } from './AnomalyScore.js';
|
|
2
|
+
export type { PolicyRule } from './PolicyRule.js';
|
|
3
|
+
export { createAnomalyScore, isHighRisk, isWarnRisk, isLowRisk } from './AnomalyScore.js';
|
|
4
|
+
export { createPolicyRule, isIntentBlocked, isScopeSensitive, isRoleProtected, isInstructionImmutable, isContextLeakPreventionEnabled } from './PolicyRule.js';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/AAL/value-objects/index.ts"],"names":[],"mappings":"AAEC,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,EACJ,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,SAAS,EACV,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,sBAAsB,EACtB,8BAA8B,EAC/B,MAAM,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { createAnomalyScore, isHighRisk, isWarnRisk, isLowRisk } from './AnomalyScore.js';
|
|
2
|
+
export { createPolicyRule, isIntentBlocked, isScopeSensitive, isRoleProtected, isInstructionImmutable, isContextLeakPreventionEnabled } from './PolicyRule.js';
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/AAL/value-objects/index.ts"],"names":[],"mappings":"AAKC,OAAO,EACJ,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,SAAS,EACV,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,sBAAsB,EACtB,8BAA8B,EAC/B,MAAM,iBAAiB,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,24 +2,28 @@
|
|
|
2
2
|
* @ai-pip/core - Core implementation of the AI-PIP protocol
|
|
3
3
|
*
|
|
4
4
|
* @remarks
|
|
5
|
-
* Main entry point that re-exports all layers (CSL, ISL, CPE, Shared)
|
|
5
|
+
* Main entry point that re-exports all layers (CSL, ISL, CPE, AAL ,Shared)
|
|
6
6
|
*
|
|
7
7
|
* You can import from specific layers:
|
|
8
8
|
* - import { segment } from '@ai-pip/core/csl'
|
|
9
9
|
* - import { sanitize } from '@ai-pip/core/isl'
|
|
10
10
|
* - import { envelope } from '@ai-pip/core/cpe'
|
|
11
|
+
* - import { createAnomalyScore } from '@ai-pip/core/AAL'
|
|
11
12
|
*
|
|
12
13
|
* Or import everything from the main entry point:
|
|
13
|
-
* - import { addLineageEntry, segment, sanitize, envelope } from '@ai-pip/core'
|
|
14
|
+
* - import { addLineageEntry, segment, sanitize, envelope, createAnomalyScore } from '@ai-pip/core'
|
|
14
15
|
*
|
|
15
16
|
* Note: Shared functions are only available from the main entry point, not as a subpath.
|
|
16
17
|
*/
|
|
17
18
|
export { segment, classifySource, classifyOrigin, initLineage, createLineageEntry, generateId, splitByContextRules, OriginType, TrustLevelType, ClassificationError, SegmentationError } from './csl/index.js';
|
|
18
19
|
export type { HashAlgorithm, Source, CSLInput, CSLSegment, CSLResult, TrustLevel, Origin, LineageEntry, ContentHash } from './csl/index.js';
|
|
19
|
-
export { sanitize } from './isl/index.js';
|
|
20
|
-
export type { RiskScore,
|
|
21
|
-
export { createPiDetection, getDetectionLength, isHighConfidence, isMediumConfidence, isLowConfidence, createPiDetectionResult, hasDetections, getDetectionCount, getDetectionsByType, getHighestConfidenceDetection,
|
|
22
|
-
export { addLineageEntry, addLineageEntries, filterLineageByStep, getLastLineageEntry } from './shared/index.js';
|
|
20
|
+
export { sanitize, emitSignal, createISLSignal, isHighRiskSignal, isMediumRiskSignal, isLowRiskSignal } from './isl/index.js';
|
|
21
|
+
export type { RiskScore, ISLSegment, ISLResult, ISLSignal, PiDetection, PiDetectionResult, Pattern } from './isl/index.js';
|
|
22
|
+
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, SanitizationError } from './isl/index.js';
|
|
23
|
+
export { addLineageEntry, addLineageEntries, filterLineageByStep, getLastLineageEntry, formatLineageForAudit, formatCSLForAudit, formatISLForAudit, formatISLSignalForAudit, formatAALForAudit, formatCPEForAudit, formatPipelineAudit } from './shared/index.js';
|
|
24
|
+
export type { LineageEntryLike, CSLResultLike, ISLResultLike, ISLSignalLike, DecisionReasonLike, RemovalPlanLike, CPEResultLike } from './shared/index.js';
|
|
23
25
|
export { envelope, createNonce, isValidNonce, equalsNonce, createMetadata, isValidMetadata, CURRENT_PROTOCOL_VERSION, createSignature, EnvelopeError } from './cpe/index.js';
|
|
24
26
|
export type { Nonce, SignatureVO, ProtocolVersion, Timestamp, NonceValue, SignatureAlgorithm, Signature, CPEMetadata, CPEEvelope, CPEResult } from './cpe/index.js';
|
|
27
|
+
export { createAnomalyScore, isHighRisk, isLowRisk, isWarnRisk, isRoleProtected, isContextLeakPreventionEnabled, isInstructionImmutable, isIntentBlocked, isScopeSensitive, resolveAgentAction, resolveAgentActionWithScore, buildDecisionReason, buildRemovalPlan, buildAALLineage } from './AAL/index.js';
|
|
28
|
+
export type { AnomalyAction, AnomalyScore, RemovedInstruction, BlockedIntent, SensitiveScope, ProtectedRole, ImmutableInstruction, AgentPolicy, DecisionReason, RemovalPlan } from './AAL/index.js';
|
|
25
29
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EACL,OAAO,EACP,cAAc,EACd,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,UAAU,EACV,mBAAmB,EACnB,UAAU,EACV,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,gBAAgB,CAAA;AACvB,YAAY,EACV,aAAa,EACb,MAAM,EACN,QAAQ,EACR,UAAU,EACV,SAAS,EACT,UAAU,EACV,MAAM,EACN,YAAY,EACZ,WAAW,EACZ,MAAM,gBAAgB,CAAA;AAGvB,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,eAAe,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAC7H,YAAY,EACV,SAAS,EACT,UAAU,EACV,SAAS,EACT,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,OAAO,EACR,MAAM,gBAAgB,CAAA;AACvB,OAAO,EACL,iB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aAAa,EACb,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,WAAW,EACX,cAAc,EACd,WAAW,EACd,MAAM,gBAAgB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -2,25 +2,28 @@
|
|
|
2
2
|
* @ai-pip/core - Core implementation of the AI-PIP protocol
|
|
3
3
|
*
|
|
4
4
|
* @remarks
|
|
5
|
-
* Main entry point that re-exports all layers (CSL, ISL, CPE, Shared)
|
|
5
|
+
* Main entry point that re-exports all layers (CSL, ISL, CPE, AAL ,Shared)
|
|
6
6
|
*
|
|
7
7
|
* You can import from specific layers:
|
|
8
8
|
* - import { segment } from '@ai-pip/core/csl'
|
|
9
9
|
* - import { sanitize } from '@ai-pip/core/isl'
|
|
10
10
|
* - import { envelope } from '@ai-pip/core/cpe'
|
|
11
|
+
* - import { createAnomalyScore } from '@ai-pip/core/AAL'
|
|
11
12
|
*
|
|
12
13
|
* Or import everything from the main entry point:
|
|
13
|
-
* - import { addLineageEntry, segment, sanitize, envelope } from '@ai-pip/core'
|
|
14
|
+
* - import { addLineageEntry, segment, sanitize, envelope, createAnomalyScore } from '@ai-pip/core'
|
|
14
15
|
*
|
|
15
16
|
* Note: Shared functions are only available from the main entry point, not as a subpath.
|
|
16
17
|
*/
|
|
17
18
|
// Re-export CSL
|
|
18
19
|
export { segment, classifySource, classifyOrigin, initLineage, createLineageEntry, generateId, splitByContextRules, OriginType, TrustLevelType, ClassificationError, SegmentationError } from './csl/index.js';
|
|
19
20
|
// Re-export ISL
|
|
20
|
-
export { sanitize } from './isl/index.js';
|
|
21
|
-
export { createPiDetection, getDetectionLength, isHighConfidence, isMediumConfidence, isLowConfidence, createPiDetectionResult, hasDetections, getDetectionCount, getDetectionsByType, getHighestConfidenceDetection,
|
|
21
|
+
export { sanitize, emitSignal, createISLSignal, isHighRiskSignal, isMediumRiskSignal, isLowRiskSignal } from './isl/index.js';
|
|
22
|
+
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, SanitizationError } from './isl/index.js';
|
|
22
23
|
// Re-export Shared
|
|
23
|
-
export { addLineageEntry, addLineageEntries, filterLineageByStep, getLastLineageEntry } from './shared/index.js';
|
|
24
|
+
export { addLineageEntry, addLineageEntries, filterLineageByStep, getLastLineageEntry, formatLineageForAudit, formatCSLForAudit, formatISLForAudit, formatISLSignalForAudit, formatAALForAudit, formatCPEForAudit, formatPipelineAudit } from './shared/index.js';
|
|
24
25
|
// Re-export CPE
|
|
25
26
|
export { envelope, createNonce, isValidNonce, equalsNonce, createMetadata, isValidMetadata, CURRENT_PROTOCOL_VERSION, createSignature, EnvelopeError } from './cpe/index.js';
|
|
27
|
+
// Re-export AAL
|
|
28
|
+
export { createAnomalyScore, isHighRisk, isLowRisk, isWarnRisk, isRoleProtected, isContextLeakPreventionEnabled, isInstructionImmutable, isIntentBlocked, isScopeSensitive, resolveAgentAction, resolveAgentActionWithScore, buildDecisionReason, buildRemovalPlan, buildAALLineage } from './AAL/index.js';
|
|
26
29
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,gBAAgB;AAChB,OAAO,EACL,OAAO,EACP,cAAc,EACd,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,UAAU,EACV,mBAAmB,EACnB,UAAU,EACV,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EAClB,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ISL (Instruction Sanitization Layer) - Semantic Core
|
|
3
3
|
*
|
|
4
4
|
* @remarks
|
|
5
|
-
* ISL
|
|
6
|
-
*
|
|
5
|
+
* ISL sanitizes malicious instructions received from CSL,
|
|
6
|
+
* applying different sanitization levels according to trust level.
|
|
7
|
+
*
|
|
8
|
+
* **Architecture:**
|
|
9
|
+
* - ISL processes content and emits signals (ISLSignal) for other layers
|
|
10
|
+
* - ISLResult is internal, ISLSignal is the external semantic contract
|
|
11
|
+
* - A layer should never consume the internal "result" of another layer
|
|
7
12
|
*/
|
|
8
13
|
export { sanitize } from './sanitize.js';
|
|
9
|
-
export
|
|
10
|
-
export {
|
|
14
|
+
export { buildISLResult, emitSignal } from './process/index.js';
|
|
15
|
+
export { buildISLLineage } from './lineage/index.js';
|
|
16
|
+
export type { ISLSignal } from './signals.js';
|
|
17
|
+
export { createISLSignal, isHighRiskSignal, isMediumRiskSignal, isLowRiskSignal } from './signals.js';
|
|
18
|
+
export type { PiDetection, PiDetectionResult, Pattern, RiskScore } from './value-objects/index.js';
|
|
19
|
+
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';
|
|
11
20
|
export { SanitizationError } from './exceptions/SanitizationError.js';
|
|
12
|
-
export type { RiskScore
|
|
21
|
+
export type { RiskScore as RiskScoreType, ISLSegment, ISLResult } from './types.js';
|
|
13
22
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/isl/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/isl/index.ts"],"names":[],"mappings":"AAAA
|
|
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;AAGxC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAG/D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAGpD,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EAChB,MAAM,cAAc,CAAA;AAGrB,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,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"}
|
package/dist/isl/index.js
CHANGED
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* ISL (Instruction Sanitization Layer) - Core
|
|
2
|
+
* ISL (Instruction Sanitization Layer) - Semantic Core
|
|
3
3
|
*
|
|
4
4
|
* @remarks
|
|
5
|
-
* ISL
|
|
6
|
-
*
|
|
5
|
+
* ISL sanitizes malicious instructions received from CSL,
|
|
6
|
+
* applying different sanitization levels according to trust level.
|
|
7
|
+
*
|
|
8
|
+
* **Architecture:**
|
|
9
|
+
* - ISL processes content and emits signals (ISLSignal) for other layers
|
|
10
|
+
* - ISLResult is internal, ISLSignal is the external semantic contract
|
|
11
|
+
* - A layer should never consume the internal "result" of another layer
|
|
7
12
|
*/
|
|
8
|
-
//
|
|
13
|
+
// Main pure functions
|
|
9
14
|
export { sanitize } from './sanitize.js';
|
|
10
|
-
|
|
15
|
+
// Process functions
|
|
16
|
+
export { buildISLResult, emitSignal } from './process/index.js';
|
|
17
|
+
// Lineage functions
|
|
18
|
+
export { buildISLLineage } from './lineage/index.js';
|
|
19
|
+
export { createISLSignal, isHighRiskSignal, isMediumRiskSignal, isLowRiskSignal } from './signals.js';
|
|
20
|
+
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';
|
|
11
21
|
// Exceptions
|
|
12
22
|
export { SanitizationError } from './exceptions/SanitizationError.js';
|
|
13
23
|
//# sourceMappingURL=index.js.map
|
package/dist/isl/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/isl/index.ts"],"names":[],"mappings":"AAAA
|
|
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;AAExC,oBAAoB;AACpB,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAE/D,oBAAoB;AACpB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAIpD,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EAChB,MAAM,cAAc,CAAA;AAIrB,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"}
|