@dcyfr/ai 1.0.4 → 2.1.1
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 +116 -0
- package/README.md +381 -9
- package/dist/ai/agents/agent-loader.d.ts +12 -0
- package/dist/ai/agents/agent-loader.d.ts.map +1 -1
- package/dist/ai/agents/agent-loader.js +74 -65
- package/dist/ai/agents/agent-loader.js.map +1 -1
- package/dist/ai/agents/agent-registry.d.ts +2 -0
- package/dist/ai/agents/agent-registry.d.ts.map +1 -1
- package/dist/ai/agents/agent-registry.js +15 -14
- package/dist/ai/agents/agent-registry.js.map +1 -1
- package/dist/ai/agents/agent-router.d.ts +20 -5
- package/dist/ai/agents/agent-router.d.ts.map +1 -1
- package/dist/ai/agents/agent-router.js +89 -43
- package/dist/ai/agents/agent-router.js.map +1 -1
- package/dist/ai/agents/index.d.ts +6 -1
- package/dist/ai/agents/index.d.ts.map +1 -1
- package/dist/ai/agents/index.js +9 -3
- package/dist/ai/agents/index.js.map +1 -1
- package/dist/ai/agents/instruction-template.d.ts +45 -0
- package/dist/ai/agents/instruction-template.d.ts.map +1 -0
- package/dist/ai/agents/instruction-template.js +197 -0
- package/dist/ai/agents/instruction-template.js.map +1 -0
- package/dist/ai/agents/persona-resolver.d.ts +90 -0
- package/dist/ai/agents/persona-resolver.d.ts.map +1 -0
- package/dist/ai/agents/persona-resolver.js +121 -0
- package/dist/ai/agents/persona-resolver.js.map +1 -0
- package/dist/ai/agents/schema.d.ts +166 -0
- package/dist/ai/agents/schema.d.ts.map +1 -0
- package/dist/ai/agents/schema.js +94 -0
- package/dist/ai/agents/schema.js.map +1 -0
- package/dist/ai/agents/types.d.ts +102 -0
- package/dist/ai/agents/types.d.ts.map +1 -1
- package/dist/ai/agents-builtin/architecture/index.js +3 -3
- package/dist/ai/agents-builtin/content/index.js +1 -1
- package/dist/ai/agents-builtin/data/index.js +1 -1
- package/dist/ai/agents-builtin/development/index.js +4 -4
- package/dist/ai/agents-builtin/devops/index.js +1 -1
- package/dist/ai/agents-builtin/index.js +33 -33
- package/dist/ai/agents-builtin/performance/index.js +1 -1
- package/dist/ai/agents-builtin/research/index.js +1 -1
- package/dist/ai/agents-builtin/security/index.js +1 -1
- package/dist/ai/agents-builtin/testing/index.js +2 -2
- package/dist/ai/config/loader.d.ts.map +1 -1
- package/dist/ai/config/loader.js +6 -3
- package/dist/ai/config/loader.js.map +1 -1
- package/dist/ai/config/schema.d.ts +242 -1156
- package/dist/ai/config/schema.d.ts.map +1 -1
- package/dist/ai/config/schema.js +69 -20
- package/dist/ai/config/schema.js.map +1 -1
- package/dist/ai/core/provider-registry.d.ts +32 -0
- package/dist/ai/core/provider-registry.d.ts.map +1 -1
- package/dist/ai/core/provider-registry.js +189 -14
- package/dist/ai/core/provider-registry.js.map +1 -1
- package/dist/ai/core/telemetry-engine.d.ts +26 -0
- package/dist/ai/core/telemetry-engine.d.ts.map +1 -1
- package/dist/ai/core/telemetry-engine.js +81 -1
- package/dist/ai/core/telemetry-engine.js.map +1 -1
- package/dist/ai/delegation/agent-registry.d.ts +143 -0
- package/dist/ai/delegation/agent-registry.d.ts.map +1 -0
- package/dist/ai/delegation/agent-registry.js +231 -0
- package/dist/ai/delegation/agent-registry.js.map +1 -0
- package/dist/ai/delegation/blast-radius-tracker.d.ts +65 -0
- package/dist/ai/delegation/blast-radius-tracker.d.ts.map +1 -0
- package/dist/ai/delegation/blast-radius-tracker.js +81 -0
- package/dist/ai/delegation/blast-radius-tracker.js.map +1 -0
- package/dist/ai/delegation/capability-bootstrap.d.ts +40 -0
- package/dist/ai/delegation/capability-bootstrap.d.ts.map +1 -0
- package/dist/ai/delegation/capability-bootstrap.js +431 -0
- package/dist/ai/delegation/capability-bootstrap.js.map +1 -0
- package/dist/ai/delegation/capability-registry.d.ts +81 -0
- package/dist/ai/delegation/capability-registry.d.ts.map +1 -0
- package/dist/ai/delegation/capability-registry.js +339 -0
- package/dist/ai/delegation/capability-registry.js.map +1 -0
- package/dist/ai/delegation/chain-tracker.d.ts +152 -0
- package/dist/ai/delegation/chain-tracker.d.ts.map +1 -0
- package/dist/ai/delegation/chain-tracker.js +336 -0
- package/dist/ai/delegation/chain-tracker.js.map +1 -0
- package/dist/ai/delegation/circuit-breaker.d.ts +59 -0
- package/dist/ai/delegation/circuit-breaker.d.ts.map +1 -0
- package/dist/ai/delegation/circuit-breaker.js +153 -0
- package/dist/ai/delegation/circuit-breaker.js.map +1 -0
- package/dist/ai/delegation/contract-manager.d.ts +415 -0
- package/dist/ai/delegation/contract-manager.d.ts.map +1 -0
- package/dist/ai/delegation/contract-manager.js +1258 -0
- package/dist/ai/delegation/contract-manager.js.map +1 -0
- package/dist/ai/delegation/delegation-manager.d.ts +505 -0
- package/dist/ai/delegation/delegation-manager.d.ts.map +1 -0
- package/dist/ai/delegation/delegation-manager.js +773 -0
- package/dist/ai/delegation/delegation-manager.js.map +1 -0
- package/dist/ai/delegation/event-schemas.d.ts +101 -0
- package/dist/ai/delegation/event-schemas.d.ts.map +1 -0
- package/dist/ai/delegation/event-schemas.js +59 -0
- package/dist/ai/delegation/event-schemas.js.map +1 -0
- package/dist/ai/delegation/execution-mode-dashboard.d.ts +109 -0
- package/dist/ai/delegation/execution-mode-dashboard.d.ts.map +1 -0
- package/dist/ai/delegation/execution-mode-dashboard.js +167 -0
- package/dist/ai/delegation/execution-mode-dashboard.js.map +1 -0
- package/dist/ai/delegation/feature-flags.d.ts +191 -0
- package/dist/ai/delegation/feature-flags.d.ts.map +1 -0
- package/dist/ai/delegation/feature-flags.js +332 -0
- package/dist/ai/delegation/feature-flags.js.map +1 -0
- package/dist/ai/delegation/index.d.ts +51 -0
- package/dist/ai/delegation/index.d.ts.map +1 -0
- package/dist/ai/delegation/index.js +39 -0
- package/dist/ai/delegation/index.js.map +1 -0
- package/dist/ai/delegation/middleware/chain-depth-middleware.d.ts +39 -0
- package/dist/ai/delegation/middleware/chain-depth-middleware.d.ts.map +1 -0
- package/dist/ai/delegation/middleware/chain-depth-middleware.js +77 -0
- package/dist/ai/delegation/middleware/chain-depth-middleware.js.map +1 -0
- package/dist/ai/delegation/middleware/chain-tracker-middleware.d.ts +46 -0
- package/dist/ai/delegation/middleware/chain-tracker-middleware.d.ts.map +1 -0
- package/dist/ai/delegation/middleware/chain-tracker-middleware.js +89 -0
- package/dist/ai/delegation/middleware/chain-tracker-middleware.js.map +1 -0
- package/dist/ai/delegation/middleware/content-policy-middleware.d.ts +31 -0
- package/dist/ai/delegation/middleware/content-policy-middleware.d.ts.map +1 -0
- package/dist/ai/delegation/middleware/content-policy-middleware.js +82 -0
- package/dist/ai/delegation/middleware/content-policy-middleware.js.map +1 -0
- package/dist/ai/delegation/middleware/feature-flag-middleware.d.ts +46 -0
- package/dist/ai/delegation/middleware/feature-flag-middleware.d.ts.map +1 -0
- package/dist/ai/delegation/middleware/feature-flag-middleware.js +59 -0
- package/dist/ai/delegation/middleware/feature-flag-middleware.js.map +1 -0
- package/dist/ai/delegation/middleware/identity-middleware.d.ts +23 -0
- package/dist/ai/delegation/middleware/identity-middleware.d.ts.map +1 -0
- package/dist/ai/delegation/middleware/identity-middleware.js +64 -0
- package/dist/ai/delegation/middleware/identity-middleware.js.map +1 -0
- package/dist/ai/delegation/middleware/permissions-middleware.d.ts +48 -0
- package/dist/ai/delegation/middleware/permissions-middleware.d.ts.map +1 -0
- package/dist/ai/delegation/middleware/permissions-middleware.js +107 -0
- package/dist/ai/delegation/middleware/permissions-middleware.js.map +1 -0
- package/dist/ai/delegation/middleware/rate-limiter-middleware.d.ts +38 -0
- package/dist/ai/delegation/middleware/rate-limiter-middleware.d.ts.map +1 -0
- package/dist/ai/delegation/middleware/rate-limiter-middleware.js +65 -0
- package/dist/ai/delegation/middleware/rate-limiter-middleware.js.map +1 -0
- package/dist/ai/delegation/middleware/reputation-middleware.d.ts +39 -0
- package/dist/ai/delegation/middleware/reputation-middleware.d.ts.map +1 -0
- package/dist/ai/delegation/middleware/reputation-middleware.js +75 -0
- package/dist/ai/delegation/middleware/reputation-middleware.js.map +1 -0
- package/dist/ai/delegation/middleware/resource-limiter-middleware.d.ts +52 -0
- package/dist/ai/delegation/middleware/resource-limiter-middleware.d.ts.map +1 -0
- package/dist/ai/delegation/middleware/resource-limiter-middleware.js +112 -0
- package/dist/ai/delegation/middleware/resource-limiter-middleware.js.map +1 -0
- package/dist/ai/delegation/middleware/threat-validator-middleware.d.ts +23 -0
- package/dist/ai/delegation/middleware/threat-validator-middleware.d.ts.map +1 -0
- package/dist/ai/delegation/middleware/threat-validator-middleware.js +83 -0
- package/dist/ai/delegation/middleware/threat-validator-middleware.js.map +1 -0
- package/dist/ai/delegation/middleware/tlp-middleware.d.ts +23 -0
- package/dist/ai/delegation/middleware/tlp-middleware.d.ts.map +1 -0
- package/dist/ai/delegation/middleware/tlp-middleware.js +59 -0
- package/dist/ai/delegation/middleware/tlp-middleware.js.map +1 -0
- package/dist/ai/delegation/monitoring.d.ts +298 -0
- package/dist/ai/delegation/monitoring.d.ts.map +1 -0
- package/dist/ai/delegation/monitoring.js +584 -0
- package/dist/ai/delegation/monitoring.js.map +1 -0
- package/dist/ai/delegation/security-middleware-chain.d.ts +71 -0
- package/dist/ai/delegation/security-middleware-chain.d.ts.map +1 -0
- package/dist/ai/delegation/security-middleware-chain.js +163 -0
- package/dist/ai/delegation/security-middleware-chain.js.map +1 -0
- package/dist/ai/delegation/session-checkpoint.d.ts +77 -0
- package/dist/ai/delegation/session-checkpoint.d.ts.map +1 -0
- package/dist/ai/delegation/session-checkpoint.js +131 -0
- package/dist/ai/delegation/session-checkpoint.js.map +1 -0
- package/dist/ai/delegation/session-manager.d.ts +131 -0
- package/dist/ai/delegation/session-manager.d.ts.map +1 -0
- package/dist/ai/delegation/session-manager.js +243 -0
- package/dist/ai/delegation/session-manager.js.map +1 -0
- package/dist/ai/delegation/session-queue.d.ts +95 -0
- package/dist/ai/delegation/session-queue.d.ts.map +1 -0
- package/dist/ai/delegation/session-queue.js +136 -0
- package/dist/ai/delegation/session-queue.js.map +1 -0
- package/dist/ai/delegation/timeout-watchdog.d.ts +60 -0
- package/dist/ai/delegation/timeout-watchdog.d.ts.map +1 -0
- package/dist/ai/delegation/timeout-watchdog.js +100 -0
- package/dist/ai/delegation/timeout-watchdog.js.map +1 -0
- package/dist/ai/examples/integration-demo.d.ts +27 -0
- package/dist/ai/examples/integration-demo.d.ts.map +1 -0
- package/dist/ai/examples/integration-demo.js +536 -0
- package/dist/ai/examples/integration-demo.js.map +1 -0
- package/dist/ai/index.d.ts +25 -0
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +34 -11
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/mcp/servers/analytics/index.js +67 -11
- package/dist/ai/mcp/servers/analytics/index.js.map +1 -1
- package/dist/ai/mcp/servers/content-manager/index.d.ts.map +1 -1
- package/dist/ai/mcp/servers/content-manager/index.js +50 -4
- package/dist/ai/mcp/servers/content-manager/index.js.map +1 -1
- package/dist/ai/mcp/servers/delegation-monitor/index.d.ts +36 -0
- package/dist/ai/mcp/servers/delegation-monitor/index.d.ts.map +1 -0
- package/dist/ai/mcp/servers/delegation-monitor/index.js +757 -0
- package/dist/ai/mcp/servers/delegation-monitor/index.js.map +1 -0
- package/dist/ai/mcp/servers/design-tokens/index.d.ts.map +1 -1
- package/dist/ai/mcp/servers/design-tokens/index.js +62 -39
- package/dist/ai/mcp/servers/design-tokens/index.js.map +1 -1
- package/dist/ai/mcp/servers/promptintel/index.js +15 -3
- package/dist/ai/mcp/servers/promptintel/index.js.map +1 -1
- package/dist/ai/mcp/servers/shared/rate-limiter.d.ts.map +1 -1
- package/dist/ai/mcp/servers/shared/rate-limiter.js +3 -1
- package/dist/ai/mcp/servers/shared/rate-limiter.js.map +1 -1
- package/dist/ai/mcp/servers/shared/redis-client.d.ts.map +1 -1
- package/dist/ai/mcp/servers/shared/redis-client.js +54 -47
- package/dist/ai/mcp/servers/shared/redis-client.js.map +1 -1
- package/dist/ai/mcp/servers/shared/types.d.ts +9 -0
- package/dist/ai/mcp/servers/shared/types.d.ts.map +1 -1
- package/dist/ai/mcp/servers/shared/utils.d.ts +9 -1
- package/dist/ai/mcp/servers/shared/utils.d.ts.map +1 -1
- package/dist/ai/mcp/servers/shared/utils.js +52 -2
- package/dist/ai/mcp/servers/shared/utils.js.map +1 -1
- package/dist/ai/memory/config.d.ts +18 -3
- package/dist/ai/memory/config.d.ts.map +1 -1
- package/dist/ai/memory/config.js +61 -15
- package/dist/ai/memory/config.js.map +1 -1
- package/dist/ai/memory/dcyfr-memory.d.ts +4 -0
- package/dist/ai/memory/dcyfr-memory.d.ts.map +1 -1
- package/dist/ai/memory/dcyfr-memory.js +44 -6
- package/dist/ai/memory/dcyfr-memory.js.map +1 -1
- package/dist/ai/memory/mem0-client.d.ts.map +1 -1
- package/dist/ai/memory/mem0-client.js +53 -14
- package/dist/ai/memory/mem0-client.js.map +1 -1
- package/dist/ai/permissions/attenuation-engine.d.ts +159 -0
- package/dist/ai/permissions/attenuation-engine.d.ts.map +1 -0
- package/dist/ai/permissions/attenuation-engine.js +511 -0
- package/dist/ai/permissions/attenuation-engine.js.map +1 -0
- package/dist/ai/plugins/plugin-loader.d.ts +4 -0
- package/dist/ai/plugins/plugin-loader.d.ts.map +1 -1
- package/dist/ai/plugins/plugin-loader.js +28 -28
- package/dist/ai/plugins/plugin-loader.js.map +1 -1
- package/dist/ai/reputation/execution-mode-reputation.d.ts +104 -0
- package/dist/ai/reputation/execution-mode-reputation.d.ts.map +1 -0
- package/dist/ai/reputation/execution-mode-reputation.js +142 -0
- package/dist/ai/reputation/execution-mode-reputation.js.map +1 -0
- package/dist/ai/reputation/reputation-engine.d.ts +204 -0
- package/dist/ai/reputation/reputation-engine.d.ts.map +1 -0
- package/dist/ai/reputation/reputation-engine.js +426 -0
- package/dist/ai/reputation/reputation-engine.js.map +1 -0
- package/dist/ai/runtime/agent-runtime.d.ts +193 -0
- package/dist/ai/runtime/agent-runtime.d.ts.map +1 -0
- package/dist/ai/runtime/agent-runtime.js +1009 -0
- package/dist/ai/runtime/agent-runtime.js.map +1 -0
- package/dist/ai/runtime/index.d.ts +11 -0
- package/dist/ai/runtime/index.d.ts.map +1 -0
- package/dist/ai/runtime/index.js +9 -0
- package/dist/ai/runtime/index.js.map +1 -0
- package/dist/ai/runtime/telemetry-schema.d.ts +192 -0
- package/dist/ai/runtime/telemetry-schema.d.ts.map +1 -0
- package/dist/ai/runtime/telemetry-schema.js +200 -0
- package/dist/ai/runtime/telemetry-schema.js.map +1 -0
- package/dist/ai/runtime/types.d.ts +236 -0
- package/dist/ai/runtime/types.d.ts.map +1 -0
- package/dist/ai/runtime/types.js +10 -0
- package/dist/ai/runtime/types.js.map +1 -0
- package/dist/ai/src/batch-processor.d.ts +298 -0
- package/dist/ai/src/batch-processor.d.ts.map +1 -0
- package/dist/ai/src/batch-processor.js +520 -0
- package/dist/ai/src/batch-processor.js.map +1 -0
- package/dist/ai/src/capability-bootstrap.d.ts +222 -0
- package/dist/ai/src/capability-bootstrap.d.ts.map +1 -0
- package/dist/ai/src/capability-bootstrap.js +421 -0
- package/dist/ai/src/capability-bootstrap.js.map +1 -0
- package/dist/ai/src/capability-manifest-generator.d.ts +61 -0
- package/dist/ai/src/capability-manifest-generator.d.ts.map +1 -0
- package/dist/ai/src/capability-manifest-generator.js +700 -0
- package/dist/ai/src/capability-manifest-generator.js.map +1 -0
- package/dist/ai/src/capability-registry.d.ts +157 -0
- package/dist/ai/src/capability-registry.d.ts.map +1 -0
- package/dist/ai/src/capability-registry.js +577 -0
- package/dist/ai/src/capability-registry.js.map +1 -0
- package/dist/ai/src/cli/telemetry-dashboard.d.ts +132 -0
- package/dist/ai/src/cli/telemetry-dashboard.d.ts.map +1 -0
- package/dist/ai/src/cli/telemetry-dashboard.js +565 -0
- package/dist/ai/src/cli/telemetry-dashboard.js.map +1 -0
- package/dist/ai/src/delegation/feature-flags.d.ts +213 -0
- package/dist/ai/src/delegation/feature-flags.d.ts.map +1 -0
- package/dist/ai/src/delegation/feature-flags.js +395 -0
- package/dist/ai/src/delegation/feature-flags.js.map +1 -0
- package/dist/ai/src/delegation/liability-firebreak.d.ts +303 -0
- package/dist/ai/src/delegation/liability-firebreak.d.ts.map +1 -0
- package/dist/ai/src/delegation/liability-firebreak.js +643 -0
- package/dist/ai/src/delegation/liability-firebreak.js.map +1 -0
- package/dist/ai/src/delegation/security-threat-model.d.ts +171 -0
- package/dist/ai/src/delegation/security-threat-model.d.ts.map +1 -0
- package/dist/ai/src/delegation/security-threat-model.js +723 -0
- package/dist/ai/src/delegation/security-threat-model.js.map +1 -0
- package/dist/ai/src/delegation/tlp-enforcement.d.ts +146 -0
- package/dist/ai/src/delegation/tlp-enforcement.d.ts.map +1 -0
- package/dist/ai/src/delegation/tlp-enforcement.js +382 -0
- package/dist/ai/src/delegation/tlp-enforcement.js.map +1 -0
- package/dist/ai/src/delegation-capability-integration.d.ts +154 -0
- package/dist/ai/src/delegation-capability-integration.d.ts.map +1 -0
- package/dist/ai/src/delegation-capability-integration.js +351 -0
- package/dist/ai/src/delegation-capability-integration.js.map +1 -0
- package/dist/ai/src/end-to-end-workflow-orchestrator.d.ts +325 -0
- package/dist/ai/src/end-to-end-workflow-orchestrator.d.ts.map +1 -0
- package/dist/ai/src/end-to-end-workflow-orchestrator.js +801 -0
- package/dist/ai/src/end-to-end-workflow-orchestrator.js.map +1 -0
- package/dist/ai/src/enhanced-capability-detection.d.ts +237 -0
- package/dist/ai/src/enhanced-capability-detection.d.ts.map +1 -0
- package/dist/ai/src/enhanced-capability-detection.js +448 -0
- package/dist/ai/src/enhanced-capability-detection.js.map +1 -0
- package/dist/ai/src/intelligent-cache-manager.d.ts +327 -0
- package/dist/ai/src/intelligent-cache-manager.d.ts.map +1 -0
- package/dist/ai/src/intelligent-cache-manager.js +634 -0
- package/dist/ai/src/intelligent-cache-manager.js.map +1 -0
- package/dist/ai/src/mcp-auto-configuration.d.ts +232 -0
- package/dist/ai/src/mcp-auto-configuration.d.ts.map +1 -0
- package/dist/ai/src/mcp-auto-configuration.js +445 -0
- package/dist/ai/src/mcp-auto-configuration.js.map +1 -0
- package/dist/ai/src/performance-profiler.d.ts +351 -0
- package/dist/ai/src/performance-profiler.d.ts.map +1 -0
- package/dist/ai/src/performance-profiler.js +475 -0
- package/dist/ai/src/performance-profiler.js.map +1 -0
- package/dist/ai/src/personas/hooks/before-llm-call.d.ts +96 -0
- package/dist/ai/src/personas/hooks/before-llm-call.d.ts.map +1 -0
- package/dist/ai/src/personas/hooks/before-llm-call.js +83 -0
- package/dist/ai/src/personas/hooks/before-llm-call.js.map +1 -0
- package/dist/ai/src/personas/index.d.ts +10 -0
- package/dist/ai/src/personas/index.d.ts.map +1 -0
- package/dist/ai/src/personas/index.js +10 -0
- package/dist/ai/src/personas/index.js.map +1 -0
- package/dist/ai/src/personas/persona-loader.d.ts +42 -0
- package/dist/ai/src/personas/persona-loader.d.ts.map +1 -0
- package/dist/ai/src/personas/persona-loader.js +162 -0
- package/dist/ai/src/personas/persona-loader.js.map +1 -0
- package/dist/ai/src/personas/types.d.ts +199 -0
- package/dist/ai/src/personas/types.d.ts.map +1 -0
- package/dist/ai/src/personas/types.js +7 -0
- package/dist/ai/src/personas/types.js.map +1 -0
- package/dist/ai/src/personas/voice-resolver.d.ts +40 -0
- package/dist/ai/src/personas/voice-resolver.d.ts.map +1 -0
- package/dist/ai/src/personas/voice-resolver.js +201 -0
- package/dist/ai/src/personas/voice-resolver.js.map +1 -0
- package/dist/ai/src/resource-monitor.d.ts +311 -0
- package/dist/ai/src/resource-monitor.d.ts.map +1 -0
- package/dist/ai/src/resource-monitor.js +475 -0
- package/dist/ai/src/resource-monitor.js.map +1 -0
- package/dist/ai/src/runtime/agent-runtime.d.ts +340 -0
- package/dist/ai/src/runtime/agent-runtime.d.ts.map +1 -0
- package/dist/ai/src/runtime/agent-runtime.js +1084 -0
- package/dist/ai/src/runtime/agent-runtime.js.map +1 -0
- package/dist/ai/src/telemetry/delegation-telemetry.d.ts +287 -0
- package/dist/ai/src/telemetry/delegation-telemetry.d.ts.map +1 -0
- package/dist/ai/src/telemetry/delegation-telemetry.js +389 -0
- package/dist/ai/src/telemetry/delegation-telemetry.js.map +1 -0
- package/dist/ai/src/telemetry/index.d.ts +48 -0
- package/dist/ai/src/telemetry/index.d.ts.map +1 -0
- package/dist/ai/src/telemetry/index.js +48 -0
- package/dist/ai/src/telemetry/index.js.map +1 -0
- package/dist/ai/src/telemetry/runtime-telemetry-integration.d.ts +67 -0
- package/dist/ai/src/telemetry/runtime-telemetry-integration.d.ts.map +1 -0
- package/dist/ai/src/telemetry/runtime-telemetry-integration.js +415 -0
- package/dist/ai/src/telemetry/runtime-telemetry-integration.js.map +1 -0
- package/dist/ai/src/telemetry/telemetry-utils.d.ts +119 -0
- package/dist/ai/src/telemetry/telemetry-utils.d.ts.map +1 -0
- package/dist/ai/src/telemetry/telemetry-utils.js +250 -0
- package/dist/ai/src/telemetry/telemetry-utils.js.map +1 -0
- package/dist/ai/src/types/agent-capabilities.d.ts +227 -0
- package/dist/ai/src/types/agent-capabilities.d.ts.map +1 -0
- package/dist/ai/src/types/agent-capabilities.js +11 -0
- package/dist/ai/src/types/agent-capabilities.js.map +1 -0
- package/dist/ai/src/types/context-verification.d.ts +158 -0
- package/dist/ai/src/types/context-verification.d.ts.map +1 -0
- package/dist/ai/src/types/context-verification.js +73 -0
- package/dist/ai/src/types/context-verification.js.map +1 -0
- package/dist/ai/src/types/delegation-contracts.d.ts +296 -0
- package/dist/ai/src/types/delegation-contracts.d.ts.map +1 -0
- package/dist/ai/src/types/delegation-contracts.js +17 -0
- package/dist/ai/src/types/delegation-contracts.js.map +1 -0
- package/dist/ai/src/validation-pipeline-integration.d.ts +266 -0
- package/dist/ai/src/validation-pipeline-integration.d.ts.map +1 -0
- package/dist/ai/src/validation-pipeline-integration.js +695 -0
- package/dist/ai/src/validation-pipeline-integration.js.map +1 -0
- package/dist/ai/src/verification/multi-modal-formatters.d.ts +57 -0
- package/dist/ai/src/verification/multi-modal-formatters.d.ts.map +1 -0
- package/dist/ai/src/verification/multi-modal-formatters.js +655 -0
- package/dist/ai/src/verification/multi-modal-formatters.js.map +1 -0
- package/dist/ai/src/verification/output-formatter.d.ts +186 -0
- package/dist/ai/src/verification/output-formatter.d.ts.map +1 -0
- package/dist/ai/src/verification/output-formatter.js +296 -0
- package/dist/ai/src/verification/output-formatter.js.map +1 -0
- package/dist/ai/src/verification/parser-integration.d.ts +137 -0
- package/dist/ai/src/verification/parser-integration.d.ts.map +1 -0
- package/dist/ai/src/verification/parser-integration.js +273 -0
- package/dist/ai/src/verification/parser-integration.js.map +1 -0
- package/dist/ai/types/agent-capabilities.d.ts +387 -0
- package/dist/ai/types/agent-capabilities.d.ts.map +1 -0
- package/dist/ai/types/agent-capabilities.js +32 -0
- package/dist/ai/types/agent-capabilities.js.map +1 -0
- package/dist/ai/types/delegation-contracts.d.ts +291 -0
- package/dist/ai/types/delegation-contracts.d.ts.map +1 -0
- package/dist/ai/types/delegation-contracts.js +14 -0
- package/dist/ai/types/delegation-contracts.js.map +1 -0
- package/dist/ai/types/index.d.ts +4 -1
- package/dist/ai/types/index.d.ts.map +1 -1
- package/dist/ai/types/index.js +4 -1
- package/dist/ai/types/index.js.map +1 -1
- package/dist/ai/types/permission-tokens.d.ts +365 -0
- package/dist/ai/types/permission-tokens.d.ts.map +1 -0
- package/dist/ai/types/permission-tokens.js +13 -0
- package/dist/ai/types/permission-tokens.js.map +1 -0
- package/dist/ai/types/security-middleware.d.ts +130 -0
- package/dist/ai/types/security-middleware.d.ts.map +1 -0
- package/dist/ai/types/security-middleware.js +13 -0
- package/dist/ai/types/security-middleware.js.map +1 -0
- package/dist/ai/utils/storage.d.ts.map +1 -1
- package/dist/ai/utils/storage.js +6 -3
- package/dist/ai/utils/storage.js.map +1 -1
- package/dist/ai/validation/validation-framework.js +1 -1
- package/dist/ai/verification/policy-framework.d.ts +161 -0
- package/dist/ai/verification/policy-framework.d.ts.map +1 -0
- package/dist/ai/verification/policy-framework.js +436 -0
- package/dist/ai/verification/policy-framework.js.map +1 -0
- package/package.json +36 -8
|
@@ -0,0 +1,723 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Security Threat Model Validation for DCYFR Delegation Framework
|
|
3
|
+
* TLP:AMBER - Internal Use Only
|
|
4
|
+
*
|
|
5
|
+
* Implements attack scenario detection, delegation abuse monitoring, and
|
|
6
|
+
* anomaly detection to protect against security threats in delegation chains.
|
|
7
|
+
*
|
|
8
|
+
* Threat Vectors Addressed:
|
|
9
|
+
* - Permission escalation through delegation chains
|
|
10
|
+
* - Reputation gaming and manipulation
|
|
11
|
+
* - Delegation abuse patterns and resource exhaustion
|
|
12
|
+
* - Anomalous delegation behavior detection
|
|
13
|
+
*
|
|
14
|
+
* @module delegation/security-threat-model
|
|
15
|
+
* @version 1.1.0
|
|
16
|
+
* @date 2026-02-14
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Security threat model validation engine
|
|
20
|
+
*/
|
|
21
|
+
export class SecurityThreatValidator {
|
|
22
|
+
agentActivities;
|
|
23
|
+
delegationChains;
|
|
24
|
+
threatHistory;
|
|
25
|
+
config;
|
|
26
|
+
constructor(config = {}) {
|
|
27
|
+
this.agentActivities = new Map();
|
|
28
|
+
this.delegationChains = new Map();
|
|
29
|
+
this.threatHistory = [];
|
|
30
|
+
this.config = {
|
|
31
|
+
max_chain_depth: config.max_chain_depth || 5,
|
|
32
|
+
max_contracts_per_hour: config.max_contracts_per_hour || 50,
|
|
33
|
+
reputation_gaming_threshold: config.reputation_gaming_threshold || 0.1,
|
|
34
|
+
anomaly_detection_window_hours: config.anomaly_detection_window_hours || 24,
|
|
35
|
+
permission_escalation_detection: config.permission_escalation_detection ?? true,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Validate delegation contract for security threats
|
|
40
|
+
*/
|
|
41
|
+
async validateDelegationSecurity(contract) {
|
|
42
|
+
// Update agent activity tracking
|
|
43
|
+
this.trackAgentActivity(contract);
|
|
44
|
+
// Run all threat detection checks
|
|
45
|
+
const threats = await Promise.all([
|
|
46
|
+
this.detectPermissionEscalation(contract),
|
|
47
|
+
this.detectReputationGaming(contract),
|
|
48
|
+
this.detectAbusePatterns(contract),
|
|
49
|
+
this.detectAnomalies(contract),
|
|
50
|
+
this.detectContextInsufficiency(contract),
|
|
51
|
+
this.detectPromptInjection(contract),
|
|
52
|
+
this.detectResourceExhaustion(contract),
|
|
53
|
+
]);
|
|
54
|
+
// Find the most appropriate threat to report based on severity and threat type priority
|
|
55
|
+
const severeThreat = this.selectPrimaryThreat(threats);
|
|
56
|
+
// Log threat detection result
|
|
57
|
+
this.threatHistory.push(severeThreat);
|
|
58
|
+
// Emit security event for monitoring
|
|
59
|
+
if (severeThreat.threat_detected) {
|
|
60
|
+
console.warn(`🚨 Security Threat Detected: ${severeThreat.threat_type} (${severeThreat.severity}) - ${severeThreat.description}`);
|
|
61
|
+
}
|
|
62
|
+
return severeThreat;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Select the primary threat to report based on severity and threat type priority
|
|
66
|
+
*/
|
|
67
|
+
selectPrimaryThreat(threats) {
|
|
68
|
+
const detectedThreats = threats.filter(t => t.threat_detected);
|
|
69
|
+
if (detectedThreats.length === 0) {
|
|
70
|
+
return { threat_detected: false, threat_type: 'none', severity: 'low', description: 'No threats detected', action: 'allow', evidence: {}, confidence: 0 };
|
|
71
|
+
}
|
|
72
|
+
// Threat type priority (higher number = higher priority to report)
|
|
73
|
+
const threatPriority = {
|
|
74
|
+
'prompt_injection': 6, // Highest - direct security attack
|
|
75
|
+
'permission_escalation': 5, // Highest priority - critical security issue
|
|
76
|
+
'resource_exhaustion': 4, // High - DoS attacks
|
|
77
|
+
'context_insufficiency': 3, // Medium - prevents dead-end implementations
|
|
78
|
+
'abuse_pattern': 3, // High priority - system abuse
|
|
79
|
+
'anomaly': 2, // Medium priority - unusual behavior
|
|
80
|
+
'reputation_gaming': 1, // Lower priority - unless severe
|
|
81
|
+
'none': 0
|
|
82
|
+
};
|
|
83
|
+
// Severity weight
|
|
84
|
+
const severityWeight = { low: 0, medium: 1, high: 2, critical: 3 };
|
|
85
|
+
// Calculate combined score: (priority * 10) + severity weight
|
|
86
|
+
// This ensures threat type priority is dominant, but severity still matters
|
|
87
|
+
const threatScores = detectedThreats.map(threat => ({
|
|
88
|
+
threat,
|
|
89
|
+
score: (threatPriority[threat.threat_type] * 10) + severityWeight[threat.severity]
|
|
90
|
+
}));
|
|
91
|
+
// Sort by score (descending) and return the highest priority threat
|
|
92
|
+
threatScores.sort((a, b) => b.score - a.score);
|
|
93
|
+
return threatScores[0].threat;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Detect permission escalation attempts through delegation chains
|
|
97
|
+
*/
|
|
98
|
+
/** Check privilege scopes and return risk delta + patterns */
|
|
99
|
+
checkPrivilegeScopes(contract) {
|
|
100
|
+
const patterns = [];
|
|
101
|
+
let risk = 0;
|
|
102
|
+
if (!contract.permission_token?.scopes)
|
|
103
|
+
return { risk, patterns };
|
|
104
|
+
const highPriv = ['admin', 'root', 'execute', 'delete', 'modify_system'];
|
|
105
|
+
const escalated = contract.permission_token.scopes.filter(s => highPriv.some(p => s.toLowerCase().includes(p.toLowerCase())));
|
|
106
|
+
if (escalated.length > 0) {
|
|
107
|
+
patterns.push(`High-privilege scopes requested: ${escalated.join(', ')}`);
|
|
108
|
+
risk += Math.min(0.3 * escalated.length, 0.7);
|
|
109
|
+
}
|
|
110
|
+
if (contract.permission_token.actions && contract.permission_token.actions.length > 5) {
|
|
111
|
+
patterns.push(`Excessive permission actions requested: ${contract.permission_token.actions.length} actions`);
|
|
112
|
+
risk += 0.6;
|
|
113
|
+
}
|
|
114
|
+
return { risk, patterns };
|
|
115
|
+
}
|
|
116
|
+
async detectPermissionEscalation(contract) {
|
|
117
|
+
if (!this.config.permission_escalation_detection) {
|
|
118
|
+
return { threat_detected: false, threat_type: 'none', severity: 'low', description: 'Permission escalation detection disabled', action: 'allow', evidence: {}, confidence: 0 };
|
|
119
|
+
}
|
|
120
|
+
const suspicious_patterns = [];
|
|
121
|
+
let risk_score = 0;
|
|
122
|
+
const scopeCheck = this.checkPrivilegeScopes(contract);
|
|
123
|
+
risk_score += scopeCheck.risk;
|
|
124
|
+
suspicious_patterns.push(...scopeCheck.patterns);
|
|
125
|
+
// Check delegation chain depth for escalation patterns
|
|
126
|
+
if (contract.metadata?.delegation_depth !== undefined && contract.metadata.delegation_depth > this.config.max_chain_depth) {
|
|
127
|
+
suspicious_patterns.push(`Delegation chain exceeds safe depth: ${contract.metadata.delegation_depth} > ${this.config.max_chain_depth}`);
|
|
128
|
+
risk_score += 0.6;
|
|
129
|
+
}
|
|
130
|
+
// Check TLP escalation without proper clearance
|
|
131
|
+
const tlp_risk = this.checkTLPEscalation(contract);
|
|
132
|
+
risk_score += tlp_risk.risk;
|
|
133
|
+
if (tlp_risk.patterns)
|
|
134
|
+
suspicious_patterns.push(...tlp_risk.patterns);
|
|
135
|
+
if (risk_score > 0.5) {
|
|
136
|
+
return {
|
|
137
|
+
threat_detected: true,
|
|
138
|
+
threat_type: 'permission_escalation',
|
|
139
|
+
severity: risk_score > 0.8 ? 'critical' : risk_score > 0.6 ? 'high' : 'medium',
|
|
140
|
+
description: `Potential permission escalation detected with risk score ${risk_score.toFixed(2)}`,
|
|
141
|
+
action: risk_score > 0.8 ? 'block' : risk_score > 0.6 ? 'escalate' : 'warn',
|
|
142
|
+
evidence: {
|
|
143
|
+
metrics: { risk_score, pattern_count: suspicious_patterns.length },
|
|
144
|
+
related_entities: [contract.delegator_agent_id, contract.delegatee_agent_id],
|
|
145
|
+
activity_timeline: [{
|
|
146
|
+
timestamp: new Date().toISOString(),
|
|
147
|
+
event: 'permission_escalation_analysis',
|
|
148
|
+
details: { suspicious_patterns, contract_id: contract.contract_id }
|
|
149
|
+
}]
|
|
150
|
+
},
|
|
151
|
+
confidence: Math.min(risk_score, 0.95)
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
return { threat_detected: false, threat_type: 'none', severity: 'low', description: 'No permission escalation detected', action: 'allow', evidence: {}, confidence: 0.1 };
|
|
155
|
+
}
|
|
156
|
+
/** Check for circular delegation and rapid success patterns */
|
|
157
|
+
checkReputationPatterns(contract) {
|
|
158
|
+
const patterns = [];
|
|
159
|
+
let risk = 0;
|
|
160
|
+
const delegator_activity = this.agentActivities.get(contract.delegator_agent_id);
|
|
161
|
+
const delegatee_activity = this.agentActivities.get(contract.delegatee_agent_id);
|
|
162
|
+
if (delegator_activity && delegatee_activity) {
|
|
163
|
+
const mutual = this.checkMutualDelegations(contract.delegator_agent_id, contract.delegatee_agent_id);
|
|
164
|
+
if (mutual > 3) {
|
|
165
|
+
patterns.push('Circular delegation pattern detected');
|
|
166
|
+
risk += 0.3;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
if (delegatee_activity) {
|
|
170
|
+
const success_rate = delegatee_activity.contracts_completed / (delegatee_activity.contracts_accepted || 1);
|
|
171
|
+
if (success_rate > 0.95 && delegatee_activity.contracts_completed > 10) {
|
|
172
|
+
patterns.push('Unusually high success rate suggesting gaming');
|
|
173
|
+
risk += 0.2;
|
|
174
|
+
}
|
|
175
|
+
if (delegatee_activity.contracts_accepted < 3) {
|
|
176
|
+
const agent_age = Date.now() - new Date(delegatee_activity.first_seen).getTime();
|
|
177
|
+
if (agent_age < 12 * 60 * 60 * 1000) {
|
|
178
|
+
patterns.push('Delegation to very new agent');
|
|
179
|
+
risk += 0.05;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return { risk, patterns };
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Detect reputation gaming attempts
|
|
187
|
+
*/
|
|
188
|
+
async detectReputationGaming(contract) {
|
|
189
|
+
const { risk: risk_score, patterns: suspicious_patterns } = this.checkReputationPatterns(contract);
|
|
190
|
+
if (risk_score > 0.2) {
|
|
191
|
+
return {
|
|
192
|
+
threat_detected: true,
|
|
193
|
+
threat_type: 'reputation_gaming',
|
|
194
|
+
severity: risk_score > 0.4 ? 'high' : 'medium',
|
|
195
|
+
description: `Potential reputation gaming detected with risk score ${risk_score.toFixed(2)}`,
|
|
196
|
+
action: risk_score > 0.4 ? 'escalate' : 'warn',
|
|
197
|
+
evidence: {
|
|
198
|
+
metrics: { risk_score, mutual_delegations: this.checkMutualDelegations(contract.delegator_agent_id, contract.delegatee_agent_id) },
|
|
199
|
+
related_entities: [contract.delegator_agent_id, contract.delegatee_agent_id],
|
|
200
|
+
},
|
|
201
|
+
confidence: risk_score
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
return { threat_detected: false, threat_type: 'none', severity: 'low', description: 'No reputation gaming detected', action: 'allow', evidence: {}, confidence: 0.1 };
|
|
205
|
+
}
|
|
206
|
+
/** Check resource requirements for abuse patterns */
|
|
207
|
+
checkResourceAbuse(contract) {
|
|
208
|
+
const patterns = [];
|
|
209
|
+
let risk = 0;
|
|
210
|
+
if (!contract.resource_requirements)
|
|
211
|
+
return { risk, patterns };
|
|
212
|
+
const { memory_mb, cpu_cores, disk_space_mb } = contract.resource_requirements;
|
|
213
|
+
if (memory_mb && memory_mb > 8192) {
|
|
214
|
+
patterns.push('Excessive memory requirement');
|
|
215
|
+
risk += 0.2;
|
|
216
|
+
}
|
|
217
|
+
if (cpu_cores && cpu_cores > 4) {
|
|
218
|
+
patterns.push('Excessive CPU requirement');
|
|
219
|
+
risk += 0.2;
|
|
220
|
+
}
|
|
221
|
+
if (disk_space_mb && disk_space_mb > 102400) {
|
|
222
|
+
patterns.push('Excessive disk space requirement');
|
|
223
|
+
risk += 0.2;
|
|
224
|
+
}
|
|
225
|
+
return { risk, patterns };
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Detect delegation abuse patterns
|
|
229
|
+
*/
|
|
230
|
+
async detectAbusePatterns(contract) {
|
|
231
|
+
const delegator_activity = this.agentActivities.get(contract.delegator_agent_id);
|
|
232
|
+
if (!delegator_activity) {
|
|
233
|
+
return { threat_detected: false, threat_type: 'none', severity: 'low', description: 'No activity history available', action: 'allow', evidence: {}, confidence: 0 };
|
|
234
|
+
}
|
|
235
|
+
const suspicious_patterns = [];
|
|
236
|
+
let risk_score = 0;
|
|
237
|
+
const recent_hour = Date.now() - 60 * 60 * 1000;
|
|
238
|
+
const recent_contracts = delegator_activity.recent_activity.filter(activity => new Date(activity.timestamp).getTime() > recent_hour).length;
|
|
239
|
+
if (recent_contracts > this.config.max_contracts_per_hour) {
|
|
240
|
+
suspicious_patterns.push('Excessive delegation frequency detected');
|
|
241
|
+
risk_score += 0.4;
|
|
242
|
+
}
|
|
243
|
+
const resourceCheck = this.checkResourceAbuse(contract);
|
|
244
|
+
risk_score += resourceCheck.risk;
|
|
245
|
+
suspicious_patterns.push(...resourceCheck.patterns);
|
|
246
|
+
if (risk_score > 0.3) {
|
|
247
|
+
return {
|
|
248
|
+
threat_detected: true,
|
|
249
|
+
threat_type: 'abuse_pattern',
|
|
250
|
+
severity: risk_score > 0.6 ? 'high' : 'medium',
|
|
251
|
+
description: `Delegation abuse pattern detected with risk score ${risk_score.toFixed(2)}`,
|
|
252
|
+
action: risk_score > 0.6 ? 'block' : 'warn',
|
|
253
|
+
evidence: {
|
|
254
|
+
metrics: { risk_score, recent_contracts },
|
|
255
|
+
related_entities: [contract.delegator_agent_id],
|
|
256
|
+
},
|
|
257
|
+
confidence: risk_score
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
return { threat_detected: false, threat_type: 'none', severity: 'low', description: 'No abuse patterns detected', action: 'allow', evidence: {}, confidence: 0.1 };
|
|
261
|
+
}
|
|
262
|
+
/** Check if execution time is anomalous compared to historical average */
|
|
263
|
+
checkExecutionTimeAnomaly(contract, activity) {
|
|
264
|
+
if (!contract.metadata?.estimated_duration_ms || activity.average_execution_time <= 0)
|
|
265
|
+
return { isAnomaly: false };
|
|
266
|
+
const estimated = contract.metadata.estimated_duration_ms;
|
|
267
|
+
const total = activity.contracts_created;
|
|
268
|
+
const historicalAvg = total > 1
|
|
269
|
+
? ((activity.average_execution_time * total) - estimated) / (total - 1)
|
|
270
|
+
: activity.average_execution_time;
|
|
271
|
+
return { isAnomaly: estimated > historicalAvg * 3 };
|
|
272
|
+
}
|
|
273
|
+
/** Check for unusual time-of-day patterns */
|
|
274
|
+
checkTimeOfDay(activity) {
|
|
275
|
+
const current_hour = new Date().getHours();
|
|
276
|
+
const usual_hours = activity.recent_activity
|
|
277
|
+
.map(a => new Date(a.timestamp).getHours())
|
|
278
|
+
.reduce((acc, hour) => { acc[hour] = (acc[hour] || 0) + 1; return acc; }, {});
|
|
279
|
+
return usual_hours[current_hour] === undefined && Object.keys(usual_hours).length > 5;
|
|
280
|
+
}
|
|
281
|
+
/** Build a high-detail anomaly ThreatDetectionResult from accumulated score */
|
|
282
|
+
buildAnomalyThreat(anomaly_score, suspicious_patterns, contract) {
|
|
283
|
+
const isCritical = anomaly_score > 0.6;
|
|
284
|
+
const isModerate = anomaly_score > 0.4;
|
|
285
|
+
return {
|
|
286
|
+
threat_detected: true,
|
|
287
|
+
threat_type: 'anomaly',
|
|
288
|
+
severity: isCritical ? 'high' : isModerate ? 'medium' : 'low',
|
|
289
|
+
description: `Anomalous delegation behavior detected with score ${anomaly_score.toFixed(2)}`,
|
|
290
|
+
action: isCritical ? 'escalate' : isModerate ? 'warn' : 'allow',
|
|
291
|
+
evidence: {
|
|
292
|
+
metrics: { anomaly_score, pattern_count: suspicious_patterns.length },
|
|
293
|
+
related_entities: [contract.delegator_agent_id],
|
|
294
|
+
},
|
|
295
|
+
confidence: Math.min(anomaly_score, 0.9)
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Detect anomalous delegation behavior
|
|
300
|
+
*/
|
|
301
|
+
async detectAnomalies(contract) {
|
|
302
|
+
const delegator_activity = this.agentActivities.get(contract.delegator_agent_id);
|
|
303
|
+
if (!delegator_activity || delegator_activity.contracts_created < 5) {
|
|
304
|
+
return { threat_detected: false, threat_type: 'none', severity: 'low', description: 'Insufficient data for anomaly detection', action: 'allow', evidence: {}, confidence: 0 };
|
|
305
|
+
}
|
|
306
|
+
const suspicious_patterns = [];
|
|
307
|
+
let anomaly_score = 0;
|
|
308
|
+
const historical_tlp = delegator_activity.tlp_level_requests.slice(0, -1).slice(-20);
|
|
309
|
+
const usual_tlp = new Set(historical_tlp);
|
|
310
|
+
const requested_tlp = contract.tlp_classification || 'TLP:CLEAR';
|
|
311
|
+
if (requested_tlp !== 'TLP:CLEAR' && !usual_tlp.has(requested_tlp)) {
|
|
312
|
+
suspicious_patterns.push('Unusual TLP level requested');
|
|
313
|
+
anomaly_score += 0.4;
|
|
314
|
+
}
|
|
315
|
+
if (this.checkExecutionTimeAnomaly(contract, delegator_activity).isAnomaly) {
|
|
316
|
+
suspicious_patterns.push('Unusually long execution time estimated');
|
|
317
|
+
anomaly_score += 0.4;
|
|
318
|
+
}
|
|
319
|
+
if (this.checkTimeOfDay(delegator_activity)) {
|
|
320
|
+
suspicious_patterns.push('Unusual time-of-day activity');
|
|
321
|
+
anomaly_score += 0.2;
|
|
322
|
+
}
|
|
323
|
+
if (anomaly_score > 0.3) {
|
|
324
|
+
return this.buildAnomalyThreat(anomaly_score, suspicious_patterns, contract);
|
|
325
|
+
}
|
|
326
|
+
return { threat_detected: false, threat_type: 'none', severity: 'low', description: 'No anomalies detected', action: 'allow', evidence: {}, confidence: 0.1 };
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Track agent activity for pattern analysis
|
|
330
|
+
*/
|
|
331
|
+
trackAgentActivity(contract) {
|
|
332
|
+
const timestamp = new Date().toISOString();
|
|
333
|
+
// Track delegator activity
|
|
334
|
+
const delegator_activity = this.agentActivities.get(contract.delegator_agent_id) || {
|
|
335
|
+
agent_id: contract.delegator_agent_id,
|
|
336
|
+
contracts_created: 0,
|
|
337
|
+
contracts_accepted: 0,
|
|
338
|
+
contracts_completed: 0,
|
|
339
|
+
contracts_failed: 0,
|
|
340
|
+
average_execution_time: 0,
|
|
341
|
+
permission_scope_requests: [],
|
|
342
|
+
tlp_level_requests: [],
|
|
343
|
+
recent_activity: [],
|
|
344
|
+
reputation_score: 0.5,
|
|
345
|
+
first_seen: timestamp,
|
|
346
|
+
last_seen: timestamp,
|
|
347
|
+
};
|
|
348
|
+
delegator_activity.contracts_created++;
|
|
349
|
+
delegator_activity.last_seen = timestamp;
|
|
350
|
+
// Track average execution time if provided
|
|
351
|
+
if (contract.metadata?.estimated_duration_ms) {
|
|
352
|
+
const new_duration = contract.metadata.estimated_duration_ms;
|
|
353
|
+
if (delegator_activity.average_execution_time === 0) {
|
|
354
|
+
delegator_activity.average_execution_time = new_duration;
|
|
355
|
+
}
|
|
356
|
+
else {
|
|
357
|
+
// Update rolling average
|
|
358
|
+
const total_contracts = delegator_activity.contracts_created;
|
|
359
|
+
delegator_activity.average_execution_time =
|
|
360
|
+
((delegator_activity.average_execution_time * (total_contracts - 1)) + new_duration) / total_contracts;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
if (contract.permission_token?.scopes) {
|
|
364
|
+
delegator_activity.permission_scope_requests.push(...contract.permission_token.scopes);
|
|
365
|
+
}
|
|
366
|
+
if (contract.tlp_classification) {
|
|
367
|
+
delegator_activity.tlp_level_requests.push(contract.tlp_classification);
|
|
368
|
+
}
|
|
369
|
+
delegator_activity.recent_activity.push({
|
|
370
|
+
timestamp,
|
|
371
|
+
action: 'contract_created',
|
|
372
|
+
contract_id: contract.contract_id,
|
|
373
|
+
details: {
|
|
374
|
+
delegatee: contract.delegatee_agent_id,
|
|
375
|
+
tlp_classification: contract.tlp_classification,
|
|
376
|
+
estimated_duration_ms: contract.metadata?.estimated_duration_ms,
|
|
377
|
+
},
|
|
378
|
+
});
|
|
379
|
+
// Keep only recent activity (last 100 entries)
|
|
380
|
+
if (delegator_activity.recent_activity.length > 100) {
|
|
381
|
+
delegator_activity.recent_activity = delegator_activity.recent_activity.slice(-100);
|
|
382
|
+
}
|
|
383
|
+
this.agentActivities.set(contract.delegator_agent_id, delegator_activity);
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Check for TLP escalation risks
|
|
387
|
+
*/
|
|
388
|
+
checkTLPEscalation(contract) {
|
|
389
|
+
const tlp_classification = contract.tlp_classification;
|
|
390
|
+
if (!tlp_classification || tlp_classification === 'TLP:CLEAR') {
|
|
391
|
+
return { risk: 0 };
|
|
392
|
+
}
|
|
393
|
+
const patterns = [];
|
|
394
|
+
let risk = 0;
|
|
395
|
+
// Check if requesting higher TLP without proper justification
|
|
396
|
+
if (tlp_classification === 'TLP:RED' && !contract.metadata?.requires_production_access) {
|
|
397
|
+
patterns.push('TLP:RED requested without production access justification');
|
|
398
|
+
risk += 0.6; // Increased from 0.3 to ensure detection
|
|
399
|
+
}
|
|
400
|
+
if (tlp_classification === 'TLP:AMBER' && (!contract.verification_policy || contract.verification_policy === 'none')) {
|
|
401
|
+
patterns.push('TLP:AMBER requested without verification policy');
|
|
402
|
+
risk += 0.4; // Increased from 0.2 to ensure detection
|
|
403
|
+
}
|
|
404
|
+
return { risk, patterns: patterns.length > 0 ? patterns : undefined };
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Check for mutual delegation patterns between agents
|
|
408
|
+
*/
|
|
409
|
+
checkMutualDelegations(agent1, agent2) {
|
|
410
|
+
const activity1 = this.agentActivities.get(agent1);
|
|
411
|
+
const activity2 = this.agentActivities.get(agent2);
|
|
412
|
+
if (!activity1 || !activity2)
|
|
413
|
+
return 0;
|
|
414
|
+
// Count delegations between these two agents
|
|
415
|
+
let mutual_count = 0;
|
|
416
|
+
activity1.recent_activity.forEach(activity => {
|
|
417
|
+
if (activity.details && typeof activity.details === 'object' &&
|
|
418
|
+
'delegatee' in activity.details && activity.details.delegatee === agent2) {
|
|
419
|
+
mutual_count++;
|
|
420
|
+
}
|
|
421
|
+
});
|
|
422
|
+
activity2.recent_activity.forEach(activity => {
|
|
423
|
+
if (activity.details && typeof activity.details === 'object' &&
|
|
424
|
+
'delegatee' in activity.details && activity.details.delegatee === agent1) {
|
|
425
|
+
mutual_count++;
|
|
426
|
+
}
|
|
427
|
+
});
|
|
428
|
+
return mutual_count;
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* Detect context insufficiency — agents proceeding without adequate information
|
|
432
|
+
*
|
|
433
|
+
* This threat vector catches delegation chains where agents are likely to make
|
|
434
|
+
* assumption-based decisions. It checks whether the contract has sufficient
|
|
435
|
+
* context for the delegatee to act without guessing.
|
|
436
|
+
*
|
|
437
|
+
* Threat indicators:
|
|
438
|
+
* - context_verification_required is true but minimum_context_confidence is very low
|
|
439
|
+
* - Task description is vague or missing critical details
|
|
440
|
+
* - No required capabilities specified for complex tasks
|
|
441
|
+
* - High-complexity tasks without success criteria
|
|
442
|
+
* - Cross-package tasks without explicit scope boundaries
|
|
443
|
+
*/
|
|
444
|
+
/** Check task criteria coverage for complex tasks */
|
|
445
|
+
checkTaskCriteriaGaps(contract, complexity) {
|
|
446
|
+
const patterns = [];
|
|
447
|
+
let risk = 0;
|
|
448
|
+
if (complexity <= 5)
|
|
449
|
+
return { risk, patterns };
|
|
450
|
+
if (!contract.success_criteria?.required_checks || contract.success_criteria.required_checks.length === 0) {
|
|
451
|
+
patterns.push('Complex task delegated without success criteria — delegatee will have to guess expected outcomes');
|
|
452
|
+
risk += 0.25;
|
|
453
|
+
}
|
|
454
|
+
if (!contract.required_capabilities || contract.required_capabilities.length === 0) {
|
|
455
|
+
patterns.push('Complex task delegated without required capabilities — agent match will be assumption-based');
|
|
456
|
+
risk += 0.15;
|
|
457
|
+
}
|
|
458
|
+
return { risk, patterns };
|
|
459
|
+
}
|
|
460
|
+
/** Check for cross-package task without explicit resource scope */
|
|
461
|
+
checkCrossPackageScope(contract) {
|
|
462
|
+
const patterns = [];
|
|
463
|
+
let risk = 0;
|
|
464
|
+
const taskCategories = contract.metadata?.task_categories;
|
|
465
|
+
if (!Array.isArray(taskCategories))
|
|
466
|
+
return { risk, patterns };
|
|
467
|
+
const crossPkg = taskCategories.filter((cat) => {
|
|
468
|
+
if (typeof cat !== 'string')
|
|
469
|
+
return false;
|
|
470
|
+
return cat.includes('cross-package') || cat.includes('multi-project') || cat.includes('workspace-wide');
|
|
471
|
+
});
|
|
472
|
+
if (crossPkg.length > 0 && !contract.permission_token?.resources?.length) {
|
|
473
|
+
patterns.push('Cross-package task without explicit resource scope — agents may assume boundaries');
|
|
474
|
+
risk += 0.2;
|
|
475
|
+
}
|
|
476
|
+
return { risk, patterns };
|
|
477
|
+
}
|
|
478
|
+
/** Build a context-insufficiency ThreatDetectionResult from accumulated risk score */
|
|
479
|
+
buildContextInsufficiencyThreat(risk_score, suspicious_patterns, contract, estimatedComplexity) {
|
|
480
|
+
const isHigh = risk_score > 0.7;
|
|
481
|
+
const isMedium = risk_score > 0.5;
|
|
482
|
+
return {
|
|
483
|
+
threat_detected: true,
|
|
484
|
+
threat_type: 'context_insufficiency',
|
|
485
|
+
severity: isHigh ? 'high' : isMedium ? 'medium' : 'low',
|
|
486
|
+
description: `Context insufficiency risk detected (score: ${risk_score.toFixed(2)}) — delegatee agent may make assumption-based decisions`,
|
|
487
|
+
action: isHigh ? 'block' : 'warn',
|
|
488
|
+
evidence: {
|
|
489
|
+
metrics: {
|
|
490
|
+
risk_score,
|
|
491
|
+
pattern_count: suspicious_patterns.length,
|
|
492
|
+
estimated_complexity: estimatedComplexity ?? 0,
|
|
493
|
+
has_success_criteria: (contract.success_criteria?.required_checks?.length ?? 0) > 0 ? 1 : 0,
|
|
494
|
+
context_verification_required: contract.context_verification_required ? 1 : 0,
|
|
495
|
+
},
|
|
496
|
+
related_entities: [contract.delegator_agent_id, contract.delegatee_agent_id],
|
|
497
|
+
activity_timeline: [{
|
|
498
|
+
timestamp: new Date().toISOString(),
|
|
499
|
+
event: 'context_insufficiency_analysis',
|
|
500
|
+
details: { suspicious_patterns, contract_id: contract.contract_id }
|
|
501
|
+
}]
|
|
502
|
+
},
|
|
503
|
+
confidence: Math.min(risk_score, 0.9)
|
|
504
|
+
};
|
|
505
|
+
}
|
|
506
|
+
async detectContextInsufficiency(contract) {
|
|
507
|
+
const suspicious_patterns = [];
|
|
508
|
+
let risk_score = 0;
|
|
509
|
+
if (contract.context_verification_required &&
|
|
510
|
+
contract.minimum_context_confidence !== undefined &&
|
|
511
|
+
contract.minimum_context_confidence < 0.3) {
|
|
512
|
+
suspicious_patterns.push('Context verification required but confidence threshold is dangerously low');
|
|
513
|
+
risk_score += 0.3;
|
|
514
|
+
}
|
|
515
|
+
if (!contract.task_description || contract.task_description.trim().length < 20) {
|
|
516
|
+
suspicious_patterns.push('Task description is missing or too vague for informed decision-making');
|
|
517
|
+
risk_score += 0.3;
|
|
518
|
+
}
|
|
519
|
+
const estimatedComplexity = contract.metadata?.estimated_complexity;
|
|
520
|
+
if (estimatedComplexity) {
|
|
521
|
+
const criteriaCheck = this.checkTaskCriteriaGaps(contract, estimatedComplexity);
|
|
522
|
+
risk_score += criteriaCheck.risk;
|
|
523
|
+
suspicious_patterns.push(...criteriaCheck.patterns);
|
|
524
|
+
if (estimatedComplexity > 7 && !contract.context_verification_required) {
|
|
525
|
+
suspicious_patterns.push('High-complexity task does not require context verification — assumption risk is elevated');
|
|
526
|
+
risk_score += 0.2;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
const scopeCheck = this.checkCrossPackageScope(contract);
|
|
530
|
+
risk_score += scopeCheck.risk;
|
|
531
|
+
suspicious_patterns.push(...scopeCheck.patterns);
|
|
532
|
+
if (risk_score > 0.3) {
|
|
533
|
+
return this.buildContextInsufficiencyThreat(risk_score, suspicious_patterns, contract, estimatedComplexity);
|
|
534
|
+
}
|
|
535
|
+
return {
|
|
536
|
+
threat_detected: false,
|
|
537
|
+
threat_type: 'none',
|
|
538
|
+
severity: 'low',
|
|
539
|
+
description: 'Sufficient context provided for delegation',
|
|
540
|
+
action: 'allow',
|
|
541
|
+
evidence: {},
|
|
542
|
+
confidence: 0.1
|
|
543
|
+
};
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* Get threat detection statistics
|
|
547
|
+
*/
|
|
548
|
+
getThreatStatistics() {
|
|
549
|
+
const threat_types = {};
|
|
550
|
+
const severity_distribution = {};
|
|
551
|
+
const action_distribution = {};
|
|
552
|
+
this.threatHistory.forEach(threat => {
|
|
553
|
+
if (threat.threat_detected) {
|
|
554
|
+
threat_types[threat.threat_type] = (threat_types[threat.threat_type] || 0) + 1;
|
|
555
|
+
severity_distribution[threat.severity] = (severity_distribution[threat.severity] || 0) + 1;
|
|
556
|
+
action_distribution[threat.action] = (action_distribution[threat.action] || 0) + 1;
|
|
557
|
+
}
|
|
558
|
+
});
|
|
559
|
+
return {
|
|
560
|
+
total_validations: this.threatHistory.length,
|
|
561
|
+
threats_detected: this.threatHistory.filter(t => t.threat_detected).length,
|
|
562
|
+
threat_types,
|
|
563
|
+
severity_distribution,
|
|
564
|
+
action_distribution,
|
|
565
|
+
};
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* Get recent threat detections
|
|
569
|
+
*/
|
|
570
|
+
getRecentThreats(limit = 10) {
|
|
571
|
+
return this.threatHistory
|
|
572
|
+
.filter(threat => threat.threat_detected)
|
|
573
|
+
.slice(-limit)
|
|
574
|
+
.reverse();
|
|
575
|
+
}
|
|
576
|
+
/**
|
|
577
|
+
* Validate delegation request for security threats
|
|
578
|
+
* Simplified method for integration tests - creates a minimal contract for validation
|
|
579
|
+
*/
|
|
580
|
+
async validateDelegationRequest(request) {
|
|
581
|
+
// Create a minimal contract for validation
|
|
582
|
+
const contract = {
|
|
583
|
+
contract_id: `validation_${Date.now()}`,
|
|
584
|
+
task_id: 'validation_task',
|
|
585
|
+
delegator: {
|
|
586
|
+
agent_id: request.delegator_agent_id || 'system',
|
|
587
|
+
agent_name: 'System',
|
|
588
|
+
},
|
|
589
|
+
delegatee: {
|
|
590
|
+
agent_id: request.delegatee_agent_id,
|
|
591
|
+
agent_name: request.delegatee_agent_id,
|
|
592
|
+
},
|
|
593
|
+
delegator_agent_id: request.delegator_agent_id || 'system',
|
|
594
|
+
delegatee_agent_id: request.delegatee_agent_id,
|
|
595
|
+
required_capabilities: (request.capabilities_required || request.required_capabilities || []).map((capability_id) => ({ capability_id })),
|
|
596
|
+
task_description: request.task_description,
|
|
597
|
+
verification_policy: 'direct_inspection',
|
|
598
|
+
success_criteria: {},
|
|
599
|
+
priority: 5,
|
|
600
|
+
timeout_ms: request.timeout_ms || 300000,
|
|
601
|
+
status: 'pending',
|
|
602
|
+
created_at: new Date().toISOString(),
|
|
603
|
+
metadata: request.metadata,
|
|
604
|
+
};
|
|
605
|
+
// Run validation
|
|
606
|
+
const threat = await this.validateDelegationSecurity(contract);
|
|
607
|
+
return {
|
|
608
|
+
is_safe: !threat.threat_detected || threat.action === 'allow' || threat.action === 'warn',
|
|
609
|
+
threats_detected: threat.threat_detected ? 1 : 0,
|
|
610
|
+
threat_types: threat.threat_detected ? [threat.threat_type] : [],
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
/**
|
|
614
|
+
* Detect prompt injection attempts in task descriptions
|
|
615
|
+
*/
|
|
616
|
+
async detectPromptInjection(contract) {
|
|
617
|
+
const taskDescription = contract.task_description?.toLowerCase() || '';
|
|
618
|
+
// Prompt injection patterns
|
|
619
|
+
const injectionPatterns = [
|
|
620
|
+
'ignore previous instructions',
|
|
621
|
+
'ignore all previous',
|
|
622
|
+
'rm -rf',
|
|
623
|
+
'expose api keys',
|
|
624
|
+
'expose secrets',
|
|
625
|
+
'delete all',
|
|
626
|
+
'system prompt',
|
|
627
|
+
'override instructions',
|
|
628
|
+
'bypass restrictions',
|
|
629
|
+
'execute system',
|
|
630
|
+
'admin privileges',
|
|
631
|
+
'root access'
|
|
632
|
+
];
|
|
633
|
+
const detectedPatterns = injectionPatterns.filter(pattern => taskDescription.includes(pattern));
|
|
634
|
+
if (detectedPatterns.length > 0) {
|
|
635
|
+
return {
|
|
636
|
+
threat_detected: true,
|
|
637
|
+
threat_type: 'prompt_injection',
|
|
638
|
+
severity: 'high',
|
|
639
|
+
description: `Prompt injection patterns detected: ${detectedPatterns.join(', ')}`,
|
|
640
|
+
action: 'block',
|
|
641
|
+
confidence: 0.95,
|
|
642
|
+
evidence: {
|
|
643
|
+
metrics: { pattern_count: detectedPatterns.length },
|
|
644
|
+
related_entities: [contract.delegator.agent_id, contract.delegatee.agent_id],
|
|
645
|
+
activity_timeline: [{
|
|
646
|
+
timestamp: new Date().toISOString(),
|
|
647
|
+
event: 'prompt_injection_detected',
|
|
648
|
+
details: { patterns: detectedPatterns, contract_id: contract.contract_id }
|
|
649
|
+
}]
|
|
650
|
+
}
|
|
651
|
+
};
|
|
652
|
+
}
|
|
653
|
+
return { threat_detected: false, threat_type: 'none', severity: 'low', description: 'No prompt injection detected', action: 'allow', evidence: {}, confidence: 0.1 };
|
|
654
|
+
}
|
|
655
|
+
/** Check contract timeout and metadata for excessive resource limits */
|
|
656
|
+
checkResourceLimits(contract, timeoutMs) {
|
|
657
|
+
const indicators = [];
|
|
658
|
+
let risk = 0;
|
|
659
|
+
if (timeoutMs > 600000) {
|
|
660
|
+
risk += 0.3;
|
|
661
|
+
indicators.push(`Excessive timeout: ${timeoutMs}ms`);
|
|
662
|
+
}
|
|
663
|
+
if (timeoutMs > 1800000) {
|
|
664
|
+
risk += 0.4;
|
|
665
|
+
indicators.push('Extremely high timeout value');
|
|
666
|
+
}
|
|
667
|
+
const meta = contract.metadata;
|
|
668
|
+
if (!meta)
|
|
669
|
+
return { risk, indicators };
|
|
670
|
+
if (typeof meta.iterations === 'number' && meta.iterations > 10_000_000) {
|
|
671
|
+
risk += 0.5;
|
|
672
|
+
indicators.push(`Excessive iterations: ${meta.iterations}`);
|
|
673
|
+
}
|
|
674
|
+
if (typeof meta.max_memory === 'number' && meta.max_memory > 1_000_000_000) {
|
|
675
|
+
risk += 0.3;
|
|
676
|
+
indicators.push(`Excessive memory: ${meta.max_memory} bytes`);
|
|
677
|
+
}
|
|
678
|
+
return { risk, indicators };
|
|
679
|
+
}
|
|
680
|
+
/** Scan task description for resource-exhaustion keywords */
|
|
681
|
+
checkExhaustionKeywords(taskDescription) {
|
|
682
|
+
const exhaustionPatterns = [
|
|
683
|
+
'infinite loop', 'recursive calls', 'unlimited', 'maximum resources',
|
|
684
|
+
'all available memory', 'exhaust', 'ddos', 'flood'
|
|
685
|
+
];
|
|
686
|
+
const detected = exhaustionPatterns.filter(p => taskDescription.includes(p));
|
|
687
|
+
return {
|
|
688
|
+
risk: detected.length * 0.2,
|
|
689
|
+
indicators: detected.map(p => `Resource exhaustion pattern: ${p}`)
|
|
690
|
+
};
|
|
691
|
+
}
|
|
692
|
+
/**
|
|
693
|
+
* Detect resource exhaustion attempts
|
|
694
|
+
*/
|
|
695
|
+
async detectResourceExhaustion(contract) {
|
|
696
|
+
const timeoutMs = contract.timeout_ms ?? 0;
|
|
697
|
+
const limits = this.checkResourceLimits(contract, timeoutMs);
|
|
698
|
+
const keywords = this.checkExhaustionKeywords(contract.task_description?.toLowerCase() ?? '');
|
|
699
|
+
const riskScore = limits.risk + keywords.risk;
|
|
700
|
+
const indicators = [...limits.indicators, ...keywords.indicators];
|
|
701
|
+
if (riskScore > 0.4) {
|
|
702
|
+
return {
|
|
703
|
+
threat_detected: true,
|
|
704
|
+
threat_type: 'resource_exhaustion',
|
|
705
|
+
severity: riskScore > 0.7 ? 'high' : 'medium',
|
|
706
|
+
description: `Resource exhaustion risk detected (score: ${riskScore.toFixed(2)})`,
|
|
707
|
+
action: riskScore > 0.7 ? 'block' : 'warn',
|
|
708
|
+
confidence: Math.min(riskScore, 0.9),
|
|
709
|
+
evidence: {
|
|
710
|
+
metrics: { risk_score: riskScore, indicator_count: indicators.length },
|
|
711
|
+
related_entities: [contract.delegator.agent_id, contract.delegatee.agent_id],
|
|
712
|
+
activity_timeline: [{
|
|
713
|
+
timestamp: new Date().toISOString(),
|
|
714
|
+
event: 'resource_exhaustion_analysis',
|
|
715
|
+
details: { indicators, contract_id: contract.contract_id }
|
|
716
|
+
}]
|
|
717
|
+
}
|
|
718
|
+
};
|
|
719
|
+
}
|
|
720
|
+
return { threat_detected: false, threat_type: 'none', severity: 'low', description: 'No resource exhaustion risk detected', action: 'allow', evidence: {}, confidence: 0.1 };
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
//# sourceMappingURL=security-threat-model.js.map
|