@aegis-scan/core 0.16.5 → 0.17.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 (129) 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/dist/utils.d.ts +4 -1
  125. package/dist/utils.d.ts.map +1 -1
  126. package/dist/utils.js +35 -3
  127. package/dist/utils.js.map +1 -1
  128. package/package.json +2 -1
  129. package/sbom.cdx.json +1 -1
package/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # @aegis-scan/core
2
+
3
+ Core engine for the [AEGIS](https://github.com/RideMatch1/a.e.g.i.s) security-scanner suite — a paranoid stack-specific SAST scanner for Next.js + Supabase projects.
4
+
5
+ This package provides the orchestrator, scoring engine (0-1000 with FORTRESS / HARDENED / SOLID / NEEDS_WORK / AT_RISK / CRITICAL grades), Zod-strict config loader, suppression filter, and shared types + utilities consumed by `@aegis-scan/scanners`, `@aegis-scan/reporters`, and `@aegis-scan/cli`.
6
+
7
+ Most consumers should depend on `@aegis-scan/cli` instead — it bundles core, scanners, and reporters into a single CLI binary. This package is exposed for advanced integrations (custom orchestration, programmatic API, custom reporter implementations).
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ npm install @aegis-scan/core
13
+ ```
14
+
15
+ Node 20+ required.
16
+
17
+ ## Supply-chain integrity
18
+
19
+ Every published version ships with SLSA v1 provenance:
20
+
21
+ ```bash
22
+ npm audit signatures
23
+ npm view @aegis-scan/core@<version> dist.attestations.provenance.predicateType
24
+ # → https://slsa.dev/provenance/v1
25
+ ```
26
+
27
+ No install-time scripts are declared in any `@aegis-scan/*` package. See the top-level [SECURITY.md](https://github.com/RideMatch1/a.e.g.i.s/blob/main/SECURITY.md) for the full supply-chain integrity posture.
28
+
29
+ ## Links
30
+
31
+ - **Main repo:** https://github.com/RideMatch1/a.e.g.i.s
32
+ - **CLI on npm:** https://www.npmjs.com/package/@aegis-scan/cli
33
+ - **CHANGELOG:** https://github.com/RideMatch1/a.e.g.i.s/blob/main/CHANGELOG.md
34
+
35
+ ## License
36
+
37
+ MIT
package/dist/index.d.ts CHANGED
@@ -9,4 +9,9 @@ export { isTestFile } from './is-test-path.js';
9
9
  export { parseSuppressions, isSuppressed, getUnusedSuppressions, getNakedSuppressions, type Suppression, } from './suppressions.js';
10
10
  export { globToRegex, configSuppressionMatches, applyPipelineSuppressions, type SuppressionStats, } from './suppression-filter.js';
11
11
  export { PRECISION_GATES, SCANNER_TIERS, tierOf, gateFor, passesPrecisionGate, type PrecisionTier, } from './precision-tiers.js';
12
+ export { RoESchema, validateTargetInScope, validateTemporalEnvelope, getAssetCriticality, validateAction, synthesizeMinimalRoE, loadRoE, type RoE, type ValidationDecision, type RoEParseResult, type RoEParseSuccess, type RoEParseFailure, } from './roe/index.js';
13
+ export { emitEvent, makeEvent, findingEvent, isCriticalSeverity, initStateFile, EngagementStateSchema, writeEngagementState, loadEngagementState, newEngagementState, installSignalHandlers, dispatchNotification, sha256, canonicalize, hashCanonical, ChainedEmitter, verifyAuditChain, type EngagementEvent, type EngagementEventBase, type EventSink, type EngagementState, type LoadStateResult, type LoadStateOk, type LoadStateFailure, type DumpReason, type SignalHandlerOptions, type NotificationConfig, type ChainedEmitterOpts, type ChainVerifyResult, type ChainVerifyOk, type ChainVerifyFailure, } from './runtime/index.js';
14
+ export { assignCiaVector, evaluateCiaThreshold, CWE_CIA_DEFAULTS, evaluateApprovalGate, detectIrreversibleActions, evaluateIrreversibleGate, PHASE_TO_AUTONOMY_LEVEL, validateDelegationMatrix, rolesForAction, escalateOnSeverity, escalateOnConfidence, escalateOnComplianceTrigger, type CiaThresholdEvaluation, type AutonomyLevel, type AutonomyLevelPolicy, type AutonomyLevelsConfig, type ApprovalGateDecision, type IrreversibleGateDecision, type DelegationEntry, type AuthorityMatrixValidation, type SeverityEscalationConfig, type ConfidencePauseConfig, type ComplianceTriggerConfig, type EscalationDecision, } from './oversight/index.js';
15
+ export { startKillRequestWatcher, requestKill, startDeadManHeartbeat, runHealthCheck, newHealthCounters, currentHeapMb, errorRate, probeTargetIntegrity, detectScopeBreach, withPhaseTimeout, derivePhaseTimeoutMs, type KillRequestWatcherOptions, type KillRequestWatcherHandle, type HeartbeatOptions, type HeartbeatHandle, type HealthThresholds, type HealthCounters, type HealthCheckResult, type IntegrityProbeBaseline, type IntegrityProbeResult, type IntegrityProbeOptions, type FindingLike, type BreachDetectionResult, type TimeoutResult, type TimeoutOk, type TimeoutFailure, type PhaseTimeoutOptions, } from './safety-controls/index.js';
16
+ export { enforceInstructionBoundary, WRAPPER_ACTION_ALLOWLIST, validateWrapperResponse, detectAuthorityClaim, pinConfig, verifyConfig, safeFetch, classifyIp, isSafeFetchRejection, detectScopeExpansion, composeEgressAllowlist, withEgressEnv, ORCHESTRATOR_ESSENTIALS, validateSandboxMode, wrapForSandbox, preflightSandboxImages, SANDBOX_MODES, DEFAULT_WRAPPER_IMAGES, type WrapperAction, type ResponseValidation, type AuthorityClaim, type AuthorityClaimResult, type ConfigPin, type ConfigVerifyResult, type SafeFetchOptions, type SafeFetchRejection, type SafeFetchRejectReason, type ScopeExpansionKind, type ScopeExpansionResult, type EgressAllowlist, type ComposeEgressAllowlistOptions, type SandboxMode, type SandboxModeValidation, type WrapForSandboxOptions, type WrappedExec, type SandboxPreflightResult, type PreflightSandboxOptions, } from './manipulation-resistance/index.js';
12
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AACnJ,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,qBAAqB,EACrB,oBAAoB,EACpB,KAAK,WAAW,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,WAAW,EACX,wBAAwB,EACxB,yBAAyB,EACzB,KAAK,gBAAgB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,eAAe,EACf,aAAa,EACb,MAAM,EACN,OAAO,EACP,mBAAmB,EACnB,KAAK,aAAa,GACnB,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAC/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,aAAa,EACb,uBAAuB,EACvB,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,aAAa,EACb,sBAAsB,EACtB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,SAAS,EACd,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,6BAA6B,EAClC,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,GAC7B,MAAM,oCAAoC,CAAC"}
package/dist/index.js CHANGED
@@ -9,4 +9,9 @@ export { isTestFile } from './is-test-path.js';
9
9
  export { parseSuppressions, isSuppressed, getUnusedSuppressions, getNakedSuppressions, } from './suppressions.js';
10
10
  export { globToRegex, configSuppressionMatches, applyPipelineSuppressions, } from './suppression-filter.js';
11
11
  export { PRECISION_GATES, SCANNER_TIERS, tierOf, gateFor, passesPrecisionGate, } from './precision-tiers.js';
12
+ export { RoESchema, validateTargetInScope, validateTemporalEnvelope, getAssetCriticality, validateAction, synthesizeMinimalRoE, loadRoE, } from './roe/index.js';
13
+ export { emitEvent, makeEvent, findingEvent, isCriticalSeverity, initStateFile, EngagementStateSchema, writeEngagementState, loadEngagementState, newEngagementState, installSignalHandlers, dispatchNotification, sha256, canonicalize, hashCanonical, ChainedEmitter, verifyAuditChain, } from './runtime/index.js';
14
+ export { assignCiaVector, evaluateCiaThreshold, CWE_CIA_DEFAULTS, evaluateApprovalGate, detectIrreversibleActions, evaluateIrreversibleGate, PHASE_TO_AUTONOMY_LEVEL, validateDelegationMatrix, rolesForAction, escalateOnSeverity, escalateOnConfidence, escalateOnComplianceTrigger, } from './oversight/index.js';
15
+ export { startKillRequestWatcher, requestKill, startDeadManHeartbeat, runHealthCheck, newHealthCounters, currentHeapMb, errorRate, probeTargetIntegrity, detectScopeBreach, withPhaseTimeout, derivePhaseTimeoutMs, } from './safety-controls/index.js';
16
+ export { enforceInstructionBoundary, WRAPPER_ACTION_ALLOWLIST, validateWrapperResponse, detectAuthorityClaim, pinConfig, verifyConfig, safeFetch, classifyIp, isSafeFetchRejection, detectScopeExpansion, composeEgressAllowlist, withEgressEnv, ORCHESTRATOR_ESSENTIALS, validateSandboxMode, wrapForSandbox, preflightSandboxImages, SANDBOX_MODES, DEFAULT_WRAPPER_IMAGES, } from './manipulation-resistance/index.js';
12
17
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,EAAE,UAAU,EAAwB,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAqC,MAAM,YAAY,CAAC;AACnJ,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,qBAAqB,EACrB,oBAAoB,GAErB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,WAAW,EACX,wBAAwB,EACxB,yBAAyB,GAE1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,eAAe,EACf,aAAa,EACb,MAAM,EACN,OAAO,EACP,mBAAmB,GAEpB,MAA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AoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EACxB,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,2BAA2B,GAa5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,uBAAuB,EACvB,WAAW,EACX,qBAAqB,EACrB,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,GAiBrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,SAAS,EACT,YAAY,EACZ,SAAS,EACT,UAAU,EACV,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,aAAa,EACb,uBAAuB,EACvB,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,aAAa,EACb,sBAAsB,GAoBvB,MAAM,oCAAoC,CAAC"}
@@ -0,0 +1,84 @@
1
+ import type { EgressAllowlist } from './oob-blocker.js';
2
+ export type SandboxMode = 'docker' | 'firejail' | 'none';
3
+ export declare const SANDBOX_MODES: readonly SandboxMode[];
4
+ /**
5
+ * Per-wrapper container image map. Operators may override via
6
+ * RoE.sandboxing.image_overrides; defaults below assume the operator
7
+ * has built/pulled the image under the canonical tag.
8
+ */
9
+ export declare const DEFAULT_WRAPPER_IMAGES: Readonly<Record<string, string>>;
10
+ export interface WrapForSandboxOptions {
11
+ /** Custom docker network to attach the container to (egress allowlist enforcement). */
12
+ dockerNetwork?: string;
13
+ /** Per-wrapper image override. Falls back to DEFAULT_WRAPPER_IMAGES. */
14
+ imageOverride?: string;
15
+ /** Egress allowlist to mount as env (works in all modes; enforced in docker). */
16
+ allowlist?: EgressAllowlist;
17
+ /** Extra docker run security flags. Sensible defaults applied; do not disable lightly. */
18
+ extraDockerArgs?: readonly string[];
19
+ }
20
+ export interface WrappedExec {
21
+ binary: string;
22
+ args: string[];
23
+ /** Env additions the wrapper should pass through to exec. */
24
+ envAdditions: NodeJS.ProcessEnv;
25
+ /** True when the original (binary, args) were rewritten through a sandboxer. */
26
+ sandboxed: boolean;
27
+ /** Diagnostic — what mode actually applied (might be 'none' on unmapped wrapper). */
28
+ mode_applied: SandboxMode;
29
+ }
30
+ export interface SandboxModeValidation {
31
+ ok: boolean;
32
+ mode?: SandboxMode;
33
+ reason?: string;
34
+ }
35
+ /**
36
+ * Validate an operator-supplied --sandbox-mode value.
37
+ */
38
+ export declare function validateSandboxMode(input: string | undefined): SandboxModeValidation;
39
+ /**
40
+ * Wrap a wrapper exec call through the chosen sandbox mode. Returns
41
+ * { binary, args, envAdditions, sandboxed, mode_applied }. When mode is
42
+ * 'none' (or the wrapper has no image mapping), the original tuple is
43
+ * returned with sandboxed=false so the caller still observes that the
44
+ * wrapper ran un-sandboxed.
45
+ */
46
+ export declare function wrapForSandbox(wrapperName: string, binary: string, args: readonly string[], mode: SandboxMode, opts?: WrapForSandboxOptions): WrappedExec;
47
+ export interface SandboxPreflightResult {
48
+ ok: boolean;
49
+ /** Missing wrapper images (map: wrapperName → image tag). */
50
+ missing_images: Record<string, string>;
51
+ /** True when the egress docker network is missing. */
52
+ missing_network: boolean;
53
+ /** Network name that was checked. */
54
+ network_name: string;
55
+ /** Operator-readable instruction block for fixing the missing artifacts. */
56
+ remediation?: string;
57
+ /** APTS refs the preflight closes when ok=true. */
58
+ apts_refs: string[];
59
+ }
60
+ export interface PreflightSandboxOptions {
61
+ /** Wrappers required by the engagement (e.g. ['strix','ptai']). */
62
+ wrappers: readonly string[];
63
+ /** Per-wrapper image override (RoE.sandboxing.image_overrides). */
64
+ imageOverrides?: Readonly<Record<string, string>>;
65
+ /** Custom egress network. Defaults to 'aegis-egress'. */
66
+ dockerNetwork?: string;
67
+ /**
68
+ * Probe function for testability. Defaults to running
69
+ * `docker image inspect <ref>` / `docker network inspect <name>`.
70
+ * Should resolve true when artifact exists, false otherwise.
71
+ */
72
+ probe?: (kind: 'image' | 'network', ref: string) => boolean;
73
+ }
74
+ /**
75
+ * Preflight check for `--sandbox-mode=docker`. Verifies every required
76
+ * wrapper image is present locally and the egress network exists.
77
+ * Returns `ok=false` with a remediation block when artifacts are missing.
78
+ *
79
+ * Call this at engagement start (after `validateSandboxMode` resolves to
80
+ * 'docker') and halt the engagement when ok=false. Closes the audit-flagged
81
+ * gap where docker-mode could be selected against non-existent images.
82
+ */
83
+ export declare function preflightSandboxImages(opts: PreflightSandboxOptions): SandboxPreflightResult;
84
+ //# sourceMappingURL=ai-io-boundary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-io-boundary.d.ts","sourceRoot":"","sources":["../../src/manipulation-resistance/ai-io-boundary.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC;AAEzD,eAAO,MAAM,aAAa,EAAE,SAAS,WAAW,EAI9C,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAIlE,CAAC;AAEH,MAAM,WAAW,qBAAqB;IACpC,uFAAuF;IACvF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wEAAwE;IACxE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iFAAiF;IACjF,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,0FAA0F;IAC1F,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,6DAA6D;IAC7D,YAAY,EAAE,MAAM,CAAC,UAAU,CAAC;IAChC,gFAAgF;IAChF,SAAS,EAAE,OAAO,CAAC;IACnB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AAsB,CAoDxB"}
@@ -0,0 +1,216 @@
1
+ /**
2
+ * AI model input/output architectural boundary.
3
+ *
4
+ * Closes APTS-MR-018 (AI Model Input/Output Architectural Boundary).
5
+ *
6
+ * Design notes:
7
+ * - LLM-pentest wrappers run as full-privilege child processes by
8
+ * default. APTS-MR-018 mandates an architectural boundary —
9
+ * sandboxed process, restricted FS, restricted network egress.
10
+ * - AEGIS exposes a `--sandbox-mode <docker|firejail|none>` siege
11
+ * flag. Default is `none` for back-compat. When the operator opts
12
+ * in, AEGIS rewrites every wrapper invocation through the chosen
13
+ * sandboxer so that the wrapper executes inside the boundary.
14
+ * - `wrapForSandbox` produces the transformation. Wrapper code calls
15
+ * it before exec; if mode is 'none' the call is a no-op pass-through.
16
+ * - For docker mode, AEGIS expects a per-wrapper container image
17
+ * to exist locally (operator-provisioned via
18
+ * `dockerfiles/sandboxes/build.sh`). The wrapper-image map keys off
19
+ * the wrapper name; an unmapped wrapper falls back to pass-through
20
+ * with an explicit warning so unsupported wrappers do not silently
21
+ * bypass the boundary.
22
+ * - `preflightSandboxImages` runs at engagement-start when
23
+ * --sandbox-mode=docker is selected and verifies that every
24
+ * required image and the egress network exist. Missing artifacts
25
+ * produce a clear instruction-rich error so operators see exactly
26
+ * what to build before re-running.
27
+ */
28
+ import { execFileSync } from 'node:child_process';
29
+ export const SANDBOX_MODES = Object.freeze([
30
+ 'docker',
31
+ 'firejail',
32
+ 'none',
33
+ ]);
34
+ /**
35
+ * Per-wrapper container image map. Operators may override via
36
+ * RoE.sandboxing.image_overrides; defaults below assume the operator
37
+ * has built/pulled the image under the canonical tag.
38
+ */
39
+ export const DEFAULT_WRAPPER_IMAGES = Object.freeze({
40
+ strix: 'aegis/strix-sandbox:latest',
41
+ ptai: 'aegis/ptai-sandbox:latest',
42
+ pentestswarm: 'aegis/pentestswarm-sandbox:latest',
43
+ });
44
+ /**
45
+ * Validate an operator-supplied --sandbox-mode value.
46
+ */
47
+ export function validateSandboxMode(input) {
48
+ if (input === undefined || input === '')
49
+ return { ok: true, mode: 'none' };
50
+ const lower = input.toLowerCase();
51
+ if (SANDBOX_MODES.includes(lower)) {
52
+ return { ok: true, mode: lower };
53
+ }
54
+ return {
55
+ ok: false,
56
+ reason: `unknown --sandbox-mode "${input}"; valid: ${SANDBOX_MODES.join(', ')}`,
57
+ };
58
+ }
59
+ /**
60
+ * Wrap a wrapper exec call through the chosen sandbox mode. Returns
61
+ * { binary, args, envAdditions, sandboxed, mode_applied }. When mode is
62
+ * 'none' (or the wrapper has no image mapping), the original tuple is
63
+ * returned with sandboxed=false so the caller still observes that the
64
+ * wrapper ran un-sandboxed.
65
+ */
66
+ export function wrapForSandbox(wrapperName, binary, args, mode, opts = {}) {
67
+ const envAdditions = {
68
+ AEGIS_SANDBOX_MODE: mode,
69
+ };
70
+ if (opts.allowlist) {
71
+ envAdditions.AEGIS_EGRESS_ALLOWLIST = opts.allowlist.envValue;
72
+ }
73
+ if (mode === 'none') {
74
+ return {
75
+ binary,
76
+ args: [...args],
77
+ envAdditions,
78
+ sandboxed: false,
79
+ mode_applied: 'none',
80
+ };
81
+ }
82
+ if (mode === 'firejail') {
83
+ // Conservative profile: read-only root FS, drop network namespace
84
+ // unless the operator opts back in via allowlist, no IPC namespace.
85
+ const firejailArgs = [
86
+ '--quiet',
87
+ '--noprofile',
88
+ '--read-only=/',
89
+ '--ipc-namespace',
90
+ '--noroot',
91
+ '--',
92
+ binary,
93
+ ...args,
94
+ ];
95
+ return {
96
+ binary: 'firejail',
97
+ args: firejailArgs,
98
+ envAdditions,
99
+ sandboxed: true,
100
+ mode_applied: 'firejail',
101
+ };
102
+ }
103
+ // docker mode
104
+ const image = opts.imageOverride ?? DEFAULT_WRAPPER_IMAGES[wrapperName];
105
+ if (!image) {
106
+ // Unmapped wrapper — fall back to pass-through but loud about it.
107
+ return {
108
+ binary,
109
+ args: [...args],
110
+ envAdditions: {
111
+ ...envAdditions,
112
+ AEGIS_SANDBOX_FALLBACK: `unmapped-wrapper:${wrapperName}`,
113
+ },
114
+ sandboxed: false,
115
+ mode_applied: 'none',
116
+ };
117
+ }
118
+ const network = opts.dockerNetwork ?? 'aegis-egress';
119
+ const baseDockerArgs = [
120
+ 'run',
121
+ '--rm',
122
+ `--network=${network}`,
123
+ '--security-opt=no-new-privileges',
124
+ '--cap-drop=ALL',
125
+ '--read-only',
126
+ '--tmpfs=/tmp',
127
+ ...(opts.extraDockerArgs ?? []),
128
+ ];
129
+ if (opts.allowlist) {
130
+ baseDockerArgs.push('--env', `AEGIS_EGRESS_ALLOWLIST=${opts.allowlist.envValue}`);
131
+ }
132
+ baseDockerArgs.push(image, ...args);
133
+ return {
134
+ binary: 'docker',
135
+ args: baseDockerArgs,
136
+ envAdditions,
137
+ sandboxed: true,
138
+ mode_applied: 'docker',
139
+ };
140
+ }
141
+ function defaultDockerProbe(kind, ref) {
142
+ // execFileSync (no shell) — argv is passed as an array so neither `kind`
143
+ // nor `ref` can be interpreted as shell metacharacters even when the RoE
144
+ // config supplies an unusual image name. Closes CodeQL
145
+ // js/shell-command-constructed-from-input.
146
+ try {
147
+ execFileSync('docker', [kind, 'inspect', ref], {
148
+ stdio: ['ignore', 'ignore', 'ignore'],
149
+ timeout: 10_000,
150
+ });
151
+ return true;
152
+ }
153
+ catch {
154
+ return false;
155
+ }
156
+ }
157
+ /**
158
+ * Preflight check for `--sandbox-mode=docker`. Verifies every required
159
+ * wrapper image is present locally and the egress network exists.
160
+ * Returns `ok=false` with a remediation block when artifacts are missing.
161
+ *
162
+ * Call this at engagement start (after `validateSandboxMode` resolves to
163
+ * 'docker') and halt the engagement when ok=false. Closes the audit-flagged
164
+ * gap where docker-mode could be selected against non-existent images.
165
+ */
166
+ export function preflightSandboxImages(opts) {
167
+ const probe = opts.probe ?? defaultDockerProbe;
168
+ const networkName = opts.dockerNetwork ?? 'aegis-egress';
169
+ const overrides = opts.imageOverrides ?? {};
170
+ const missing_images = {};
171
+ for (const wrapper of opts.wrappers) {
172
+ const image = overrides[wrapper] ?? DEFAULT_WRAPPER_IMAGES[wrapper];
173
+ if (!image)
174
+ continue; // unmapped wrapper — wrapForSandbox falls back
175
+ if (!probe('image', image)) {
176
+ missing_images[wrapper] = image;
177
+ }
178
+ }
179
+ const missing_network = !probe('network', networkName);
180
+ const ok = missing_network === false && Object.keys(missing_images).length === 0;
181
+ let remediation;
182
+ if (!ok) {
183
+ const lines = [
184
+ 'APTS-MR-018 sandbox preflight failed.',
185
+ '',
186
+ ];
187
+ if (Object.keys(missing_images).length > 0) {
188
+ lines.push('Missing docker images:');
189
+ for (const [wrapper, image] of Object.entries(missing_images)) {
190
+ lines.push(` - ${wrapper}: ${image}`);
191
+ }
192
+ lines.push('');
193
+ lines.push('Build them with:');
194
+ lines.push(' bash dockerfiles/sandboxes/build.sh');
195
+ lines.push('');
196
+ }
197
+ if (missing_network) {
198
+ lines.push(`Missing docker network: ${networkName}`);
199
+ lines.push('Create with:');
200
+ lines.push(` docker network create --driver=bridge --internal ${networkName}`);
201
+ lines.push('(or run the build script which creates it automatically.)');
202
+ lines.push('');
203
+ }
204
+ lines.push('After fixing, re-run with --sandbox-mode=docker.');
205
+ remediation = lines.join('\n');
206
+ }
207
+ return {
208
+ ok,
209
+ missing_images,
210
+ missing_network,
211
+ network_name: networkName,
212
+ remediation,
213
+ apts_refs: ['APTS-MR-018'],
214
+ };
215
+ }
216
+ //# sourceMappingURL=ai-io-boundary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-io-boundary.js","sourceRoot":"","sources":["../../src/manipulation-resistance/ai-io-boundary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAKlD,MAAM,CAAC,MAAM,aAAa,GAA2B,MAAM,CAAC,MAAM,CAAC;IACjE,QAAQ;IACR,UAAU;IACV,MAAM;CACP,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAs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
+ /** Lowercase-hex SHA-256 of the canonical-JSON serialization. */
3
+ hash: string;
4
+ /** ISO-8601 timestamp when the pin was created. */
5
+ pinned_at: string;
6
+ /** Operator-supplied label for audit traceability (e.g. "roe", "aegis-config"). */
7
+ label: string;
8
+ }
9
+ export interface ConfigVerifyResult {
10
+ ok: boolean;
11
+ reason?: string;
12
+ /** Hash that was actually computed (for mismatch reporting). */
13
+ observed_hash?: string;
14
+ apts_refs: string[];
15
+ }
16
+ /**
17
+ * Pin a config value at engagement-start. The returned pin is the
18
+ * source of truth for subsequent verifications. Caller should emit a
19
+ * scope-validation or audit event recording the pin.
20
+ */
21
+ export declare function pinConfig(label: string, config: unknown): ConfigPin;
22
+ /**
23
+ * Verify the current in-memory config against a previous pin. Returns
24
+ * { ok: true } on match or { ok: false, reason, observed_hash } on
25
+ * mismatch. Callers should halt the engagement on mismatch.
26
+ */
27
+ export declare function verifyConfig(config: unknown, pin: ConfigPin): ConfigVerifyResult;
28
+ //# sourceMappingURL=config-integrity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-integrity.d.ts","sourceRoot":"","sources":["../../src/manipulation-resistance/config-integrity.ts"],"names":[],"mappings":"AAoBA,MAAM,WAAW,SAAS;IACxB,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,SAAS,EAAE,MAAM,CAAC;IAClB,mFAAmF;IACnF,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gEAAgE;IAChE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,SAAS,CAMnE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,GAAG,kBAAkB,CAehF"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Configuration-file integrity verification.
3
+ *
4
+ * Closes APTS-MR-004 (Configuration File Integrity Verification) +
5
+ * APTS-MR-012 (Immutable Scope Enforcement Architecture).
6
+ *
7
+ * Design notes:
8
+ * - At engagement-start, AEGIS pins a SHA-256 hash of the canonical
9
+ * form of every operator-supplied config (RoE + aegis.config.json).
10
+ * The pin is timestamped and emitted into the audit channel.
11
+ * - At every phase boundary, AEGIS re-hashes the in-memory config and
12
+ * compares against the pin. A mismatch indicates either a runtime
13
+ * mutation (memory tamper, plugin drift) or a stale fixture, and
14
+ * the engagement halts with an explicit reason.
15
+ * - MR-012 (immutable scope) is closed jointly: the SHA-256 pin
16
+ * covers RoE.in_scope/out_of_scope, so any post-pin change to
17
+ * scope is detected at the next verification.
18
+ */
19
+ import { hashCanonical } from '../runtime/hash.js';
20
+ /**
21
+ * Pin a config value at engagement-start. The returned pin is the
22
+ * source of truth for subsequent verifications. Caller should emit a
23
+ * scope-validation or audit event recording the pin.
24
+ */
25
+ export function pinConfig(label, config) {
26
+ return {
27
+ hash: hashCanonical(config),
28
+ pinned_at: new Date().toISOString(),
29
+ label,
30
+ };
31
+ }
32
+ /**
33
+ * Verify the current in-memory config against a previous pin. Returns
34
+ * { ok: true } on match or { ok: false, reason, observed_hash } on
35
+ * mismatch. Callers should halt the engagement on mismatch.
36
+ */
37
+ export function verifyConfig(config, pin) {
38
+ const observed = hashCanonical(config);
39
+ if (observed !== pin.hash) {
40
+ return {
41
+ ok: false,
42
+ reason: `config "${pin.label}" integrity check failed: pinned ${pin.hash} at ${pin.pinned_at}, observed ${observed}`,
43
+ observed_hash: observed,
44
+ apts_refs: ['APTS-MR-004', 'APTS-MR-012'],
45
+ };
46
+ }
47
+ return {
48
+ ok: true,
49
+ observed_hash: observed,
50
+ apts_refs: ['APTS-MR-004', 'APTS-MR-012'],
51
+ };
52
+ }
53
+ //# sourceMappingURL=config-integrity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-integrity.js","sourceRoot":"","sources":["../../src/manipulation-resistance/config-integrity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAmBnD;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,KAAa,EAAE,MAAe;IACtD,OAAO;QACL,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC;QAC3B,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACnC,KAAK;KACN,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,MAAe,EAAE,GAAc;IAC1D,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IACvC,IAAI,QAAQ,KAAK,GAAG,CAAC,IAAI,EAAE,CAAC;QAC1B,OAAO;YACL,EAAE,EAAE,KAAK;YACT,MAAM,EAAE,WAAW,GAAG,CAAC,KAAK,oCAAoC,GAAG,CAAC,IAAI,OAAO,GAAG,CAAC,SAAS,cAAc,QAAQ,EAAE;YACpH,aAAa,EAAE,QAAQ;YACvB,SAAS,EAAE,CAAC,aAAa,EAAE,aAAa,CAAC;SAC1C,CAAC;IACJ,CAAC;IACD,OAAO;QACL,EAAE,EAAE,IAAI;QACR,aAAa,EAAE,QAAQ;QACvB,SAAS,EAAE,CAAC,aAAa,EAAE,aAAa,CAAC;KAC1C,CAAC;AACJ,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Manipulation Resistance public surface.
3
+ *
4
+ * Closes APTS Tier-1 Manipulation Resistance domain (MR-001/002/004/005/
5
+ * 007/008/009/010/011/012/018). Each module documents its individual
6
+ * APTS coverage; this barrel re-exports everything operator/orchestrator
7
+ * code needs.
8
+ */
9
+ export { enforceInstructionBoundary, WRAPPER_ACTION_ALLOWLIST, type WrapperAction, } from './instruction-boundary.js';
10
+ export { validateWrapperResponse, detectAuthorityClaim, type ResponseValidation, type AuthorityClaim, type AuthorityClaimResult, } from './response-validator.js';
11
+ export { pinConfig, verifyConfig, type ConfigPin, type ConfigVerifyResult, } from './config-integrity.js';
12
+ export { safeFetch, classifyIp, isSafeFetchRejection, type SafeFetchOptions, type SafeFetchRejection, type SafeFetchRejectReason, } from './redirect-policy.js';
13
+ export { detectScopeExpansion, type ScopeExpansionKind, type ScopeExpansionResult, } from './scope-expansion-detector.js';
14
+ export { composeEgressAllowlist, withEgressEnv, ORCHESTRATOR_ESSENTIALS, type EgressAllowlist, type ComposeEgressAllowlistOptions, } from './oob-blocker.js';
15
+ export { validateSandboxMode, wrapForSandbox, preflightSandboxImages, SANDBOX_MODES, DEFAULT_WRAPPER_IMAGES, type SandboxMode, type SandboxModeValidation, type WrapForSandboxOptions, type WrappedExec, type SandboxPreflightResult, type PreflightSandboxOptions, } from './ai-io-boundary.js';
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/manipulation-resistance/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,KAAK,aAAa,GACnB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,oBAAoB,GAC1B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,SAAS,EACT,YAAY,EACZ,KAAK,SAAS,EACd,KAAK,kBAAkB,GACxB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,SAAS,EACT,UAAU,EACV,oBAAoB,EACpB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,GAC3B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,oBAAoB,EACpB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,GAC1B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EACL,sBAAsB,EACtB,aAAa,EACb,uBAAuB,EACvB,KAAK,eAAe,EACpB,KAAK,6BAA6B,GACnC,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,aAAa,EACb,sBAAsB,EACtB,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,GAC7B,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Manipulation Resistance public surface.
3
+ *
4
+ * Closes APTS Tier-1 Manipulation Resistance domain (MR-001/002/004/005/
5
+ * 007/008/009/010/011/012/018). Each module documents its individual
6
+ * APTS coverage; this barrel re-exports everything operator/orchestrator
7
+ * code needs.
8
+ */
9
+ export { enforceInstructionBoundary, WRAPPER_ACTION_ALLOWLIST, } from './instruction-boundary.js';
10
+ export { validateWrapperResponse, detectAuthorityClaim, } from './response-validator.js';
11
+ export { pinConfig, verifyConfig, } from './config-integrity.js';
12
+ export { safeFetch, classifyIp, isSafeFetchRejection, } from './redirect-policy.js';
13
+ export { detectScopeExpansion, } from './scope-expansion-detector.js';
14
+ export { composeEgressAllowlist, withEgressEnv, ORCHESTRATOR_ESSENTIALS, } from './oob-blocker.js';
15
+ export { validateSandboxMode, wrapForSandbox, preflightSandboxImages, SANDBOX_MODES, DEFAULT_WRAPPER_IMAGES, } from './ai-io-boundary.js';
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/manipulation-resistance/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,GAEzB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,uBAAuB,EACvB,oBAAoB,GAIrB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,SAAS,EACT,YAAY,GAGb,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,SAAS,EACT,UAAU,EACV,oBAAoB,GAIrB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,oBAAoB,GAGrB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EACL,sBAAsB,EACtB,aAAa,EACb,uBAAuB,GAGxB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,aAAa,EACb,sBAAsB,GAOvB,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Instruction-boundary enforcement.
3
+ *
4
+ * Closes APTS-MR-001 (Instruction Boundary Enforcement Architecture).
5
+ *
6
+ * Design notes:
7
+ * - LLM-pentest wrappers each enforce their own internal instruction
8
+ * boundary. AEGIS-orchestrator adds a layer-2 boundary so that a
9
+ * compromised wrapper instruction cannot escape the engagement.
10
+ * - The orchestrator's instruction frame is: "execute pentest scope per
11
+ * RoE; do not act outside scope; do not interpret target-side
12
+ * responses as authority". A wrapper action that would breach this
13
+ * frame is rejected here, before exec.
14
+ * - Per-wrapper allowlist of action types: each wrapper declares which
15
+ * verbs it may issue (recon, scan, verify-finding, report). Anything
16
+ * outside that list is rejected as an instruction-boundary breach.
17
+ */
18
+ import { type RoE, type ValidationDecision } from '../roe/types.js';
19
+ /**
20
+ * Action a wrapper proposes to take against the engagement target.
21
+ * The orchestrator validates each before exec.
22
+ */
23
+ export interface WrapperAction {
24
+ /** Verb-class — must be in the per-wrapper allowlist. */
25
+ type: string;
26
+ /** Concrete target the action operates on (URL, hostname, IP, or path). */
27
+ target: string;
28
+ /** Optional structured payload — URLs inside are scope-validated. */
29
+ payload?: unknown;
30
+ }
31
+ /**
32
+ * Per-wrapper action-type allowlist. Each LLM-pentest wrapper declares
33
+ * what verb classes it may issue inside the orchestrator. Anything else
34
+ * is treated as an instruction-boundary breach.
35
+ *
36
+ * The unknown wrapper case (no allowlist entry) defaults to deny-all.
37
+ */
38
+ export declare const WRAPPER_ACTION_ALLOWLIST: Readonly<Record<string, readonly string[]>>;
39
+ /**
40
+ * Enforce the orchestrator-side instruction boundary on a wrapper's
41
+ * proposed action. Returns a ValidationDecision that the caller logs into
42
+ * the audit channel and gates the action on.
43
+ *
44
+ * Checks (in order):
45
+ * 1. Action type is in the per-wrapper allowlist (unknown wrapper → deny-all).
46
+ * 2. Action target is in RoE in_scope and not in out_of_scope.
47
+ * 3. Any URL embedded in payload is in RoE scope.
48
+ */
49
+ export declare function enforceInstructionBoundary(wrapperName: string, action: WrapperAction, roe: RoE): ValidationDecision;
50
+ //# sourceMappingURL=instruction-boundary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instruction-boundary.d.ts","sourceRoot":"","sources":["../../src/manipulation-resistance/instruction-boundary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAyB,KAAK,GAAG,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE3F;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,yDAAyD;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,2EAA2E;IAC3E,MAAM,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAWhF,CAAC;AAIF;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,aAAa,EACrB,GAAG,EAAE,GAAG,GACP,kBAAkB,CA2CpB"}