Entropy

io.github.terradev-cloud由 GitHub 帳號 terradev-cloud 發布v0.1.1更新於 Oct 25, 2026

Cryptographically sound randomness for agents, with verifiable commit-reveal.

已驗證Streamable HTTP可網頁執行安全與監控資料與分析

概覽

AI 產生的概覽

Entropy 為 AI 助理提供來自作業系統 CSPRNG 的密碼學可靠隨機數,並附上提交-揭示紀錄,讓第三方能驗證抽取未被竄改。

可以做什麼
產生隨機位元組、無偏整數、洗牌、加權選擇以及常見分布的抽樣,包含帶一致性證明的逐屬性約束抽樣。對序列執行統計檢定組:頻率、卡方、連串、最長連串、序列相關、Shannon 熵、KS 與間隙檢定。提交種子並綁定抽取規格、揭示種子、一次呼叫完成抽取,並獨立於伺服器狀態驗證整條鏈。以 epsilon-greedy、Thompson 或 UCB1 進行多臂吃角子老虎選擇,每次無狀態呼叫由呼叫端傳入狀態。
適用情境
適合助理需要做出公平且不可預測的選擇(例如抽出得獎者、打亂順序、依屬性抽樣),且之後可能需要他人核查抽取未被操縱的情境。也適用於可重現的帶種子抽取,以及對產生序列做快速統計合理性檢查。
執行需求
透過 streamable HTTP 連線至指定 URL 的遠端端點;未宣告驗證或環境變數。README 另記錄了本機 pip 安裝及可選 HTTP 傳輸。可選設定包括 ENTROPY_COMMITMENT_LOG、ENTROPY_STAMP_URL、ENTROPY_BEACON_URL、ENTROPY_HOST 與 ENTROPY_PORT;預設會存取遠端 Stamp 與 drand 端點。
安裝前請注意
提交-揭示能證明抽取未被操縱,但不能證明抽取未被丟棄,因此能重跑抽取的一方仍可挑選結果。種子會回傳給呼叫端且不存放在伺服器端,遺失種子會導致後續驗證失敗。提交紀錄會寫入本機日誌檔。可選錨定會把提交資料傳送到 Stamp 端點與 drand API。檢定組參考 NIST SP 800-22,但未經認證。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Entropy,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.terradev-cloud%2Fentropy/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "entropy": {
      "type": "http",
      "url": "https://entropy-mcp.terradev.cloud/mcp"
    }
  }
}

README

entropy-mcp

Entropy gives agents randomness they cannot produce themselves, and proof they did not manipulate it.

The evidence

Language models cannot generate statistically sound randomness. This is measured, not speculative:

  • arXiv:2601.05414 — 11 frontier models, 15 distributions: 7% median pass rate in batch mode; 10 of 11 models passed zero distributions in stateless mode.
  • arXiv:2604.06543 — the knowing-doing gap: models can describe correct sampling and still fail to do it. Asking a model to generate its own seed reproduces the same bias.
  • arXiv:2606.06622 — UnpredictaBench: models are measurably predictable where they should be random.

The stateless point

Agents operate in exactly the regime where models fail hardest: independent, stateless calls with no memory of prior draws. Every "pick a random number" an agent answers from its own weights is a draw from a biased, predictable source. Entropy moves the draw out of the model and into the OS CSPRNG — and the commit-reveal chain proves the draw that happened is the draw that was reported.

Install

bash
pip install entropy-mcp          # stdio core + stamp-mcp dependencypip install entropy-mcp[http]    # adds the aiohttp HTTP transport

Quickstart

json
{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"commitment","arguments":{  "operation":"draw",  "draw_spec":{"operation":"shuffle","params":{"items":["alice","bob","carol","dave"]}},  "description":"who goes first"}}}

One call returns the shuffled list plus a commitment record, a reveal record, and a verification block — the full chain a third party can check with commitment operation:"verify".

Command reference

Four tools. operation selects the primitive; params carries its arguments; seed makes any draw reproducible.

ToolOperations
randombytes (CSPRNG, hex/base64) · int (unbiased [min,max] via rejection sampling) · shuffle (Fisher-Yates + permutation) · choose (weighted/unweighted, with/without replacement) · sample (uniform, normal, lognormal, exponential, triangular, beta) · constrained (independent per-attribute sampling + chi² conformance proof)
commitmentcommit (hash seed, bind draw spec, attest) · reveal (verify seed, re-execute, attest outcome) · draw (commit + execute + reveal in one call) · verify (pure third-party verification, no local state) · list (local commitment log)
testStatistical battery: frequency, chi², runs, longest run, serial, Shannon, KS, gap
exploreBandit selection: epsilon_greedy, thompson, ucb1 (stateless)

Every seeded command is deterministic given its inputs and seed — byte-identical across processes, machines, and Python versions. Only the raw OS-entropy paths are non-deterministic, and they say so.

How commit-reveal works

  1. commit generates (or accepts) a 32-byte seed, stores only sha256(seed), binds it to your draw spec via canonical hash, timestamps it via Stamp's NTP, optionally anchors it to a drand round, and attests the whole record. The seed goes to you. It is never stored server-side.
  2. reveal takes the seed back, verifies it hashes to the committed seed_hash, re-executes the draw deterministically, and attests the outcome.
  3. verify_chain checks, independently of any server state:
CheckProves
seed_produces_commitment_hashthe revealed seed is the one committed to
commitment_attestation_validthe commitment record is intact and attested
reveal_attestation_validthe reveal record is intact and attested
commitment_precedes_revealthe commit happened before the reveal
outcome_reproduciblethe reported outcome is what the seed actually produces
params_hash_matchesthe draw spec wasn't altered after commitment
beacon_anchor_validthe commitment predates the drand round's publication (when anchored)

What this is not

  • Not a statistics package — the summary block and test battery are conveniences, not an analysis suite.
  • Not a simulation engine — no Monte Carlo, no sensitivity analysis, no fitting.
  • Not a randomness beacon — drand anchoring is optional hardening, not a source.
  • Not NIST-certified — the test battery is informed by SP 800-22, in the spirit of it.

Configuration

Env varDefaultPurpose
ENTROPY_COMMITMENT_LOG~/.entropy/commitments.jsonlcommitment log path (0600, capped at 10k records)
ENTROPY_STAMP_URLhttps://stamp-mcp.terradev.cloudremote Stamp endpoint (local stamp_mcp import preferred)
ENTROPY_BEACON_URLhttps://api.drand.shdrand API base
ENTROPY_HOST / ENTROPY_PORT127.0.0.1 / 8001HTTP transport bind

Threat model

See THREAT_MODEL.md. The honest summary: Entropy proves a draw was not manipulated; it cannot prove a draw was not discarded.

License

Apache 2.0.

來源:README.md,提交 d8c1c0d

工具

4

random

Direct randomness. operation selects the primitive: bytes -- raw CSPRNG bytes. params: {count<=4096, encoding: hex|base64} int -- unbiased integers in [min,max] via rejection sampling. params: {min, max, count<=10000} shuffle -- Fisher-Yates; permutation[i] is the original index now at position i. params: {items, return_permutation} choose -- k items, weighted or not, with/without replacement. params: {items, k, weights, replacement} sample -- named distributions: uniform, normal, lognormal, exponential, triangular, beta. params: {distribution, params, n<=10000} constrained -- records with independently sampled attributes + chi-squared conformance proof. params: {attributes: {attr: {value: prop}}, n} seed (top level) makes any operation reproducible.

輸入參數seedparamsoperation必填

commitment

Verifiable commit-reveal. operation selects the step: commit -- hash a seed, bind it to draw_spec {operation, params}, attest via Stamp. The seed is returned to the caller and never stored. reveal -- verify a seed against commitment_id, re-execute the draw deterministically, attest the outcome. draw -- commit + execute + reveal in one call. Pass draw_spec, or operation + params directly. verify -- pure third-party verification of commitment_record + reveal_record. No local state. list -- read-only view of the local commitment log (limit, since).

輸入參數seedlimitsinceattesteddraw_specoperation必填descriptionanchor_beaconcommitment_idreveal_recordcommitment_record

test

Statistical battery over a sequence: frequency, chi-squared, runs, longest run, serial correlation, Shannon entropy, KS, gap test. Informed by NIST SP 800-22; no certification claimed. sequence is a list of numbers, list of strings, or a hex/base64 byte string.

輸入參數alphatestsexpectedsequence必填input_typedist_paramsdistribution

explore

Bandit arm selection: epsilon_greedy, thompson, or ucb1. Stateless -- caller passes state in as {arm: {pulls, successes, total_reward}} and gets a selection back. params: {epsilon} for epsilon_greedy.

輸入參數arms必填seedstateparamsstrategy必填

版本歷史

1
  1. v0.1.1最新Sep 27, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。