@opena2a/oasb 0.2.0 → 0.3.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 (46) hide show
  1. package/README.md +57 -16
  2. package/dist/harness/adapter.d.ts +187 -0
  3. package/dist/harness/adapter.js +18 -0
  4. package/dist/harness/arp-wrapper.d.ts +24 -20
  5. package/dist/harness/arp-wrapper.js +114 -28
  6. package/dist/harness/create-adapter.d.ts +16 -0
  7. package/dist/harness/create-adapter.js +36 -0
  8. package/dist/harness/event-collector.d.ts +1 -1
  9. package/dist/harness/llm-guard-wrapper.d.ts +31 -0
  10. package/dist/harness/llm-guard-wrapper.js +315 -0
  11. package/dist/harness/mock-llm-adapter.d.ts +2 -2
  12. package/dist/harness/mock-llm-adapter.js +6 -5
  13. package/dist/harness/types.d.ts +4 -38
  14. package/package.json +15 -7
  15. package/src/atomic/ai-layer/AT-AI-001.prompt-input-scan.test.ts +18 -42
  16. package/src/atomic/ai-layer/AT-AI-002.prompt-output-scan.test.ts +13 -32
  17. package/src/atomic/ai-layer/AT-AI-003.mcp-tool-scan.test.ts +18 -42
  18. package/src/atomic/ai-layer/AT-AI-004.a2a-message-scan.test.ts +14 -36
  19. package/src/atomic/ai-layer/AT-AI-005.pattern-coverage.test.ts +11 -5
  20. package/src/atomic/enforcement/AT-ENF-001.log-action.test.ts +4 -4
  21. package/src/atomic/enforcement/AT-ENF-002.alert-callback.test.ts +5 -5
  22. package/src/atomic/enforcement/AT-ENF-003.pause-sigstop.test.ts +4 -4
  23. package/src/atomic/enforcement/AT-ENF-004.kill-sigterm.test.ts +5 -5
  24. package/src/atomic/enforcement/AT-ENF-005.resume-sigcont.test.ts +4 -4
  25. package/src/atomic/intelligence/AT-INT-001.l0-rule-match.test.ts +1 -1
  26. package/src/atomic/intelligence/AT-INT-002.l1-anomaly-score.test.ts +10 -8
  27. package/src/atomic/intelligence/AT-INT-003.l2-escalation.test.ts +1 -1
  28. package/src/atomic/intelligence/AT-INT-004.budget-exhaustion.test.ts +8 -6
  29. package/src/atomic/intelligence/AT-INT-005.baseline-learning.test.ts +9 -9
  30. package/src/baseline/BL-002.anomaly-injection.test.ts +6 -6
  31. package/src/baseline/BL-003.baseline-persistence.test.ts +9 -9
  32. package/src/harness/adapter.ts +222 -0
  33. package/src/harness/arp-wrapper.ts +150 -42
  34. package/src/harness/create-adapter.ts +49 -0
  35. package/src/harness/event-collector.ts +1 -1
  36. package/src/harness/llm-guard-wrapper.ts +333 -0
  37. package/src/harness/mock-llm-adapter.ts +7 -6
  38. package/src/harness/types.ts +31 -39
  39. package/src/integration/INT-001.data-exfil-detection.test.ts +1 -1
  40. package/src/integration/INT-002.mcp-tool-abuse.test.ts +1 -1
  41. package/src/integration/INT-003.prompt-injection-response.test.ts +1 -1
  42. package/src/integration/INT-004.a2a-trust-exploitation.test.ts +1 -1
  43. package/src/integration/INT-005.baseline-then-attack.test.ts +1 -1
  44. package/src/integration/INT-006.multi-monitor-correlation.test.ts +1 -1
  45. package/src/integration/INT-007.budget-exhaustion-attack.test.ts +8 -8
  46. package/src/integration/INT-008.kill-switch-recovery.test.ts +6 -6
@@ -12,7 +12,7 @@
12
12
  import { describe, it, expect, beforeEach, afterEach } from 'vitest';
13
13
  import { spawn, type ChildProcess } from 'child_process';
14
14
  import { ArpWrapper } from '../harness/arp-wrapper';
15
- import type { ARPEvent, AlertRule } from '@opena2a/arp';
15
+ import type { SecurityEvent, AlertRule } from '../harness/adapter';
16
16
 
17
17
  describe('INT-008: Kill Switch and Recovery', () => {
18
18
  let arp: ArpWrapper;
@@ -107,7 +107,7 @@ describe('INT-008: Kill Switch and Recovery', () => {
107
107
  expect(isProcessAlive(pid)).toBe(true);
108
108
 
109
109
  // Create a mock event referencing the child PID
110
- const mockEvent: ARPEvent = {
110
+ const mockEvent: SecurityEvent = {
111
111
  id: 'kill-test-001',
112
112
  timestamp: new Date().toISOString(),
113
113
  source: 'process',
@@ -139,7 +139,7 @@ describe('INT-008: Kill Switch and Recovery', () => {
139
139
  // Use a PID that almost certainly does not exist
140
140
  const fakePid = 999999;
141
141
 
142
- const mockEvent: ARPEvent = {
142
+ const mockEvent: SecurityEvent = {
143
143
  id: 'kill-test-002',
144
144
  timestamp: new Date().toISOString(),
145
145
  source: 'process',
@@ -160,7 +160,7 @@ describe('INT-008: Kill Switch and Recovery', () => {
160
160
  });
161
161
 
162
162
  it('should report failure when no PID is provided for kill', async () => {
163
- const mockEvent: ARPEvent = {
163
+ const mockEvent: SecurityEvent = {
164
164
  id: 'kill-test-003',
165
165
  timestamp: new Date().toISOString(),
166
166
  source: 'process',
@@ -184,7 +184,7 @@ describe('INT-008: Kill Switch and Recovery', () => {
184
184
  const pid = child.pid!;
185
185
 
186
186
  // Kill the child
187
- const mockEvent: ARPEvent = {
187
+ const mockEvent: SecurityEvent = {
188
188
  id: 'kill-test-004',
189
189
  timestamp: new Date().toISOString(),
190
190
  source: 'process',
@@ -272,7 +272,7 @@ describe('INT-008: Kill Switch and Recovery', () => {
272
272
  const pid = child.pid!;
273
273
 
274
274
  // Kill the child via enforcement
275
- const mockEvent: ARPEvent = {
275
+ const mockEvent: SecurityEvent = {
276
276
  id: 'kill-test-006',
277
277
  timestamp: new Date().toISOString(),
278
278
  source: 'process',