Trust gate for AI agents: multi-model adversarial consensus, signed and verifiable verdicts.
Developer toolkit for EthersFlow — a multi-model trust layer that verifies AI outputs through adversarial consensus. MCP server, SDKs, and API docs.
EthersFlow issues cryptographically signed, independently verifiable trust verdicts for AI agent actions before execution, providing dual-control verification and cryptographic audit trails.
+-------------------------------------+
| Autonomous AI Agent |
+------------------+------------------+
| Proposed Action
v
+----------------------------------------------------------------------------------------+
| EthersFlow Verification Gateway |
| |
| +----------------------+ +----------------------+ +----------------------------+ |
| | Direct Pragmatist | | Constructive Skeptic | | Lateral Synthesizer | |
| +----------+-----------+ +----------+-----------+ +-------------+--------------+ |
| +--------------------------+-----------------------------+ |
| | Adversarial Cross-Examination |
| v |
| +-----------------------------+ |
| | Federated Consensus Engine | |
| +--------------+--------------+ |
| | Ed25519 Signature |
+----------------------------------------+-----------------------------------------------+
| Signed Verdict
v
+----------------------------------------------+
| APPROVED / FLAGGED / REJECTED Decision Gate |
+----------------------------------------------+
EthersFlow operates a dual-lane execution engine balancing rapid determinism (~20-30x speedup) with multi-model adversarial deliberation:
| Execution Lane | p50 Latency | p95 Latency | Mechanism | Guarantee & Finality |
|---|---|---|---|---|
| Policy Fast Path | 0.45 s | 2.4 s | Deterministic safety kernel & catalog matcher (<$100, allowlisted vendor, operational ticket, pre-fast-path intent screen). | POLICY_FAST_PATH_APPROVAL |
| Idempotent Replay | 3.2 ms | 4.5 ms | Sub-millisecond deduplication on repeated idempotency_key and action hash. | replayed: true |
| Adversarial Consensus | 11.2 s | 28.6 s | Live multi-model debate across heterogeneous frontier models (Qwen, Llama, Gemini) with cryptographic node attestations. | POLICY_SUPERMAJORITY_APPROVAL / POLICY_FINAL_BLOCK |
Velocity Capping & Preconditions: Operational tickets (e.g.
FAC-101) have an automated allowance of 5 fast-path approvals per 24 hours ($500 cap). The velocity cap counts attempts (stateful), requiring a proper 5-purchase precondition on a fresh ticket for verification. When this threshold is reached, subsequent requests automatically fall back to the live multi-model consensus lane to prevent micro-expense structuring attacks. Full empirical data is published indocs/calibration-benchmark.md.
Launch Architecture Principle: "The deterministic fast path plus signed receipt is the provable core; consensus is escalation telemetry whose semantic detection is confirmed (3/3 on kernel-invisible attacks) but conditionally reachable — under measurement, published."
EthersFlow unifies audit compliance with data privacy through a receipt-persist + payload-discard model:
Default Behavior (Receipt-Only Persistence):
By default, EthersFlow persists the receipt artifact only (verdict, normalized hashes, Ed25519 cryptographic signature, reason codes, request ID — NO raw action text). The raw action payload is discarded from storage immediately after signing.
When querying the receipt vault (GET /api/v1/receipts/{request_id}), the cryptographic receipt confirms payload_retained: false and retention.policy: "receipt_only_payload_discarded". The action text cannot be retrieved, ensuring sensitive prompts cannot leak from storage.
Explicit Opt-In Audit Retention (zero_retention: false):
If full action payload retention is strictly required for compliance audit logs, clients must explicitly opt in per call:
{
"agent_action": "Order $42 notebooks from Staples under ticket FAC-902",
"zero_retention": false
}
This creates an audit record logged in the receipt (retention.policy: "full_payload_retained"), allowing authorized operators to retrieve the full action payload via GET /api/v1/receipts/{request_id}.
Ephemeral Zero Retention & Cryptographic Binding (zero_retention: true / default):
For confidentiality and data boundary compliance:
receipt_only mode, the receipt vault persists the verification artifact only (verdict, reason codes, SHA-256 action hash, and Ed25519 signatures); action text is scrubbed from stored explanation and summary fields ([PAYLOAD_DISCARDED]).durability: "none_zero_retention"), with cryptographic Ed25519 receipts bound to the payload via agent_action_sha256 and verifiable against public JWKS keys.Every EthersFlow decision receipt binds a canonical policy_id across both top-level metadata (receipt.policy_id) and the signed configuration tuple (receipt.receipt_v2.config_tuple.policy_id):
| Policy ID | Description | Default Rules & Thresholds |
|---|---|---|
finops_default_v1 | Default Enterprise FinOps Safety Policy | Dual-lane evaluation: Micro-expense fast-path (<$100, approved catalog vendor, ticket anchor, 5 approvals/24hr window) and multi-model consensus fallback. |
tripwire_circuit_breaker_v1 | High-Assurance Circuit Breaker Policy | Immediate fail-closed tripping on anomalous wire transfers, credential exfiltration, prompt injection patterns, or authority bypasses. |
EthersFlow provides a hybrid enforcement and advisory architecture:
Deterministic Enforcement Gates (Fail-Closed by Default):
REJECTED or FLAGGED_HUMAN_REVIEW verdict with approval_blocked: true.cloudflareVerifyGate in @ethersflow/sdk or execution bindings (POST /api/v1/binding/confirm) strictly halt agent execution unless an active, cryptographically signed approval receipt exists.verdict: REJECTED, status: 500/503) unless fail_mode: "fail-open" is explicitly opted into by the caller.Advisory Multi-Model Consensus:
consensus_score, risk_index, and signed individual perspectives across heterogeneous models./api/v1/reviews/resolve).This repository contains the official client surfaces and developer tools for the EthersFlow ecosystem:
| Surface | Path | Description |
|---|---|---|
| MCP Server | /mcp-server | Model Context Protocol server for Claude Desktop, Cursor, and MCP clients |
| Python Demo & Verifier | efverify.py | Zero-dependency pure-Python client and Ed25519 signature validator |
| Python SDK | /sdk/python | Native Python package & LangChain tool wrapper |
| TypeScript SDK | /sdk/typescript | TypeScript SDK + Cloudflare Worker middleware helper |
| Postman Collection | /postman | 11-request Postman collection + environment variables |
Note: The core Federated Adversarial Consensus engine operates with default receipt-only persistence and payload discard (verdicts, reason codes, action hashes, and Ed25519 signatures retained; raw action payloads discarded immediately after signing). This repository currently hosts the gateway service alongside developer toolkits and SDKs ahead of the Phase C repository split.
curl -X POST "https://www.ethersflow.com/api/v1/verify" \
-H "Authorization: Bearer $ETHERSFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_action": "Transfer 5000 USDC to wallet 0x9f for smart contract audit",
"persona_preset": "financial_compliance",
"agent_count": 3
}'
Install via pip:
pip install ethersflow
Or run the included zero-dependency reference script:
python efverify.py verify "Transfer 5000 USDC to wallet 0x9f for smart contract audit"
npx -y @ethersflow/mcp-server --api-key=YOUR_API_KEY
Connect your MCP client directly to EthersFlow's production endpoint with connection-level authentication:
https://www.ethersflow.com/api/mcpAuthorization: Bearer YOUR_API_KEYWWW-Authenticate: Bearer realm="ethersflow-gateway", resource_metadata="/.well-known/oauth-protected-resource". Tool calls without authorization cleanly emit structured JSON-RPC -32000 (MISSING_AUTHORIZATION) errors with preserved request IDs.Authorization header at connection initialization so every tool call automatically inherits valid gateway authorization.{
"mcpServers": {
"ethersflow": {
"command": "npx",
"args": ["-y", "@ethersflow/mcp-server"],
"env": {
"ETHERSFLOW_TOKEN": "YOUR_API_KEY",
"ETHERSFLOW_BASE_URL": "https://www.ethersflow.com"
}
}
}
}
git clone https://github.com/Ethersflow/EthersFlow.git
cd EthersFlow/mcp-server
npm install
npm start
EthersFlow evaluates requests across two primary execution lanes:
FAST_PATH (<1s, ~470ms server): Deterministic, synchronous policy verification for low-risk micro-expenses (under $100) anchored by verified operational artifacts.CONSENSUS (~11–14s): Multi-model adversarial cross-examination across independent LLM nodes.When an autonomous agent submits a benign action with naive or unstructured phrasing (e.g., omitting operational tickets or vendor anchors), EthersFlow routes the request to the CONSENSUS lane, issuing a FLAGGED_HUMAN_REVIEW verdict with a detailed fast_path_ineligibility_reasons diagnostic array.
A developer or agent submits an unanchored micro-expense:
POST /api/v1/verify
{
"agent_action": "Order pens and paper for the team"
}
Because the request lacks structured anchors, it cannot be fast-pathed and is flagged for review:
{
"verdict": "FLAGGED_HUMAN_REVIEW",
"policy_fast_path": false,
"lane": "CONSENSUS",
"fast_path_ineligibility_reasons": [
"AMOUNT_UNDETERMINED: Action text does not specify a parseable dollar amount or amount_usd in context.",
"TICKET_MISSING: Operational ticket anchor (e.g. FAC-*, OPS-*, JIRA-*) missing from context and action.",
"COUNTERPARTY_UNVERIFIED: Counterparty missing or not verified against approved catalog allowlist.",
"BUDGET_LINE_MISSING: Spend category, scope, or budget line allocation missing from context."
]
}
The developer or agent loop inspects fast_path_ineligibility_reasons and supplies the four missing operational anchors:
"$10 of pens") or in context.amount_usd: 10.00."under ticket FAC-911" or context.ticket: "FAC-911")."from Staples" or context.vendor: "Staples").context.scope: "routine_office_supplies" or context.budget_line: "office_supplies_q3").POST /api/v1/verify
{
"agent_action": "Order $10 of pens from Staples under ticket FAC-911",
"context": {
"ticket": "FAC-911",
"vendor": "Staples",
"scope": "routine_office_supplies"
}
}
{
"verdict": "APPROVED",
"policy_fast_path": true,
"lane": "FAST_PATH",
"fast_path_ineligibility_reasons": [],
"consensus_score": 96.8,
"risk_index": 1.5,
"latency_ms": 472,
"attestation": {
"status": "VERIFIED_ED25519_SIG",
"key_id": "ef_attest_v3"
}
}
EthersFlow implements opt-in deduplication at the verification boundary to support both high-throughput distributed agent swarms and explicit, intentional re-verifications:
When duplicate actions are submitted without an idempotency_key:
request_id.replayed: false and c2_replayed: false.idempotency_key)To prevent duplicate financial disbursements, API calls, or ticket mutations across retrying agents, include an idempotency_key (via JSON body idempotency_key or HTTP header Idempotency-Key / X-Idempotency-Key):
replayed: false, replay_index: 0).replayed: true, c2_replayed: true).replay_index (1, 2, ...), creates a distinct audit transaction ID, while preserving the reference to original_request_id and the immutable action_hash.# First Call (Fresh Verification ~470ms Fast-Path or ~14s Consensus)
curl -X POST https://www.ethersflow.com/api/v1/verify \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: agent-step-uuid-101" \
-d '{"agent_action": "Order $10 of pens from Staples under ticket FAC-911"}'
# Response: {"request_id": "req_a1b2...", "replayed": false, "replay_index": 0, ...}
# Second Call (Instant Replay ~12ms)
curl -X POST https://www.ethersflow.com/api/v1/verify \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: agent-step-uuid-101" \
-d '{"agent_action": "Order $10 of pens from Staples under ticket FAC-911"}'
# Response: {"request_id": "req_c3d4...", "original_request_id": "req_a1b2...", "replayed": true, "replay_index": 1, ...}
EthersFlow strictly distinguishes between raw unparsed action payloads and derived operational audit metadata:
payload_retained: false, agent_action: "[PAYLOAD_DISCARDED]").retention.policy: "receipt_only_payload_discarded", perspectives_retained: false).retention.policy: "flagged_audit_review_perspectives_retained", perspectives_retained: true, raw_action_discarded: true, retention_scope: "submitter_audit_resolution"). Neither path retains raw action payloads./.well-known/jwks.json with zero trust required in EthersFlow's servers.APPROVED <-> FLAGGED_HUMAN_REVIEW). We strongly recommend routing any FLAGGED_HUMAN_REVIEW verdict directly to human operators for sign-off./.well-known/jwks.json.zero_retention: false), and action payloads are never used for model training./v1/chat/completions or /v1/messages as a drop-in replacement for existing agent pipelines.financial_compliance (FINRA/SEC, wire limits, KYC, sanctions)clinical_safety (ISMP high-alert meds, dosage bounds, FDA)cybersecurity_auditor (NIST SP 800-53, privilege escalation, SOC 2)legal_citation (FCPA, evidentiary privilege, contract breach)general_adversarial (Cross-domain safety & logic verification)import os
from ethersflow import EthersFlowLangChainTool
verifier_tool = EthersFlowLangChainTool(api_key=os.getenv("ETHERSFLOW_API_KEY", "your_api_key"))
# Add to your LangChain agent tools
tools = [verifier_tool]
import { cloudflareVerifyGate } from '@ethersflow/sdk';
export default {
async fetch(request: Request, env: { ETHERSFLOW_API_KEY: string }) {
const isSafe = await cloudflareVerifyGate(
"Transfer 5000 USDC to wallet 0x9f",
"Vendor audit payment",
env.ETHERSFLOW_API_KEY
);
if (!isSafe) {
return new Response("Action blocked by EthersFlow Consensus Gate", { status: 403 });
}
// Proceed with execution
}
};
EthersFlow publishes its public key set in JSON Web Key Set (JWKS) format:
GET /.well-known/jwks.jsonGET /.well-known/attestation.jsonPOST /api/v1/verify-attestationYou can verify signatures locally or through the API to prove that every audit node's perspective originated directly from the EthersFlow signing authority.
To ensure empirical rigor and prevent circular evaluation (testing against samples seen during development), EthersFlow maintains an independently developed held-out test battery:
data/held_out_attack_set.jsondocs/held-out-reproduction.mdImport postman/ethersflow.postman_collection.json and postman/ethersflow.postman_environment.json into Postman to test all 11 core endpoints instantly.
Code & SDK wrappers licensed under MIT License. Hosted EthersFlow API services subject to Terms of Service.
Source-derived launch command. Check the maintainer’s required arguments and credentials before running:
npx -y @ethersflow/mcp-serverMerge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.
{
"mcpServers": {
"io-github-ethersflow-ethersflow": {
"command": "npx",
"args": [
"-y",
"@ethersflow/mcp-server"
]
}
}
}Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the client’s tool list, then try a read-only example from its documentation.
Claude Desktop setup reference@ethersflow/mcp-servernpmEthersFlow — Trust Gate for AI Agents works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.
~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.~/.cursor/mcp.jsonRestart Cursor for changes to take effect..vscode/mcp.jsonReload VS Code window for changes to take effect.~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect..mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.