@aegis-scan/core 0.16.6 → 0.18.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 (125) hide show
  1. package/README.md +37 -0
  2. package/dist/index.d.ts +5 -0
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +5 -0
  5. package/dist/index.js.map +1 -1
  6. package/dist/manipulation-resistance/ai-io-boundary.d.ts +84 -0
  7. package/dist/manipulation-resistance/ai-io-boundary.d.ts.map +1 -0
  8. package/dist/manipulation-resistance/ai-io-boundary.js +216 -0
  9. package/dist/manipulation-resistance/ai-io-boundary.js.map +1 -0
  10. package/dist/manipulation-resistance/config-integrity.d.ts +28 -0
  11. package/dist/manipulation-resistance/config-integrity.d.ts.map +1 -0
  12. package/dist/manipulation-resistance/config-integrity.js +53 -0
  13. package/dist/manipulation-resistance/config-integrity.js.map +1 -0
  14. package/dist/manipulation-resistance/index.d.ts +16 -0
  15. package/dist/manipulation-resistance/index.d.ts.map +1 -0
  16. package/dist/manipulation-resistance/index.js +16 -0
  17. package/dist/manipulation-resistance/index.js.map +1 -0
  18. package/dist/manipulation-resistance/instruction-boundary.d.ts +50 -0
  19. package/dist/manipulation-resistance/instruction-boundary.d.ts.map +1 -0
  20. package/dist/manipulation-resistance/instruction-boundary.js +114 -0
  21. package/dist/manipulation-resistance/instruction-boundary.js.map +1 -0
  22. package/dist/manipulation-resistance/oob-blocker.d.ts +58 -0
  23. package/dist/manipulation-resistance/oob-blocker.d.ts.map +1 -0
  24. package/dist/manipulation-resistance/oob-blocker.js +55 -0
  25. package/dist/manipulation-resistance/oob-blocker.js.map +1 -0
  26. package/dist/manipulation-resistance/redirect-policy.d.ts +43 -0
  27. package/dist/manipulation-resistance/redirect-policy.d.ts.map +1 -0
  28. package/dist/manipulation-resistance/redirect-policy.js +197 -0
  29. package/dist/manipulation-resistance/redirect-policy.js.map +1 -0
  30. package/dist/manipulation-resistance/response-validator.d.ts +33 -0
  31. package/dist/manipulation-resistance/response-validator.d.ts.map +1 -0
  32. package/dist/manipulation-resistance/response-validator.js +186 -0
  33. package/dist/manipulation-resistance/response-validator.js.map +1 -0
  34. package/dist/manipulation-resistance/scope-expansion-detector.d.ts +33 -0
  35. package/dist/manipulation-resistance/scope-expansion-detector.d.ts.map +1 -0
  36. package/dist/manipulation-resistance/scope-expansion-detector.js +68 -0
  37. package/dist/manipulation-resistance/scope-expansion-detector.js.map +1 -0
  38. package/dist/oversight/approval-gates.d.ts +77 -0
  39. package/dist/oversight/approval-gates.d.ts.map +1 -0
  40. package/dist/oversight/approval-gates.js +133 -0
  41. package/dist/oversight/approval-gates.js.map +1 -0
  42. package/dist/oversight/authority-matrix.d.ts +39 -0
  43. package/dist/oversight/authority-matrix.d.ts.map +1 -0
  44. package/dist/oversight/authority-matrix.js +75 -0
  45. package/dist/oversight/authority-matrix.js.map +1 -0
  46. package/dist/oversight/cia-scoring.d.ts +56 -0
  47. package/dist/oversight/cia-scoring.d.ts.map +1 -0
  48. package/dist/oversight/cia-scoring.js +98 -0
  49. package/dist/oversight/cia-scoring.js.map +1 -0
  50. package/dist/oversight/escalation.d.ts +58 -0
  51. package/dist/oversight/escalation.d.ts.map +1 -0
  52. package/dist/oversight/escalation.js +97 -0
  53. package/dist/oversight/escalation.js.map +1 -0
  54. package/dist/oversight/index.d.ts +15 -0
  55. package/dist/oversight/index.d.ts.map +1 -0
  56. package/dist/oversight/index.js +15 -0
  57. package/dist/oversight/index.js.map +1 -0
  58. package/dist/roe/index.d.ts +3 -0
  59. package/dist/roe/index.d.ts.map +1 -0
  60. package/dist/roe/index.js +3 -0
  61. package/dist/roe/index.js.map +1 -0
  62. package/dist/roe/loader.d.ts +15 -0
  63. package/dist/roe/loader.d.ts.map +1 -0
  64. package/dist/roe/loader.js +56 -0
  65. package/dist/roe/loader.js.map +1 -0
  66. package/dist/roe/types.d.ts +738 -0
  67. package/dist/roe/types.d.ts.map +1 -0
  68. package/dist/roe/types.js +525 -0
  69. package/dist/roe/types.js.map +1 -0
  70. package/dist/runtime/chain.d.ts +60 -0
  71. package/dist/runtime/chain.d.ts.map +1 -0
  72. package/dist/runtime/chain.js +156 -0
  73. package/dist/runtime/chain.js.map +1 -0
  74. package/dist/runtime/events.d.ts +104 -0
  75. package/dist/runtime/events.d.ts.map +1 -0
  76. package/dist/runtime/events.js +68 -0
  77. package/dist/runtime/events.js.map +1 -0
  78. package/dist/runtime/hash.d.ts +16 -0
  79. package/dist/runtime/hash.d.ts.map +1 -0
  80. package/dist/runtime/hash.js +70 -0
  81. package/dist/runtime/hash.js.map +1 -0
  82. package/dist/runtime/index.d.ts +7 -0
  83. package/dist/runtime/index.d.ts.map +1 -0
  84. package/dist/runtime/index.js +7 -0
  85. package/dist/runtime/index.js.map +1 -0
  86. package/dist/runtime/notifications.d.ts +24 -0
  87. package/dist/runtime/notifications.d.ts.map +1 -0
  88. package/dist/runtime/notifications.js +41 -0
  89. package/dist/runtime/notifications.js.map +1 -0
  90. package/dist/runtime/signals.d.ts +56 -0
  91. package/dist/runtime/signals.d.ts.map +1 -0
  92. package/dist/runtime/signals.js +72 -0
  93. package/dist/runtime/signals.js.map +1 -0
  94. package/dist/runtime/state.d.ts +88 -0
  95. package/dist/runtime/state.d.ts.map +1 -0
  96. package/dist/runtime/state.js +172 -0
  97. package/dist/runtime/state.js.map +1 -0
  98. package/dist/safety-controls/boundary-monitor.d.ts +45 -0
  99. package/dist/safety-controls/boundary-monitor.d.ts.map +1 -0
  100. package/dist/safety-controls/boundary-monitor.js +77 -0
  101. package/dist/safety-controls/boundary-monitor.js.map +1 -0
  102. package/dist/safety-controls/decision-timeout.d.ts +56 -0
  103. package/dist/safety-controls/decision-timeout.d.ts.map +1 -0
  104. package/dist/safety-controls/decision-timeout.js +67 -0
  105. package/dist/safety-controls/decision-timeout.js.map +1 -0
  106. package/dist/safety-controls/health-monitor.d.ts +61 -0
  107. package/dist/safety-controls/health-monitor.d.ts.map +1 -0
  108. package/dist/safety-controls/health-monitor.js +79 -0
  109. package/dist/safety-controls/health-monitor.js.map +1 -0
  110. package/dist/safety-controls/index.d.ts +13 -0
  111. package/dist/safety-controls/index.d.ts.map +1 -0
  112. package/dist/safety-controls/index.js +13 -0
  113. package/dist/safety-controls/index.js.map +1 -0
  114. package/dist/safety-controls/kill-switch.d.ts +45 -0
  115. package/dist/safety-controls/kill-switch.d.ts.map +1 -0
  116. package/dist/safety-controls/kill-switch.js +117 -0
  117. package/dist/safety-controls/kill-switch.js.map +1 -0
  118. package/dist/safety-controls/post-test-integrity.d.ts +51 -0
  119. package/dist/safety-controls/post-test-integrity.d.ts.map +1 -0
  120. package/dist/safety-controls/post-test-integrity.js +79 -0
  121. package/dist/safety-controls/post-test-integrity.js.map +1 -0
  122. package/dist/types.d.ts +17 -0
  123. package/dist/types.d.ts.map +1 -1
  124. package/package.json +2 -1
  125. package/sbom.cdx.json +1 -1
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Per-engagement health probe with auto-halt thresholds.
3
+ *
4
+ * Closes APTS-SC-010 (Health Check Monitoring with Threshold-Based
5
+ * Automatic Halt).
6
+ *
7
+ * Design notes:
8
+ * - Three independent thresholds: heap memory, error rate, target
9
+ * response time. Each is checked at every phase boundary; any
10
+ * breach returns a halt-decision with the specific threshold that
11
+ * fired.
12
+ * - The orchestrator caller increments `record*` counters as events
13
+ * flow through; the snapshot reflects the rolling window.
14
+ * - Defaults are operator-friendly (1 GB heap, 50% error rate, 10 s
15
+ * response). RoE.safety_controls overrides per engagement.
16
+ */
17
+ export interface HealthThresholds {
18
+ /** Maximum heap-used in MB before halt. Default 1024. */
19
+ max_heap_mb?: number;
20
+ /** Maximum error rate (0..1) over the rolling window before halt. Default 0.5. */
21
+ max_error_rate?: number;
22
+ /** Maximum target HEAD response time in ms before halt. Default 10_000. */
23
+ max_target_response_ms?: number;
24
+ }
25
+ export interface HealthCounters {
26
+ /** Total event-emit attempts. Includes both ok + error paths. */
27
+ total_events: number;
28
+ /** Subset of total_events that errored. */
29
+ error_events: number;
30
+ /** Most recent target HEAD response time in ms (or null if not measured). */
31
+ last_target_response_ms: number | null;
32
+ }
33
+ export interface HealthCheckResult {
34
+ ok: boolean;
35
+ reason?: string;
36
+ observed?: {
37
+ heap_mb: number;
38
+ error_rate: number;
39
+ target_response_ms: number | null;
40
+ };
41
+ apts_refs: string[];
42
+ }
43
+ /**
44
+ * Read process heap memory in MB.
45
+ */
46
+ export declare function currentHeapMb(): number;
47
+ /**
48
+ * Compute the rolling error rate from counters.
49
+ */
50
+ export declare function errorRate(c: HealthCounters): number;
51
+ /**
52
+ * Run a health-check snapshot. Returns ok=true if every threshold is
53
+ * within bounds; otherwise ok=false with the specific reason and
54
+ * observed values for the audit trail.
55
+ */
56
+ export declare function runHealthCheck(counters: HealthCounters, thresholds?: HealthThresholds): HealthCheckResult;
57
+ /**
58
+ * Allocate a fresh counters object. Caller mutates as events flow.
59
+ */
60
+ export declare function newHealthCounters(): HealthCounters;
61
+ //# sourceMappingURL=health-monitor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"health-monitor.d.ts","sourceRoot":"","sources":["../../src/safety-controls/health-monitor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,yDAAyD;IACzD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kFAAkF;IAClF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,2EAA2E;IAC3E,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,cAAc;IAC7B,iEAAiE;IACjE,YAAY,EAAE,MAAM,CAAC;IACrB,2CAA2C;IAC3C,YAAY,EAAE,MAAM,CAAC;IACrB,6EAA6E;IAC7E,uBAAuB,EAAE,MAAM,GAAG,IAAI,CAAC;CACxC;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE;QACT,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;KACnC,CAAC;IACF,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAQD;;GAEG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,cAAc,GAAG,MAAM,CAGnD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,cAAc,EACxB,UAAU,GAAE,gBAAqB,GAChC,iBAAiB,CAgCnB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,cAAc,CAElD"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Per-engagement health probe with auto-halt thresholds.
3
+ *
4
+ * Closes APTS-SC-010 (Health Check Monitoring with Threshold-Based
5
+ * Automatic Halt).
6
+ *
7
+ * Design notes:
8
+ * - Three independent thresholds: heap memory, error rate, target
9
+ * response time. Each is checked at every phase boundary; any
10
+ * breach returns a halt-decision with the specific threshold that
11
+ * fired.
12
+ * - The orchestrator caller increments `record*` counters as events
13
+ * flow through; the snapshot reflects the rolling window.
14
+ * - Defaults are operator-friendly (1 GB heap, 50% error rate, 10 s
15
+ * response). RoE.safety_controls overrides per engagement.
16
+ */
17
+ const DEFAULTS = {
18
+ max_heap_mb: 1024,
19
+ max_error_rate: 0.5,
20
+ max_target_response_ms: 10_000,
21
+ };
22
+ /**
23
+ * Read process heap memory in MB.
24
+ */
25
+ export function currentHeapMb() {
26
+ return Math.round((process.memoryUsage().heapUsed / (1024 * 1024)) * 100) / 100;
27
+ }
28
+ /**
29
+ * Compute the rolling error rate from counters.
30
+ */
31
+ export function errorRate(c) {
32
+ if (c.total_events === 0)
33
+ return 0;
34
+ return c.error_events / c.total_events;
35
+ }
36
+ /**
37
+ * Run a health-check snapshot. Returns ok=true if every threshold is
38
+ * within bounds; otherwise ok=false with the specific reason and
39
+ * observed values for the audit trail.
40
+ */
41
+ export function runHealthCheck(counters, thresholds = {}) {
42
+ const t = { ...DEFAULTS, ...thresholds };
43
+ const heapMb = currentHeapMb();
44
+ const er = errorRate(counters);
45
+ const trMs = counters.last_target_response_ms;
46
+ const observed = { heap_mb: heapMb, error_rate: er, target_response_ms: trMs };
47
+ if (heapMb > t.max_heap_mb) {
48
+ return {
49
+ ok: false,
50
+ reason: `heap memory ${heapMb} MB exceeds threshold ${t.max_heap_mb} MB`,
51
+ observed,
52
+ apts_refs: ['APTS-SC-010'],
53
+ };
54
+ }
55
+ if (er > t.max_error_rate) {
56
+ return {
57
+ ok: false,
58
+ reason: `error rate ${(er * 100).toFixed(1)}% exceeds threshold ${(t.max_error_rate * 100).toFixed(1)}%`,
59
+ observed,
60
+ apts_refs: ['APTS-SC-010'],
61
+ };
62
+ }
63
+ if (trMs !== null && trMs > t.max_target_response_ms) {
64
+ return {
65
+ ok: false,
66
+ reason: `target response time ${trMs} ms exceeds threshold ${t.max_target_response_ms} ms`,
67
+ observed,
68
+ apts_refs: ['APTS-SC-010'],
69
+ };
70
+ }
71
+ return { ok: true, observed, apts_refs: ['APTS-SC-010'] };
72
+ }
73
+ /**
74
+ * Allocate a fresh counters object. Caller mutates as events flow.
75
+ */
76
+ export function newHealthCounters() {
77
+ return { total_events: 0, error_events: 0, last_target_response_ms: null };
78
+ }
79
+ //# sourceMappingURL=health-monitor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"health-monitor.js","sourceRoot":"","sources":["../../src/safety-controls/health-monitor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AA+BH,MAAM,QAAQ,GAA+B;IAC3C,WAAW,EAAE,IAAI;IACjB,cAAc,EAAE,GAAG;IACnB,sBAAsB,EAAE,MAAM;CAC/B,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,WAAW,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,CAAC;SAC3B,CAAC;IACJ,CAAC;IACD,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,GAAG,CAAC,CAAC,sBAAsB,EAAE,CAAC;QACrD,OAAO;YACL,EAAE,EAAE,KAAK;YACT,MAAM,EAAE,wBAAwB,IAAI,yBAAyB,CAAC,CAAC,sBAAsB,KAAK;YAC1F,QAAQ;YACR,SAAS,EAAE,CAAC,aAAa,CAAC;SAC3B,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,aAAa,CAAC,EAAE,CAAC;AAC5D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,EAAE,YAAY,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,uBAAuB,EAAE,IAAI,EAAE,CAAC;AAC7E,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Safety Controls public surface.
3
+ *
4
+ * Closes APTS Tier-1 entries: SC-009 (multi-path kill switch), SC-010
5
+ * (health monitoring + auto-halt), SC-015 (post-test integrity), AL-016
6
+ * (continuous boundary monitoring), HO-003 (decision timeout).
7
+ */
8
+ export { startKillRequestWatcher, requestKill, startDeadManHeartbeat, type KillRequestWatcherOptions, type KillRequestWatcherHandle, type HeartbeatOptions, type HeartbeatHandle, } from './kill-switch.js';
9
+ export { runHealthCheck, newHealthCounters, currentHeapMb, errorRate, type HealthThresholds, type HealthCounters, type HealthCheckResult, } from './health-monitor.js';
10
+ export { probeTargetIntegrity, type IntegrityProbeBaseline, type IntegrityProbeResult, type IntegrityProbeOptions, } from './post-test-integrity.js';
11
+ export { detectScopeBreach, type FindingLike, type BreachDetectionResult, } from './boundary-monitor.js';
12
+ export { withPhaseTimeout, derivePhaseTimeoutMs, type TimeoutResult, type TimeoutOk, type TimeoutFailure, type PhaseTimeoutOptions, } from './decision-timeout.js';
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/safety-controls/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,uBAAuB,EACvB,WAAW,EACX,qBAAqB,EACrB,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACrB,KAAK,eAAe,GACrB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,iBAAiB,GACvB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,oBAAoB,EACpB,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,GAC3B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,iBAAiB,EACjB,KAAK,WAAW,EAChB,KAAK,qBAAqB,GAC3B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,mBAAmB,GACzB,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Safety Controls public surface.
3
+ *
4
+ * Closes APTS Tier-1 entries: SC-009 (multi-path kill switch), SC-010
5
+ * (health monitoring + auto-halt), SC-015 (post-test integrity), AL-016
6
+ * (continuous boundary monitoring), HO-003 (decision timeout).
7
+ */
8
+ export { startKillRequestWatcher, requestKill, startDeadManHeartbeat, } from './kill-switch.js';
9
+ export { runHealthCheck, newHealthCounters, currentHeapMb, errorRate, } from './health-monitor.js';
10
+ export { probeTargetIntegrity, } from './post-test-integrity.js';
11
+ export { detectScopeBreach, } from './boundary-monitor.js';
12
+ export { withPhaseTimeout, derivePhaseTimeoutMs, } from './decision-timeout.js';
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/safety-controls/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,uBAAuB,EACvB,WAAW,EACX,qBAAqB,GAKtB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,SAAS,GAIV,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,oBAAoB,GAIrB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,iBAAiB,GAGlB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,gBAAgB,EAChB,oBAAoB,GAKrB,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,45 @@
1
+ export interface KillRequestWatcherOptions {
2
+ /** Path to watch for a `.killreq` marker (typically `<state-file>.killreq`). */
3
+ markerPath: string;
4
+ /** Poll interval in ms. Default 2000. */
5
+ pollIntervalMs?: number;
6
+ /** Callback fired when the marker is detected. */
7
+ onKillRequest: (markerPath: string) => void;
8
+ }
9
+ export interface KillRequestWatcherHandle {
10
+ /** Stop polling — call on engagement completion. */
11
+ stop: () => void;
12
+ }
13
+ /**
14
+ * Start a kill-request watcher. Polls for `markerPath` every
15
+ * `pollIntervalMs` ms and fires `onKillRequest` on first detection.
16
+ * The handle's `stop()` clears the interval.
17
+ */
18
+ export declare function startKillRequestWatcher(opts: KillRequestWatcherOptions): KillRequestWatcherHandle;
19
+ /**
20
+ * Write the kill-request marker. Used by the `--kill` CLI subcommand.
21
+ */
22
+ export declare function requestKill(stateFilePath: string, reason?: string): string;
23
+ export interface HeartbeatOptions {
24
+ /** Operator endpoint to POST a heartbeat to (HTTPS only, public IP). */
25
+ url: string;
26
+ /** Heartbeat interval in ms. Default 30 s. */
27
+ intervalMs?: number;
28
+ /** Consecutive missed heartbeats before halt. Default 3. */
29
+ maxConsecutiveFailures?: number;
30
+ /** Callback fired when the failure threshold is hit. */
31
+ onMissedThreshold: (consecutiveFailures: number) => void;
32
+ /** Override fetch — for tests. */
33
+ fetchImpl?: typeof fetch;
34
+ }
35
+ export interface HeartbeatHandle {
36
+ stop: () => void;
37
+ }
38
+ /**
39
+ * Start a dead-man-switch heartbeat. Posts an empty body to `url` every
40
+ * `intervalMs` ms; counts consecutive failures (network error, non-2xx
41
+ * status, timeout) and fires `onMissedThreshold` when the count crosses
42
+ * `maxConsecutiveFailures`.
43
+ */
44
+ export declare function startDeadManHeartbeat(opts: HeartbeatOptions): HeartbeatHandle;
45
+ //# sourceMappingURL=kill-switch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kill-switch.d.ts","sourceRoot":"","sources":["../../src/safety-controls/kill-switch.ts"],"names":[],"mappings":"AAwBA,MAAM,WAAW,yBAAyB;IACxC,gFAAgF;IAChF,UAAU,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kDAAkD;IAClD,aAAa,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C;AAED,MAAM,WAAW,wBAAwB;IACvC,oDAAoD;IACpD,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,yBAAyB,GAC9B,wBAAwB,CAqB1B;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,SAAuB,GAAG,MAAM,CAOxF;AAKD,MAAM,WAAW,gBAAgB;IAC/B,wEAAwE;IACxE,GAAG,EAAE,MAAM,CAAC;IACZ,8CAA8C;IAC9C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,wDAAwD;IACxD,iBAAiB,EAAE,CAAC,mBAAmB,EAAE,MAAM,KAAK,IAAI,CAAC;IACzD,kCAAkC;IAClC,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,gBAAgB,GAAG,eAAe,CAyC7E"}
@@ -0,0 +1,117 @@
1
+ /**
2
+ * Multi-path kill switch.
3
+ *
4
+ * Closes APTS-SC-009 (Kill Switch).
5
+ *
6
+ * Design notes:
7
+ * - Signals (SIGINT, SIGTERM, SIGUSR1) are already wired in
8
+ * `runtime/signals.ts` from Cluster-2. SC-009 requires *more than*
9
+ * signals — a multi-path kill so a stuck or unreachable engagement
10
+ * can be terminated by alternate channels.
11
+ * - Path 1 (signals): existing.
12
+ * - Path 2 (file-based kill request): operator runs
13
+ * `aegis siege --kill <state-file>`, which writes a
14
+ * `<state-file>.killreq` marker. The running engagement polls for
15
+ * the marker every `pollIntervalMs` (default 2 s) and halts on
16
+ * detection. Decoupled from process IPC so it works across hosts
17
+ * (e.g. operator on a separate ssh session).
18
+ * - Path 3 (dead-man-switch): operator-provided heartbeat URL.
19
+ * Engagement POSTs a heartbeat every `intervalMs`; consecutive
20
+ * missed heartbeats (default 3) trigger halt. Defends against the
21
+ * case where the operator's monitoring infra is the canary.
22
+ */
23
+ import { existsSync, writeFileSync } from 'node:fs';
24
+ /**
25
+ * Start a kill-request watcher. Polls for `markerPath` every
26
+ * `pollIntervalMs` ms and fires `onKillRequest` on first detection.
27
+ * The handle's `stop()` clears the interval.
28
+ */
29
+ export function startKillRequestWatcher(opts) {
30
+ const interval = opts.pollIntervalMs ?? 2_000;
31
+ let stopped = false;
32
+ let timer = null;
33
+ const tick = () => {
34
+ if (stopped)
35
+ return;
36
+ if (existsSync(opts.markerPath)) {
37
+ stopped = true;
38
+ if (timer)
39
+ clearInterval(timer);
40
+ opts.onKillRequest(opts.markerPath);
41
+ }
42
+ };
43
+ timer = setInterval(tick, interval);
44
+ // unref so the timer doesn't keep the event loop alive.
45
+ if (typeof timer.unref === 'function')
46
+ timer.unref();
47
+ return {
48
+ stop: () => {
49
+ stopped = true;
50
+ if (timer)
51
+ clearInterval(timer);
52
+ },
53
+ };
54
+ }
55
+ /**
56
+ * Write the kill-request marker. Used by the `--kill` CLI subcommand.
57
+ */
58
+ export function requestKill(stateFilePath, reason = 'operator-requested') {
59
+ const markerPath = `${stateFilePath}.killreq`;
60
+ writeFileSync(markerPath, JSON.stringify({ requested_at: new Date().toISOString(), reason }) + '\n');
61
+ return markerPath;
62
+ }
63
+ /**
64
+ * Start a dead-man-switch heartbeat. Posts an empty body to `url` every
65
+ * `intervalMs` ms; counts consecutive failures (network error, non-2xx
66
+ * status, timeout) and fires `onMissedThreshold` when the count crosses
67
+ * `maxConsecutiveFailures`.
68
+ */
69
+ export function startDeadManHeartbeat(opts) {
70
+ const interval = opts.intervalMs ?? 30_000;
71
+ const threshold = opts.maxConsecutiveFailures ?? 3;
72
+ const fetchImpl = opts.fetchImpl ?? fetch;
73
+ let consecutive = 0;
74
+ let stopped = false;
75
+ let fired = false;
76
+ let timer = null;
77
+ const tick = async () => {
78
+ if (stopped)
79
+ return;
80
+ try {
81
+ const res = await fetchImpl(opts.url, {
82
+ method: 'POST',
83
+ body: JSON.stringify({ ts: new Date().toISOString() }),
84
+ headers: { 'content-type': 'application/json' },
85
+ });
86
+ if (!res.ok) {
87
+ consecutive += 1;
88
+ }
89
+ else {
90
+ consecutive = 0;
91
+ }
92
+ }
93
+ catch {
94
+ consecutive += 1;
95
+ }
96
+ if (consecutive >= threshold && !fired) {
97
+ fired = true;
98
+ stopped = true;
99
+ if (timer)
100
+ clearInterval(timer);
101
+ opts.onMissedThreshold(consecutive);
102
+ }
103
+ };
104
+ timer = setInterval(() => {
105
+ void tick();
106
+ }, interval);
107
+ if (typeof timer.unref === 'function')
108
+ timer.unref();
109
+ return {
110
+ stop: () => {
111
+ stopped = true;
112
+ if (timer)
113
+ clearInterval(timer);
114
+ },
115
+ };
116
+ }
117
+ //# sourceMappingURL=kill-switch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":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AC,CAAC;QACtC,CAAC;IACH,CAAC,CAAC;IACF,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE;QACvB,KAAK,IAAI,EAAE,CAAC;IACd,CAAC,EAAE,QAAQ,CAAC,CAAC;IACb,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,UAAU;QAAE,KAAK,CAAC,KAAK,EAAE,CAAC;IACrD,OAAO;QACL,IAAI,EAAE,GAAG,EAAE;YACT,OAAO,GAAG,IAAI,CAAC;YACf,IAAI,KAAK;gBAAE,aAAa,CAAC,KAAK,CAAC,CAAC;QAClC,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Post-test system integrity validation.
3
+ *
4
+ * Closes APTS-SC-015 (Post-Test System Integrity Validation).
5
+ *
6
+ * Design notes:
7
+ * - Run after the engagement's reporting phase. Confirms the target
8
+ * service is still responsive and records a final state-snapshot
9
+ * for the audit trail. A non-responsive target after engagement is
10
+ * a regression signal — record it explicitly.
11
+ * - Uses safeFetch for the probe (same SSRF defenses as the rest of
12
+ * orchestrator HTTP egress).
13
+ * - The pre-engagement baseline is optional; when supplied, the
14
+ * verdict includes a response-time delta so spikes are visible.
15
+ */
16
+ import { safeFetch } from '../manipulation-resistance/redirect-policy.js';
17
+ export interface IntegrityProbeBaseline {
18
+ /** Pre-engagement target response time in ms. */
19
+ baseline_response_ms: number;
20
+ /** Pre-engagement HTTP status. */
21
+ baseline_status: number;
22
+ }
23
+ export interface IntegrityProbeResult {
24
+ ok: boolean;
25
+ reason?: string;
26
+ observed?: {
27
+ status: number;
28
+ response_ms: number;
29
+ response_delta_ms?: number;
30
+ };
31
+ apts_refs: string[];
32
+ }
33
+ export interface IntegrityProbeOptions {
34
+ /** Optional baseline captured at engagement-start. */
35
+ baseline?: IntegrityProbeBaseline;
36
+ /** Maximum acceptable response-time delta vs baseline in ms. Default 5000. */
37
+ max_response_delta_ms?: number;
38
+ /** Probe timeout in ms. Default 10_000. */
39
+ timeout_ms?: number;
40
+ /** Operator opt-in to permit loopback probe. Mirrors siege --allow-loopback. */
41
+ allowLoopback?: boolean;
42
+ /** Override safeFetch — for tests. */
43
+ fetchImpl?: typeof safeFetch;
44
+ }
45
+ /**
46
+ * Probe the target with HEAD via safeFetch. Returns ok=false if the
47
+ * probe rejects, the status is 5xx, or the response-time delta vs
48
+ * baseline exceeds the threshold.
49
+ */
50
+ export declare function probeTargetIntegrity(target: string, opts?: IntegrityProbeOptions): Promise<IntegrityProbeResult>;
51
+ //# sourceMappingURL=post-test-integrity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"post-test-integrity.d.ts","sourceRoot":"","sources":["../../src/safety-controls/post-test-integrity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,SAAS,EAAwB,MAAM,+CAA+C,CAAC;AAEhG,MAAM,WAAW,sBAAsB;IACrC,iDAAiD;IACjD,oBAAoB,EAAE,MAAM,CAAC;IAC7B,kCAAkC;IAClC,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE;QACT,MAAM,EAAE,MAAM,CAAC;QACf,WAAW,EAAE,MAAM,CAAC;QACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B,CAAC;IACF,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,qBAAqB;IACpC,sDAAsD;IACtD,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAClC,8EAA8E;IAC9E,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gFAAgF;IAChF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,sCAAsC;IACtC,SAAS,CAAC,EAAE,OAAO,SAAS,CAAC;CAC9B;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,qBAA0B,GAC/B,OAAO,CAAC,oBAAoB,CAAC,CAyD/B"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Post-test system integrity validation.
3
+ *
4
+ * Closes APTS-SC-015 (Post-Test System Integrity Validation).
5
+ *
6
+ * Design notes:
7
+ * - Run after the engagement's reporting phase. Confirms the target
8
+ * service is still responsive and records a final state-snapshot
9
+ * for the audit trail. A non-responsive target after engagement is
10
+ * a regression signal — record it explicitly.
11
+ * - Uses safeFetch for the probe (same SSRF defenses as the rest of
12
+ * orchestrator HTTP egress).
13
+ * - The pre-engagement baseline is optional; when supplied, the
14
+ * verdict includes a response-time delta so spikes are visible.
15
+ */
16
+ import { safeFetch, isSafeFetchRejection } from '../manipulation-resistance/redirect-policy.js';
17
+ /**
18
+ * Probe the target with HEAD via safeFetch. Returns ok=false if the
19
+ * probe rejects, the status is 5xx, or the response-time delta vs
20
+ * baseline exceeds the threshold.
21
+ */
22
+ export async function probeTargetIntegrity(target, opts = {}) {
23
+ const fetchImpl = opts.fetchImpl ?? safeFetch;
24
+ const timeoutMs = opts.timeout_ms ?? 10_000;
25
+ const start = Date.now();
26
+ try {
27
+ const controller = new AbortController();
28
+ const timeout = setTimeout(() => controller.abort(), timeoutMs);
29
+ const res = await fetchImpl(target, {
30
+ method: 'HEAD',
31
+ signal: controller.signal,
32
+ allowLoopback: opts.allowLoopback === true,
33
+ });
34
+ clearTimeout(timeout);
35
+ const elapsed = Date.now() - start;
36
+ const observed = {
37
+ status: res.status,
38
+ response_ms: elapsed,
39
+ };
40
+ if (opts.baseline) {
41
+ observed.response_delta_ms = elapsed - opts.baseline.baseline_response_ms;
42
+ }
43
+ if (res.status >= 500) {
44
+ return {
45
+ ok: false,
46
+ reason: `target returned ${res.status} (server-side fault) after engagement`,
47
+ observed,
48
+ apts_refs: ['APTS-SC-015'],
49
+ };
50
+ }
51
+ if (opts.baseline &&
52
+ observed.response_delta_ms !== undefined &&
53
+ observed.response_delta_ms > (opts.max_response_delta_ms ?? 5_000)) {
54
+ return {
55
+ ok: false,
56
+ reason: `target response time spiked by ${observed.response_delta_ms} ms vs pre-engagement baseline (${opts.baseline.baseline_response_ms} → ${elapsed} ms)`,
57
+ observed,
58
+ apts_refs: ['APTS-SC-015'],
59
+ };
60
+ }
61
+ return { ok: true, observed, apts_refs: ['APTS-SC-015'] };
62
+ }
63
+ catch (err) {
64
+ if (isSafeFetchRejection(err)) {
65
+ return {
66
+ ok: false,
67
+ reason: `post-test integrity probe rejected by safeFetch policy: ${err.reason}`,
68
+ apts_refs: ['APTS-SC-015', 'APTS-MR-009'],
69
+ };
70
+ }
71
+ const msg = err instanceof Error ? err.message : String(err);
72
+ return {
73
+ ok: false,
74
+ reason: `post-test integrity probe failed: ${msg}`,
75
+ apts_refs: ['APTS-SC-015'],
76
+ };
77
+ }
78
+ }
79
+ //# sourceMappingURL=post-test-integrity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"post-test-integrity.js","sourceRoot":"","sources":["../../src/safety-controls/post-test-integrity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AAiChG;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,MAAc,EACd,OAA8B,EAAE;IAEhC,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC;IAC9C,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,IAAI,MAAM,CAAC;IAC5C,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACzB,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;QACzC,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,SAAS,CAAC,CAAC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C,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,oBAAoB,CAAC,GAAG,CAAC,EAAE,CAAC;YAC9B,OAAO;gBACL,EAAE,EAAE,KAAK;gBACT,MAAM,EAAE,2DAA2D,GAAG,CAAC,MAAM,EAAE;gBAC/E,SAAS,EAAE,CAAC,aAAa,EAAE,aAAa,CAAC;aAC1C,CAAC;QACJ,CAAC;QACD,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC7D,OAAO;YACL,EAAE,EAAE,KAAK;YACT,MAAM,EAAE,qCAAqC,GAAG,EAAE;YAClD,SAAS,EAAE,CAAC,aAAa,CAAC;SAC3B,CAAC;IACJ,CAAC;AACH,CAAC"}
package/dist/types.d.ts CHANGED
@@ -89,7 +89,24 @@ export interface Finding {
89
89
  * to mean "scanner's default confidence tier (typically high)".
90
90
  */
91
91
  confidence?: Confidence;
92
+ /**
93
+ * APTS-SC-001 — Confidentiality / Integrity / Availability impact
94
+ * vector. Each axis is one of `none | low | medium | high`. Populated
95
+ * by the orchestrator from `assignCiaVector(finding)` after scanner
96
+ * emit; operators may override per-finding via the suppression
97
+ * pipeline. Default mappings are CWE-driven; unknown CWE → all-low.
98
+ */
99
+ cia_vector?: {
100
+ c: CiaImpact;
101
+ i: CiaImpact;
102
+ a: CiaImpact;
103
+ };
92
104
  }
105
+ /**
106
+ * APTS-SC-001 CIA impact ordinal. Lowercased for consistency with
107
+ * the `severity` enum + Zod-friendly serialization.
108
+ */
109
+ export type CiaImpact = 'none' | 'low' | 'medium' | 'high';
93
110
  export interface ScanResult {
94
111
  scanner: string;
95
112
  category: ScanCategory;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ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4
  "description": "AEGIS core engine — orchestrator, scoring (0-1000), config loader with Zod-strict schema, suppression filter, shared types + utilities. The foundation of the AEGIS security-scanner suite for Next.js + Supabase.",
5
5
  "license": "MIT",
6
6
  "author": "RideMatch1 <230386010+RideMatch1@users.noreply.github.com>",
@@ -33,6 +33,7 @@
33
33
  },
34
34
  "files": [
35
35
  "dist",
36
+ "README.md",
36
37
  "sbom.cdx.json"
37
38
  ],
38
39
  "type": "module",
package/sbom.cdx.json CHANGED
@@ -1 +1 @@
1
- {"bomFormat":"CycloneDX","specVersion":"1.6","serialNumber":"urn:uuid:670c5742-f23f-4730-a028-8e6e4b53da93","version":1,"metadata":{"timestamp":"2026-04-26T14:21:03Z","tools":{"components":[{"group":"@cyclonedx","name":"cdxgen","version":"12.1.4","purl":"pkg:npm/%40cyclonedx/cdxgen@12.1.4","type":"application","bom-ref":"pkg:npm/@cyclonedx/cdxgen@12.1.4","publisher":"OWASP Foundation","authors":[{"name":"OWASP Foundation"}]}]},"authors":[{"name":"OWASP Foundation"}],"lifecycles":[{"phase":"build"}],"component":{"name":"core","group":"@aegis-scan","version":"0.16.6","description":"AEGIS core engine — orchestrator, scoring (0-1000), config loader with Zod-strict schema, suppression filter, shared types + utilities. The foundation of the AEGIS security-scanner suite for Next.js + Supabase.","purl":"pkg:npm/%40aegis-scan/core@0.16.6","bom-ref":"pkg:npm/@aegis-scan/core@0.16.6","author":"RideMatch1 <230386010+RideMatch1@users.noreply.github.com>","type":"application","licenses":[{"license":{"id":"MIT","url":"https://opensource.org/licenses/MIT"}}],"externalReferences":[{"type":"vcs","url":"https://github.com/RideMatch1/a.e.g.i.s#readme"},{"type":"vcs","url":"git+https://github.com/RideMatch1/a.e.g.i.s.git"}]},"properties":[{"name":"cdx:bom:componentTypes","value":"npm"},{"name":"cdx:bom:componentNamespaces","value":"@types"},{"name":"cdx:bom:componentSrcFiles","value":"packages/core/node_modules/@types/node/package.json\\npackages/core/node_modules/@types/picomatch/package.json\\npackages/core/node_modules/ignore/package.json\\npackages/core/node_modules/picomatch/package.json\\npackages/core/node_modules/typescript/package.json\\npackages/core/node_modules/vitest/package.json\\npackages/core/node_modules/zod/package.json"}]},"components":[{"authors":[{"name":"Colin McDonnell <zod@colinhacks.com>"}],"group":"","name":"zod","version":"3.25.76","description":"TypeScript-first schema declaration and validation library with static type inference","scope":"optional","licenses":[{"license":{"id":"MIT","url":"https://opensource.org/licenses/MIT"}}],"purl":"pkg:npm/zod@3.25.76","externalReferences":[{"type":"website","url":"https://zod.dev"},{"type":"vcs","url":"git+https://github.com/colinhacks/zod.git"}],"type":"library","bom-ref":"pkg:npm/zod@3.25.76","properties":[{"name":"SrcFile","value":"packages/core/node_modules/zod/package.json"}],"evidence":{"identity":[{"field":"purl","confidence":0.7,"methods":[{"technique":"manifest-analysis","confidence":0.7,"value":"packages/core/node_modules/zod/package.json"}],"concludedValue":"packages/core/node_modules/zod/package.json"}]},"tags":["validation"]},{"authors":[{"name":"Anthony Fu <anthonyfu117@hotmail.com>"}],"group":"","name":"vitest","version":"3.2.4","description":"Next generation testing framework powered by Vite","scope":"optional","licenses":[{"license":{"id":"MIT","url":"https://opensource.org/licenses/MIT"}}],"purl":"pkg:npm/vitest@3.2.4","externalReferences":[{"type":"vcs","url":"https://github.com/vitest-dev/vitest#readme"},{"type":"vcs","url":"git+https://github.com/vitest-dev/vitest.git"}],"type":"framework","bom-ref":"pkg:npm/vitest@3.2.4","properties":[{"name":"SrcFile","value":"packages/core/node_modules/vitest/package.json"}],"evidence":{"identity":[{"field":"purl","confidence":0.7,"methods":[{"technique":"manifest-analysis","confidence":0.7,"value":"packages/core/node_modules/vitest/package.json"}],"concludedValue":"packages/core/node_modules/vitest/package.json"}]},"tags":["framework"]},{"authors":[{"name":"Microsoft Corp."}],"group":"","name":"typescript","version":"5.9.3","description":"TypeScript is a language for application scale JavaScript development","scope":"optional","licenses":[{"license":{"id":"Apache-2.0","url":"https://opensource.org/licenses/Apache-2.0"}}],"purl":"pkg:npm/typescript@5.9.3","externalReferences":[{"type":"website","url":"https://www.typescriptlang.org/"},{"type":"vcs","url":"https://github.com/microsoft/TypeScript.git"}],"type":"library","bom-ref":"pkg:npm/typescript@5.9.3","properties":[{"name":"SrcFile","value":"packages/core/node_modules/typescript/package.json"}],"evidence":{"identity":[{"field":"purl","confidence":0.7,"methods":[{"technique":"manifest-analysis","confidence":0.7,"value":"packages/core/node_modules/typescript/package.json"}],"concludedValue":"packages/core/node_modules/typescript/package.json"}]}},{"authors":[{"name":"Jon Schlinkert (https://github.com/jonschlinkert)"}],"group":"","name":"picomatch","version":"4.0.4","description":"Blazing fast and accurate glob matcher written in JavaScript, with no dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions.","scope":"required","licenses":[{"license":{"id":"MIT","url":"https://opensource.org/licenses/MIT"}}],"purl":"pkg:npm/picomatch@4.0.4","externalReferences":[{"type":"vcs","url":"https://github.com/micromatch/picomatch"}],"type":"library","bom-ref":"pkg:npm/picomatch@4.0.4","properties":[{"name":"SrcFile","value":"packages/core/node_modules/picomatch/package.json"},{"name":"ImportedModules","value":"picomatch"}],"evidence":{"identity":[{"field":"purl","confidence":0.7,"methods":[{"technique":"manifest-analysis","confidence":0.7,"value":"packages/core/node_modules/picomatch/package.json"}],"concludedValue":"packages/core/node_modules/picomatch/package.json"}],"occurrences":[{"location":"dist/utils.js#5"},{"location":"src/utils.ts#5"}]}},{"authors":[{"name":"kael"}],"group":"","name":"ignore","version":"7.0.5","description":"Ignore is a manager and filter for .gitignore rules, the one used by eslint, gitbook and many others.","scope":"required","licenses":[{"license":{"id":"MIT","url":"https://opensource.org/licenses/MIT"}}],"purl":"pkg:npm/ignore@7.0.5","type":"library","bom-ref":"pkg:npm/ignore@7.0.5","properties":[{"name":"SrcFile","value":"packages/core/node_modules/ignore/package.json"},{"name":"ImportedModules","value":"ignore"}],"evidence":{"identity":[{"field":"purl","confidence":0.7,"methods":[{"technique":"manifest-analysis","confidence":0.7,"value":"packages/core/node_modules/ignore/package.json"}],"concludedValue":"packages/core/node_modules/ignore/package.json"}],"occurrences":[{"location":"dist/utils.js#4"},{"location":"src/utils.ts#4"}]}},{"group":"@types","name":"picomatch","version":"3.0.2","description":"TypeScript definitions for picomatch","scope":"optional","licenses":[{"license":{"id":"MIT","url":"https://opensource.org/licenses/MIT"}}],"purl":"pkg:npm/%40types/picomatch@3.0.2","externalReferences":[{"type":"vcs","url":"https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/picomatch"},{"type":"vcs","url":"https://github.com/DefinitelyTyped/DefinitelyTyped.git"}],"type":"library","bom-ref":"pkg:npm/@types/picomatch@3.0.2","properties":[{"name":"SrcFile","value":"packages/core/node_modules/@types/picomatch/package.json"}],"evidence":{"identity":[{"field":"purl","confidence":0.7,"methods":[{"technique":"manifest-analysis","confidence":0.7,"value":"packages/core/node_modules/@types/picomatch/package.json"}],"concludedValue":"packages/core/node_modules/@types/picomatch/package.json"}]}},{"group":"@types","name":"node","version":"22.19.17","description":"TypeScript definitions for node","scope":"optional","licenses":[{"license":{"id":"MIT","url":"https://opensource.org/licenses/MIT"}}],"purl":"pkg:npm/%40types/node@22.19.17","externalReferences":[{"type":"vcs","url":"https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node"},{"type":"vcs","url":"https://github.com/DefinitelyTyped/DefinitelyTyped.git"}],"type":"library","bom-ref":"pkg:npm/@types/node@22.19.17","properties":[{"name":"SrcFile","value":"packages/core/node_modules/@types/node/package.json"}],"evidence":{"identity":[{"field":"purl","confidence":0.7,"methods":[{"technique":"manifest-analysis","confidence":0.7,"value":"packages/core/node_modules/@types/node/package.json"}],"concludedValue":"packages/core/node_modules/@types/node/package.json"}]}}],"dependencies":[],"annotations":[{"bom-ref":"metadata-annotations","subjects":["pkg:npm/@aegis-scan/core@0.16.6"],"annotator":{"component":{"group":"@cyclonedx","name":"cdxgen","version":"12.1.4","purl":"pkg:npm/%40cyclonedx/cdxgen@12.1.4","type":"application","bom-ref":"pkg:npm/@cyclonedx/cdxgen@12.1.4","publisher":"OWASP Foundation","authors":[{"name":"OWASP Foundation"}]}},"timestamp":"2026-04-26T14:21:03Z","text":"This Software Bill-of-Materials (SBOM) document was created on Sunday, April 26, 2026 with cdxgen. The data was captured during the build lifecycle phase. The document describes an application named 'core' with version '0.16.6'. The package type in this SBOM is npm with a single purl namespace '@types' described under components. The components were identified from 7 source files."}]}
1
+ {"bomFormat":"CycloneDX","specVersion":"1.6","serialNumber":"urn:uuid:34366355-b756-4ee1-9350-4872ba7f0db0","version":1,"metadata":{"timestamp":"2026-05-01T15:54:28Z","tools":{"components":[{"group":"@cyclonedx","name":"cdxgen","version":"12.1.4","purl":"pkg:npm/%40cyclonedx/cdxgen@12.1.4","type":"application","bom-ref":"pkg:npm/@cyclonedx/cdxgen@12.1.4","publisher":"OWASP Foundation","authors":[{"name":"OWASP Foundation"}]}]},"authors":[{"name":"OWASP Foundation"}],"lifecycles":[{"phase":"build"}],"component":{"name":"core","group":"@aegis-scan","version":"0.18.0","description":"AEGIS core engine — orchestrator, scoring (0-1000), config loader with Zod-strict schema, suppression filter, shared types + utilities. The foundation of the AEGIS security-scanner suite for Next.js + Supabase.","purl":"pkg:npm/%40aegis-scan/core@0.18.0","bom-ref":"pkg:npm/@aegis-scan/core@0.18.0","author":"RideMatch1 <230386010+RideMatch1@users.noreply.github.com>","type":"application","licenses":[{"license":{"id":"MIT","url":"https://opensource.org/licenses/MIT"}}],"externalReferences":[{"type":"vcs","url":"https://github.com/RideMatch1/a.e.g.i.s#readme"},{"type":"vcs","url":"git+https://github.com/RideMatch1/a.e.g.i.s.git"}]},"properties":[{"name":"cdx:bom:componentTypes","value":"npm"},{"name":"cdx:bom:componentNamespaces","value":"@types"},{"name":"cdx:bom:componentSrcFiles","value":"packages/core/node_modules/@types/node/package.json\\npackages/core/node_modules/@types/picomatch/package.json\\npackages/core/node_modules/ignore/package.json\\npackages/core/node_modules/picomatch/package.json\\npackages/core/node_modules/typescript/package.json\\npackages/core/node_modules/vitest/package.json\\npackages/core/node_modules/zod/package.json"}]},"components":[{"authors":[{"name":"Colin McDonnell <zod@colinhacks.com>"}],"group":"","name":"zod","version":"3.25.76","description":"TypeScript-first schema declaration and validation library with static type inference","scope":"required","licenses":[{"license":{"id":"MIT","url":"https://opensource.org/licenses/MIT"}}],"purl":"pkg:npm/zod@3.25.76","externalReferences":[{"type":"website","url":"https://zod.dev"},{"type":"vcs","url":"git+https://github.com/colinhacks/zod.git"}],"type":"library","bom-ref":"pkg:npm/zod@3.25.76","properties":[{"name":"SrcFile","value":"packages/core/node_modules/zod/package.json"},{"name":"ImportedModules","value":"zod,zod/z"}],"evidence":{"identity":[{"field":"purl","confidence":0.7,"methods":[{"technique":"manifest-analysis","confidence":0.7,"value":"packages/core/node_modules/zod/package.json"}],"concludedValue":"packages/core/node_modules/zod/package.json"}],"occurrences":[{"location":"dist/manipulation-resistance/response-validator.js#23"},{"location":"dist/roe/types.js#24"},{"location":"dist/runtime/state.js#32"},{"location":"src/manipulation-resistance/response-validator.ts#23"},{"location":"src/roe/types.ts#24"},{"location":"src/runtime/state.ts#32"}]},"tags":["validation"]},{"authors":[{"name":"Anthony Fu <anthonyfu117@hotmail.com>"}],"group":"","name":"vitest","version":"3.2.4","description":"Next generation testing framework powered by Vite","scope":"optional","licenses":[{"license":{"id":"MIT","url":"https://opensource.org/licenses/MIT"}}],"purl":"pkg:npm/vitest@3.2.4","externalReferences":[{"type":"vcs","url":"https://github.com/vitest-dev/vitest#readme"},{"type":"vcs","url":"git+https://github.com/vitest-dev/vitest.git"}],"type":"framework","bom-ref":"pkg:npm/vitest@3.2.4","properties":[{"name":"SrcFile","value":"packages/core/node_modules/vitest/package.json"}],"evidence":{"identity":[{"field":"purl","confidence":0.7,"methods":[{"technique":"manifest-analysis","confidence":0.7,"value":"packages/core/node_modules/vitest/package.json"}],"concludedValue":"packages/core/node_modules/vitest/package.json"}]},"tags":["framework"]},{"authors":[{"name":"Microsoft Corp."}],"group":"","name":"typescript","version":"5.9.3","description":"TypeScript is a language for application scale JavaScript development","scope":"optional","licenses":[{"license":{"id":"Apache-2.0","url":"https://opensource.org/licenses/Apache-2.0"}}],"purl":"pkg:npm/typescript@5.9.3","externalReferences":[{"type":"website","url":"https://www.typescriptlang.org/"},{"type":"vcs","url":"https://github.com/microsoft/TypeScript.git"}],"type":"library","bom-ref":"pkg:npm/typescript@5.9.3","properties":[{"name":"SrcFile","value":"packages/core/node_modules/typescript/package.json"}],"evidence":{"identity":[{"field":"purl","confidence":0.7,"methods":[{"technique":"manifest-analysis","confidence":0.7,"value":"packages/core/node_modules/typescript/package.json"}],"concludedValue":"packages/core/node_modules/typescript/package.json"}]}},{"authors":[{"name":"Jon Schlinkert (https://github.com/jonschlinkert)"}],"group":"","name":"picomatch","version":"4.0.4","description":"Blazing fast and accurate glob matcher written in JavaScript, with no dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions.","scope":"required","licenses":[{"license":{"id":"MIT","url":"https://opensource.org/licenses/MIT"}}],"purl":"pkg:npm/picomatch@4.0.4","externalReferences":[{"type":"vcs","url":"https://github.com/micromatch/picomatch"}],"type":"library","bom-ref":"pkg:npm/picomatch@4.0.4","properties":[{"name":"SrcFile","value":"packages/core/node_modules/picomatch/package.json"},{"name":"ImportedModules","value":"picomatch"}],"evidence":{"identity":[{"field":"purl","confidence":0.7,"methods":[{"technique":"manifest-analysis","confidence":0.7,"value":"packages/core/node_modules/picomatch/package.json"}],"concludedValue":"packages/core/node_modules/picomatch/package.json"}],"occurrences":[{"location":"dist/utils.js#5"},{"location":"src/utils.ts#5"}]}},{"authors":[{"name":"kael"}],"group":"","name":"ignore","version":"7.0.5","description":"Ignore is a manager and filter for .gitignore rules, the one used by eslint, gitbook and many others.","scope":"required","licenses":[{"license":{"id":"MIT","url":"https://opensource.org/licenses/MIT"}}],"purl":"pkg:npm/ignore@7.0.5","type":"library","bom-ref":"pkg:npm/ignore@7.0.5","properties":[{"name":"SrcFile","value":"packages/core/node_modules/ignore/package.json"},{"name":"ImportedModules","value":"ignore"}],"evidence":{"identity":[{"field":"purl","confidence":0.7,"methods":[{"technique":"manifest-analysis","confidence":0.7,"value":"packages/core/node_modules/ignore/package.json"}],"concludedValue":"packages/core/node_modules/ignore/package.json"}],"occurrences":[{"location":"dist/utils.js#4"},{"location":"src/utils.ts#4"}]}},{"group":"@types","name":"picomatch","version":"3.0.2","description":"TypeScript definitions for picomatch","scope":"optional","licenses":[{"license":{"id":"MIT","url":"https://opensource.org/licenses/MIT"}}],"purl":"pkg:npm/%40types/picomatch@3.0.2","externalReferences":[{"type":"vcs","url":"https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/picomatch"},{"type":"vcs","url":"https://github.com/DefinitelyTyped/DefinitelyTyped.git"}],"type":"library","bom-ref":"pkg:npm/@types/picomatch@3.0.2","properties":[{"name":"SrcFile","value":"packages/core/node_modules/@types/picomatch/package.json"}],"evidence":{"identity":[{"field":"purl","confidence":0.7,"methods":[{"technique":"manifest-analysis","confidence":0.7,"value":"packages/core/node_modules/@types/picomatch/package.json"}],"concludedValue":"packages/core/node_modules/@types/picomatch/package.json"}]}},{"group":"@types","name":"node","version":"22.19.17","description":"TypeScript definitions for node","scope":"optional","licenses":[{"license":{"id":"MIT","url":"https://opensource.org/licenses/MIT"}}],"purl":"pkg:npm/%40types/node@22.19.17","externalReferences":[{"type":"vcs","url":"https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node"},{"type":"vcs","url":"https://github.com/DefinitelyTyped/DefinitelyTyped.git"}],"type":"library","bom-ref":"pkg:npm/@types/node@22.19.17","properties":[{"name":"SrcFile","value":"packages/core/node_modules/@types/node/package.json"}],"evidence":{"identity":[{"field":"purl","confidence":0.7,"methods":[{"technique":"manifest-analysis","confidence":0.7,"value":"packages/core/node_modules/@types/node/package.json"}],"concludedValue":"packages/core/node_modules/@types/node/package.json"}]}}],"dependencies":[],"annotations":[{"bom-ref":"metadata-annotations","subjects":["pkg:npm/@aegis-scan/core@0.18.0"],"annotator":{"component":{"group":"@cyclonedx","name":"cdxgen","version":"12.1.4","purl":"pkg:npm/%40cyclonedx/cdxgen@12.1.4","type":"application","bom-ref":"pkg:npm/@cyclonedx/cdxgen@12.1.4","publisher":"OWASP Foundation","authors":[{"name":"OWASP Foundation"}]}},"timestamp":"2026-05-01T15:54:28Z","text":"This Software Bill-of-Materials (SBOM) document was created on Friday, May 1, 2026 with cdxgen. The data was captured during the build lifecycle phase. The document describes an application named 'core' with version '0.18.0'. The package type in this SBOM is npm with a single purl namespace '@types' described under components. The components were identified from 7 source files."}]}