@mnemom/agent-integrity-protocol 0.1.6 → 0.1.7

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/dist/index.cjs CHANGED
@@ -91,6 +91,16 @@ var DEFAULT_CONSCIENCE_VALUES = [
91
91
  content: "Risk of agreeing with the user to avoid conflict rather than providing honest assessment"
92
92
  }
93
93
  ];
94
+ var EU_COMPLIANCE_WINDOW_CONFIG = {
95
+ max_size: 10,
96
+ mode: "sliding",
97
+ session_boundary: "reset",
98
+ max_age_seconds: 7200
99
+ };
100
+ var EU_COMPLIANCE_FAILURE_POLICY = {
101
+ mode: "fail_closed",
102
+ analysis_timeout_ms: 15e3
103
+ };
94
104
  var CHECKPOINT_ID_PREFIX = "ic-";
95
105
  var DRIFT_ALERT_ID_PREFIX = "ida-";
96
106
  var REGISTRATION_ID_PREFIX = "reg-";
@@ -1447,6 +1457,7 @@ async function callAnalysisLLM(llmConfig, system, user, timeoutMs) {
1447
1457
  const controller = new AbortController();
1448
1458
  const timeoutId = setTimeout(() => controller.abort(), timeoutMs);
1449
1459
  try {
1460
+ const systemPayload = llmConfig.enable_prompt_caching ? [{ type: "text", text: system, cache_control: { type: "ephemeral" } }] : system;
1450
1461
  const response = await fetch(`${llmConfig.base_url}/v1/messages`, {
1451
1462
  method: "POST",
1452
1463
  headers: {
@@ -1457,7 +1468,7 @@ async function callAnalysisLLM(llmConfig, system, user, timeoutMs) {
1457
1468
  body: JSON.stringify({
1458
1469
  model: llmConfig.model,
1459
1470
  max_tokens: llmConfig.max_tokens,
1460
- system,
1471
+ system: systemPayload,
1461
1472
  messages: [{ role: "user", content: user }]
1462
1473
  }),
1463
1474
  signal: controller.signal
@@ -1560,6 +1571,8 @@ exports.DEFAULT_WINDOW_MAX_SIZE = DEFAULT_WINDOW_MAX_SIZE;
1560
1571
  exports.DRIFT_ALERT_ID_PREFIX = DRIFT_ALERT_ID_PREFIX;
1561
1572
  exports.DRIFT_SEVERITY_LOW_THRESHOLD = DRIFT_SEVERITY_LOW_THRESHOLD;
1562
1573
  exports.DRIFT_SEVERITY_MEDIUM_THRESHOLD = DRIFT_SEVERITY_MEDIUM_THRESHOLD;
1574
+ exports.EU_COMPLIANCE_FAILURE_POLICY = EU_COMPLIANCE_FAILURE_POLICY;
1575
+ exports.EU_COMPLIANCE_WINDOW_CONFIG = EU_COMPLIANCE_WINDOW_CONFIG;
1563
1576
  exports.FallbackAdapter = FallbackAdapter;
1564
1577
  exports.GoogleAdapter = GoogleAdapter;
1565
1578
  exports.MAX_EVIDENCE_LENGTH = MAX_EVIDENCE_LENGTH;