eif-engine 4.2.0__tar.gz → 4.3.0__tar.gz

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 (222) hide show
  1. {eif_engine-4.2.0 → eif_engine-4.3.0}/CHANGELOG.md +32 -0
  2. {eif_engine-4.2.0 → eif_engine-4.3.0}/PKG-INFO +35 -16
  3. {eif_engine-4.2.0 → eif_engine-4.3.0}/README.md +31 -15
  4. {eif_engine-4.2.0 → eif_engine-4.3.0}/SECURITY.md +32 -0
  5. {eif_engine-4.2.0 → eif_engine-4.3.0}/deploy/do_app_spec.yaml +5 -0
  6. {eif_engine-4.2.0 → eif_engine-4.3.0}/docs/architecture.md +2 -0
  7. eif_engine-4.3.0/docs/eif_host_tenant_keys_tech_spec.md +138 -0
  8. {eif_engine-4.2.0 → eif_engine-4.3.0}/docs/integrations/CLAUDE_CODE.md +8 -6
  9. {eif_engine-4.2.0 → eif_engine-4.3.0}/docs/integrations/CLAUDE_DESKTOP.md +19 -7
  10. {eif_engine-4.2.0 → eif_engine-4.3.0}/docs/integrations/CURSOR.md +7 -5
  11. eif_engine-4.3.0/docs/integrations/HOST_APP.md +118 -0
  12. {eif_engine-4.2.0 → eif_engine-4.3.0}/docs/integrations/README.md +7 -5
  13. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/__init__.py +1 -1
  14. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/falsify/native_tools.py +1 -1
  15. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/input_guard/eif_input_guard_intent.yaml +2 -2
  16. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/integration/interceptor.py +9 -5
  17. eif_engine-4.3.0/eif/mcp_server/auth.py +189 -0
  18. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/mcp_server/http_server.py +32 -4
  19. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/mcp_server/server.py +112 -16
  20. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/schemas.py +1 -1
  21. eif_engine-4.3.0/eif/session.py +116 -0
  22. {eif_engine-4.2.0 → eif_engine-4.3.0}/pyproject.toml +5 -1
  23. {eif_engine-4.2.0 → eif_engine-4.3.0}/server.json +1 -1
  24. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/integration/test_mcp_server.py +1 -1
  25. eif_engine-4.3.0/tests/unit/test_integration_interceptor_langchain.py +33 -0
  26. eif_engine-4.3.0/tests/unit/test_tenant_keys.py +353 -0
  27. eif_engine-4.3.0/tests/unit/test_verify_zero_evidence_revise.py +60 -0
  28. eif_engine-4.2.0/eif/mcp_server/auth.py +0 -81
  29. eif_engine-4.2.0/eif/session.py +0 -61
  30. {eif_engine-4.2.0 → eif_engine-4.3.0}/.dockerignore +0 -0
  31. {eif_engine-4.2.0 → eif_engine-4.3.0}/.env.example +0 -0
  32. {eif_engine-4.2.0 → eif_engine-4.3.0}/.github/CODEOWNERS +0 -0
  33. {eif_engine-4.2.0 → eif_engine-4.3.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  34. {eif_engine-4.2.0 → eif_engine-4.3.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  35. {eif_engine-4.2.0 → eif_engine-4.3.0}/.github/dependabot.yml +0 -0
  36. {eif_engine-4.2.0 → eif_engine-4.3.0}/.github/pull_request_template.md +0 -0
  37. {eif_engine-4.2.0 → eif_engine-4.3.0}/.github/workflows/ci.yml +0 -0
  38. {eif_engine-4.2.0 → eif_engine-4.3.0}/.gitignore +0 -0
  39. {eif_engine-4.2.0 → eif_engine-4.3.0}/.pre-commit-config.yaml +0 -0
  40. {eif_engine-4.2.0 → eif_engine-4.3.0}/.trustlint.yaml +0 -0
  41. {eif_engine-4.2.0 → eif_engine-4.3.0}/CODE_OF_CONDUCT.md +0 -0
  42. {eif_engine-4.2.0 → eif_engine-4.3.0}/CONTRIBUTING.md +0 -0
  43. {eif_engine-4.2.0 → eif_engine-4.3.0}/DATA_PROCESSING_AGREEMENT.md +0 -0
  44. {eif_engine-4.2.0 → eif_engine-4.3.0}/DECISIONS.md +0 -0
  45. {eif_engine-4.2.0 → eif_engine-4.3.0}/Dockerfile +0 -0
  46. {eif_engine-4.2.0 → eif_engine-4.3.0}/LEGAL.md +0 -0
  47. {eif_engine-4.2.0 → eif_engine-4.3.0}/LICENSE +0 -0
  48. {eif_engine-4.2.0 → eif_engine-4.3.0}/NOTICE +0 -0
  49. {eif_engine-4.2.0 → eif_engine-4.3.0}/PRIVACY_POLICY.md +0 -0
  50. {eif_engine-4.2.0 → eif_engine-4.3.0}/TERMS_OF_SERVICE.md +0 -0
  51. {eif_engine-4.2.0 → eif_engine-4.3.0}/dev_factory/standard_ei_01_nist_ai_risk_management_framework/bind.py +0 -0
  52. {eif_engine-4.2.0 → eif_engine-4.3.0}/dev_factory/standard_ei_01_nist_ai_risk_management_framework/test_bind.py +0 -0
  53. {eif_engine-4.2.0 → eif_engine-4.3.0}/docs/compliance.md +0 -0
  54. {eif_engine-4.2.0 → eif_engine-4.3.0}/docs/eif_causal_gate_v4_tech_spec.md +0 -0
  55. {eif_engine-4.2.0 → eif_engine-4.3.0}/docs/eif_s17_s18_s19_tech_spec.md +0 -0
  56. {eif_engine-4.2.0 → eif_engine-4.3.0}/docs/eif_v2_tech_spec.md +0 -0
  57. {eif_engine-4.2.0 → eif_engine-4.3.0}/docs/integrations/COMPLYEDGE.md +0 -0
  58. {eif_engine-4.2.0 → eif_engine-4.3.0}/docs/research_foundation.md +0 -0
  59. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/auto.py +0 -0
  60. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/calibrate/__init__.py +0 -0
  61. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/calibrate/bayesian.py +0 -0
  62. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/calibrate/conformal.py +0 -0
  63. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/calibrate/domain_constraints.py +0 -0
  64. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/calibrate/ece.py +0 -0
  65. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/calibrate/prior_strategy.py +0 -0
  66. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/calibrate/trust.py +0 -0
  67. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/causal_gate/__init__.py +0 -0
  68. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/causal_gate/confound.py +0 -0
  69. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/causal_gate/direction.py +0 -0
  70. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/causal_gate/eif_causal_gate_v4_intent.yaml +0 -0
  71. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/causal_gate/evidence_probe.py +0 -0
  72. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/causal_gate/intervention.py +0 -0
  73. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/causal_gate/iris_pipeline.py +0 -0
  74. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/causal_gate/verdict.py +0 -0
  75. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/challenge/__init__.py +0 -0
  76. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/challenge/diversity.py +0 -0
  77. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/challenge/eif_multi_critic_intent.yaml +0 -0
  78. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/challenge/multi_critic.py +0 -0
  79. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/challenge/protocol.py +0 -0
  80. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/challenge/replicator.py +0 -0
  81. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/cost_model/__init__.py +0 -0
  82. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/cost_model/catch_rate_empirical.py +0 -0
  83. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/cost_model/cost_ledger.py +0 -0
  84. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/cost_model/eif_catchrate_intent.yaml +0 -0
  85. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/declare/__init__.py +0 -0
  86. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/declare/extractor.py +0 -0
  87. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/declare/harking_guard.py +0 -0
  88. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/declare/registry.py +0 -0
  89. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/eif_engine_intent.yaml +0 -0
  90. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/eif_v2_intent.yaml +0 -0
  91. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/eif_v3_intent.yaml +0 -0
  92. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/explain/__init__.py +0 -0
  93. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/explain/artifact.py +0 -0
  94. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/explain/eif_explain_coldstart_intent.yaml +0 -0
  95. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/explain/hard_to_vary.py +0 -0
  96. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/explain/reach.py +0 -0
  97. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/falsify/__init__.py +0 -0
  98. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/falsify/condition.py +0 -0
  99. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/falsify/eif_evidence_collection_intent.yaml +0 -0
  100. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/falsify/eif_native_tools_intent.yaml +0 -0
  101. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/falsify/eif_v5_evidence_trust_weighting_intent.yaml +0 -0
  102. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/falsify/evidence_collector.py +0 -0
  103. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/falsify/hard_to_vary.py +0 -0
  104. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/falsify/sprt.py +0 -0
  105. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/falsify/trivial_check.py +0 -0
  106. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/hypothesis_agenda/__init__.py +0 -0
  107. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/hypothesis_agenda/agenda.py +0 -0
  108. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/hypothesis_agenda/eif_hypothesis_agenda_intent.yaml +0 -0
  109. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/hypothesis_agenda/fdr.py +0 -0
  110. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/hypothesis_agenda/scorer.py +0 -0
  111. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/input_guard/__init__.py +0 -0
  112. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/input_guard/detector.py +0 -0
  113. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/integration/__init__.py +0 -0
  114. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/integration/eif_auto.py +0 -0
  115. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/mcp_server/__init__.py +0 -0
  116. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/mcp_server/compliance.py +0 -0
  117. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/mcp_server/resources.py +0 -0
  118. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/mcp_server/runtime_compliance_intent.yaml +0 -0
  119. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/memory/__init__.py +0 -0
  120. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/memory/strategy.py +0 -0
  121. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/programme/__init__.py +0 -0
  122. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/programme/monitor.py +0 -0
  123. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/programme/principle_memory.py +0 -0
  124. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/programme/principle_revision.py +0 -0
  125. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/programme/signals.py +0 -0
  126. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/programme/status.py +0 -0
  127. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/py.typed +0 -0
  128. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/record/__init__.py +0 -0
  129. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/record/chain.py +0 -0
  130. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/record/compliance.py +0 -0
  131. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/record/isc_disclosure.py +0 -0
  132. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/record/outcome_store.py +0 -0
  133. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/record/provenance.py +0 -0
  134. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/record/research_object.py +0 -0
  135. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/replicate/__init__.py +0 -0
  136. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/replicate/divergence.py +0 -0
  137. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/replicate/eif_independent_replication_intent.yaml +0 -0
  138. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/replicate/independent.py +0 -0
  139. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/replicate/protocol.py +0 -0
  140. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/reporting/__init__.py +0 -0
  141. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/reporting/pdf_renderer.py +0 -0
  142. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/sdk/__init__.py +0 -0
  143. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/sdk/exceptions.py +0 -0
  144. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/sdk/interceptor.py +0 -0
  145. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/sycophancy/__init__.py +0 -0
  146. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/sycophancy/cost_model.py +0 -0
  147. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/sycophancy/detector.py +0 -0
  148. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/sycophancy/drift.py +0 -0
  149. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/sycophancy/eif_sycophancy_intent.yaml +0 -0
  150. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/sycophancy/faithfulness.py +0 -0
  151. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/sycophancy/framing.py +0 -0
  152. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/update/__init__.py +0 -0
  153. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/update/eig.py +0 -0
  154. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/update/paradigm.py +0 -0
  155. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/update/posterior.py +0 -0
  156. {eif_engine-4.2.0 → eif_engine-4.3.0}/eif/update/stopping.py +0 -0
  157. {eif_engine-4.2.0 → eif_engine-4.3.0}/examples/quickstart.py +0 -0
  158. {eif_engine-4.2.0 → eif_engine-4.3.0}/index.html +0 -0
  159. {eif_engine-4.2.0 → eif_engine-4.3.0}/research/README.md +0 -0
  160. {eif_engine-4.2.0 → eif_engine-4.3.0}/research/ai_agents/calibration.md +0 -0
  161. {eif_engine-4.2.0 → eif_engine-4.3.0}/research/ai_agents/causal_reasoning.md +0 -0
  162. {eif_engine-4.2.0 → eif_engine-4.3.0}/research/ai_agents/hypothesis_generation.md +0 -0
  163. {eif_engine-4.2.0 → eif_engine-4.3.0}/research/ai_agents/multi_agent_review.md +0 -0
  164. {eif_engine-4.2.0 → eif_engine-4.3.0}/research/ai_agents/overview.md +0 -0
  165. {eif_engine-4.2.0 → eif_engine-4.3.0}/research/ai_agents/provenance.md +0 -0
  166. {eif_engine-4.2.0 → eif_engine-4.3.0}/research/foundations/ai_and_science.md +0 -0
  167. {eif_engine-4.2.0 → eif_engine-4.3.0}/research/foundations/classical_method.md +0 -0
  168. {eif_engine-4.2.0 → eif_engine-4.3.0}/research/foundations/deutsch_epistemology.md +0 -0
  169. {eif_engine-4.2.0 → eif_engine-4.3.0}/research/foundations/frontier_debates.md +0 -0
  170. {eif_engine-4.2.0 → eif_engine-4.3.0}/research/foundations/philosophy_of_science.md +0 -0
  171. {eif_engine-4.2.0 → eif_engine-4.3.0}/research/foundations/replication_crisis.md +0 -0
  172. {eif_engine-4.2.0 → eif_engine-4.3.0}/research/foundations/statistics.md +0 -0
  173. {eif_engine-4.2.0 → eif_engine-4.3.0}/research/sycophancy_bias_research.md +0 -0
  174. {eif_engine-4.2.0 → eif_engine-4.3.0}/scripts/compliance/check.sh +0 -0
  175. {eif_engine-4.2.0 → eif_engine-4.3.0}/scripts/compliance/runtime_check.sh +0 -0
  176. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/__init__.py +0 -0
  177. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/conftest.py +0 -0
  178. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/integration/__init__.py +0 -0
  179. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/integration/test_eif_loop.py +0 -0
  180. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/__init__.py +0 -0
  181. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_calibrate.py +0 -0
  182. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_catch_rate_empirical.py +0 -0
  183. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_causal_gate.py +0 -0
  184. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_complyedge_cold_start.py +0 -0
  185. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_cost_ledger.py +0 -0
  186. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_dases_adaptive.py +0 -0
  187. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_dases_replicator.py +0 -0
  188. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_declare.py +0 -0
  189. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_deeptrace_live.py +0 -0
  190. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_ece_v2.py +0 -0
  191. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_evidence_trust_weighting.py +0 -0
  192. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_explain.py +0 -0
  193. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_exploratory_confirmatory.py +0 -0
  194. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_falsify.py +0 -0
  195. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_fdr.py +0 -0
  196. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_framing_elephant.py +0 -0
  197. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_hard_to_vary.py +0 -0
  198. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_host_tool_numeric.py +0 -0
  199. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_http_rate_limit.py +0 -0
  200. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_independent_replication.py +0 -0
  201. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_iris_pipeline.py +0 -0
  202. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_isc_disclosure.py +0 -0
  203. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_memory.py +0 -0
  204. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_monica_drift.py +0 -0
  205. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_native_tools_nt3.py +0 -0
  206. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_outcome_store.py +0 -0
  207. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_p1_sandbox_security.py +0 -0
  208. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_paradigm.py +0 -0
  209. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_principle_memory.py +0 -0
  210. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_principle_revision.py +0 -0
  211. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_programme.py +0 -0
  212. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_record.py +0 -0
  213. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_replicate.py +0 -0
  214. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_research_object.py +0 -0
  215. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_runtime_check_attribution.py +0 -0
  216. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_runtime_compliance.py +0 -0
  217. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_schemas.py +0 -0
  218. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_sdk_interceptor.py +0 -0
  219. {eif_engine-4.2.0 → eif_engine-4.3.0}/tests/unit/test_update.py +0 -0
  220. {eif_engine-4.2.0 → eif_engine-4.3.0}/validation/CORPUS_REPORT.md +0 -0
  221. {eif_engine-4.2.0 → eif_engine-4.3.0}/validation/EIF_INVESTMENT_V31_EVIDENCE.md +0 -0
  222. {eif_engine-4.2.0 → eif_engine-4.3.0}/validation/data/.gitkeep +0 -0
@@ -7,6 +7,38 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [4.3.0] - 2026-11-20
11
+
12
+ ### Changed
13
+ - `eif_verify` returns REVISE, not PASS, when nothing contradicts but a checked
14
+ claim stays below posterior 0.70 (no evidence leaves it at 0.5). PASS now
15
+ means every checked claim reached 0.70. Same thresholds as `eif_calibrate`.
16
+ Callers that only check for HALT keep working. Rules block v1.5.
17
+
18
+ ### Added
19
+ - `[search]` extra installs `ddgs` for P3 web search. Kept opt-in because it
20
+ sends claim-derived search terms off the machine.
21
+ - Host-derived tenant keys: one self-hosted HTTP server can serve many tenants,
22
+ each with its own sessions and a three-tool allowlist. See
23
+ `docs/integrations/HOST_APP.md`.
24
+
25
+ ### Fixed
26
+ - The `eif_verify` tool description gave a `host_tool_outputs` shape the code
27
+ ignores; it now gives `{tool_name, query, result, data_scope}`.
28
+ - Removed the claim that `eif_verify` catches correlation presented as causation
29
+ from the server instructions and the `eif_verify` description (4.2.0 removed
30
+ it from the README only).
31
+ - Docs: a plain install has no evidence source; web search needs `ddgs`;
32
+ `pip install eif` is a different project.
33
+ - Docs: Claude Desktop does not connect a remote `url` from its config file;
34
+ the hosted option now uses the `mcp-remote` bridge with the key in `env`.
35
+ - README corpus table: noted that the verdict columns add to 75 of 84 turns.
36
+ - serverInfo reports EIF's version, not the mcp library's.
37
+ - `eif.integration.EIFInterceptor` failed on langchain 1.x
38
+ (`No module named 'langchain.callbacks'`); it now imports from
39
+ `langchain_core` and needs only `langchain-core`. The README example passes
40
+ `get_langchain_handler()` and sets `intercept_chains=True` for chains.
41
+
10
42
  ## [4.2.0] - 2026-11-05
11
43
 
12
44
  ### Fixed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: eif-engine
3
- Version: 4.2.0
3
+ Version: 4.3.0
4
4
  Summary: EIF (Epistemic Integrity Framework): runtime gate for AI agent claims. Catches sycophantic drift, circular self-validation, causal errors.
5
5
  Project-URL: Homepage, https://github.com/leocelis/eif
6
6
  Project-URL: Repository, https://github.com/leocelis/eif
@@ -21,6 +21,7 @@ Requires-Dist: numpy>=1.26
21
21
  Requires-Dist: pydantic>=2.0
22
22
  Requires-Dist: scipy>=1.11
23
23
  Provides-Extra: dev
24
+ Requires-Dist: langchain-core>=0.2; extra == 'dev'
24
25
  Requires-Dist: pytest-asyncio>=0.21; extra == 'dev'
25
26
  Requires-Dist: pytest>=7.0; extra == 'dev'
26
27
  Requires-Dist: ruff>=0.4; extra == 'dev'
@@ -43,6 +44,8 @@ Provides-Extra: sdk-langchain
43
44
  Requires-Dist: httpx>=0.27; extra == 'sdk-langchain'
44
45
  Requires-Dist: langchain-core>=0.2; extra == 'sdk-langchain'
45
46
  Requires-Dist: openai>=1.0; extra == 'sdk-langchain'
47
+ Provides-Extra: search
48
+ Requires-Dist: ddgs>=9; extra == 'search'
46
49
  Provides-Extra: server
47
50
  Requires-Dist: mcp<2,>=1.19; extra == 'server'
48
51
  Requires-Dist: uvicorn>=0.27; extra == 'server'
@@ -81,7 +84,7 @@ EIF is a Python library and MCP server that runs an 8-phase scientific-method pi
81
84
 
82
85
  ```
83
86
  DECLARE → name every assumption: KNOWN / ASSUMED / GUESSED
84
- FALSIFY → collect independent evidence via P1 code, P2 tools, P3 web search
87
+ FALSIFY → collect independent evidence via P1 code, P2 tools, P3 web search (opt-in `[search]` extra)
85
88
  CAUSAL_GATE → check Pearl causal level; flag confounders and disjunctive bias
86
89
  CALIBRATE → Bayesian posterior update (prior × likelihood → route)
87
90
  CHALLENGE → adversarial critic produces counter-evidence and competing hypothesis
@@ -102,7 +105,7 @@ PROGRAMME → Lakatos health monitor: PROGRESSIVE / STABLE / DEGENERATIVE
102
105
 
103
106
  At the end of each turn, EIF routes the agent's output:
104
107
  - **ACT** - posterior ≥ threshold, evidence supports, safe to proceed
105
- - **REVISE** - some assumptions unresolved, moderate confidence
108
+ - **REVISE** - no contradiction, but a claim has no evidence or weak evidence (posterior below 0.70)
106
109
  - **HALT** - evidence contradicts a HIGH-consequence claim; do not proceed
107
110
 
108
111
  ---
@@ -131,6 +134,8 @@ EIF was validated against **14 multi-agent conversation scenarios** across 5 dom
131
134
  | S19a Model Scaling Ablation (gpt-4o-mini) | investment | 6 | 0 | 5 | 1 |
132
135
  | **TOTAL** | | **84** | **35** | **25** | **15** |
133
136
 
137
+ The three verdict columns add to 75, not 84: the 6 turns of S14 (the cold-start baseline for EXPLAIN) and 3 of the 9 turns of S11 carry no routing verdict.
138
+
134
139
  **P4 (circular LLM self-validation) rate: 0.0% across all 14 scenarios.** Every piece of evidence came from an independent source - executable code, coordinator tool outputs, or live web search.
135
140
 
136
141
  Full evidence: [`validation/CORPUS_REPORT.md`](validation/CORPUS_REPORT.md). Per-scenario reports available on request via GitHub Discussions.
@@ -140,11 +145,14 @@ Full evidence: [`validation/CORPUS_REPORT.md`](validation/CORPUS_REPORT.md). Per
140
145
  ## Quick start
141
146
 
142
147
  ```bash
143
- pip install -e ".[mcp]" # local dev (the MCP extra powers the examples below)
148
+ pip install 'eif-engine[mcp]' # the MCP extra powers the examples below
149
+ # from a source checkout: pip install -e ".[mcp]"
144
150
  # or: uvx --from 'eif-engine[mcp]' eif-mcp-server # zero-install stdio MCP server
145
151
  ```
146
152
 
147
- ### Two-tool path (recommended for first session)
153
+ The PyPI package named `eif` is an unrelated project (Extended Isolation Forest) that also imports as `eif`; install `eif-engine`, and not both in one environment.
154
+
155
+ ### Three-call path (recommended for first session)
148
156
 
149
157
  ```python
150
158
  import asyncio
@@ -177,6 +185,8 @@ async def run():
177
185
  asyncio.run(run())
178
186
  ```
179
187
 
188
+ On a plain install, with no host data, EIF has no evidence source: each claim comes back INSUFFICIENT and the verdict is REVISE. Pass the data your agent already fetched as `host_tool_outputs` (next section) to get a real check.
189
+
180
190
  ### Register a P0 host tool (highest-accuracy evidence tier)
181
191
 
182
192
  When your agent has access to an authoritative data source (IGDB, your database, an internal API), register it as a P0 host tool. EIF calls it directly - no web search, no guessing.
@@ -223,7 +233,7 @@ The short version:
223
233
 
224
234
  Request a key by [opening a Discussion](https://github.com/leocelis/eif/discussions), then add the config for your client.
225
235
 
226
- Cursor (`~/.cursor/mcp.json`) and Claude Desktop (`~/Library/Application Support/Claude/claude_desktop_config.json`):
236
+ Cursor (`~/.cursor/mcp.json`):
227
237
 
228
238
  ```json
229
239
  {
@@ -236,6 +246,8 @@ Cursor (`~/.cursor/mcp.json`) and Claude Desktop (`~/Library/Application Support
236
246
  }
237
247
  ```
238
248
 
249
+ Claude Desktop does not read a remote `url` from its config file; use the `mcp-remote` bridge in [`docs/integrations/CLAUDE_DESKTOP.md`](docs/integrations/CLAUDE_DESKTOP.md).
250
+
239
251
  VS Code / GitHub Copilot (`.vscode/mcp.json`): use `"servers"` (not `"mcpServers"`) and add `"type": "http"` to the entry.
240
252
 
241
253
  > The hosted endpoint is in private alpha. Everything below runs fully on your own machine with no key.
@@ -344,7 +356,7 @@ Paste the block below into an agent instruction file (`.cursorrules`, `CLAUDE.md
344
356
  it is present and your agent picks up the loop automatically:
345
357
 
346
358
  ```
347
- # <BEGIN-EIF v1.3>
359
+ # <BEGIN-EIF v1.5>
348
360
  # ==============================================================================
349
361
  # EIF - Epistemic Integrity Framework
350
362
  # ==============================================================================
@@ -373,8 +385,10 @@ it is present and your agent picks up the loop automatically:
373
385
  # 3. Pass data you ALREADY fetched (DB rows, API results, tool output) as
374
386
  # host_tool_outputs. That is P0 evidence, the highest tier, and it is what
375
387
  # lets EIF check a number against ground truth instead of guessing.
376
- # 4. Verdict HALT: do not act; surface halt_cards to the user. REVISE:
377
- # gather more evidence before acting. PASS: proceed.
388
+ # 4. Verdict HALT: do not act; surface halt_cards to the user. REVISE: a
389
+ # claim had no evidence or weak evidence (below 0.70); pass the data you
390
+ # already fetched as host_tool_outputs, or gather more, then verify again.
391
+ # PASS: every checked claim reached 0.70; proceed.
378
392
  # 5. Re-verify after the user pushes back across turns: sycophantic drift is
379
393
  # otherwise invisible.
380
394
  #
@@ -383,7 +397,7 @@ it is present and your agent picks up the loop automatically:
383
397
  #
384
398
  # Do NOT run eif_verify on every reply. Reserve it for consequential decisions;
385
399
  # routine chatter does not need it.
386
- # <END-EIF v1.3>
400
+ # <END-EIF v1.5>
387
401
  ```
388
402
 
389
403
  The canonical text of this block lives in
@@ -401,7 +415,7 @@ EIF's `FALSIFY` phase collects evidence from independent sources, prioritised:
401
415
  | **P0** HOST_TOOL | Host agent has a registered tool for this data source | Calls the authoritative data API directly (e.g. IGDB, EHR, internal DB) |
402
416
  | **P1** CODE_EXECUTION | Numerical/metric claims | Executes Python against public benchmark data |
403
417
  | **P2** TOOL_OUTPUT | Agent tool calls available | Parses coordinator web search / API results |
404
- | **P3** WEB_SEARCH | Regulatory / temporal claims | Live web search via DDGS native or OpenAI responses API |
418
+ | **P3** WEB_SEARCH | Regulatory / temporal claims | Live web search via DDGS, only when the `ddgs` package is installed (opt-in: `pip install "eif-engine[mcp,search]"`; claim-derived search terms leave your machine) |
405
419
  | **P4** PARAMETRIC | All else (capped) | LLM parametric probe - fallback only |
406
420
 
407
421
  P0 is the highest-priority tier and is the mechanism used in the Manor Lords / IGDB demo. P4 is never used for company-specific claims. In the validation corpus, P4 rate was **0.0%** across all 14 scenarios.
@@ -544,7 +558,7 @@ except EIFHaltError as e:
544
558
  # Do not act on this response - EIF found a claim without independent evidence.
545
559
  ```
546
560
 
547
- Install: `pip install "eif-engine[sdk]"` (or `pip install -e ".[sdk]"` from a source checkout)
561
+ Install: `pip install "eif-engine[sdk,server]"` (the server needs `[server]`; or `pip install -e ".[sdk,server]"` from a source checkout)
548
562
 
549
563
  Note: on any EIF server error the SDK fails open (the response passes through unverified) so your agent never blocks on EIF availability. Treat `EIFHaltError` as the only enforcement signal.
550
564
 
@@ -553,7 +567,8 @@ Note: on any EIF server error the SDK fails open (the response passes through un
553
567
  ```python
554
568
  import eif.auto # add once at your agent's entry point
555
569
 
556
- # All subsequent OpenAI and Anthropic calls are intercepted automatically.
570
+ # Subsequent calls on the sync OpenAI client, and on the Anthropic client (best effort),
571
+ # are intercepted. Async clients are not.
557
572
  # EIFHaltError is raised if a HALT verdict is reached.
558
573
  ```
559
574
 
@@ -585,16 +600,20 @@ except EIFHaltError as e:
585
600
  For in-process LangChain integration (no HTTP server required), use the original integration layer:
586
601
 
587
602
  ```python
603
+ import asyncio
604
+ from eif import session
588
605
  from eif.integration import EIFInterceptor, EIFHaltError
589
- interceptor = EIFInterceptor(session_id="my-session")
590
- chain = my_chain.with_config(callbacks=[interceptor])
606
+
607
+ sid = asyncio.run(session.new_session()).session_id
608
+ interceptor = EIFInterceptor(session_id=sid, intercept_chains=True) # True for LCEL chains; agents use on_agent_finish
609
+ chain = my_chain.with_config(callbacks=[interceptor.get_langchain_handler()])
591
610
  ```
592
611
 
593
612
  ---
594
613
 
595
614
  ## Design principles
596
615
 
597
- 1. **No LLM calls in the engine** - all computation is deterministic local math; LLM calls happen only in evidence collection (P3/P4) and claim extraction (integration layer)
616
+ 1. **No LLM calls in the engine** - all computation is deterministic local math; LLM calls happen only in eif_challenge (multi-critic) and the causal evidence probe, and only when OPENAI_API_KEY is set
598
617
  2. **Pydantic v2 throughout** - every input and output is a typed, validated model
599
618
  3. **H₀ = claim-is-TRUE** - Popper orientation: REJECT means the claim fails
600
619
  4. **EIG stopping rule** - stop gathering evidence when KL(posterior ∥ prior) < 0.01 nats
@@ -29,7 +29,7 @@ EIF is a Python library and MCP server that runs an 8-phase scientific-method pi
29
29
 
30
30
  ```
31
31
  DECLARE → name every assumption: KNOWN / ASSUMED / GUESSED
32
- FALSIFY → collect independent evidence via P1 code, P2 tools, P3 web search
32
+ FALSIFY → collect independent evidence via P1 code, P2 tools, P3 web search (opt-in `[search]` extra)
33
33
  CAUSAL_GATE → check Pearl causal level; flag confounders and disjunctive bias
34
34
  CALIBRATE → Bayesian posterior update (prior × likelihood → route)
35
35
  CHALLENGE → adversarial critic produces counter-evidence and competing hypothesis
@@ -50,7 +50,7 @@ PROGRAMME → Lakatos health monitor: PROGRESSIVE / STABLE / DEGENERATIVE
50
50
 
51
51
  At the end of each turn, EIF routes the agent's output:
52
52
  - **ACT** - posterior ≥ threshold, evidence supports, safe to proceed
53
- - **REVISE** - some assumptions unresolved, moderate confidence
53
+ - **REVISE** - no contradiction, but a claim has no evidence or weak evidence (posterior below 0.70)
54
54
  - **HALT** - evidence contradicts a HIGH-consequence claim; do not proceed
55
55
 
56
56
  ---
@@ -79,6 +79,8 @@ EIF was validated against **14 multi-agent conversation scenarios** across 5 dom
79
79
  | S19a Model Scaling Ablation (gpt-4o-mini) | investment | 6 | 0 | 5 | 1 |
80
80
  | **TOTAL** | | **84** | **35** | **25** | **15** |
81
81
 
82
+ The three verdict columns add to 75, not 84: the 6 turns of S14 (the cold-start baseline for EXPLAIN) and 3 of the 9 turns of S11 carry no routing verdict.
83
+
82
84
  **P4 (circular LLM self-validation) rate: 0.0% across all 14 scenarios.** Every piece of evidence came from an independent source - executable code, coordinator tool outputs, or live web search.
83
85
 
84
86
  Full evidence: [`validation/CORPUS_REPORT.md`](validation/CORPUS_REPORT.md). Per-scenario reports available on request via GitHub Discussions.
@@ -88,11 +90,14 @@ Full evidence: [`validation/CORPUS_REPORT.md`](validation/CORPUS_REPORT.md). Per
88
90
  ## Quick start
89
91
 
90
92
  ```bash
91
- pip install -e ".[mcp]" # local dev (the MCP extra powers the examples below)
93
+ pip install 'eif-engine[mcp]' # the MCP extra powers the examples below
94
+ # from a source checkout: pip install -e ".[mcp]"
92
95
  # or: uvx --from 'eif-engine[mcp]' eif-mcp-server # zero-install stdio MCP server
93
96
  ```
94
97
 
95
- ### Two-tool path (recommended for first session)
98
+ The PyPI package named `eif` is an unrelated project (Extended Isolation Forest) that also imports as `eif`; install `eif-engine`, and not both in one environment.
99
+
100
+ ### Three-call path (recommended for first session)
96
101
 
97
102
  ```python
98
103
  import asyncio
@@ -125,6 +130,8 @@ async def run():
125
130
  asyncio.run(run())
126
131
  ```
127
132
 
133
+ On a plain install, with no host data, EIF has no evidence source: each claim comes back INSUFFICIENT and the verdict is REVISE. Pass the data your agent already fetched as `host_tool_outputs` (next section) to get a real check.
134
+
128
135
  ### Register a P0 host tool (highest-accuracy evidence tier)
129
136
 
130
137
  When your agent has access to an authoritative data source (IGDB, your database, an internal API), register it as a P0 host tool. EIF calls it directly - no web search, no guessing.
@@ -171,7 +178,7 @@ The short version:
171
178
 
172
179
  Request a key by [opening a Discussion](https://github.com/leocelis/eif/discussions), then add the config for your client.
173
180
 
174
- Cursor (`~/.cursor/mcp.json`) and Claude Desktop (`~/Library/Application Support/Claude/claude_desktop_config.json`):
181
+ Cursor (`~/.cursor/mcp.json`):
175
182
 
176
183
  ```json
177
184
  {
@@ -184,6 +191,8 @@ Cursor (`~/.cursor/mcp.json`) and Claude Desktop (`~/Library/Application Support
184
191
  }
185
192
  ```
186
193
 
194
+ Claude Desktop does not read a remote `url` from its config file; use the `mcp-remote` bridge in [`docs/integrations/CLAUDE_DESKTOP.md`](docs/integrations/CLAUDE_DESKTOP.md).
195
+
187
196
  VS Code / GitHub Copilot (`.vscode/mcp.json`): use `"servers"` (not `"mcpServers"`) and add `"type": "http"` to the entry.
188
197
 
189
198
  > The hosted endpoint is in private alpha. Everything below runs fully on your own machine with no key.
@@ -292,7 +301,7 @@ Paste the block below into an agent instruction file (`.cursorrules`, `CLAUDE.md
292
301
  it is present and your agent picks up the loop automatically:
293
302
 
294
303
  ```
295
- # <BEGIN-EIF v1.3>
304
+ # <BEGIN-EIF v1.5>
296
305
  # ==============================================================================
297
306
  # EIF - Epistemic Integrity Framework
298
307
  # ==============================================================================
@@ -321,8 +330,10 @@ it is present and your agent picks up the loop automatically:
321
330
  # 3. Pass data you ALREADY fetched (DB rows, API results, tool output) as
322
331
  # host_tool_outputs. That is P0 evidence, the highest tier, and it is what
323
332
  # lets EIF check a number against ground truth instead of guessing.
324
- # 4. Verdict HALT: do not act; surface halt_cards to the user. REVISE:
325
- # gather more evidence before acting. PASS: proceed.
333
+ # 4. Verdict HALT: do not act; surface halt_cards to the user. REVISE: a
334
+ # claim had no evidence or weak evidence (below 0.70); pass the data you
335
+ # already fetched as host_tool_outputs, or gather more, then verify again.
336
+ # PASS: every checked claim reached 0.70; proceed.
326
337
  # 5. Re-verify after the user pushes back across turns: sycophantic drift is
327
338
  # otherwise invisible.
328
339
  #
@@ -331,7 +342,7 @@ it is present and your agent picks up the loop automatically:
331
342
  #
332
343
  # Do NOT run eif_verify on every reply. Reserve it for consequential decisions;
333
344
  # routine chatter does not need it.
334
- # <END-EIF v1.3>
345
+ # <END-EIF v1.5>
335
346
  ```
336
347
 
337
348
  The canonical text of this block lives in
@@ -349,7 +360,7 @@ EIF's `FALSIFY` phase collects evidence from independent sources, prioritised:
349
360
  | **P0** HOST_TOOL | Host agent has a registered tool for this data source | Calls the authoritative data API directly (e.g. IGDB, EHR, internal DB) |
350
361
  | **P1** CODE_EXECUTION | Numerical/metric claims | Executes Python against public benchmark data |
351
362
  | **P2** TOOL_OUTPUT | Agent tool calls available | Parses coordinator web search / API results |
352
- | **P3** WEB_SEARCH | Regulatory / temporal claims | Live web search via DDGS native or OpenAI responses API |
363
+ | **P3** WEB_SEARCH | Regulatory / temporal claims | Live web search via DDGS, only when the `ddgs` package is installed (opt-in: `pip install "eif-engine[mcp,search]"`; claim-derived search terms leave your machine) |
353
364
  | **P4** PARAMETRIC | All else (capped) | LLM parametric probe - fallback only |
354
365
 
355
366
  P0 is the highest-priority tier and is the mechanism used in the Manor Lords / IGDB demo. P4 is never used for company-specific claims. In the validation corpus, P4 rate was **0.0%** across all 14 scenarios.
@@ -492,7 +503,7 @@ except EIFHaltError as e:
492
503
  # Do not act on this response - EIF found a claim without independent evidence.
493
504
  ```
494
505
 
495
- Install: `pip install "eif-engine[sdk]"` (or `pip install -e ".[sdk]"` from a source checkout)
506
+ Install: `pip install "eif-engine[sdk,server]"` (the server needs `[server]`; or `pip install -e ".[sdk,server]"` from a source checkout)
496
507
 
497
508
  Note: on any EIF server error the SDK fails open (the response passes through unverified) so your agent never blocks on EIF availability. Treat `EIFHaltError` as the only enforcement signal.
498
509
 
@@ -501,7 +512,8 @@ Note: on any EIF server error the SDK fails open (the response passes through un
501
512
  ```python
502
513
  import eif.auto # add once at your agent's entry point
503
514
 
504
- # All subsequent OpenAI and Anthropic calls are intercepted automatically.
515
+ # Subsequent calls on the sync OpenAI client, and on the Anthropic client (best effort),
516
+ # are intercepted. Async clients are not.
505
517
  # EIFHaltError is raised if a HALT verdict is reached.
506
518
  ```
507
519
 
@@ -533,16 +545,20 @@ except EIFHaltError as e:
533
545
  For in-process LangChain integration (no HTTP server required), use the original integration layer:
534
546
 
535
547
  ```python
548
+ import asyncio
549
+ from eif import session
536
550
  from eif.integration import EIFInterceptor, EIFHaltError
537
- interceptor = EIFInterceptor(session_id="my-session")
538
- chain = my_chain.with_config(callbacks=[interceptor])
551
+
552
+ sid = asyncio.run(session.new_session()).session_id
553
+ interceptor = EIFInterceptor(session_id=sid, intercept_chains=True) # True for LCEL chains; agents use on_agent_finish
554
+ chain = my_chain.with_config(callbacks=[interceptor.get_langchain_handler()])
539
555
  ```
540
556
 
541
557
  ---
542
558
 
543
559
  ## Design principles
544
560
 
545
- 1. **No LLM calls in the engine** - all computation is deterministic local math; LLM calls happen only in evidence collection (P3/P4) and claim extraction (integration layer)
561
+ 1. **No LLM calls in the engine** - all computation is deterministic local math; LLM calls happen only in eif_challenge (multi-critic) and the causal evidence probe, and only when OPENAI_API_KEY is set
546
562
  2. **Pydantic v2 throughout** - every input and output is a typed, validated model
547
563
  3. **H₀ = claim-is-TRUE** - Popper orientation: REJECT means the claim fails
548
564
  4. **EIG stopping rule** - stop gathering evidence when KL(posterior ∥ prior) < 0.01 nats
@@ -69,3 +69,35 @@ EIF is self-hosted software. You own the security of your deployment.
69
69
  - **The P1 sandbox executes generated Python in a subprocess** after AST-based
70
70
  validation. It is designed for EIF's own stdlib-only code templates. Do not
71
71
  route untrusted arbitrary code through it.
72
+
73
+ ---
74
+
75
+ ## Tenant Keys (Host Apps)
76
+
77
+ A host app that serves many of its own customers (tenants) through one EIF
78
+ HTTP server can give each tenant its own key, derived from one secret shared
79
+ between the host and the server. See `docs/integrations/HOST_APP.md`.
80
+
81
+ - **Derived, never stored.** `key = "eif_" + tenant + "_" +
82
+ base64url_nopad(HMAC-SHA256(EIF_TENANT_KEY_SECRET, "eif:" + VERSION + ":" + tenant))`.
83
+ The server recomputes the MAC and compares it in constant time. Keep
84
+ `EIF_TENANT_KEY_SECRET` out of source control like every other key.
85
+ - **Rotation and revocation.** `EIF_TENANT_KEY_VERSIONS` (default `v1`) lists
86
+ the versions accepted; add a new version, move the host to it, then drop the
87
+ old one. `EIF_REVOKED_TENANTS` refuses one tenant's keys at once.
88
+ - **Tenant keys only.** A server with the secret set and no `EIF_API_KEY`
89
+ accepts tenant keys and nothing else, in development and in production; the
90
+ open development mode is off.
91
+ - **Sessions have owners.** A session belongs to the tenant whose request
92
+ created it. Another tenant asking for it, by tool or by resource, gets the
93
+ same "not found or expired" error as for an id that does not exist. A session
94
+ created with `EIF_API_KEY` is not readable with a tenant key, and the reverse.
95
+ - **One MCP session, one identity.** An MCP session is bound to the key that
96
+ opened it; a message on it with a key for another tenant (or the operator
97
+ key) is refused. The tenant is read from each message's own request.
98
+ - **Three tools.** A tenant key may call `eif_new_session`,
99
+ `eif_extract_claims_from_decision` and `eif_verify` only; `tools/list` shows
100
+ only those. Tools that can call a paid model on the operator's key (such as
101
+ `eif_challenge`) are out of tenant reach.
102
+ - **What it is not.** Sessions stay in memory; a restart loses them for every
103
+ caller. Rate limits are per key and per process.
@@ -67,6 +67,11 @@ services:
67
67
  - key: COMPLYEDGE_API_KEY
68
68
  type: SECRET
69
69
  scope: RUN_TIME
70
+ # Optional: derived per-tenant keys for a host app (docs/integrations/HOST_APP.md).
71
+ # Unset = only EIF_API_KEY authenticates.
72
+ - key: EIF_TENANT_KEY_SECRET
73
+ type: SECRET
74
+ scope: RUN_TIME
70
75
 
71
76
  # Custom domain: add in the DO dashboard (Settings -> Domains), e.g.
72
77
  # eif.<your-domain>, then CNAME it to the app's default hostname.
@@ -209,6 +209,8 @@ eif/
209
209
  - Docker image built from this repository.
210
210
  - Optional hosted alpha: the maintainer runs the same HTTP/SSE server at `eif.leocelis.com` (Bearer key required, private alpha). See the README's MCP server section.
211
211
 
212
+ **Tenant keys.** For a host app serving many tenants through one HTTP server, `EIF_TENANT_KEY_SECRET` turns on keys derived per tenant (`auth.py`). Each MCP message is resolved to its own request's tenant, the MCP session is bound to the key that opened it, a session belongs to the tenant that created it (another tenant gets "not found or expired", by tool or by resource), and a tenant key sees only `eif_new_session`, `eif_extract_claims_from_decision` and `eif_verify`. `EIF_API_KEY` is unchanged. See `docs/integrations/HOST_APP.md`.
213
+
212
214
  ---
213
215
 
214
216
  ## Design principles
@@ -0,0 +1,138 @@
1
+ # EIF: Host-Derived Tenant Keys and Session Owners: Tech Spec
2
+
3
+ **Status:** BUILT (2026-11-16). Proposed 2026-11-15.
4
+ **Scope:** the self-hosted HTTP server (`eif/mcp_server/`) and the session store (`eif/session.py`).
5
+ Stdio and local use do not change.
6
+
7
+ ## 1. Problem
8
+
9
+ The HTTP server has one shared key, `EIF_API_KEY` (`eif/mcp_server/auth.py`). Its own note says:
10
+ "For multi-user deployments, put a real gateway in front." Sessions live in one in-memory dict with
11
+ no owner (`eif/session.py`): anyone who holds a `session_id` can read that session.
12
+
13
+ That fits one person. It does not fit a **host app** that serves many of its own customers
14
+ (tenants) through one EIF server: every tenant would share one key, and a leaked session id would
15
+ open another tenant's claims and evidence.
16
+
17
+ ## 2. Goal
18
+
19
+ A host app can give each of its tenants claim verification, with one secret shared between the host
20
+ and the server, no provisioning step, and no tenant able to read another's session.
21
+
22
+ The existing `EIF_API_KEY` keeps working exactly as today.
23
+
24
+ ## 3. Design
25
+
26
+ ### 3.1 The key
27
+
28
+ ```
29
+ key = "eif_" + tenant + "_" + base64url_nopad( HMAC-SHA256(SECRET, "eif:" + VERSION + ":" + tenant) )
30
+ ```
31
+
32
+ - `tenant` matches `^[a-z0-9][a-z0-9-]{0,55}$`. Lowercase only.
33
+ - The MAC is always 43 characters. The server reads the tenant as the text between the prefix and
34
+ the last 44 characters, never by splitting on `_`.
35
+ - Neither the host nor the server stores the key.
36
+ - The signed text starts with the product name, so a key made for one server is not valid on
37
+ another even if an operator reuses a secret.
38
+
39
+ Test vector (each project that implements this scheme carries its own, same secret and tenant):
40
+
41
+ | Secret | Version | Tenant | Key |
42
+ |---|---|---|---|
43
+ | `test-secret-do-not-use` | `v1` | `acme` | `eif_acme_Zz3YW-iyGIXp3c4AL9D0Kcpxxyneizso6QEKw0_Lf9I` |
44
+
45
+ ### 3.2 Server settings
46
+
47
+ | Variable | Meaning | Default |
48
+ |---|---|---|
49
+ | `EIF_TENANT_KEY_SECRET` | The shared secret. Not set → the feature is off | not set |
50
+ | `EIF_TENANT_KEY_VERSIONS` | Comma-separated versions the server accepts | `v1` |
51
+ | `EIF_REVOKED_TENANTS` | Comma-separated tenants whose keys are refused | empty |
52
+
53
+ ### 3.3 Verification (E1)
54
+
55
+ `validate_key` accepts a bearer key that is not `EIF_API_KEY` when the secret is set, the key has the
56
+ `eif_` prefix and a valid tenant, its MAC matches for an accepted version (constant-time compare),
57
+ and the tenant is not revoked. Its `key_info` gains `tenant`.
58
+
59
+ A request made with `EIF_API_KEY` has no tenant.
60
+
61
+ Three things in today's code need care:
62
+
63
+ - **Order.** With `EIF_API_KEY` unset outside production, `validate_key` accepts any key as a local
64
+ developer before anything else is checked; in production it rejects everything. When the tenant
65
+ secret is set, the tenant check runs first, and a server with a tenant secret and no
66
+ `EIF_API_KEY` serves tenant keys only.
67
+ - **The middleware discards the result today** (`http_server.py` calls `require_api_key` and drops
68
+ what it returns). It keeps it.
69
+ - **`POST /verify`** is a second way in: it reads the key from the JSON body and opens a session
70
+ itself. It attaches the same tenant and owner as the MCP path.
71
+
72
+ The tenant is read from **each message's own request**, not from a value set when the MCP
73
+ session was opened. With stateful Streamable HTTP the server task for a session starts inside the
74
+ request that created it, so a per-request variable set there stays the first caller's. A session is
75
+ also bound to the identity that opened it: a message whose key resolves to a different identity
76
+ (another tenant, or an operator key) is refused. Without that, one MCP session reused for two
77
+ tenants would run both as the first.
78
+ The compliance module already reads the message's own request this way (`compliance.py`,
79
+ `_request_identity`).
80
+
81
+ ### 3.4 A session has an owner (E2)
82
+
83
+ - `new_session` records the tenant of the request that created it (none for `EIF_API_KEY`).
84
+ - `get_session` and `update_session` take the caller's tenant. A session asked for by a different
85
+ tenant raises the same "not found or expired" error as a session that does not exist, so the
86
+ answer does not reveal that the id is real.
87
+ - The same check applies to the five session resources (`eif://session/{id}/…`).
88
+ - A session with no owner is readable only by callers with no tenant, as today.
89
+
90
+ ### 3.5 What a tenant key may call (E3)
91
+
92
+ | Allowed | Refused |
93
+ |---|---|
94
+ | `eif_new_session`, `eif_extract_claims_from_decision`, `eif_verify` | Every other tool |
95
+
96
+ `eif_challenge` and the causal evidence probe call OpenAI on the server operator's key. They stay
97
+ out of tenant reach so a tenant cannot spend the operator's money. `tools/list` for a tenant key
98
+ returns only the three allowed tools.
99
+
100
+ `eif_get_session` is left out on purpose: it reports only the provenance chain, which only
101
+ `eif_record` writes, and `eif_record` is not offered. A tenant would always read an empty session.
102
+ The verdict a tenant needs comes back from `eif_verify` itself.
103
+
104
+ ### 3.6 What a host should send
105
+
106
+ The server works best when the host, not the model, fills two arguments of `eif_verify`:
107
+
108
+ - `conversation_turns`: without them the sycophancy check reports "SKIPPED - no conversation
109
+ context".
110
+ - `host_tool_outputs`: data the host already fetched. It is the strongest evidence tier, and it
111
+ only means something when the host supplies it.
112
+
113
+ ## 4. What does not change
114
+
115
+ - `EIF_API_KEY`: same tools, same sessions.
116
+ - Stdio transport and local development mode.
117
+ - Sessions stay in memory. A restart loses them for every caller; a host opens a new one and
118
+ retries.
119
+
120
+ ## 5. Tests
121
+
122
+ - The test vector verifies; a tampered MAC, an unknown version, a revoked tenant and a tenant that
123
+ breaks the rule are refused.
124
+ - Tenant B asking for tenant A's session, by tool or by resource, gets "not found or expired".
125
+ - A session created with `EIF_API_KEY` is not readable with a tenant key, and the reverse.
126
+ - A tenant key calling `eif_challenge` is refused; `tools/list` shows three tools.
127
+ - With the tenant secret set and `EIF_API_KEY` unset, in development and in production, a valid
128
+ tenant key is accepted and a tampered one is refused.
129
+ - `POST /verify` with a tenant key creates a session owned by that tenant.
130
+ - An MCP session opened with one key and continued with another is refused.
131
+ - `EIF_API_KEY` behaves as before.
132
+
133
+ ## 6. Files
134
+
135
+ `eif/mcp_server/auth.py`, `eif/mcp_server/http_server.py`, `eif/mcp_server/server.py`,
136
+ `eif/mcp_server/resources.py`, `eif/session.py`, `SECURITY.md`, a new
137
+ `docs/integrations/HOST_APP.md`, tests. `docs/architecture.md` gains one paragraph under
138
+ "MCP surface" once this is built.
@@ -6,7 +6,7 @@ EIF ships a FastMCP server exposing 25 tools. The six you will touch most:
6
6
  |---|---|
7
7
  | `eif_new_session` | Create a session; every other stateful tool requires its session_id |
8
8
  | `eif_extract_claims_from_decision` | Turn a plain-text decision into structured claims ranked by HALT probability |
9
- | `eif_verify` | One-call full pipeline: declare, falsify, calibrate, route. Returns PASS or HALT |
9
+ | `eif_verify` | One-call full pipeline: declare, falsify, calibrate, route. Returns PASS, REVISE or HALT |
10
10
  | `eif_get_context` | Load EIF thresholds and the pipeline quick reference (granular pipeline only) |
11
11
  | `eif_demo` | Zero-setup HALT example, no API calls |
12
12
  | `eif_check_rules_installed` | Confirm the rules block below is installed |
@@ -45,7 +45,7 @@ claude mcp get eif
45
45
 
46
46
  ```bash
47
47
  pip install 'eif-engine[mcp]'
48
- claude mcp add eif -- /path/to/venv/bin/python -m eif.mcp_server.server --scope user
48
+ claude mcp add eif --scope user -- /path/to/venv/bin/python -m eif.mcp_server.server
49
49
  ```
50
50
 
51
51
  ### Option C - project scope (`.mcp.json`)
@@ -90,7 +90,7 @@ without being asked. For a single project, put the same block in the
90
90
  project's `CLAUDE.md` instead.
91
91
 
92
92
  ```
93
- # <BEGIN-EIF v1.3>
93
+ # <BEGIN-EIF v1.5>
94
94
  # ==============================================================================
95
95
  # EIF - Epistemic Integrity Framework
96
96
  # ==============================================================================
@@ -119,8 +119,10 @@ project's `CLAUDE.md` instead.
119
119
  # 3. Pass data you ALREADY fetched (DB rows, API results, tool output) as
120
120
  # host_tool_outputs. That is P0 evidence, the highest tier, and it is what
121
121
  # lets EIF check a number against ground truth instead of guessing.
122
- # 4. Verdict HALT: do not act; surface halt_cards to the user. REVISE:
123
- # gather more evidence before acting. PASS: proceed.
122
+ # 4. Verdict HALT: do not act; surface halt_cards to the user. REVISE: a
123
+ # claim had no evidence or weak evidence (below 0.70); pass the data you
124
+ # already fetched as host_tool_outputs, or gather more, then verify again.
125
+ # PASS: every checked claim reached 0.70; proceed.
124
126
  # 5. Re-verify after the user pushes back across turns: sycophantic drift is
125
127
  # otherwise invisible.
126
128
  #
@@ -129,7 +131,7 @@ project's `CLAUDE.md` instead.
129
131
  #
130
132
  # Do NOT run eif_verify on every reply. Reserve it for consequential decisions;
131
133
  # routine chatter does not need it.
132
- # <END-EIF v1.3>
134
+ # <END-EIF v1.5>
133
135
  ```
134
136
 
135
137
  ---