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 的密码学可靠随机数,并附带提交-揭示记录,让第三方可以验证抽取未被篡改。

可以做什么
生成随机字节、无偏整数、洗牌、加权选择以及常见分布的抽样,包括带一致性证明的逐属性约束抽样。对序列运行统计检验组:频率、卡方、游程、最长游程、序列相关、香农熵、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 分

    请在仓库或注册中心条目中声明许可证。